org.openmrs.api.impl
Class ConceptServiceImpl

java.lang.Object
  extended by org.openmrs.api.impl.BaseOpenmrsService
      extended by org.openmrs.api.impl.ConceptServiceImpl
All Implemented Interfaces:
ConceptService, OpenmrsService

public class ConceptServiceImpl
extends BaseOpenmrsService
implements ConceptService

Default Implementation of ConceptService service layer classes

See Also:
to access these methods

Constructor Summary
ConceptServiceImpl()
           
 
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> locales, 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<ConceptWord> findConcepts(java.lang.String phrase, java.util.Locale locale, boolean includeRetired)
          Deprecated. use #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 #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 includeRetired)
          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.  
 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 #getConcept(String))
 Concept getConceptByName(java.lang.String name)
          Return a Concept that matches the name exactly
 ConceptClass getConceptClass(java.lang.Integer i)
          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()
          Return a list of concept classes currently in the database
 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()
          Deprecated. use getAllConceptDatatypes()
 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 cp)
          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 c)
          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 c)
          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 c)
          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 answerToConcept, 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 drugNameOrId)
          Deprecated. use getDrug(String)
 java.util.List<Drug> getDrugs()
          Deprecated. use getAllDrugs()
 java.util.List<Drug> getDrugs(boolean includeVoided)
          Deprecated. Use getAllDrugs(boolean)
 java.util.List<Drug> getDrugs(Concept concept)
          Deprecated. use getDrugsByConcept(Concept)
 java.util.List<Drug> getDrugs(Concept concept, boolean includeRetired)
          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 c)
          Finds the next concept in the dictionary that has the next largest concept id
 Concept getPrevConcept(Concept c)
          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
protected  void modifyCollections(Concept concept)
          Sets required fields for a concept before saving it.
 void proposeConcept(ConceptProposal conceptProposal)
           
 void purgeConcept(Concept concept)
          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 concept, 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)etireConcept
protected  java.util.List<ConceptWord> weightWords(java.lang.String phrase, java.util.List<java.util.Locale> locales, java.util.List<ConceptWord> conceptWords)
          This will weight and sort the concepts we are assuming the hits are sorted with synonym matches at the bottom
 
Methods inherited from class org.openmrs.api.impl.BaseOpenmrsService
onShutdown, onStartup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openmrs.api.OpenmrsService
onShutdown, onStartup
 

Constructor Detail

ConceptServiceImpl

public ConceptServiceImpl()
Method Detail

setConceptDAO

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

Specified by:
setConceptDAO in interface ConceptService
Parameters:
dao - The data access object to use
See Also:
ConceptService.setConceptDAO(org.openmrs.api.db.ConceptDAO)

createConcept

public void createConcept(Concept concept)
Deprecated. use saveConcept(Concept)

Specified by:
createConcept in interface ConceptService

createConcept

public void createConcept(ConceptNumeric concept)
Deprecated. use saveConcept(Concept)

Specified by:
createConcept in interface ConceptService

updateConcept

public void updateConcept(Concept concept)
Deprecated. use saveConcept(Concept)

Specified by:
updateConcept in interface ConceptService

updateConcept

public void updateConcept(ConceptNumeric concept)
Deprecated. use saveConcept(Concept)

Specified by:
updateConcept in interface ConceptService

createDrug

public void createDrug(Drug drug)
Deprecated. use #saveDrug(Drug)

Specified by:
createDrug in interface ConceptService

updateDrug

public void updateDrug(Drug drug)
Deprecated. Use #saveDrug(Drug)

Specified by:
updateDrug in interface ConceptService

deleteConcept

public void deleteConcept(Concept concept)
Deprecated. use #purgeConcept(Concept concept)

Specified by:
deleteConcept in interface ConceptService

voidConcept

public void voidConcept(Concept concept,
                        java.lang.String reason)
Deprecated. use retireConcept(Concept, String)etireConcept

Specified by:
voidConcept in interface ConceptService

saveConcept

public Concept saveConcept(Concept concept)
                    throws APIException
Description copied from interface: ConceptService
Save or update the given Concept or ConceptNumeric in the database

Specified by:
saveConcept in interface ConceptService
Returns:
the Concept or ConceptNumeric that was saved or updated
Throws:
APIException
See Also:
ConceptService.saveConcept(org.openmrs.Concept)

saveDrug

public Drug saveDrug(Drug drug)
              throws APIException
Description copied from interface: ConceptService
Save or update the given Drug in the database

Specified by:
saveDrug in interface ConceptService
Returns:
the Drug that was saved or updated
Throws:
APIException
See Also:
ConceptService.saveDrug(org.openmrs.Drug)

purgeConcept

public void purgeConcept(Concept concept)
                  throws APIException
Description copied from interface: ConceptService
Completely purge a Concept or ConceptNumeric from the database. This should not typically be used unless desperately needed. Most should just be retired. See ConceptService.retireConcept(Concept, String)

Specified by:
purgeConcept in interface ConceptService
Throws:
APIException
See Also:
org.openmrs.api.ConceptService#purgeConcept(java.lang.Object)

retireConcept

public Concept retireConcept(Concept concept,
                             java.lang.String reason)
                      throws APIException
Description copied from interface: ConceptService
Retiring a concept essentially removes it from circulation

Specified by:
retireConcept in interface ConceptService
Returns:
the retired Concept or ConceptNumeric
Throws:
APIException
See Also:
ConceptService.retireConcept(org.openmrs.Concept, java.lang.String)

retireDrug

public Drug retireDrug(Drug drug,
                       java.lang.String reason)
                throws APIException
Description copied from interface: ConceptService
Retiring a Drug essentially removes it from circulation

Specified by:
retireDrug in interface ConceptService
Returns:
the retired Drug
Throws:
APIException
See Also:
ConceptService.retireDrug(org.openmrs.Drug, java.lang.String)

purgeDrug

public void purgeDrug(Drug drug)
               throws APIException
Description copied from interface: ConceptService
Completely purge a Drug from the database. This should not typically be used unless desperately needed. Most Drugs should just be retired.

Specified by:
purgeDrug in interface ConceptService
Throws:
APIException
See Also:
ConceptService.purgeDrug(org.openmrs.Drug)

getConcept

public Concept getConcept(java.lang.Integer conceptId)
                   throws APIException
Description copied from interface: ConceptService
Gets the concept with the given id

Specified by:
getConcept in interface ConceptService
Returns:
the matching Concept object
Throws:
APIException
See Also:
ConceptService.getConcept(java.lang.Integer)

getConceptAnswer

public ConceptAnswer getConceptAnswer(java.lang.Integer conceptAnswerId)
                               throws APIException
Description copied from interface: ConceptService
Gets the ConceptAnswer with the given id

Specified by:
getConceptAnswer in interface ConceptService
Returns:
the matching ConceptAnswer object
Throws:
APIException
See Also:
ConceptService.getConceptAnswer(java.lang.Integer)

getDrug

public Drug getDrug(java.lang.Integer drugId)
             throws APIException
Description copied from interface: ConceptService
Get the Drug with the given id

Specified by:
getDrug in interface ConceptService
Returns:
the matching Drug object
Throws:
APIException
See Also:
ConceptService.getDrug(java.lang.Integer)

getConceptNumeric

public ConceptNumeric getConceptNumeric(java.lang.Integer conceptId)
                                 throws APIException
Description copied from interface: ConceptService
Get the ConceptNumeric with the given id

Specified by:
getConceptNumeric in interface ConceptService
Returns:
the matching ConceptNumeric object
Throws:
APIException
See Also:
ConceptService.getConceptNumeric(java.lang.Integer)

getAllConcepts

public java.util.List<Concept> getAllConcepts()
                                       throws APIException
Description copied from interface: ConceptService
Return a list of unretired concepts sorted by concept id ascending and

Specified by:
getAllConcepts in interface ConceptService
Returns:
a List object containing all of the sorted concepts
Throws:
APIException
See Also:
ConceptService.getAllConcepts()

getAllConcepts

public java.util.List<Concept> getAllConcepts(java.lang.String sortBy,
                                              boolean asc,
                                              boolean includeRetired)
                                       throws APIException
Description copied from interface: ConceptService
Return a list of concepts sorted on sortBy in dir direction (asc/desc)

Specified by:
getAllConcepts in interface ConceptService
Parameters:
sortBy - The property name to sort by; if null or invalid, concept_id is used.
Returns:
a List object containing all of the sorted concepts
Throws:
APIException
See Also:
ConceptService.getAllConcepts(java.lang.String, boolean, boolean)

getConcepts

public java.util.List<Concept> getConcepts(java.lang.String sortBy,
                                           java.lang.String dir)
                                    throws APIException
Deprecated. use getAllConcepts(String, boolean, boolean)

Specified by:
getConcepts in interface ConceptService
Throws:
APIException

getConceptsByName

public java.util.List<Concept> getConceptsByName(java.lang.String name)
                                          throws APIException
Description copied from interface: ConceptService
Returns a list of concepts matching any part of a concept name

Specified by:
getConceptsByName in interface ConceptService
Returns:
a List object containing all of the matching concepts
Throws:
APIException
See Also:
ConceptService.getConceptsByName(java.lang.String)

getConceptByName

public Concept getConceptByName(java.lang.String name)
Description copied from interface: ConceptService
Return a Concept that matches the name exactly

Specified by:
getConceptByName in interface ConceptService
Returns:
the found Concept
See Also:
ConceptService.getConceptByName(java.lang.String)

getConceptByIdOrName

public Concept getConceptByIdOrName(java.lang.String idOrName)
Deprecated. use #getConcept(String))

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

Specified by:
getConceptByIdOrName in interface ConceptService
Returns:
the found Concept
See Also:
ConceptService.getConceptByIdOrName(java.lang.String)

getConcept

public Concept getConcept(java.lang.String conceptIdOrName)
Description copied from interface: ConceptService
Get Concept by id or name convenience method

Specified by:
getConcept in interface ConceptService
Returns:
the found Concept
See Also:
ConceptService.getConcept(java.lang.String)

getConceptWords

public 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 answerToConcept,
                                                   java.lang.Integer start,
                                                   java.lang.Integer size)
Description copied from interface: ConceptService
Searches for concepts by the given parameters via the ConceptWord table

Specified by:
getConceptWords in interface ConceptService
answerToConcept - all results will be a possible answer to this concept
Returns:
A List object containing all matching ConceptWords
See Also:
org.openmrs.api.ConceptService#getConceptWords(java.lang.String, java.util.Locale, boolean, java.util.List, java.util.List, java.util.List, java.util.List, Concept, int, int)

getConceptWords

public java.util.List<ConceptWord> getConceptWords(java.lang.String phrase,
                                                   java.util.Locale locale)
                                            throws APIException
Description copied from interface: ConceptService
Convenience method for #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)

Specified by:
getConceptWords in interface ConceptService
Parameters:
phrase - search string
Returns:
Throws:
APIException
See Also:
ConceptService.getConceptWords(java.lang.String, java.util.Locale)

findConcepts

public java.util.List<ConceptWord> findConcepts(java.lang.String phrase,
                                                java.util.Locale locale,
                                                boolean includeRetired,
                                                int start,
                                                int size)
Deprecated. use #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)

Specified by:
findConcepts in interface ConceptService

findConcepts

public java.util.List<ConceptWord> findConcepts(java.lang.String phrase,
                                                java.util.Locale locale,
                                                boolean includeRetired)
Deprecated. use #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)

Specified by:
findConcepts in interface ConceptService

findConcepts

public 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)

Specified by:
findConcepts in interface ConceptService

findConcepts

public java.util.List<ConceptWord> findConcepts(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)
Deprecated. use #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)

Description copied from interface: ConceptService
Searches on given phrase via the concept word table within a sorted list of Locales

Specified by:
findConcepts in interface ConceptService
locales - ordered List of Locales within which to search
includeRetired - boolean
requireClasses - List
excludeClasses - List
requireDatatypes - List
excludeDatatypes - List
Returns:
See Also:
ConceptService.findConcepts(String,Locale,boolean)

getDrug

public Drug getDrug(java.lang.String drugNameOrId)
Description copied from interface: ConceptService
Return the drug object corresponding to the given name or drugId

Specified by:
getDrug in interface ConceptService
Parameters:
drugNameOrId - name or drugId to match exactly on
Returns:
Drug
See Also:
ConceptService.getDrug(java.lang.String)

getDrugByNameOrId

public Drug getDrugByNameOrId(java.lang.String drugNameOrId)
Deprecated. use getDrug(String)

Description copied from interface: ConceptService
Return the drug object corresponding to the given name or drugId

Specified by:
getDrugByNameOrId in interface ConceptService
Returns:
Drug
See Also:
ConceptService.getDrugByNameOrId(java.lang.String)

getDrugs

public java.util.List<Drug> getDrugs()
Deprecated. use getAllDrugs()

Specified by:
getDrugs in interface ConceptService

getAllDrugs

public java.util.List<Drug> getAllDrugs()
Description copied from interface: ConceptService
Return a list of drugs currently in the database that are not retired

Specified by:
getAllDrugs in interface ConceptService
Returns:
a List object containing all drugs
See Also:
ConceptService.getAllDrugs()

getAllDrugs

public java.util.List<Drug> getAllDrugs(boolean includeRetired)
Description copied from interface: ConceptService
Get drugs by concept. This method is the utility method that should be used to generically retrieve all Drugs in the system.

Specified by:
getAllDrugs in interface ConceptService
Parameters:
includeRetired - If true then the search will include voided Drugs
Returns:
A List object containing all matching Drugs
See Also:
ConceptService.getAllDrugs(boolean)

getDrugs

public java.util.List<Drug> getDrugs(Concept concept)
Deprecated. use getDrugsByConcept(Concept)

Specified by:
getDrugs in interface ConceptService
See Also:
ConceptService.getDrugs(org.openmrs.Concept)

getDrugsByConcept

public java.util.List<Drug> getDrugsByConcept(Concept concept)
Description copied from interface: ConceptService
Return a list of drugs associated with the given concept

Specified by:
getDrugsByConcept in interface ConceptService
Returns:
a List object containing all matching drugs
See Also:
ConceptService.getDrugsByConcept(org.openmrs.Concept)

getDrugs

public java.util.List<Drug> getDrugs(Concept concept,
                                     boolean includeRetired)
Deprecated. Use getDrugsByConcept(Concept)

See Also:
org.openmrs.api.ConceptService#getDrugs(org.openmrs.Concept, boolean)

getDrugs

public java.util.List<Drug> getDrugs(boolean includeVoided)
Deprecated. Use getAllDrugs(boolean)

See Also:
org.openmrs.api.ConceptService#getDrugs(boolean)

findDrugs

public java.util.List<Drug> findDrugs(java.lang.String phrase,
                                      boolean includeRetired)
Deprecated. Use getDrugs(String)

Specified by:
findDrugs in interface ConceptService
See Also:
ConceptService.findDrugs(java.lang.String, boolean)

getDrugs

public java.util.List<Drug> getDrugs(java.lang.String phrase)
Description copied from interface: ConceptService
Find drugs in the system. The string search can match either drug.name or drug.concept.name

Specified by:
getDrugs in interface ConceptService
Returns:
A List object containing all Drug matches
See Also:
ConceptService.getDrugs(java.lang.String)

getConceptsByClass

public java.util.List<Concept> getConceptsByClass(ConceptClass cc)
Specified by:
getConceptsByClass in interface ConceptService
Returns:
Returns all concepts in a given class
See Also:
ConceptService.getConceptsByClass(org.openmrs.ConceptClass)

getConceptClasses

public java.util.List<ConceptClass> getConceptClasses()
Description copied from interface: ConceptService
Return a list of concept classes currently in the database

Specified by:
getConceptClasses in interface ConceptService
Returns:
List object with all ConceptClass objects
See Also:
ConceptService.getConceptClasses()

getAllConceptClasses

public java.util.List<ConceptClass> getAllConceptClasses(boolean includeRetired)
Description copied from interface: ConceptService
Return a list of concept classes currently in the database

Specified by:
getAllConceptClasses in interface ConceptService
Returns:
List object with all ConceptClass objects
See Also:
ConceptService.getAllConceptClasses(boolean)

getConceptClass

public ConceptClass getConceptClass(java.lang.Integer i)
Description copied from interface: ConceptService
Return a Concept class matching the given identifier

Specified by:
getConceptClass in interface ConceptService
Returns:
the matching ConceptClass
See Also:
ConceptService.getConceptClass(java.lang.Integer)

getConceptClassByName

public ConceptClass getConceptClassByName(java.lang.String name)
Description copied from interface: ConceptService
Return a Concept class matching the given name

Specified by:
getConceptClassByName in interface ConceptService
Returns:
ConceptClass
See Also:
ConceptService.getConceptClassByName(java.lang.String)

getAllConceptClasses

public java.util.List<ConceptClass> getAllConceptClasses()
                                                  throws APIException
Description copied from interface: ConceptService
Return a list of concept classes currently in the database

Specified by:
getAllConceptClasses in interface ConceptService
Returns:
List object with all ConceptClass objects
Throws:
APIException
See Also:
ConceptService.getAllConceptClasses(boolean)

saveConceptClass

public ConceptClass saveConceptClass(ConceptClass cc)
                              throws APIException
Description copied from interface: ConceptService
Creates or updates a concept class

Specified by:
saveConceptClass in interface ConceptService
Throws:
APIException
See Also:
ConceptService.saveConceptClass(org.openmrs.ConceptClass)

purgeConceptClass

public void purgeConceptClass(ConceptClass cc)
Description copied from interface: ConceptService
Purge a ConceptClass

Specified by:
purgeConceptClass in interface ConceptService
See Also:
ConceptService.purgeConceptClass(org.openmrs.ConceptClass)

purgeConceptDatatype

public void purgeConceptDatatype(ConceptDatatype cd)
                          throws APIException
Description copied from interface: ConceptService
Purge a ConceptDatatype. This removes the concept datatype from the database completely.

Specified by:
purgeConceptDatatype in interface ConceptService
Throws:
APIException
See Also:
ConceptService.purgeConceptDatatype(org.openmrs.ConceptDatatype)

saveConceptDatatype

public ConceptDatatype saveConceptDatatype(ConceptDatatype cd)
                                    throws APIException
Description copied from interface: ConceptService
Create or update a ConceptDatatype

Specified by:
saveConceptDatatype in interface ConceptService
Throws:
APIException
See Also: