// Path: src/com/umls/models/ConceptWordModel.java
// public class ConceptWordModel {
// 	
// 	// ConceptId(CUI)
// 	private String concept;
// 	
// 	// word for concept
// 	private String word;
// 
// 	public ConceptWordModel(String concept, String word) {
// 		super();
// 		this.concept = concept;
// 		this.word = word;
// 	}
// 
// 	public String getConcept() {
// 		return concept;
// 	}
// 
// 	public void setConcept(String concept) {
// 		this.concept = concept;
// 	}
// 
// 	public String getWord() {
// 		return word;
// 	}
// 
// 	public void setWord(String word) {
// 		this.word = word;
// 	}
// }


import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.LinkedList;
import com.umls.models.ConceptWordModel;
package com.umls.database;



/*
 * Class that implements the method for Operation on table MRXW_ENG(table with English word and CUI's)
 */

public class MRXWTableOperation {
	
	/*
	 * method to get the list of CUI's for given query
	 */
	public static LinkedList<String> searchCUI(String query) {
		if (UmlsDatabaseConnector.getConnection() != null) {
			try {
				Statement stat = UmlsDatabaseConnector.getConnection().createStatement();
				// execute the SQL query
				ResultSet rs = stat.executeQuery("SELECT MRXW_ENG.CUI FROM umls.MRXW_ENG WHERE"
						+ " MRXW_ENG.WD In (" + getWords(query) + ") group by MRXW_ENG.CUI;");

				// create a linked list of objects with EncounterId, drugId,
				// ConceptId(observation)
				LinkedList<String> data = new LinkedList<String>();
				while (rs.next()) {
					data.add(rs.getString(1));
				}
				return data;
			} catch (SQLException e1) {
				e1.printStackTrace();

			}
		} else
			System.out.println("connection lost!");
		return null;
	}

// Path: src/com/umls/models/ConceptWordModel.java
// public class ConceptWordModel {
// 	
// 	// ConceptId(CUI)
// 	private String concept;
// 	
// 	// word for concept
// 	private String word;
// 
// 	public ConceptWordModel(String concept, String word) {
// 		super();
// 		this.concept = concept;
// 		this.word = word;
// 	}
// 
// 	public String getConcept() {
// 		return concept;
// 	}
// 
// 	public void setConcept(String concept) {
// 		this.concept = concept;
// 	}
// 
// 	public String getWord() {
// 		return word;
// 	}
// 
// 	public void setWord(String word) {
// 		this.word = word;
// 	}
// }


// Path: src/com/umls/database/MRXWTableOperation.java
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.LinkedList;
import com.umls.models.ConceptWordModel;

package com.umls.database;



/*
 * Class that implements the method for Operation on table MRXW_ENG(table with English word and CUI's)
 */

public class MRXWTableOperation {
	
	/*
	 * method to get the list of CUI's for given query
	 */
	public static LinkedList<String> searchCUI(String query) {
		if (UmlsDatabaseConnector.getConnection() != null) {
			try {
				Statement stat = UmlsDatabaseConnector.getConnection().createStatement();
				// execute the SQL query
				ResultSet rs = stat.executeQuery("SELECT MRXW_ENG.CUI FROM umls.MRXW_ENG WHERE"
						+ " MRXW_ENG.WD In (" + getWords(query) + ") group by MRXW_ENG.CUI;");

				// create a linked list of objects with EncounterId, drugId,
				// ConceptId(observation)
				LinkedList<String> data = new LinkedList<String>();
				while (rs.next()) {
					data.add(rs.getString(1));
				}
				return data;
			} catch (SQLException e1) {
				e1.printStackTrace();

			}
		} else
			System.out.println("connection lost!");
		return null;
	}

	public static LinkedList<ConceptWordModel> getWordsByLimit(int start, int size) {