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

Field Summary
static java.lang.String CONCEPT_WORD_UPDATE_TASK_NAME
           
 
Constructor Summary
ConceptServiceImpl()
           
 
Method Summary
 void checkIfLocked()
          Check if the concepts are locked and if so, throw exception during manipulation of concept
 java.util.Iterator<Concept> conceptIterator()
          Returns an iterator for all concepts, including retired and expired.
 void convertBooleanConceptToCoded(Concept conceptToChange)
          Changes the datatype of a concept from boolean to coded when it has observations it is associated to.
 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, Concept, 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, Concept, 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, Concept, 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, Concept, 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 all 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<ConceptNameTag> getAllConceptNameTags()
          Get all the concept name tags defined in the database, included voided ones
 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<ConceptSource> getAllConceptSources()
          Return a list of concept sources currently in the database that are not voided
 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
 ConceptAnswer getConceptAnswerByUuid(java.lang.String uuid)
          Get ConceptAnswer by its UUID
 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 getConceptByMapping(java.lang.String conceptCode, java.lang.String mappingCode)
          Looks up a concept via ConceptMap This will return the Concept which contains a ConceptMap entry whose sourceCode is equal to the passed conceptCode and whose ConceptSource has either a name or hl7Code that is equal to the passed mappingCode
 Concept getConceptByName(java.lang.String name)
          Return a Concept that matches the name exactly
 Concept getConceptByUuid(java.lang.String uuid)
          Get Concept by its UUID
 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
 ConceptClass getConceptClassByUuid(java.lang.String uuid)
          Get ConceptClass by its UUID
 java.util.List<ConceptClass> getConceptClasses()
          Deprecated.  
 ConceptComplex getConceptComplex(java.lang.Integer conceptId)
          Get a ComplexConcept with the given conceptId
 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
 ConceptDatatype getConceptDatatypeByUuid(java.lang.String uuid)
          Get ConceptDatatype by its UUID
 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
 ConceptDescription getConceptDescriptionByUuid(java.lang.String uuid)
          Get ConceptDescription by its UUID
 ConceptName getConceptName(java.lang.Integer conceptNameId)
          Gets the concept-name with the given id
 ConceptName getConceptNameByUuid(java.lang.String uuid)
          Get ConceptName by its UUID
 ConceptNameTag getConceptNameTag(java.lang.Integer id)
          Gets the ConceptNameTag with the given database primary key
 ConceptNameTag getConceptNameTagByName(java.lang.String tagName)
          Search for a ConceptNameTag by name
 ConceptNameTag getConceptNameTagByUuid(java.lang.String uuid)
          Get ConceptNameTag by its UUID
 ConceptNumeric getConceptNumeric(java.lang.Integer conceptId)
          Get the ConceptNumeric with the given id
 ConceptNumeric getConceptNumericByUuid(java.lang.String uuid)
          Get ConceptNumeric by its UUID
 ConceptProposal getConceptProposal(java.lang.Integer conceptProposalId)
          Get a ConceptProposal by conceptProposalId
 ConceptProposal getConceptProposalByUuid(java.lang.String uuid)
          Get ConceptProposal by its UUID
 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 Concepts to which this concept is a value-coded answer.
 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<ConceptMap> getConceptsByConceptSource(ConceptSource conceptSource)
          Looks up a list of ConceptMaps for a given ConceptSource
 java.util.List<Concept> getConceptsByName(java.lang.String name)
          Returns a list of concepts matching any part of a concept name, this method is case insensitive to the concept name string
 ConceptSet getConceptSetByUuid(java.lang.String uuid)
          Get ConceptSet by its UUID
 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
 java.util.List<Concept> getConceptsInSet(Concept c)
          Deprecated. use getConceptsByConceptSet(Concept)
 ConceptSource getConceptSource(java.lang.Integer conceptSourceId)
          Return a Concept source matching the given concept source id
 ConceptSource getConceptSourceByName(java.lang.String conceptSourceName)
          Lookup a ConceptSource by its name property
 ConceptSource getConceptSourceByUuid(java.lang.String uuid)
          Get ConceptSource by its UUID
 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 ConceptService.getConceptWords(String, List, boolean, List, List, List, List, Concept, 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)
 Drug getDrugByUuid(java.lang.String uuid)
          Get Drug by its UUID
 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
 Concept getFalseConcept()
          Returns the FALSE concept
 java.util.Set<java.util.Locale> getLocalesOfConceptNames()
          Gets the set of unique Locales used by existing concept names.
 java.lang.Integer getMaxConceptId()
          Gets the highest concept-id used by a concept.
 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 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 getTrueConcept()
          Returns the TRUE concept
 boolean hasAnyObservation(Concept concept)
          Checks if there are any observations (including voided observations) for a concept.
 boolean hasAnyObservation(ConceptName conceptName)
          Checks if there are any observations (including voided observations) using a conceptName.
 Concept mapConceptProposalToConcept(ConceptProposal cp, Concept mappedConcept)
          Maps a concept proposal to a concept
 void proposeConcept(ConceptProposal conceptProposal)
          Deprecated.  
 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.
 ConceptSource purgeConceptSource(ConceptSource cs)
          Delete ConceptSource
 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
 ConceptSource retireConceptSource(ConceptSource cs, java.lang.String reason)
          This effectively removes a concept source from the database.
 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
 ConceptNameTag saveConceptNameTag(ConceptNameTag nameTag)
          Creates a new Concept name tag if none exists.
 ConceptProposal saveConceptProposal(ConceptProposal conceptProposal)
          Saves/updates/proposes a concept proposal
 ConceptSource saveConceptSource(ConceptSource conceptSource)
          Create a new ConceptSource
 Drug saveDrug(Drug drug)
          Save or update the given Drug in the database.
 void setConceptDAO(ConceptDAO dao)
          Sets the data access object for Concepts.
 Drug unretireDrug(Drug drug)
          Marks a drug that is currently retired as not retired.
 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 according to how many of the words in the name match the words in the search phrase.
 
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
 

Field Detail

CONCEPT_WORD_UPDATE_TASK_NAME

public static final java.lang.String CONCEPT_WORD_UPDATE_TASK_NAME
See Also:
Constant Field Values
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

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

Specified by:
createConcept in interface ConceptService

createConcept

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

Specified by:
createConcept in interface ConceptService

updateConcept

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

Specified by:
updateConcept in interface ConceptService

updateConcept

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

Specified by:
updateConcept in interface ConceptService

createDrug

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

Specified by:
createDrug in interface ConceptService

updateDrug

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

Specified by:
updateDrug in interface ConceptService

deleteConcept

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

Specified by:
deleteConcept in interface ConceptService

voidConcept

@Deprecated
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

If this is a new concept, the returned concept will have a new Concept.getConceptId() inserted into it that was generated by the database

Specified by:
saveConcept in interface ConceptService
Parameters:
concept - The Concept or ConceptNumeric to save or update
Returns:
the Concept or ConceptNumeric that was saved or updated
Throws:
APIException
ConceptsLockedException
ConceptInUseException
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. If this is a new drug, the returned drug object will have a new Drug.getDrugId() inserted into it that was generated by the database

Specified by:
saveDrug in interface ConceptService
Parameters:
drug - The Drug to save or update
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
Parameters:
concept - The Concept or ConceptNumeric to remove from the system
Throws:
APIException
See Also:
ConceptService.purgeConcept(Concept)

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
Parameters:
concept - The Concept or ConceptNumeric to retire
reason - The retire reason
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
Parameters:
drug - The Drug to retire
reason - The retire reason
Returns:
the retired Drug
Throws:
APIException
See Also:
ConceptService.retireDrug(org.openmrs.Drug, java.lang.String)

unretireDrug

public Drug unretireDrug(Drug drug)
                  throws APIException
Description copied from interface: ConceptService
Marks a drug that is currently retired as not retired.

Specified by:
unretireDrug in interface ConceptService
Parameters:
drug - that is current set as retired
Returns:
the given drug, marked as not retired now, and saved to the db
Throws:
APIException
See Also:
ConceptService.unretireDrug(org.openmrs.Drug)

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
Parameters:
drug - The Drug to remove from the system
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)

getConceptName

public ConceptName getConceptName(java.lang.Integer conceptNameId)
                           throws APIException
Description copied from interface: ConceptService
Gets the concept-name with the given id

Specified by:
getConceptName in interface ConceptService
Returns:
the matching Concept object
Throws:
APIException
See Also:
ConceptService.getConceptName(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
Parameters:
conceptId - The ConceptNumeric id
Returns:
the matching ConceptNumeric object
Throws:
APIException
See Also:
ConceptService.getConceptNumeric(java.lang.Integer)

getConceptComplex

public ConceptComplex getConceptComplex(java.lang.Integer conceptId)
Description copied from interface: ConceptService
Get a ComplexConcept with the given conceptId

Specified by:
getConceptComplex in interface ConceptService
Parameters:
conceptId - of the ComplexConcept
Returns:
a ConceptComplex object
See Also:
ConceptService.getConceptComplex(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.
asc - true = sort ascending; false = sort descending
includeRetired - If true, retired concepts will also be returned
Returns:
a List object containing all of the sorted concepts
Throws:
APIException
See Also:
ConceptService.getAllConcepts(java.lang.String, boolean, boolean)

getConcepts

@Deprecated
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, this method is case insensitive to the concept name string

Specified by:
getConceptsByName in interface ConceptService
Parameters:
name - The search string
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
Parameters:
name - The search string
Returns:
the found Concept
See Also:
ConceptService.getConceptByName(java.lang.String)

getConceptByIdOrName

@Deprecated
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
Parameters:
phrase - matched to the start of any word in any of the names of a concept
locales - List to restrict to
includeRetired - boolean if false, will exclude retired concepts
requireClasses - List to restrict to
excludeClasses - List to leave out of results
requireDatatypes - List to restrict to
excludeDatatypes - List to leave out of results
answerToConcept - all results will be a possible answer to this concept
start - all results less than this number will be removed
size - if non zero, all results after start + size will be removed
Returns:
A List object containing all matching ConceptWords
See Also:
ConceptService.getConceptWords(String, List, boolean, List, List, List, List, Concept, Integer, Integer)

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 ConceptService.getConceptWords(String, List, boolean, List, List, List, List, Concept, Integer, Integer)

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

findConcepts

@Deprecated
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, Concept, Integer, Integer)

Specified by:
findConcepts in interface ConceptService

findConcepts

@Deprecated
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, Concept, Integer, Integer)

Specified by:
findConcepts in interface ConceptService

findConcepts

@Deprecated
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, Concept, Integer, Integer)

Specified by:
findConcepts in interface ConceptService

findConcepts

@Deprecated
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, Concept, 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
Parameters:
phrase - String search phrase
locales - ordered List of Locales within which to search
includeRetired - boolean
requireClasses - List of ConceptClasses that must be included
excludeClasses - List of ConceptClasses that must not be included
requireDatatypes - List of ConceptDatatypes that must be included
excludeDatatypes - Listof ConceptDatatypes that must not be included
Returns:
List object of ConceptWords matching the criteria
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 - String name or drugId to match exactly on
Returns:
matching Drug object
See Also:
ConceptService.getDrug(java.lang.String)

getDrugByNameOrId

@Deprecated
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
Parameters:
drugNameOrId - String
Returns:
matching Drug object
See Also:
ConceptService.getDrugByNameOrId(java.lang.String)

getDrugs

@Deprecated
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

@Deprecated
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

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

See Also:
ConceptService.getDrugs(Concept)

getDrugs

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

See Also:
ConceptService.getAllDrugs(boolean)

findDrugs

@Deprecated
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
Parameters:
phrase - Search phrase
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
Parameters:
cc - ConceptClass
Returns:
Returns all concepts in a given class
See Also:
ConceptService.getConceptsByClass(org.openmrs.ConceptClass)

getConceptClasses

@Deprecated
public java.util.List<ConceptClass> getConceptClasses()
Deprecated. 

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
Parameters:
includeRetired - include retired concept classes in the search results?
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
Parameters:
i - the concept class identifier
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 matching the given name
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
Parameters:
cc - ConceptClass to create or update
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
Parameters:
cc - ConceptClass to delete
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
Parameters:
cd - ConceptDatatype to purge
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
Parameters:
cd - ConceptDatatype to create or update
Throws:
APIException
See Also:
ConceptService.saveConceptDatatype(org.openmrs.ConceptDatatype)

getConceptDatatypes

@Deprecated
public java.util.List<ConceptDatatype> getConceptDatatypes()
Deprecated. use getAllConceptDatatypes()

See Also:
ConceptService.getAllConceptDatatypes()

getAllConceptDatatypes

public java.util.List<ConceptDatatype> getAllConceptDatatypes()
Description copied from interface: ConceptService
Return a list of all concept datatypes currently in the database

Specified by:
getAllConceptDatatypes in interface ConceptService
Returns:
List of ConceptDatatypes
See Also:
ConceptService.getAllConceptDatatypes()

getAllConceptDatatypes

public java.util.List<ConceptDatatype> getAllConceptDatatypes(boolean includeRetired)
                                                       throws APIException
Description copied from interface: ConceptService
Return a list of concept datatypes currently in the database

Specified by:
getAllConceptDatatypes in interface ConceptService
Parameters:
includeRetired - boolean - include the retired datatypes?
Returns:
List of ConceptDatatypes
Throws:
APIException
See Also:
ConceptService.getAllConceptDatatypes(boolean)

getConceptDatatype

public ConceptDatatype getConceptDatatype(java.lang.Integer i)
Description copied from interface: ConceptService
Return a ConceptDatatype matching the given identifier

Specified by:
getConceptDatatype in interface ConceptService
Parameters:
i - Integer for the requested ConceptDatatype
Returns:
ConceptDatatype matching the given identifier
See Also:
ConceptService.getConceptDatatype(java.lang.Integer)

getConceptDatatypes

public java.util.List<ConceptDatatype> getConceptDatatypes(java.lang.String name)
Description copied from interface: ConceptService
Find concept datatypes that contain the given name string

Specified by:
getConceptDatatypes in interface ConceptService
Returns:
List object of ConceptDatatypes matching the string
See Also:
ConceptService.getConceptDatatypes(java.lang.String)

getConceptDatatypeByName

public ConceptDatatype getConceptDatatypeByName(java.lang.String name)
Description copied from interface: ConceptService
Return a Concept datatype matching the given name

Specified by:
getConceptDatatypeByName in interface ConceptService
Returns:
ConceptDatatype matching the given name
See Also:
ConceptService.getConceptDatatypeByName(java.lang.String)

updateConceptSetDerived

public void updateConceptSetDerived(Concept concept)
                             throws APIException
Description copied from interface: ConceptService
Updates the concept set derived business table for this concept (bursting the concept sets)

Specified by:
updateConceptSetDerived in interface ConceptService
Throws:
APIException
See Also:
ConceptService.updateConceptSetDerived(org.openmrs.Concept)

updateConceptSetDerived

public void updateConceptSetDerived()
                             throws APIException
Description copied from interface: ConceptService
Iterates over all concepts calling updateConceptSetDerived(concept)

Specified by:
updateConceptSetDerived in interface ConceptService
Throws:
APIException
See Also:
ConceptService.updateConceptSetDerived()

getConceptSets

@Deprecated
public java.util.List<ConceptSet> getConceptSets(Concept c)
Deprecated. use getConceptSetsByConcept(Concept)

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

getConceptSetsByConcept

public java.util.List<ConceptSet> getConceptSetsByConcept(Concept concept)
                                                   throws APIException
Description copied from interface: ConceptService
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.

Specified by:
getConceptSetsByConcept in interface ConceptService
Parameters:
concept - The concept representing the concept set
Returns:
A List object containing all matching ConceptSets
Throws:
APIException
See Also:
ConceptService.getConceptSetsByConcept(org.openmrs.Concept)

getConceptsInSet

@Deprecated
public java.util.List<Concept> getConceptsInSet(Concept c)
Deprecated. use getConceptsByConceptSet(Concept)

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

getConceptsByConceptSet

public java.util.List<Concept> getConceptsByConceptSet(Concept c)
Description copied from interface: ConceptService
Return a List of all concepts within a concept set

Specified by:
getConceptsByConceptSet in interface ConceptService
Parameters:
c - The concept representing the concept set
Returns:
A List object containing all objects within the ConceptSet
See Also:
ConceptService.getConceptsInSet(org.openmrs.Concept)

getSetsContainingConcept

public java.util.List<ConceptSet> getSetsContainingConcept(Concept concept)
Description copied from interface: ConceptService
Find all sets that the given concept is a member of

Specified by:
getSetsContainingConcept in interface ConceptService
Returns:
A List object with all parent concept sets
See Also:
ConceptService.getSetsContainingConcept(org.openmrs.Concept)

getConceptProposal

public ConceptProposal getConceptProposal(java.lang.Integer conceptProposalId)
Description copied from interface: ConceptService
Get a ConceptProposal by conceptProposalId

Specified by:
getConceptProposal in interface ConceptService
Parameters:
conceptProposalId - the Integer concept proposal Id
Returns:
the found ConceptProposal
See Also:
ConceptService.getConceptProposal(java.lang.Integer)

getConceptProposals

@Deprecated
public java.util.List<ConceptProposal> getConceptProposals(boolean includeCompleted)
Deprecated. use getAllConceptProposals(boolean)

Specified by:
getConceptProposals in interface ConceptService
See Also:
ConceptService.getConceptProposals(boolean)

getAllConceptProposals

public java.util.List<ConceptProposal> getAllConceptProposals(boolean includeCompleted)
Description copied from interface: ConceptService
Get a List of all concept proposals

Specified by:
getAllConceptProposals in interface ConceptService
Parameters:
includeCompleted - boolean - include completed proposals as well?
Returns:
a List object of all found ConceptProposals
See Also:
ConceptService.getAllConceptProposals(boolean)

getConceptProposals

public java.util.List<ConceptProposal> getConceptProposals(java.lang.String cp)
Description copied from interface: ConceptService
Find matching concept proposals

Specified by:
getConceptProposals in interface ConceptService
Returns:
a List object containing matching concept proposals
See Also:
ConceptService.getConceptProposals(java.lang.String)

findProposedConcepts

@Deprecated
public java.util.List<Concept> findProposedConcepts(java.lang.String text)
Deprecated. 

Specified by:
findProposedConcepts in interface ConceptService
See Also:
ConceptService.findProposedConcepts(java.lang.String)

getProposedConcepts

public java.util.List<Concept> getProposedConcepts(java.lang.String text)
Description copied from interface: ConceptService
Find matching proposed concepts

Specified by:
getProposedConcepts in interface ConceptService
Returns:
a List object containing matching proposed concepts
See Also:
ConceptService.getProposedConcepts(java.lang.String)

proposeConcept

@Deprecated
public void proposeConcept(ConceptProposal conceptProposal)
Deprecated. 

Specified by:
proposeConcept in interface ConceptService
See Also:
ConceptService.proposeConcept(org.openmrs.ConceptProposal)

saveConceptProposal

public ConceptProposal saveConceptProposal(ConceptProposal conceptProposal)
                                    throws APIException
Description copied from interface: ConceptService
Saves/updates/proposes a concept proposal

Specified by:
saveConceptProposal in interface ConceptService
Parameters:
conceptProposal - The ConceptProposal to save
Returns:
the saved/updated ConceptProposal object
Throws:
APIException
See Also:
ConceptService.saveConceptProposal(org.openmrs.ConceptProposal)

purgeConceptProposal

public void purgeConceptProposal(ConceptProposal cp)
                          throws APIException
Description copied from interface: ConceptService
Removes a concept proposal from the database entirely.

Specified by:
purgeConceptProposal in interface ConceptService
Throws:
APIException
See Also:
ConceptService.purgeConceptProposal(org.openmrs.ConceptProposal)

mapConceptProposalToConcept

public Concept mapConceptProposalToConcept(ConceptProposal cp,
                                           Concept mappedConcept)
                                    throws APIException
Description copied from interface: ConceptService
Maps a concept proposal to a concept

Specified by:
mapConceptProposalToConcept in interface ConceptService
Returns:
the mappedConcept
Throws:
APIException
See Also:
ConceptService.mapConceptProposalToConcept(org.openmrs.ConceptProposal, org.openmrs.Concept)

rejectConceptProposal

@Deprecated
public void rejectConceptProposal(ConceptProposal cp)
Deprecated. use ConceptProposal.rejectConceptProposal()

Specified by:
rejectConceptProposal in interface ConceptService
See Also:
ConceptService.rejectConceptProposal(org.openmrs.ConceptProposal)

findMatchingConceptProposals

@Deprecated
public java.util.List<ConceptProposal> findMatchingConceptProposals(java.lang.String text)
Deprecated. use getConceptProposals(String)

Specified by:
findMatchingConceptProposals in interface ConceptService
See Also:
ConceptService.findMatchingConceptProposals(String text)

findConceptAnswers

@Deprecated
public java.util.List<ConceptWord> findConceptAnswers(java.lang.String phrase,
                                                                 java.util.Locale locale,
                                                                 Concept concept,
                                                                 boolean includeRetired)
Deprecated. use getConceptAnswers(String, Locale, Concept)

Specified by:
findConceptAnswers in interface ConceptService
See Also:
ConceptService.findConceptAnswers(String phrase, Locale locale,Concept concept, boolean includeRetired)

getConceptAnswers

public java.util.List<ConceptWord> getConceptAnswers(java.lang.String phrase,
                                                     java.util.Locale locale,
                                                     Concept concept)
                                              throws APIException
Description copied from interface: ConceptService
Finds concepts that are possible value coded answers to concept parameter

Specified by:
getConceptAnswers in interface ConceptService
concept - the answers to match on
Returns:
List object
Throws:
APIException
See Also:
ConceptService.getConceptAnswers(java.lang.String, java.util.Locale, org.openmrs.Concept)

getQuestionsForAnswer

@Deprecated
public java.util.List<Concept> getQuestionsForAnswer(Concept concept)
Deprecated. use getConceptsByAnswer(Concept)

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

getConceptsByAnswer

public java.util.List<Concept> getConceptsByAnswer(Concept concept)
                                            throws APIException
Description copied from interface: ConceptService
Returns all possible Concepts to which this concept is a value-coded answer. To navigate in the other direction, i.e., from Concept to its answers use Concept.getAnswers()

Specified by:
getConceptsByAnswer in interface ConceptService
Returns:
A List containing all possible questions to which this concept is a valued_Coded answer
Throws:
APIException
See Also:
ConceptService.getConceptsByAnswer(org.openmrs.Concept)

getPrevConcept

public Concept getPrevConcept(Concept c)
Description copied from interface: ConceptService
Finds the previous concept in the dictionary that has the next lowest concept id

Specified by:
getPrevConcept in interface ConceptService
Parameters:
c - the offset Concept
Returns:
the foundConcept
See Also:
ConceptService.getPrevConcept(org.openmrs.Concept)

getNextConcept

public Concept getNextConcept(Concept c)
Description copied from interface: ConceptService
Finds the next concept in the dictionary that has the next largest concept id

Specified by:
getNextConcept in interface ConceptService
Parameters:
c - the offset Concept
Returns:
the foundConcept
See Also:
ConceptService.getNextConcept(org.openmrs.Concept)

checkIfLocked

public void checkIfLocked()
                   throws ConceptsLockedException
Description copied from interface: ConceptService
Check if the concepts are locked and if so, throw exception during manipulation of concept

Specified by:
checkIfLocked in interface ConceptService
Throws:
ConceptsLockedException
See Also:
ConceptService.checkIfLocked()

getConceptsWithDrugsInFormulary

public java.util.List<Concept> getConceptsWithDrugsInFormulary()
Description copied from interface: ConceptService
Convenience method for finding concepts associated with drugs in formulary.

Specified by:
getConceptsWithDrugsInFormulary in interface ConceptService
Returns:
A List object of all concepts that occur as a Drug.concept.
See Also:
ConceptService.getConceptsWithDrugsInFormulary()

updateConceptWords

public void updateConceptWords()
                        throws APIException
Description copied from interface: ConceptService
Iterates over all concepts and calls upddateConceptWords(Concept concept)

Specified by:
updateConceptWords in interface ConceptService
Throws:
APIException
See Also:
ConceptService.updateConceptWords()

updateConceptWord

public void updateConceptWord(Concept concept)
                       throws APIException
Description copied from interface: ConceptService
Iterates over the words in names and synonyms (for each locale) and updates the concept_word table

Specified by:
updateConceptWord in interface ConceptService
Throws:
APIException
See Also:
ConceptService.updateConceptWord(org.openmrs.Concept)

updateConceptWords

public void updateConceptWords(java.lang.Integer conceptIdStart,
                               java.lang.Integer conceptIdEnd)
                        throws APIException
Description copied from interface: ConceptService
Iterates over all concepts with conceptIds between conceptIdStart and conceptIdEnd (inclusive) and calls updateConceptWord(concept)

Specified by:
updateConceptWords in interface ConceptService
Parameters:
conceptIdStart - starts update with this concept_id
conceptIdEnd - ends update with this concept_id
Throws:
APIException
See Also:
ConceptService.updateConceptWords(java.lang.Integer, java.lang.Integer)

getMaxConceptId

public java.lang.Integer getMaxConceptId()
Description copied from interface: ConceptService
Gets the highest concept-id used by a concept.

Specified by:
getMaxConceptId in interface ConceptService
Returns:
highest concept-id
See Also:
ConceptService.getMaxConceptId()

weightWords

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 according to how many of the words in the name match the words in the search phrase.

Parameters:
phrase - that was used to get this search
locales - List that were used to get this search
conceptWords - the words that were found via a db search and now must be weighted before being shown to the user
Returns:
List object containing sorted ConceptWords
Expected behavior:
not fail with null phrase, weigh preferred names higher than other names in the locale, weigh a fully specified name higher than an indexTerm in the locale, weigh a fully specified name higher than a synonym in the locale, weight names that contain all words in search phrase higher than names that dont, weight better matches higher than lower matches

getConceptNameTagByName

public ConceptNameTag getConceptNameTagByName(java.lang.String tagName)
Description copied from interface: ConceptService
Search for a ConceptNameTag by name

Specified by:
getConceptNameTagByName in interface ConceptService
Parameters:
tagName - String name of ConceptNameTag
Returns:
ConceptNameTag matching the given String tag
See Also:
ConceptService.getConceptNameTagByName(java.lang.String)

getLocalesOfConceptNames

public java.util.Set<java.util.Locale> getLocalesOfConceptNames()
Description copied from interface: ConceptService
Gets the set of unique Locales used by existing concept names.

Specified by:
getLocalesOfConceptNames in interface ConceptService
Returns:
set of used Locales
See Also:
ConceptService.getLocalesOfConceptNames()

getConceptSource

public ConceptSource getConceptSource(java.lang.Integer conceptSourceId)
Description copied from interface: ConceptService
Return a Concept source matching the given concept source id

Specified by:
getConceptSource in interface ConceptService
Parameters:
conceptSourceId - Integer conceptSourceId
Returns:
ConceptSource
See Also:
ConceptService.getConceptSource(java.lang.Integer)

getAllConceptSources

public java.util.List<ConceptSource> getAllConceptSources()
Description copied from interface: ConceptService
Return a list of concept sources currently in the database that are not voided

Specified by:
getAllConceptSources in interface ConceptService
Returns:
List of Concept source objects
See Also:
ConceptService.getAllConceptSources()

purgeConceptSource

public ConceptSource purgeConceptSource(ConceptSource cs)
                                 throws APIException
Description copied from interface: ConceptService
Delete ConceptSource

Specified by:
purgeConceptSource in interface ConceptService
Parameters:
cs - ConceptSource object delete
Throws:
APIException
See Also:
ConceptService.purgeConceptSource(org.openmrs.ConceptSource)

retireConceptSource

public ConceptSource retireConceptSource(ConceptSource cs,
                                         java.lang.String reason)
                                  throws APIException
Description copied from interface: ConceptService
This effectively removes a concept source from the database. The source can still be referenced by old data, but no new data should use this source.

Specified by:
retireConceptSource in interface ConceptService
Parameters:
cs - the concept source to retire
reason - why the concept source is to be retired, must not be empty of null
Returns:
the retired concept source
Throws:
APIException
See Also:
ConceptService.retireConceptSource(org.openmrs.ConceptSource,String)

saveConceptSource

public ConceptSource saveConceptSource(ConceptSource conceptSource)
                                throws APIException
Description copied from interface: ConceptService
Create a new ConceptSource

Specified by:
saveConceptSource in interface ConceptService
Parameters:
conceptSource - ConceptSource to create
Throws:
APIException
See Also:
ConceptService.saveConceptSource(org.openmrs.ConceptSource)

saveConceptNameTag

public ConceptNameTag saveConceptNameTag(ConceptNameTag nameTag)
Description copied from interface: ConceptService
Creates a new Concept name tag if none exists. If a tag exists with the same name then that existing tag is returned.

Specified by:
saveConceptNameTag in interface ConceptService
Parameters:
nameTag - the concept name tag to be saved
Returns:
the newly created or existing concept name tag
See Also:
ConceptService.saveConceptNameTag(org.openmrs.ConceptNameTag)

conceptIterator

public java.util.Iterator<Concept> conceptIterator()
Description copied from interface: ConceptService
Returns an iterator for all concepts, including retired and expired.

Specified by:
conceptIterator in interface ConceptService
Returns:
the Iterator
See Also:
ConceptService.conceptIterator()

getConceptByUuid

public Concept getConceptByUuid(java.lang.String uuid)
Description copied from interface: ConceptService
Get Concept by its UUID

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

getConceptClassByUuid

public ConceptClass getConceptClassByUuid(java.lang.String uuid)
Description copied from interface: ConceptService
Get ConceptClass by its UUID

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

getConceptAnswerByUuid

public ConceptAnswer getConceptAnswerByUuid(java.lang.String uuid)
Description copied from interface: ConceptService
Get ConceptAnswer by its UUID

Specified by:
getConceptAnswerByUuid in interface ConceptService
Returns:

getConceptNameByUuid

public ConceptName getConceptNameByUuid(java.lang.String uuid)
Description copied from interface: ConceptService
Get ConceptName by its UUID

Specified by:
getConceptNameByUuid in interface ConceptService
Returns:

getConceptSetByUuid

public ConceptSet getConceptSetByUuid(java.lang.String uuid)
Description copied from interface: ConceptService
Get ConceptSet by its UUID

Specified by:
getConceptSetByUuid in interface ConceptService
Returns:

getConceptSourceByUuid

public ConceptSource getConceptSourceByUuid(java.lang.String uuid)
Description copied from interface: ConceptService
Get ConceptSource by its UUID

Specified by:
getConceptSourceByUuid in interface ConceptService
Returns:

getConceptDatatypeByUuid

public ConceptDatatype getConceptDatatypeByUuid(java.lang.String uuid)
Description copied from interface: ConceptService
Get ConceptDatatype by its UUID

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

getConceptNumericByUuid

public ConceptNumeric getConceptNumericByUuid(java.lang.String uuid)
Description copied from interface: ConceptService
Get ConceptNumeric by its UUID

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

getConceptProposalByUuid

public ConceptProposal getConceptProposalByUuid(java.lang.String uuid)
Description copied from interface: ConceptService
Get ConceptProposal by its UUID

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

getDrugByUuid

public Drug getDrugByUuid(java.lang.String uuid)
Description copied from interface: ConceptService
Get Drug by its UUID

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

getConceptDescriptionByUuid

public ConceptDescription getConceptDescriptionByUuid(java.lang.String uuid)
Description copied from interface: ConceptService
Get ConceptDescription by its UUID

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

getConceptNameTagByUuid

public ConceptNameTag getConceptNameTagByUuid(java.lang.String uuid)
Description copied from interface: ConceptService
Get ConceptNameTag by its UUID

Specified by:
getConceptNameTagByUuid in interface ConceptService
Returns:
the conceptNameTag with a matching uuid
See Also:
ConceptService.getConceptNameTagByUuid(java.lang.String)

getAllConceptNameTags

public java.util.List<ConceptNameTag> getAllConceptNameTags()
Description copied from interface: ConceptService
Get all the concept name tags defined in the database, included voided ones

Specified by:
getAllConceptNameTags in interface ConceptService
Returns:
a list of the concept name tags stored in the
See Also:
ConceptService.getAllConceptNameTags()

getConceptNameTag

public ConceptNameTag getConceptNameTag(java.lang.Integer id)
Description copied from interface: ConceptService
Gets the ConceptNameTag with the given database primary key

Specified by:
getConceptNameTag in interface ConceptService
Parameters:
id - the concept name tag id to find
Returns:
the matching ConceptNameTag or null if none found
See Also:
ConceptService.getConceptNameTag(java.lang.Integer)

getConceptByMapping

public Concept getConceptByMapping(java.lang.String conceptCode,
                                   java.lang.String mappingCode)
                            throws APIException
Description copied from interface: ConceptService
Looks up a concept via ConceptMap This will return the Concept which contains a ConceptMap entry whose sourceCode is equal to the passed conceptCode and whose ConceptSource has either a name or hl7Code that is equal to the passed mappingCode

Specified by:
getConceptByMapping in interface ConceptService
Parameters:
conceptCode - the code associated with a concept within a given ConceptSource
mappingCode - the name or hl7Code of the ConceptSource to check
Returns:
the Concept that has the given mapping, or null if no Concept found
Throws:
APIException
See Also:
ConceptService.getConceptByMapping(java.lang.String, java.lang.String)

getFalseConcept

public Concept getFalseConcept()
Description copied from interface: ConceptService
Returns the FALSE concept

Specified by:
getFalseConcept in interface ConceptService
Returns:
false concept
See Also:
ConceptService.getFalseConcept()

getTrueConcept

public Concept getTrueConcept()
Description copied from interface: ConceptService
Returns the TRUE concept

Specified by:
getTrueConcept in interface ConceptService
Returns:
true concept
See Also:
ConceptService.getTrueConcept()

getConceptsByConceptSource

public java.util.List<ConceptMap> getConceptsByConceptSource(ConceptSource conceptSource)
                                                      throws APIException
Description copied from interface: ConceptService
Looks up a list of ConceptMaps for a given ConceptSource

Specified by:
getConceptsByConceptSource in interface ConceptService
Returns:
a List object
Throws:
APIException
See Also:
ConceptService.getConceptsByConceptSource(org.openmrs.ConceptSource)

getConceptSourceByName

public ConceptSource getConceptSourceByName(java.lang.String conceptSourceName)
                                     throws APIException
Description copied from interface: ConceptService
Lookup a ConceptSource by its name property

Specified by:
getConceptSourceByName in interface ConceptService
Returns:
ConceptSource
Throws:
APIException
See Also:
ConceptService.getConceptSourceByName(java.lang.String)

hasAnyObservation

public boolean hasAnyObservation(Concept concept)
Description copied from interface: ConceptService
Checks if there are any observations (including voided observations) for a concept.

Specified by:
hasAnyObservation in interface ConceptService
Parameters:
concept - which used or not used by an observation
Returns:
boolean true if the concept is used by an observation
See Also:
ConceptService.hasAnyObservation(org.openmrs.Concept)

convertBooleanConceptToCoded

public void convertBooleanConceptToCoded(Concept conceptToChange)
                                  throws APIException
Description copied from interface: ConceptService
Changes the datatype of a concept from boolean to coded when it has observations it is associated to.

Specified by:
convertBooleanConceptToCoded in interface ConceptService
Parameters:
conceptToChange - the concept which to change
Throws:
APIException
See Also:
ConceptService.convertBooleanConceptToCoded(org.openmrs.Concept)

hasAnyObservation

public boolean hasAnyObservation(ConceptName conceptName)
                          throws APIException
Description copied from interface: ConceptService
Checks if there are any observations (including voided observations) using a conceptName.

Specified by:
hasAnyObservation in interface ConceptService
Parameters:
conceptName - which is used or not used by an observation
Returns:
boolean true if the conceptName is used by an observation otherwise false
Throws:
APIException
See Also:
ConceptService.hasAnyObservation(org.openmrs.ConceptName)

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change