|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openmrs.api.impl.BaseOpenmrsService
org.openmrs.api.impl.ConceptServiceImpl
public class ConceptServiceImpl
Default Implementation of ConceptService service layer classes
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 |
|---|
public ConceptServiceImpl()
| Method Detail |
|---|
public void setConceptDAO(ConceptDAO dao)
ConceptService
setConceptDAO in interface ConceptServicedao - The data access object to useConceptService.setConceptDAO(org.openmrs.api.db.ConceptDAO)public void createConcept(Concept concept)
saveConcept(Concept)
createConcept in interface ConceptServicepublic void createConcept(ConceptNumeric concept)
saveConcept(Concept)
createConcept in interface ConceptServicepublic void updateConcept(Concept concept)
saveConcept(Concept)
updateConcept in interface ConceptServicepublic void updateConcept(ConceptNumeric concept)
saveConcept(Concept)
updateConcept in interface ConceptServicepublic void createDrug(Drug drug)
createDrug in interface ConceptServicepublic void updateDrug(Drug drug)
updateDrug in interface ConceptServicepublic void deleteConcept(Concept concept)
deleteConcept in interface ConceptService
public void voidConcept(Concept concept,
java.lang.String reason)
retireConcept(Concept, String)etireConcept
voidConcept in interface ConceptService
public Concept saveConcept(Concept concept)
throws APIException
ConceptServiceConcept or ConceptNumeric in the database
saveConcept in interface ConceptServiceConcept or ConceptNumeric that was saved or updated
APIExceptionConceptService.saveConcept(org.openmrs.Concept)
public Drug saveDrug(Drug drug)
throws APIException
ConceptServiceDrug in the database
saveDrug in interface ConceptServiceAPIExceptionConceptService.saveDrug(org.openmrs.Drug)
public void purgeConcept(Concept concept)
throws APIException
ConceptServiceConcept or ConceptNumeric from the database.
This should not typically be used unless desperately needed. Most should just be retired.
See ConceptService.retireConcept(Concept, String)
purgeConcept in interface ConceptServiceAPIExceptionorg.openmrs.api.ConceptService#purgeConcept(java.lang.Object)
public Concept retireConcept(Concept concept,
java.lang.String reason)
throws APIException
ConceptService
retireConcept in interface ConceptServiceConcept or ConceptNumeric
APIExceptionConceptService.retireConcept(org.openmrs.Concept, java.lang.String)
public Drug retireDrug(Drug drug,
java.lang.String reason)
throws APIException
ConceptService
retireDrug in interface ConceptServiceAPIExceptionConceptService.retireDrug(org.openmrs.Drug, java.lang.String)
public void purgeDrug(Drug drug)
throws APIException
ConceptService
purgeDrug in interface ConceptServiceAPIExceptionConceptService.purgeDrug(org.openmrs.Drug)
public Concept getConcept(java.lang.Integer conceptId)
throws APIException
ConceptService
getConcept in interface ConceptServiceAPIExceptionConceptService.getConcept(java.lang.Integer)
public ConceptAnswer getConceptAnswer(java.lang.Integer conceptAnswerId)
throws APIException
ConceptService
getConceptAnswer in interface ConceptServiceAPIExceptionConceptService.getConceptAnswer(java.lang.Integer)
public Drug getDrug(java.lang.Integer drugId)
throws APIException
ConceptService
getDrug in interface ConceptServiceAPIExceptionConceptService.getDrug(java.lang.Integer)
public ConceptNumeric getConceptNumeric(java.lang.Integer conceptId)
throws APIException
ConceptService
getConceptNumeric in interface ConceptServiceAPIExceptionConceptService.getConceptNumeric(java.lang.Integer)
public java.util.List<Concept> getAllConcepts()
throws APIException
ConceptService
getAllConcepts in interface ConceptServiceAPIExceptionConceptService.getAllConcepts()
public java.util.List<Concept> getAllConcepts(java.lang.String sortBy,
boolean asc,
boolean includeRetired)
throws APIException
ConceptService
getAllConcepts in interface ConceptServicesortBy - The property name to sort by; if null or invalid, concept_id is used.
APIExceptionConceptService.getAllConcepts(java.lang.String, boolean, boolean)
public java.util.List<Concept> getConcepts(java.lang.String sortBy,
java.lang.String dir)
throws APIException
getAllConcepts(String, boolean, boolean)
getConcepts in interface ConceptServiceAPIException
public java.util.List<Concept> getConceptsByName(java.lang.String name)
throws APIException
ConceptService
getConceptsByName in interface ConceptServiceAPIExceptionConceptService.getConceptsByName(java.lang.String)public Concept getConceptByName(java.lang.String name)
ConceptService
getConceptByName in interface ConceptServiceConceptService.getConceptByName(java.lang.String)public Concept getConceptByIdOrName(java.lang.String idOrName)
#getConcept(String))
ConceptService
getConceptByIdOrName in interface ConceptServiceConceptService.getConceptByIdOrName(java.lang.String)public Concept getConcept(java.lang.String conceptIdOrName)
ConceptService
getConcept in interface ConceptServiceConceptService.getConcept(java.lang.String)
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)
ConceptService
getConceptWords in interface ConceptServiceanswerToConcept - all results will be a possible answer to this concept
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)
public java.util.List<ConceptWord> getConceptWords(java.lang.String phrase,
java.util.Locale locale)
throws APIException
ConceptService#getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)
getConceptWords in interface ConceptServicephrase - search string
APIExceptionConceptService.getConceptWords(java.lang.String, java.util.Locale)
public java.util.List<ConceptWord> findConcepts(java.lang.String phrase,
java.util.Locale locale,
boolean includeRetired,
int start,
int size)
#getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)
findConcepts in interface ConceptService
public java.util.List<ConceptWord> findConcepts(java.lang.String phrase,
java.util.Locale locale,
boolean includeRetired)
#getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)
findConcepts in interface ConceptService
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)
#getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)
findConcepts in interface ConceptService
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)
#getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)
ConceptService
findConcepts in interface ConceptServicelocales - ordered List of Locales within which to searchincludeRetired - booleanrequireClasses - ListexcludeClasses - ListrequireDatatypes - ListexcludeDatatypes - ListConceptService.findConcepts(String,Locale,boolean)public Drug getDrug(java.lang.String drugNameOrId)
ConceptService
getDrug in interface ConceptServicedrugNameOrId - name or drugId to match exactly on
ConceptService.getDrug(java.lang.String)public Drug getDrugByNameOrId(java.lang.String drugNameOrId)
getDrug(String)
ConceptService
getDrugByNameOrId in interface ConceptServiceConceptService.getDrugByNameOrId(java.lang.String)public java.util.List<Drug> getDrugs()
getAllDrugs()
getDrugs in interface ConceptServicepublic java.util.List<Drug> getAllDrugs()
ConceptService
getAllDrugs in interface ConceptServiceConceptService.getAllDrugs()public java.util.List<Drug> getAllDrugs(boolean includeRetired)
ConceptService
getAllDrugs in interface ConceptServiceincludeRetired - If true then the search will include voided Drugs
ConceptService.getAllDrugs(boolean)public java.util.List<Drug> getDrugs(Concept concept)
getDrugsByConcept(Concept)
getDrugs in interface ConceptServiceConceptService.getDrugs(org.openmrs.Concept)public java.util.List<Drug> getDrugsByConcept(Concept concept)
ConceptService
getDrugsByConcept in interface ConceptServiceConceptService.getDrugsByConcept(org.openmrs.Concept)
public java.util.List<Drug> getDrugs(Concept concept,
boolean includeRetired)
getDrugsByConcept(Concept)
org.openmrs.api.ConceptService#getDrugs(org.openmrs.Concept, boolean)public java.util.List<Drug> getDrugs(boolean includeVoided)
getAllDrugs(boolean)
org.openmrs.api.ConceptService#getDrugs(boolean)
public java.util.List<Drug> findDrugs(java.lang.String phrase,
boolean includeRetired)
getDrugs(String)
findDrugs in interface ConceptServiceConceptService.findDrugs(java.lang.String, boolean)public java.util.List<Drug> getDrugs(java.lang.String phrase)
ConceptService
getDrugs in interface ConceptServiceConceptService.getDrugs(java.lang.String)public java.util.List<Concept> getConceptsByClass(ConceptClass cc)
getConceptsByClass in interface ConceptServiceConceptService.getConceptsByClass(org.openmrs.ConceptClass)public java.util.List<ConceptClass> getConceptClasses()
ConceptService
getConceptClasses in interface ConceptServiceConceptService.getConceptClasses()public java.util.List<ConceptClass> getAllConceptClasses(boolean includeRetired)
ConceptService
getAllConceptClasses in interface ConceptServiceConceptService.getAllConceptClasses(boolean)public ConceptClass getConceptClass(java.lang.Integer i)
ConceptService
getConceptClass in interface ConceptServiceConceptService.getConceptClass(java.lang.Integer)public ConceptClass getConceptClassByName(java.lang.String name)
ConceptService
getConceptClassByName in interface ConceptServiceConceptService.getConceptClassByName(java.lang.String)
public java.util.List<ConceptClass> getAllConceptClasses()
throws APIException
ConceptService
getAllConceptClasses in interface ConceptServiceAPIExceptionConceptService.getAllConceptClasses(boolean)
public ConceptClass saveConceptClass(ConceptClass cc)
throws APIException
ConceptService
saveConceptClass in interface ConceptServiceAPIExceptionConceptService.saveConceptClass(org.openmrs.ConceptClass)public void purgeConceptClass(ConceptClass cc)
ConceptService
purgeConceptClass in interface ConceptServiceConceptService.purgeConceptClass(org.openmrs.ConceptClass)
public void purgeConceptDatatype(ConceptDatatype cd)
throws APIException
ConceptService
purgeConceptDatatype in interface ConceptServiceAPIExceptionConceptService.purgeConceptDatatype(org.openmrs.ConceptDatatype)
public ConceptDatatype saveConceptDatatype(ConceptDatatype cd)
throws APIException
ConceptService
saveConceptDatatype in interface ConceptServiceAPIException