org.openmrs.api
Interface ConceptService

All Superinterfaces:
OpenmrsService
All Known Implementing Classes:
ConceptServiceImpl

@Transactional
public interface ConceptService
extends OpenmrsService

Contains methods pertaining to creating/updating/deleting/retiring Concepts, Drugs, Concept Proposals, and all other things 'Concept' Use: List concepts = Context.getConceptService().getAllConcepts();

See Also:
Context

Method Summary
 void checkIfLocked()
          Check if the concepts are locked and if so, throw exception during manipulation of concept
 void createConcept(Concept concept)
          Deprecated. use #saveConcept(Concept)
 void createConcept(ConceptNumeric concept)
          Deprecated. use #saveConcept(Concept)
 void createDrug(Drug drug)
          Deprecated. use #saveDrug(Drug)
 void deleteConcept(Concept concept)
          Deprecated. use #purgeConcept(Concept concept)
 java.util.List<ConceptWord> findConceptAnswers(java.lang.String phrase, java.util.Locale locale, Concept concept, boolean includeRetired)
          Deprecated. use getConceptAnswers(String, Locale, Concept)
 java.util.List<ConceptWord> findConcepts(java.lang.String phrase, java.util.List<java.util.Locale> searchLocales, boolean includeRetired, java.util.List<ConceptClass> requireClasses, java.util.List<ConceptClass> excludeClasses, java.util.List<ConceptDatatype> requireDatatypes, java.util.List<ConceptDatatype> excludeDatatypes)
          Searches on given phrase via the concept word table within a sorted list of Locales
 java.util.List<ConceptWord> findConcepts(java.lang.String phrase, java.util.Locale locale, boolean includeRetired)
          Deprecated. Use {@link #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)
 java.util.List<ConceptWord> findConcepts(java.lang.String phrase, java.util.Locale locale, boolean includeRetired, int start, int size)
          Deprecated. Use {@link #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)
 java.util.List<ConceptWord> findConcepts(java.lang.String phrase, java.util.Locale locale, boolean includeRetired, java.util.List<ConceptClass> requireClasses, java.util.List<ConceptClass> excludeClasses, java.util.List<ConceptDatatype> requireDatatypes, java.util.List<ConceptDatatype> excludeDatatypes)
          Deprecated. Use #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)
 java.util.List<Drug> findDrugs(java.lang.String phrase, boolean includeVoided)
          Deprecated. Use getDrugs(String)
 java.util.List<ConceptProposal> findMatchingConceptProposals(java.lang.String text)
          Deprecated. use getConceptProposals(String)
 java.util.List<Concept> findProposedConcepts(java.lang.String text)
          Deprecated. Use #getConceptProposals(String) and then retrieve the Concepts out of the ConceptProposals...
 java.util.List<ConceptClass> getAllConceptClasses()
          Return a list of concept classes currently in the database
 java.util.List<ConceptClass> getAllConceptClasses(boolean includeRetired)
          Return a list of concept classes currently in the database
 java.util.List<ConceptDatatype> getAllConceptDatatypes()
          Return a list of concept datatypes currently in the database
 java.util.List<ConceptDatatype> getAllConceptDatatypes(boolean includeRetired)
          Return a list of concept datatypes currently in the database
 java.util.List<ConceptProposal> getAllConceptProposals(boolean includeCompleted)
          Get a List of all concept proposals
 java.util.List<Concept> getAllConcepts()
          Return a list of unretired concepts sorted by concept id ascending and
 java.util.List<Concept> getAllConcepts(java.lang.String sortBy, boolean asc, boolean includeRetired)
          Return a list of concepts sorted on sortBy in dir direction (asc/desc)
 java.util.List<Drug> getAllDrugs()
          Return a list of drugs currently in the database that are not retired
 java.util.List<Drug> getAllDrugs(boolean includeRetired)
          Get drugs by concept.
 Concept getConcept(java.lang.Integer conceptId)
          Gets the concept with the given id
 Concept getConcept(java.lang.String conceptIdOrName)
          Get Concept by id or name convenience method
 ConceptAnswer getConceptAnswer(java.lang.Integer conceptAnswerId)
          Gets the ConceptAnswer with the given id
 java.util.List<ConceptWord> getConceptAnswers(java.lang.String phrase, java.util.Locale locale, Concept concept)
          Finds concepts that are possible value coded answers to concept parameter
 Concept getConceptByIdOrName(java.lang.String idOrName)
          Deprecated. use getConceptByName(String)
 Concept getConceptByName(java.lang.String name)
          Return a Concept that matches the name exactly
 ConceptClass getConceptClass(java.lang.Integer conceptClassId)
          Return a Concept class matching the given identifier
 ConceptClass getConceptClassByName(java.lang.String name)
          Return a Concept class matching the given name
 java.util.List<ConceptClass> getConceptClasses()
          Deprecated. use #getAllConceptClasses(boolean)
 ConceptDatatype getConceptDatatype(java.lang.Integer i)
          Return a ConceptDatatype matching the given identifier
 ConceptDatatype getConceptDatatypeByName(java.lang.String name)
          Return a Concept datatype matching the given name
 java.util.List<ConceptDatatype> getConceptDatatypes(java.lang.String name)
          Find concept datatypes that contain the given name string
 ConceptNumeric getConceptNumeric(java.lang.Integer conceptId)
          Get the ConceptNumeric with the given id
 ConceptProposal getConceptProposal(java.lang.Integer conceptProposalId)
          Get a ConceptProposal by conceptProposalId
 java.util.List<ConceptProposal> getConceptProposals(boolean includeCompleted)
          Deprecated. use getAllConceptProposals(boolean)
 java.util.List<ConceptProposal> getConceptProposals(java.lang.String text)
          find matching concept proposals
 java.util.List<Concept> getConcepts(java.lang.String sortBy, java.lang.String dir)
          Deprecated. use getAllConcepts(String, boolean, boolean)
 java.util.List<Concept> getConceptsByAnswer(Concept concept)
          Returns all possible value-coded answers to a Concept To navigate in the other direction, i.e., from Concept to its answers use Concept.getAnswers()
 java.util.List<Concept> getConceptsByClass(ConceptClass cc)
           
 java.util.List<Concept> getConceptsByConceptSet(Concept concept)
          Return a List of all concepts within a concept set
 java.util.List<Concept> getConceptsByName(java.lang.String name)
          Returns a list of concepts matching any part of a concept name
 java.util.List<ConceptSet> getConceptSets(Concept concept)
          Deprecated. use getConceptSetsByConcept(Concept)
 java.util.List<ConceptSet> getConceptSetsByConcept(Concept concept)
          Return a list of the concept sets with concept_set matching concept For example to find all concepts for ARVs, you would do getConceptSets(getConcept("ANTIRETROVIRAL MEDICATIONS")) and then take the conceptIds from the resulting list.
 java.util.List<Concept> getConceptsInSet(Concept concept)
          Deprecated. use getConceptsByConceptSet(Concept)
 java.util.List<Concept> getConceptsWithDrugsInFormulary()
          Convenience method for finding concepts associated with drugs in formulary.
 java.util.List<ConceptWord> getConceptWords(java.lang.String phrase, java.util.List<java.util.Locale> locales, boolean includeRetired, java.util.List<ConceptClass> requireClasses, java.util.List<ConceptClass> excludeClasses, java.util.List<ConceptDatatype> requireDatatypes, java.util.List<ConceptDatatype> excludeDatatypes, Concept answersToConcept, java.lang.Integer start, java.lang.Integer size)
          Searches for concepts by the given parameters via the ConceptWord table
 java.util.List<ConceptWord> getConceptWords(java.lang.String phrase, java.util.Locale locale)
          Convenience method for #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)
 Drug getDrug(java.lang.Integer drugId)
          Get the Drug with the given id
 Drug getDrug(java.lang.String drugNameOrId)
          Return the drug object corresponding to the given name or drugId
 Drug getDrugByNameOrId(java.lang.String drugId)
          Return the drug object corresponding to the given name or drugId
 java.util.List<Drug> getDrugs()
          Deprecated. use getAllDrugs()
 java.util.List<Drug> getDrugs(Concept concept)
          Deprecated. Use getDrugsByConcept(Concept)
 java.util.List<Drug> getDrugs(java.lang.String phrase)
          Find drugs in the system.
 java.util.List<Drug> getDrugsByConcept(Concept concept)
          Return a list of drugs associated with the given concept
 java.lang.Integer getNextAvailableId()
          Get the lowest concept id that is not currently in use
 Concept getNextConcept(Concept concept)
          Finds the next concept in the dictionary that has the next largest concept id
 Concept getPrevConcept(Concept concept)
          Finds the previous concept in the dictionary that has the next lowest concept id
 java.util.List<Concept> getProposedConcepts(java.lang.String text)
          find matching concept proposals and return a list of the proposed concepts
 java.util.List<Concept> getQuestionsForAnswer(Concept concept)
          Deprecated. use #getConceptsByAnswer(Concept)
 java.util.List<ConceptSet> getSetsContainingConcept(Concept concept)
          Find all sets that the given concept is a member of
 Concept mapConceptProposalToConcept(ConceptProposal cp, Concept mappedConcept)
          Maps a concept proposal to a concept
 void proposeConcept(ConceptProposal conceptProposal)
          Deprecated. use saveConceptProposal(ConceptProposal)
 void purgeConcept(Concept conceptOrConceptNumeric)
          Completely purge a Concept or ConceptNumeric from the database.
 void purgeConceptClass(ConceptClass cc)
          Purge a ConceptClass
 void purgeConceptDatatype(ConceptDatatype cd)
          Purge a ConceptDatatype.
 void purgeConceptProposal(ConceptProposal cp)
          Removes a concept proposal from the database entirely.
 void purgeDrug(Drug drug)
          Completely purge a Drug from the database.
 void rejectConceptProposal(ConceptProposal cp)
          Deprecated. use ConceptProposal.rejectConceptProposal()
 Concept retireConcept(Concept conceptOrConceptNumeric, java.lang.String reason)
          Retiring a concept essentially removes it from circulation
 Drug retireDrug(Drug drug, java.lang.String reason)
          Retiring a Drug essentially removes it from circulation
 Concept saveConcept(Concept concept)
          Save or update the given Concept or ConceptNumeric in the database
 ConceptClass saveConceptClass(ConceptClass cc)
          Creates or updates a concept class
 ConceptDatatype saveConceptDatatype(ConceptDatatype cd)
          Create or update a ConceptDatatype
 ConceptProposal saveConceptProposal(ConceptProposal conceptProposal)
          Saves/updates/proposes a concept proposal
 Drug saveDrug(Drug drug)
          Save or update the given Drug in the database
 void setConceptDAO(ConceptDAO dao)
          Sets the data access object for Concepts.
 void updateConcept(Concept concept)
          Deprecated. use #saveConcept(Concept)
 void updateConcept(ConceptNumeric concept)
          Deprecated. use #saveConcept(Concept)
 void updateConceptSetDerived()
          Iterates over all concepts calling updateConceptSetDerived(concept)
 void updateConceptSetDerived(Concept concept)
          Updates the concept set derived business table for this concept (bursting the concept sets)
 void updateConceptWord(Concept concept)
          Iterates over the words in names and synonyms (for each locale) and updates the concept_word table
 void updateConceptWords()
          Iterates over all concepts and calls upddateConceptWords(Concept concept)
 void updateConceptWords(java.lang.Integer conceptIdStart, java.lang.Integer conceptIdEnd)
          Iterates over all concepts with conceptIds between conceptIdStart and conceptIdEnd (inclusive) and calls updateConceptWord(concept)
 void updateDrug(Drug drug)
          Deprecated. use #saveDrug(Drug)
 void voidConcept(Concept concept, java.lang.String reason)
          Deprecated. use retireConcept(Concept, String)
 
Methods inherited from interface org.openmrs.api.OpenmrsService
onShutdown, onStartup
 

Method Detail

setConceptDAO

void setConceptDAO(ConceptDAO dao)
Sets the data access object for Concepts. The dao is used for saving and getting concepts to/from the database

Parameters:
dao - The data access object to use

createConcept

@Authorized(value="Manage Concepts")
void createConcept(Concept concept)
                   throws APIException
Deprecated. use #saveConcept(Concept)

Throws:
APIException

createConcept

@Authorized(value="Manage Concepts")
void createConcept(ConceptNumeric concept)
                   throws APIException
Deprecated. use #saveConcept(Concept)

Throws:
APIException

updateConcept

@Authorized(value="Manage Concepts")
void updateConcept(Concept concept)
                   throws APIException
Deprecated. use #saveConcept(Concept)

Throws:
APIException

updateConcept

@Authorized(value="Manage Concepts")
void updateConcept(ConceptNumeric concept)
                   throws APIException
Deprecated. use #saveConcept(Concept)

Throws:
APIException

createDrug

@Authorized(value="Manage Concepts")
void createDrug(Drug drug)
                throws APIException
Deprecated. use #saveDrug(Drug)

Throws:
APIException

updateDrug

@Authorized(value="Manage Concepts")
void updateDrug(Drug drug)
                throws APIException
Deprecated. use #saveDrug(Drug)

Throws:
APIException

deleteConcept

@Authorized(value="Purge Concepts")
void deleteConcept(Concept concept)
                   throws APIException
Deprecated. use #purgeConcept(Concept concept)

Throws:
APIException

voidConcept

@Authorized(value="Manage Concepts")
void voidConcept(Concept concept,
                                 java.lang.String reason)
                 throws APIException
Deprecated. use retireConcept(Concept, String)

Throws:
APIException

saveConcept

@Authorized(value="Manage Concepts")
Concept saveConcept(Concept concept)
                    throws APIException
Save or update the given Concept or ConceptNumeric in the database

Parameters:
Concept - concept The Concept or ConceptNumeric to save or update
Returns:
the Concept or ConceptNumeric that was saved or updated
Throws:
APIException

saveDrug

@Authorized(value="Manage Concepts")
Drug saveDrug(Drug drug)
              throws APIException
Save or update the given Drug in the database

Parameters:
Drug - drug The Drug to save or update
Returns:
the Drug that was saved or updated
Throws:
APIException

purgeConcept

@Authorized(value="Purge Concepts")
void purgeConcept(Concept conceptOrConceptNumeric)
                  throws APIException
Completely purge a Concept or ConceptNumeric from the database. This should not typically be used unless desperately needed. Most should just be retired. See retireConcept(Concept, String)

Parameters:
Object - conceptOrConceptNumeric The Concept or ConceptNumeric to remove from the system
Throws:
APIException

retireConcept

@Authorized(value="Manage Concepts")
Concept retireConcept(Concept conceptOrConceptNumeric,
                                      java.lang.String reason)
                      throws APIException
Retiring a concept essentially removes it from circulation

Parameters:
Concept - conceptOrConceptNumeric The Concept or ConceptNumeric to retire
String - reason The retire reason
Returns:
the retired Concept or ConceptNumeric
Throws:
APIException

retireDrug

@Authorized(value="Manage Concepts")
Drug retireDrug(Drug drug,
                                java.lang.String reason)
                throws APIException
Retiring a Drug essentially removes it from circulation

Parameters:
Drug - drug The Drug to retire
String - reason The retire reason
Returns:
the retired Drug
Throws:
APIException

purgeDrug

@Authorized(value="Purge Concepts")
void purgeDrug(Drug drug)
               throws APIException
Completely purge a Drug from the database. This should not typically be used unless desperately needed. Most Drugs should just be retired.

Parameters:
Drug - drug The Drug to remove from the system
Throws:
APIException

getConcept

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
Concept getConcept(java.lang.Integer conceptId)
                   throws APIException
Gets the concept with the given id

Parameters:
Integer - conceptId
Returns:
the matching Concept object
Throws:
APIException

getConceptAnswer

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
ConceptAnswer getConceptAnswer(java.lang.Integer conceptAnswerId)
                               throws APIException
Gets the ConceptAnswer with the given id

Parameters:
Integer - conceptAnswerId
Returns:
the matching ConceptAnswer object
Throws:
APIException

getDrug

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
Drug getDrug(java.lang.Integer drugId)
             throws APIException
Get the Drug with the given id

Parameters:
Integer - drugId
Returns:
the matching Drug object
Throws:
APIException

getConceptNumeric

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
ConceptNumeric getConceptNumeric(java.lang.Integer conceptId)
                                 throws APIException
Get the ConceptNumeric with the given id

Parameters:
Integer - conceptId The ConceptNumeric id
Returns:
the matching ConceptNumeric object
Throws:
APIException

getConceptClass

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
ConceptClass getConceptClass(java.lang.Integer conceptClassId)
                             throws APIException
Return a Concept class matching the given identifier

Parameters:
i - the concept class identifier
Returns:
the matching ConceptClass
Throws:
APIException

getAllConcepts

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<Concept> getAllConcepts()
                                       throws APIException
Return a list of unretired concepts sorted by concept id ascending and

Returns:
a List object containing all of the sorted concepts
Throws:
APIException

getAllConcepts

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<Concept> getAllConcepts(java.lang.String sortBy,
                                                                     boolean asc,
                                                                     boolean includeRetired)
                                       throws APIException
Return a list of concepts sorted on sortBy in dir direction (asc/desc)

Parameters:
sortBy - The property name to sort by; if null or invalid, concept_id is used.
boolean - asc true = sort ascending; false = sort descending
boolean - includeRetired If true, retired concepts will also be returned
Returns:
a List object containing all of the sorted concepts
Throws:
APIException

getConcepts

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<Concept> getConcepts(java.lang.String sortBy,
                                                                  java.lang.String dir)
                                    throws APIException
Deprecated. use getAllConcepts(String, boolean, boolean)

Throws:
APIException

getConceptsByName

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<Concept> getConceptsByName(java.lang.String name)
                                          throws APIException
Returns a list of concepts matching any part of a concept name

Parameters:
String - name The search string
Returns:
a List object containing all of the matching concepts
Throws:
APIException

getConceptByName

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
Concept getConceptByName(java.lang.String name)
                         throws APIException
Return a Concept that matches the name exactly

Parameters:
String - name The search string
Returns:
the found Concept
Throws:
APIException

getConceptByIdOrName

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
Concept getConceptByIdOrName(java.lang.String idOrName)
                             throws APIException
Deprecated. use getConceptByName(String)

Get Concepts by id or name Note: this just calls other impl methods; no DAO of its own

Parameters:
String - idOrName
Returns:
the found Concept
Throws:
APIException

getConcept

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
Concept getConcept(java.lang.String conceptIdOrName)
                   throws APIException
Get Concept by id or name convenience method

Parameters:
String - conceptIdOrName
Returns:
the found Concept
Throws:
APIException

getConceptWords

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<ConceptWord> getConceptWords(java.lang.String phrase,
                                                                          java.util.List<java.util.Locale> locales,
                                                                          boolean includeRetired,
                                                                          java.util.List<ConceptClass> requireClasses,
                                                                          java.util.List<ConceptClass> excludeClasses,
                                                                          java.util.List<ConceptDatatype> requireDatatypes,
                                                                          java.util.List<ConceptDatatype> excludeDatatypes,
                                                                          Concept answersToConcept,
                                                                          java.lang.Integer start,
                                                                          java.lang.Integer size)
                                            throws APIException
Searches for concepts by the given parameters via the ConceptWord table

Parameters:
String - phrase
List - locales
boolean - includeRetired
List - requireClasses
List - excludeClasses
List - requireDatatypes
List - excludeDatatypes
answersToConcept - all results will be a possible answer to this concept
int - start
int - size
Returns:
A List object containing all matching ConceptWords
Throws:
APIException

getConceptWords

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<ConceptWord> getConceptWords(java.lang.String phrase,
                                                                          java.util.Locale locale)
                                            throws APIException
Convenience method for #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)

Parameters:
phrase - search string
locale -
Returns:
Throws:
APIException

findConcepts

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<ConceptWord> findConcepts(java.lang.String phrase,
                                                                       java.util.Locale locale,
                                                                       boolean includeRetired)
                                         throws APIException
Deprecated. Use {@link #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)

Throws:
APIException

findConcepts

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<ConceptWord> findConcepts(java.lang.String phrase,
                                                                       java.util.Locale locale,
                                                                       boolean includeRetired,
                                                                       java.util.List<ConceptClass> requireClasses,
                                                                       java.util.List<ConceptClass> excludeClasses,
                                                                       java.util.List<ConceptDatatype> requireDatatypes,
                                                                       java.util.List<ConceptDatatype> excludeDatatypes)
                                         throws APIException
Deprecated. Use #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)

Throws:
APIException

findConcepts

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<ConceptWord> findConcepts(java.lang.String phrase,
                                                                       java.util.Locale locale,
                                                                       boolean includeRetired,
                                                                       int start,
                                                                       int size)
                                         throws APIException
Deprecated. Use {@link #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)

Throws:
APIException

getDrug

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
Drug getDrug(java.lang.String drugNameOrId)
             throws APIException
Return the drug object corresponding to the given name or drugId

Parameters:
drugNameOrId - name or drugId to match exactly on
Returns:
Drug
Throws:
APIException

getDrugByNameOrId

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
Drug getDrugByNameOrId(java.lang.String drugId)
                       throws APIException
Return the drug object corresponding to the given name or drugId

Parameters:
String - drugId
Returns:
Drug
Throws:
APIException

getDrugs

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<Drug> getDrugs()
                              throws APIException
Deprecated. use getAllDrugs()

Throws:
APIException

getAllDrugs

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<Drug> getAllDrugs()
                                 throws APIException
Return a list of drugs currently in the database that are not retired

Returns:
a List object containing all drugs
Throws:
APIException

getDrugs

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<Drug> getDrugs(Concept concept)
                              throws APIException
Deprecated. Use getDrugsByConcept(Concept)

Throws:
APIException

getDrugsByConcept

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<Drug> getDrugsByConcept(Concept concept)
                                       throws APIException
Return a list of drugs associated with the given concept

Parameters:
Concept - concept
Returns:
a List object containing all matching drugs
Throws:
APIException

getAllDrugs

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<Drug> getAllDrugs(boolean includeRetired)
Get drugs by concept. This method is the utility method that should be used to generically retrieve all Drugs in the system.

Parameters:
includeRetired - If true then the search will include voided Drugs
Returns:
A List object containing all matching Drugs

findDrugs

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<Drug> findDrugs(java.lang.String phrase,
                                                             boolean includeVoided)
                               throws APIException
Deprecated. Use getDrugs(String)

Throws:
APIException

getDrugs

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<Drug> getDrugs(java.lang.String phrase)
                              throws APIException
Find drugs in the system. The string search can match either drug.name or drug.concept.name

Parameters:
String - phrase
Locale - locale
Returns:
A List object containing all Drug matches
Throws:
APIException

getConceptsByClass

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<Concept> getConceptsByClass(ConceptClass cc)
                                           throws APIException
Parameters:
ConceptClass - cc
Returns:
Returns all concepts in a given class
Throws:
APIException

getConceptClasses

@Transactional(readOnly=true)
@Authorized(value="View Concept Classes")
java.util.List<ConceptClass> getConceptClasses()
                                               throws APIException
Deprecated. use #getAllConceptClasses(boolean)

Return a list of concept classes currently in the database

Returns:
List object with all ConceptClass objects
Throws:
APIException

getConceptClassByName

@Transactional(readOnly=true)
@Authorized(value="View Concept Classes")
ConceptClass getConceptClassByName(java.lang.String name)
                                   throws APIException
Return a Concept class matching the given name

Parameters:
String - name
Returns:
ConceptClass
Throws:
APIException

getAllConceptClasses

@Transactional(readOnly=true)
@Authorized(value="View Concept Classes")
java.util.List<ConceptClass> getAllConceptClasses()
                                                  throws APIException
Return a list of concept classes currently in the database

Returns:
List object with all ConceptClass objects
Throws:
APIException

getAllConceptClasses

@Transactional(readOnly=true)
@Authorized(value="View Concept Classes")
java.util.List<ConceptClass> getAllConceptClasses(boolean includeRetired)
                                                  throws APIException
Return a list of concept classes currently in the database

Parameters:
include - retired concept classes in the search results
Returns:
List object with all ConceptClass objects
Throws:
APIException

saveConceptClass

@Authorized(value="Manage Concept Classes")
ConceptClass saveConceptClass(ConceptClass cc)
                              throws APIException
Creates or updates a concept class

Parameters:
ConceptClass - to create or update
Throws:
APIException

purgeConceptClass

@Authorized(value="Purge Concept Classes")
void purgeConceptClass(ConceptClass cc)
                       throws APIException
Purge a ConceptClass

Parameters:
ConceptClass - to delete
Throws:
APIException

saveConceptDatatype

@Authorized(value="Manage Concept Datatypes")
ConceptDatatype saveConceptDatatype(ConceptDatatype cd)
                                    throws APIException
Create or update a ConceptDatatype

Parameters:
ConceptDatatype - to create or update
Throws:
APIException

purgeConceptDatatype

@Authorized(value="Purge Concept Datatypes")
void purgeConceptDatatype(ConceptDatatype cd)
                          throws APIException
Purge a ConceptDatatype. This removes the concept datatype from the database completely.

Parameters:
ConceptDatatype - to purge
Throws:
APIException

getAllConceptDatatypes

@Transactional(readOnly=true)
@Authorized(value="View Concept Datatypes")
java.util.List<ConceptDatatype> getAllConceptDatatypes()
                                                       throws APIException
Return a list of concept datatypes currently in the database

Returns:
List of ConceptDatatypes
Throws:
APIException

getAllConceptDatatypes

@Transactional(readOnly=true)
@Authorized(value="View Concept Datatypes")
java.util.List<ConceptDatatype> getAllConceptDatatypes(boolean includeRetired)
                                                       throws APIException
Return a list of concept datatypes currently in the database

Parameters:
includeRetired - true/false whether to include the retired datatypes
Returns:
List of ConceptDatatypes
Throws:
APIException

getConceptDatatypes

@Transactional(readOnly=true)
@Authorized(value="View Concept Datatypes")
java.util.List<ConceptDatatype> getConceptDatatypes(java.lang.String name)
                                                    throws APIException
Find concept datatypes that contain the given name string

Parameters:
name -
Returns:
Throws:
APIException

getConceptDatatype

@Transactional(readOnly=true)
@Authorized(value="View Concept Datatypes")
ConceptDatatype getConceptDatatype(java.lang.Integer i)
                                   throws APIException
Return a ConceptDatatype matching the given identifier

Parameters:
Integer - i
Returns:
ConceptDatatype
Throws:
APIException

getConceptDatatypeByName

@Transactional(readOnly=true)
@Authorized(value="View Concept Datatypes")
ConceptDatatype getConceptDatatypeByName(java.lang.String name)
                                         throws APIException
Return a Concept datatype matching the given name

Parameters:
String - name
Returns:
ConceptDatatype
Throws:
APIException

updateConceptSetDerived

@Authorized(value="Manage Concepts")
void updateConceptSetDerived(Concept concept)
                             throws APIException
Updates the concept set derived business table for this concept (bursting the concept sets)

Parameters:
concept -
Throws:
APIException

updateConceptSetDerived

@Authorized(value="Manage Concepts")
void updateConceptSetDerived()
                             throws APIException
Iterates over all concepts calling updateConceptSetDerived(concept)

Throws:
APIException

getConceptSets

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<ConceptSet> getConceptSets(Concept concept)
                                          throws APIException
Deprecated. use getConceptSetsByConcept(Concept)

Throws:
APIException

getConceptSetsByConcept

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<ConceptSet> getConceptSetsByConcept(Concept concept)
                                                   throws APIException
Return a list of the concept sets with concept_set matching concept For example to find all concepts for ARVs, you would do getConceptSets(getConcept("ANTIRETROVIRAL MEDICATIONS")) and then take the conceptIds from the resulting list.

Parameters:
Concept - concept The concept representing the concept set
Returns:
A List object containing all matching ConceptSets
Throws:
APIException

getConceptsInSet

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<Concept> getConceptsInSet(Concept concept)
                                         throws APIException
Deprecated. use getConceptsByConceptSet(Concept)

Throws:
APIException

getConceptsByConceptSet

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<Concept> getConceptsByConceptSet(Concept concept)
                                                throws APIException
Return a List of all concepts within a concept set

Parameters:
Concept - concept The concept representing the concept set
Returns:
A List object containing all objects within the ConceptSet
Throws:
APIException

getSetsContainingConcept

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<ConceptSet> getSetsContainingConcept(Concept concept)
                                                    throws APIException
Find all sets that the given concept is a member of

Parameters:
Concept - concept
Returns:
A List object with all parent concept sets
Throws:
APIException

getConceptProposals

@Transactional(readOnly=true)
@Authorized(value="View Concept Proposals")
java.util.List<ConceptProposal> getConceptProposals(boolean includeCompleted)
                                                    throws APIException
Deprecated. use getAllConceptProposals(boolean)

Throws:
APIException

getAllConceptProposals

@Transactional(readOnly=true)
@Authorized(value="View Concept Proposals")
java.util.List<ConceptProposal> getAllConceptProposals(boolean includeCompleted)
                                                       throws APIException
Get a List of all concept proposals

Parameters:
boolean - includeCompleted
Returns:
a List object of all found ConceptProposals
Throws:
APIException

getConceptProposal

@Transactional(readOnly=true)
@Authorized(value="View Concept Proposals")
ConceptProposal getConceptProposal(java.lang.Integer conceptProposalId)
                                   throws APIException
Get a ConceptProposal by conceptProposalId

Parameters:
Integer - conceptProposalId the concept proposal Id
Returns:
the found ConceptProposal
Throws:
APIException

getConceptProposals

@Transactional(readOnly=true)
@Authorized(