// Path: src/com/learningmodule/association/conceptdrug/AbstractDrugModel.java
// public interface AbstractDrugModel {
// 	
// 	/*
// 	 * set the Drug Id for this drug
// 	 */
// 	public void setDrugId(String id);
// 
// 	/*
// 	 * get the drug Id for this drug
// 	 */
// 	public String getDrugId();
// }
// 
// Path: src/com/learningmodule/association/conceptdrug/ConceptDrugDatabaseInterface.java
// public interface ConceptDrugDatabaseInterface {
// 
// 	/*
// 	 * get name of file that will contain the prediction matrix generated by
// 	 * algorithm
// 	 */
// 	public String getMatrixFileName();
// 
// 	/*
// 	 * Method to get all the medical records containing encounterId(integer that
// 	 * represent an id for prescriptions written for a patient),
// 	 * ConceptId(integer that represent a diagnosis/diseases/observation for
// 	 * patient has been treated), DrugId(integer representing a drug that was
// 	 * written in the prescription)
// 	 */
// 	public LinkedList<EncounterIdConceptDrug> getData();
// 
// 	/*
// 	 * Method to get the medical records with given list of concepts Ids contaning encounterId, conceptId, DrugId,
// 	 * and feature related to medical records like age of patient, location of doctor/patient etc.
// 	 */
// 	
// 	public LinkedList<EncounterIdConceptFeaturesDrugModel> getDataByConceptIds(LinkedList<String> ids);
// 
// 	/*
// 	 * Method to get the list of conceptId and concept_name for given list of conceptId(integer)
// 	 */
// 	
// 	public LinkedList<ConceptNameModel> getConceptIdNameByConceptIds(LinkedList<String> conceptIds);
// 
// 	/*
// 	 * Method to get the list of Drugs for given drugIds(integers)
// 	 */
// 	public LinkedList<AbstractDrugModel> getDrugInfoByDrugIds(LinkedList<String> conceptIds);
// 
// 	/*
// 	 * Method to get the list of all conceptId and concept_words
// 	 */
// 	public LinkedList<ConceptWordModel> getConceptWords();
// }
// 
// Path: src/com/learningmodule/association/conceptdrug/PredictionResult.java
// public interface PredictionResult {
// 	public double getConfidence();
// 	public Object getValue();
// }
// 
// Path: src/com/learningmodule/association/conceptdrug/model/ConceptDrugPredictionResult.java
// public class ConceptDrugPredictionResult implements PredictionResult {
// 	// contains drug info
// 	private AbstractDrugModel drug;
// 
// 	// confidence related to the drug and query
// 	private double confidence;
// 
// 	// concepts names for the concepts, drug related to
// 	private LinkedList<String> tags;
// 
// 	// conceptsId of concepts drug realted to
// 	private HashSet<String> conceptIds;
// 
// 	public ConceptDrugPredictionResult(String drug, double confidence) {
// 		this.drug = new DrugModel(drug);
// 		this.confidence = confidence;
// 		this.conceptIds = new HashSet<String>();
// 		this.tags = new LinkedList<String>();
// 	}
// 
// 	public AbstractDrugModel getDrug() {
// 		return drug;
// 	}
// 	
// 	@Override
// 	public Object getValue() {
// 		return drug;
// 	}
// 
// 	public void setDrug(AbstractDrugModel drug) {
// 		this.drug = drug;
// 	}
// 
// 	@Override
// 	public double getConfidence() {
// 		return confidence;
// 	}
// 
// 	public void setConfidence(double confidence) {
// 		this.confidence = confidence;
// 	}
// 
// 	public LinkedList<String> getTags() {
// 		return tags;
// 	}
// 
// 	/*
// 	 * method to add a tag for drug result
// 	 */
// 	public void addTags(String tag) {
// 		this.tags.add(tag);
// 	}
// 
// 	public HashSet<String> getConceptIds() {
// 		return conceptIds;
// 	}
// 
// 	/*
// 	 * method to add concept Ids related to the drug result
// 	 */
// 	public void addConceptId(String conceptId) {
// 		this.conceptIds.add(conceptId);
// 	}
// 
// 	public boolean hasConcept(String conceptId) {
// 		return conceptIds.contains(conceptId);
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "PredictionResults [drug=" + drug.toString() + ", confidence=" + confidence + "]";
// 	}
// }


import java.util.LinkedList;
import org.apache.log4j.Logger;
import com.learningmodule.association.conceptdrug.AbstractDrugModel;
import com.learningmodule.association.conceptdrug.ConceptDrugDatabaseInterface;
import com.learningmodule.association.conceptdrug.PredictionResult;
import com.learningmodule.association.conceptdrug.model.ConceptDrugPredictionResult;
package com.learningmodule.association.conceptdrug.predictionmodule;




/*
 * class to fetch the drug data from database and add drug info in results
 */

public class DrugTableOperation {

	private static Logger log = Logger.getLogger(DrugTableOperation.class);

	// method to get the list of Drugs details from database of given drugIDs
// Path: src/com/learningmodule/association/conceptdrug/AbstractDrugModel.java
// public interface AbstractDrugModel {
// 	
// 	/*
// 	 * set the Drug Id for this drug
// 	 */
// 	public void setDrugId(String id);
// 
// 	/*
// 	 * get the drug Id for this drug
// 	 */
// 	public String getDrugId();
// }
// 
// Path: src/com/learningmodule/association/conceptdrug/ConceptDrugDatabaseInterface.java
// public interface ConceptDrugDatabaseInterface {
// 
// 	/*
// 	 * get name of file that will contain the prediction matrix generated by
// 	 * algorithm
// 	 */
// 	public String getMatrixFileName();
// 
// 	/*
// 	 * Method to get all the medical records containing encounterId(integer that
// 	 * represent an id for prescriptions written for a patient),
// 	 * ConceptId(integer that represent a diagnosis/diseases/observation for
// 	 * patient has been treated), DrugId(integer representing a drug that was
// 	 * written in the prescription)
// 	 */
// 	public LinkedList<EncounterIdConceptDrug> getData();
// 
// 	/*
// 	 * Method to get the medical records with given list of concepts Ids contaning encounterId, conceptId, DrugId,
// 	 * and feature related to medical records like age of patient, location of doctor/patient etc.
// 	 */
// 	
// 	public LinkedList<EncounterIdConceptFeaturesDrugModel> getDataByConceptIds(LinkedList<String> ids);
// 
// 	/*
// 	 * Method to get the list of conceptId and concept_name for given list of conceptId(integer)
// 	 */
// 	
// 	public LinkedList<ConceptNameModel> getConceptIdNameByConceptIds(LinkedList<String> conceptIds);
// 
// 	/*
// 	 * Method to get the list of Drugs for given drugIds(integers)
// 	 */
// 	public LinkedList<AbstractDrugModel> getDrugInfoByDrugIds(LinkedList<String> conceptIds);
// 
// 	/*
// 	 * Method to get the list of all conceptId and concept_words
// 	 */
// 	public LinkedList<ConceptWordModel> getConceptWords();
// }
// 
// Path: src/com/learningmodule/association/conceptdrug/PredictionResult.java
// public interface PredictionResult {
// 	public double getConfidence();
// 	public Object getValue();
// }
// 
// Path: src/com/learningmodule/association/conceptdrug/model/ConceptDrugPredictionResult.java
// public class ConceptDrugPredictionResult implements PredictionResult {
// 	// contains drug info
// 	private AbstractDrugModel drug;
// 
// 	// confidence related to the drug and query
// 	private double confidence;
// 
// 	// concepts names for the concepts, drug related to
// 	private LinkedList<String> tags;
// 
// 	// conceptsId of concepts drug realted to
// 	private HashSet<String> conceptIds;
// 
// 	public ConceptDrugPredictionResult(String drug, double confidence) {
// 		this.drug = new DrugModel(drug);
// 		this.confidence = confidence;
// 		this.conceptIds = new HashSet<String>();
// 		this.tags = new LinkedList<String>();
// 	}
// 
// 	public AbstractDrugModel getDrug() {
// 		return drug;
// 	}
// 	
// 	@Override
// 	public Object getValue() {
// 		return drug;
// 	}
// 
// 	public void setDrug(AbstractDrugModel drug) {
// 		this.drug = drug;
// 	}
// 
// 	@Override
// 	public double getConfidence() {
// 		return confidence;
// 	}
// 
// 	public void setConfidence(double confidence) {
// 		this.confidence = confidence;
// 	}
// 
// 	public LinkedList<String> getTags() {
// 		return tags;
// 	}
// 
// 	/*
// 	 * method to add a tag for drug result
// 	 */
// 	public void addTags(String tag) {
// 		this.tags.add(tag);
// 	}
// 
// 	public HashSet<String> getConceptIds() {
// 		return conceptIds;
// 	}
// 
// 	/*
// 	 * method to add concept Ids related to the drug result
// 	 */
// 	public void addConceptId(String conceptId) {
// 		this.conceptIds.add(conceptId);
// 	}
// 
// 	public boolean hasConcept(String conceptId) {
// 		return conceptIds.contains(conceptId);
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "PredictionResults [drug=" + drug.toString() + ", confidence=" + confidence + "]";
// 	}
// }


// Path: src/com/learningmodule/association/conceptdrug/predictionmodule/DrugTableOperation.java
import java.util.LinkedList;
import org.apache.log4j.Logger;
import com.learningmodule.association.conceptdrug.AbstractDrugModel;
import com.learningmodule.association.conceptdrug.ConceptDrugDatabaseInterface;
import com.learningmodule.association.conceptdrug.PredictionResult;
import com.learningmodule.association.conceptdrug.model.ConceptDrugPredictionResult;

package com.learningmodule.association.conceptdrug.predictionmodule;




/*
 * class to fetch the drug data from database and add drug info in results
 */

public class DrugTableOperation {

	private static Logger log = Logger.getLogger(DrugTableOperation.class);

	// method to get the list of Drugs details from database of given drugIDs
	public static LinkedList<PredictionResult> addDrugInfo(