org.openmrs.api
Interface ConceptService

All Superinterfaces:
OpenmrsService
All Known Implementing Classes:
ConceptServiceImpl

@Transactional
public interface ConceptService
extends OpenmrsService

Contains methods pertaining to creating/updating/deleting/retiring Concepts, Drugs, Concept Proposals, and all other things 'Concept'.

To get a list of concepts:

 List<Concept> concepts = Context.getConceptService().getAllConcepts();
 
To get a single concept:
   // if there is a concept row in the database with concept_id = 3845
   Concept concept = Context.getConceptService().getConcept(3845);
 
   String name = concept.getPreferredName(Context.getLocale()).getName();
 
To save a concept to the database
   Concept concept = new Concept();
   concept.setConceptClass(Context.getConceptService().getConceptClass(3));
   concept.setDatatype(Context.getConceptService().getConceptDatatype(17));
   concept.setName...
   ... // and other required values on the concept
   Context.getConceptService().saveConcept(concept);
 

See Also:
Context

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> searchLocales, boolean includeRetired, java.util.List<ConceptClass> requireClasses, java.util.List<ConceptClass> excludeClasses, java.util.List<ConceptDatatype> requireDatatypes, java.util.List<ConceptDatatype> excludeDatatypes)
          Searches on given phrase via the concept word table within a sorted list of Locales
 java.util.List<ConceptWord> findConcepts(java.lang.String phrase, java.util.Locale locale, boolean includeRetired)
          Deprecated. Use 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 includeVoided)
          Deprecated. Use getDrugs(String)
 java.util.List<ConceptProposal> findMatchingConceptProposals(java.lang.String text)
          Deprecated. use getConceptProposals(String)
 java.util.List<Concept> findProposedConcepts(java.lang.String text)
          Deprecated. Use getProposedConcepts(String)
 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 conceptClassId)
          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. use getAllConceptClasses(boolean)
 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(java.lang.String name)
          Deprecated. you *probably* want to use getConceptDatatypeByName(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 tag)
          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 text)
          Find matching concept proposals
 java.util.List<Concept> getConcepts(java.lang.String sortBy, java.lang.String dir)
          Deprecated. use getAllConcepts(String, boolean, boolean)
 java.util.List<Concept> getConceptsByAnswer(Concept concept)
          Returns all possible Concepts to which this concept is a value-coded answer.
 java.util.List<Concept> getConceptsByClass(ConceptClass cc)
           
 java.util.List<Concept> getConceptsByConceptSet(Concept concept)
          Return a List of all concepts within a concept set
 java.util.List<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 concept)
          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 concept)
          Deprecated. use getConceptsByConceptSet(Concept)
 ConceptSource getConceptSource(java.lang.Integer i)
          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 answersToConcept, java.lang.Integer start, java.lang.Integer size)
          Searches for concepts by the given parameters via the ConceptWord table
 java.util.List<ConceptWord> getConceptWords(java.lang.String phrase, java.util.Locale locale)
          Convenience method for getConceptWords(String, List, boolean, List, List, List, List, 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 drugId)
          Return the drug object corresponding to the given name or drugId
 Drug getDrugByUuid(java.lang.String uuid)
          Get Drug by its UUID
 java.util.List<Drug> getDrugs()
          Deprecated. use getAllDrugs()
 java.util.List<Drug> getDrugs(Concept concept)
          Deprecated. Use getDrugsByConcept(Concept)
 java.util.List<Drug> getDrugs(java.lang.String phrase)
          Find drugs in the system.
 java.util.List<Drug> getDrugsByConcept(Concept concept)
          Return a list of drugs associated with the given concept
 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 concept)
          Finds the next concept in the dictionary that has the next largest concept id
 Concept getPrevConcept(Concept concept)
          Finds the previous concept in the dictionary that has the next lowest concept id
 java.util.List<Concept> getProposedConcepts(java.lang.String text)
          Find matching 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. use saveConceptProposal(ConceptProposal)
 void purgeConcept(Concept conceptOrConceptNumeric)
          Completely purge a Concept or ConceptNumeric from the database.
 void purgeConceptClass(ConceptClass cc)
          Purge a ConceptClass
 void purgeConceptDatatype(ConceptDatatype cd)
          Purge a ConceptDatatype.
 void purgeConceptProposal(ConceptProposal cp)
          Removes a concept proposal from the database entirely.
 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 conceptOrConceptNumeric, 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)
 
Methods inherited from interface org.openmrs.api.OpenmrsService
onShutdown, onStartup
 

Method Detail

setConceptDAO

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

Parameters:
dao - The data access object to use

createConcept

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

Throws:
APIException

createConcept

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

Throws:
APIException

updateConcept

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

Throws:
APIException

getConceptByUuid

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
Concept getConceptByUuid(java.lang.String uuid)
Get Concept by its UUID

Parameters:
uuid -
Returns:
Expected behavior:
find object given valid uuid, return null if no object found with given uuid

updateConcept

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

Throws:
APIException

createDrug

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

Throws:
APIException

updateDrug

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

Throws:
APIException

deleteConcept

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

Throws:
APIException

voidConcept

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

Throws:
APIException

saveConcept

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

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

Parameters:
concept - The Concept or ConceptNumeric to save or update
Returns:
the Concept or ConceptNumeric that was saved or updated
Throws:
APIException
ConceptsLockedException
ConceptInUseException
Expected behavior:
put generated concept id onto returned concept, create new concept in database, update concept already existing in database, generate id for new concept if none is specified, keep id for new concept if one is specified, save non ConceptNumeric object as conceptNumeric, save a ConceptNumeric as a concept, save a new ConceptNumeric, void the conceptName if the text of the name has changed, create a new conceptName when the old name is changed, set a preferred name for each locale if none is marked, not fail when a duplicate name is edited to a unique value

saveDrug

@Authorized(value="Manage Concepts")
Drug saveDrug(Drug drug)
              throws APIException
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

Parameters:
drug - The Drug to save or update
Returns:
the Drug that was saved or updated
Throws:
APIException
Expected behavior:
put generated drug id onto returned drug, create new drug in database, update drug already existing in database

purgeConcept

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

Parameters:
conceptOrConceptNumeric - The Concept or ConceptNumeric to remove from the system
Throws:
APIException
Expected behavior:
fail if any of the conceptNames of the concept is being used by an obs

retireConcept

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

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

retireDrug

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

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

unretireDrug

@Authorized(value="Manage Concepts")
Drug unretireDrug(Drug drug)
                  throws APIException
Marks a drug that is currently retired as not retired.

Parameters:
drug - that is current set as retired
Returns:
the given drug, marked as not retired now, and saved to the db
Throws:
APIException
Expected behavior:
mark drug as retired, not change attributes of drug that is already retired

purgeDrug

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

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

getConcept

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

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

getConceptName

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
ConceptName getConceptName(java.lang.Integer conceptNameId)
                           throws APIException
Gets the concept-name with the given id

Parameters:
conceptNameId -
Returns:
the matching Concept object
Throws:
APIException

getConceptAnswer

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

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

getDrug

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

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

getConceptNumeric

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

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

getConceptClass

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

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

getAllConcepts

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

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

getAllConcepts

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

Parameters:
sortBy - The property name to sort by; if null or invalid, concept_id is used.
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

getConcepts

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

Throws:
APIException

getConceptsByName

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<Concept> getConceptsByName(java.lang.String name)
                                          throws APIException
Returns a list of concepts matching any part of a concept name, this method is case insensitive to the concept name string

Parameters:
name - The search string
Returns:
a List object containing all of the matching concepts
Throws:
APIException
Expected behavior:
pass irrespective of the case of the passed parameter

getConceptByName

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

Parameters:
name - The search string
Returns:
the found Concept
Throws:
APIException
Expected behavior:
get concept by name, get concept by partial name, return null given null parameter, find concepts with names in more specific locales, find concepts with names in more generic locales, find concepts with names in same specific locale, return null given blank string

getConceptByIdOrName

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

Get Concepts by id or name

Note: this just calls other impl methods; no DAO of its own

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

getConcept

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

Parameters:
conceptIdOrName -
Returns:
the found Concept
Throws:
APIException
Expected behavior:
return null given null parameter

getConceptWords

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

Parameters:
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
answersToConcept - 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
Throws:
APIException
Expected behavior:
return the best matched name

getConceptWords

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

Parameters:
phrase - search string
locale -
Returns:
List object matching search phrase and locale
Throws:
APIException

findConcepts

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

Throws:
APIException

findConcepts

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

Throws:
APIException

getDrugByUuid

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
Drug getDrugByUuid(java.lang.String uuid)
Get Drug by its UUID

Parameters:
uuid -
Returns:
Expected behavior:
find object given valid uuid, return null if no object found with given uuid

findConcepts

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

Throws:
APIException

getDrug

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

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

getDrugByNameOrId

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

Parameters:
drugId - String
Returns:
matching Drug object
Throws:
APIException

getDrugs

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

Throws:
APIException

getAllDrugs

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

Returns:
a List object containing all drugs
Throws:
APIException

getDrugs

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

Throws:
APIException

getDrugsByConcept

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

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

getAllDrugs

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

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

findDrugs

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

Throws:
APIException

getDrugs

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

Parameters:
phrase - Search phrase
Returns:
A List object containing all Drug matches
Throws:
APIException

getConceptsByClass

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

getConceptClasses

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

Return a list of concept classes currently in the database

Returns:
List object with all ConceptClass objects
Throws:
APIException

getConceptClassByName

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

Parameters:
name -
Returns:
ConceptClass matching the given name
Throws:
APIException

getAllConceptClasses

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

Returns:
List object with all ConceptClass objects
Throws:
APIException

getAllConceptClasses

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

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

getConceptClassByUuid

@Transactional(readOnly=true)
@Authorized(value="View Concept Classes")
ConceptClass getConceptClassByUuid(java.lang.String uuid)
Get ConceptClass by its UUID

Parameters:
uuid -
Returns:
Expected behavior:
find object given valid uuid, return null if no object found with given uuid

getConceptAnswerByUuid

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
ConceptAnswer getConceptAnswerByUuid(java.lang.String uuid)
Get ConceptAnswer by its UUID

Parameters:
uuid -
Returns:
Expected behavior:
find object given valid uuid, return null if no object found with given uuid

getConceptNameByUuid

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
ConceptName getConceptNameByUuid(java.lang.String uuid)
Get ConceptName by its UUID

Parameters:
uuid -
Returns:
Expected behavior:
find object given valid uuid, return null if no object found with given uuid

getConceptSetByUuid

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
ConceptSet getConceptSetByUuid(java.lang.String uuid)
Get ConceptSet by its UUID

Parameters:
uuid -
Returns:
Expected behavior:
find object given valid uuid, return null if no object found with given uuid

getConceptSourceByUuid

@Transactional(readOnly=true)
@Authorized(value="View Concept Sources")
ConceptSource getConceptSourceByUuid(java.lang.String uuid)
Get ConceptSource by its UUID

Parameters:
uuid -
Returns:
Expected behavior:
find object given valid uuid, return null if no object found with given uuid

saveConceptClass

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

Parameters:
cc - ConceptClass to create or update
Throws:
APIException

purgeConceptClass

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

Parameters:
cc - ConceptClass to delete
Throws:
APIException

saveConceptDatatype

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

Parameters:
cd - ConceptDatatype to create or update
Throws:
APIException

purgeConceptDatatype

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

Parameters:
cd - ConceptDatatype to purge
Throws:
APIException

getAllConceptDatatypes

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

Returns:
List of ConceptDatatypes
Throws:
APIException

getAllConceptDatatypes

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

Parameters:
includeRetired - boolean - include the retired datatypes?
Returns:
List of ConceptDatatypes
Throws:
APIException

getConceptDatatypes

@Transactional(readOnly=true)
@Authorized(value="View Concept Datatypes")
@Deprecated
java.util.List<ConceptDatatype> getConceptDatatypes(java.lang.String name)
                                                    throws APIException
Deprecated. you *probably* want to use getConceptDatatypeByName(String)

Find concept datatypes that contain the given name string

Parameters:
name -
Returns:
List object of ConceptDatatypes matching the string
Throws:
APIException

getConceptDatatype

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

Parameters:
i - Integer for the requested ConceptDatatype
Returns:
ConceptDatatype matching the given identifier
Throws:
APIException

getConceptDatatypeByUuid

@Transactional(readOnly=true)
@Authorized(value="View Concept Datatypes")
ConceptDatatype getConceptDatatypeByUuid(java.lang.String uuid)
Get ConceptDatatype by its UUID

Parameters:
uuid -
Returns:
Expected behavior:
find object given valid uuid, return null if no object found with given uuid

getConceptDatatypeByName

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

Parameters:
name -
Returns:
ConceptDatatype matching the given name
Throws:
APIException
Expected behavior:
return an exact match on name, not return a fuzzy match on name

updateConceptSetDerived

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

Parameters:
concept -
Throws:
APIException

updateConceptSetDerived

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

Throws:
APIException

getConceptSets

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

Throws:
APIException

getConceptSetsByConcept

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<ConceptSet> getConceptSetsByConcept(Concept concept)
                                                   throws APIException
Return a list of the concept sets with concept_set matching concept

For example to find all concepts for ARVs, you would do getConceptSets(getConcept("ANTIRETROVIRAL MEDICATIONS")) and then take the conceptIds from the resulting list.

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

getConceptsInSet

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

Throws:
APIException

getConceptsByConceptSet

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

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

getSetsContainingConcept

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

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

getConceptProposals

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

Throws:
APIException

getAllConceptProposals

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

Parameters:
includeCompleted - boolean - include completed proposals as well?
Returns:
a List object of all found ConceptProposals
Throws:
APIException

getConceptNumericByUuid

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
ConceptNumeric getConceptNumericByUuid(java.lang.String uuid)
Get ConceptNumeric by its UUID

Parameters:
uuid -
Returns:
Expected behavior:
find object given valid uuid, return null if no object found with given uuid

getConceptProposal

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

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

getConceptProposals

@Transactional(readOnly=true)
@Authorized(value="View Concept Proposals")
java.util.List<ConceptProposal> getConceptProposals(java.lang.String text)
                                                    throws APIException
Find matching concept proposals

Parameters:
text -
Returns:
a List object containing matching concept proposals
Throws:
APIException

findProposedConcepts

@Deprecated
@Transactional(readOnly=true)
@Authorized(value="View Concept Proposals")
java.util.List<Concept> findProposedConcepts(java.lang.String text)
                                             throws APIException
Deprecated. Use getProposedConcepts(String)

Throws:
APIException

getProposedConcepts

@Transactional(readOnly=true)
@Authorized(value="View Concept Proposals")
java.util.List<Concept> getProposedConcepts(java.lang.String text)
                                            throws APIException
Find matching proposed concepts

Parameters:
text -
Returns:
a List object containing matching proposed concepts
Throws:
APIException

findConcepts

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<ConceptWord> findConcepts(java.lang.String phrase,
                                                                       java.util.List<java.util.Locale> searchLocales,
                                                                       boolean includeRetired,
                                                                       java.util.List<ConceptClass> requireClasses,
                                                                       java.util.List<ConceptClass> excludeClasses,
                                                                       java.util.List<ConceptDatatype> requireDatatypes,
                                                                       java.util.List<ConceptDatatype> excludeDatatypes)
Searches on given phrase via the concept word table within a sorted list of Locales

Parameters:
phrase - String search phrase
searchLocales - 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:
findConcepts(String,Locale,boolean)

proposeConcept

@Deprecated
@Authorized(value="Add Concept Proposals")
void proposeConcept(ConceptProposal conceptProposal)
                    throws APIException
Deprecated. use saveConceptProposal(ConceptProposal)

Throws:
APIException

saveConceptProposal

@Authorized(value={"Add Concept Proposals","Edit Concept Proposals"})
ConceptProposal saveConceptProposal(ConceptProposal conceptProposal)
                                    throws APIException
Saves/updates/proposes a concept proposal

Parameters:
conceptProposal - The ConceptProposal to save
Returns:
the saved/updated ConceptProposal object
Throws:
APIException

purgeConceptProposal

@Authorized(value="Purge Concept Proposals")
void purgeConceptProposal(ConceptProposal cp)
                          throws APIException
Removes a concept proposal from the database entirely.

Parameters:
cp -
Throws:
APIException

mapConceptProposalToConcept

@Authorized(value="Manage Concepts")
Concept mapConceptProposalToConcept(ConceptProposal cp,
                                                    Concept mappedConcept)
                                    throws APIException
Maps a concept proposal to a concept

Parameters:
cp -
mappedConcept -
Returns:
the mappedConcept
Throws:
APIException

rejectConceptProposal

@Deprecated
@Authorized(value="Edit Concept Proposals")
void rejectConceptProposal(ConceptProposal cp)
                           throws APIException
Deprecated. use ConceptProposal.rejectConceptProposal()

Throws:
APIException

findMatchingConceptProposals

@Deprecated
@Authorized(value="Add Concept Proposals")
java.util.List<ConceptProposal> findMatchingConceptProposals(java.lang.String text)
Deprecated. use getConceptProposals(String)


findConceptAnswers

@Deprecated
@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<ConceptWord> findConceptAnswers(java.lang.String phrase,
                                                                                        java.util.Locale locale,
                                                                                        Concept concept,
                                                                                        boolean includeRetired)
                                               throws APIException
Deprecated. use getConceptAnswers(String, Locale, Concept)

Throws:
APIException

getConceptAnswers

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<ConceptWord> getConceptAnswers(java.lang.String phrase,
                                                                            java.util.Locale locale,
                                                                            Concept concept)
                                              throws APIException
Finds concepts that are possible value coded answers to concept parameter

Parameters:
phrase -
locale -
concept - the answers to match on
Returns:
List object
Throws:
APIException

getQuestionsForAnswer

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

Throws:
APIException

getConceptsByAnswer

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<Concept> getConceptsByAnswer(Concept concept)
                                            throws APIException
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()

Parameters:
concept -
Returns:
A List containing all possible questions to which this concept is a valued_Coded answer
Throws:
APIException

getPrevConcept

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
Concept getPrevConcept(Concept concept)
                       throws APIException
Finds the previous concept in the dictionary that has the next lowest concept id

Parameters:
concept - the offset Concept
Returns:
the foundConcept
Throws:
APIException

getNextConcept

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
Concept getNextConcept(Concept concept)
                       throws APIException
Finds the next concept in the dictionary that has the next largest concept id

Parameters:
concept - the offset Concept
Returns:
the foundConcept
Throws:
APIException

checkIfLocked

@Transactional(readOnly=true)
void checkIfLocked()
                   throws ConceptsLockedException
Check if the concepts are locked and if so, throw exception during manipulation of concept

Throws:
ConceptsLockedException

getConceptProposalByUuid

@Transactional(readOnly=true)
@Authorized(value="View Concept Proposals")
ConceptProposal getConceptProposalByUuid(java.lang.String uuid)
Get ConceptProposal by its UUID

Parameters:
uuid -
Returns:
Expected behavior:
find object given valid uuid, return null if no object found with given uuid

getConceptsWithDrugsInFormulary

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<Concept> getConceptsWithDrugsInFormulary()
                                                        throws APIException
Convenience method for finding concepts associated with drugs in formulary.

Returns:
A List object of all concepts that occur as a Drug.concept.
Throws:
APIException

updateConceptWord

@Authorized(value="Manage Concepts")
void updateConceptWord(Concept concept)
                       throws APIException
Iterates over the words in names and synonyms (for each locale) and updates the concept_word table

Parameters:
concept -
Throws:
APIException

updateConceptWords

@Authorized(value="Manage Concepts")
void updateConceptWords()
                        throws APIException
Iterates over all concepts and calls upddateConceptWords(Concept concept)

Throws:
APIException

getConceptNameTagByUuid

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
ConceptNameTag getConceptNameTagByUuid(java.lang.String uuid)
Get ConceptNameTag by its UUID

Parameters:
uuid -
Returns:
the conceptNameTag with a matching uuid
See Also:
Concept.setPreferredName(ConceptName), Concept.setFullySpecifiedName(ConceptName), Concept.setShortName(ConceptName)
Expected behavior:
find object given valid uuid, return null if no object found with given uuid

updateConceptWords

@Authorized(value="Manage Concepts")
void updateConceptWords(java.lang.Integer conceptIdStart,
                                        java.lang.Integer conceptIdEnd)
                        throws APIException
Iterates over all concepts with conceptIds between conceptIdStart and conceptIdEnd (inclusive) and calls updateConceptWord(concept)

Parameters:
conceptIdStart - starts update with this concept_id
conceptIdEnd - ends update with this concept_id
Throws:
APIException

getConceptComplex

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
ConceptComplex getConceptComplex(java.lang.Integer conceptId)
Get a ComplexConcept with the given conceptId

Parameters:
conceptId - of the ComplexConcept
Returns:
a ConceptComplex object
Since:
1.5
Expected behavior:
return a concept complex object

getConceptNameTagByName

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
ConceptNameTag getConceptNameTagByName(java.lang.String tag)
Search for a ConceptNameTag by name

Parameters:
tag - String name of ConceptNameTag
Returns:
ConceptNameTag matching the given String tag
See Also:
Concept.getPreferredName(Locale), Concept.getFullySpecifiedName(Locale), Concept.getShortNameInLocale(Locale), Concept.getShortestName(Locale, Boolean)

getLocalesOfConceptNames

@Transactional(readOnly=true)
java.util.Set<java.util.Locale> getLocalesOfConceptNames()
Gets the set of unique Locales used by existing concept names.

Returns:
set of used Locales

getAllConceptSources

@Transactional(readOnly=true)
@Authorized(value="View Concept Sources")
java.util.List<ConceptSource> getAllConceptSources()
                                                   throws APIException
Return a list of concept sources currently in the database that are not voided

Returns:
List of Concept source objects
Throws:
APIException

getConceptSource

@Transactional(readOnly=true)
@Authorized(value="View Concept Sources")
ConceptSource getConceptSource(java.lang.Integer i)
                               throws APIException
Return a Concept source matching the given concept source id

Parameters:
i - Integer conceptSourceId
Returns:
ConceptSource
Throws:
APIException

saveConceptSource

@Authorized(value="Manage Concept Sources")
ConceptSource saveConceptSource(ConceptSource conceptSource)
                                throws APIException
Create a new ConceptSource

Parameters:
conceptSource - ConceptSource to create
Throws:
APIException
Expected behavior:
not set creator if one is supplied already, not set date created if one is supplied already, save a ConceptSource with a null hl7Code, not save a ConceptSource if voided is null

purgeConceptSource

@Authorized(value="Purge Concept Sources")
ConceptSource purgeConceptSource(ConceptSource cs)
                                 throws APIException
Delete ConceptSource

Parameters:
cs - ConceptSource object delete
Throws:
APIException

retireConceptSource

@Authorized(value="Purge Concept Sources")
ConceptSource retireConceptSource(ConceptSource cs,
                                                  java.lang.String reason)
                                  throws APIException
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.

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
Expected behavior:
retire concept source

saveConceptNameTag

@Authorized(value="Manage Concept Name tags")
ConceptNameTag saveConceptNameTag(ConceptNameTag nameTag)
Creates a new Concept name tag if none exists. If a tag exists with the same name then that existing tag is returned.

Parameters:
nameTag - the concept name tag to be saved
Returns:
the newly created or existing concept name tag
Expected behavior:
save a concept name tag if tag does not exist, not save a concept name tag if tag exists

getMaxConceptId

@Transactional(readOnly=true)
java.lang.Integer getMaxConceptId()
Gets the highest concept-id used by a concept.

Returns:
highest concept-id

conceptIterator

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.Iterator<Concept> conceptIterator()
Returns an iterator for all concepts, including retired and expired.

Returns:
the Iterator
Expected behavior:
start with the smallest concept id, iterate over all concepts

getConceptByMapping

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
Concept getConceptByMapping(java.lang.String conceptCode,
                                                          java.lang.String mappingCode)
                            throws APIException
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

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
Expected behavior:
get concept with given code and and source hl7 code, get concept with given code and source name, return null if code does not exist, return null if mapping does not exist

getAllConceptNameTags

@Transactional(readOnly=true)
java.util.List<ConceptNameTag> getAllConceptNameTags()
Get all the concept name tags defined in the database, included voided ones

Returns:
a list of the concept name tags stored in the
Since:
1.5

getConceptNameTag

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
ConceptNameTag getConceptNameTag(java.lang.Integer id)
Gets the ConceptNameTag with the given database primary key

Parameters:
id - the concept name tag id to find
Returns:
the matching ConceptNameTag or null if none found
Since:
1.5

getConceptDescriptionByUuid

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
ConceptDescription getConceptDescriptionByUuid(java.lang.String uuid)
Get ConceptDescription by its UUID

Parameters:
uuid -
Returns:
Expected behavior:
find object given valid uuid, return null if no object found with given uuid

getConceptSourceByName

@Transactional(readOnly=true)
@Authorized(value="View Concept Sources")
ConceptSource getConceptSourceByName(java.lang.String conceptSourceName)
                                     throws APIException
Lookup a ConceptSource by its name property

Parameters:
conceptSourceName -
Returns:
ConceptSource
Throws:
APIException
Expected behavior:
get ConceptSource with the given name, return null if no ConceptSource with that name is found

getConceptsByConceptSource

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
java.util.List<ConceptMap> getConceptsByConceptSource(ConceptSource conceptSource)
                                                      throws APIException
Looks up a list of ConceptMaps for a given ConceptSource

Parameters:
conceptSource -
Returns:
a List object
Throws:
APIException
Expected behavior:
return a List of ConceptMaps if concept mappings found, return empty List of ConceptMaps if none found

hasAnyObservation

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
boolean hasAnyObservation(Concept concept)
Checks if there are any observations (including voided observations) for a concept.

Parameters:
concept - which used or not used by an observation
Returns:
boolean true if the concept is used by an observation
Throws:
APIException

getTrueConcept

@Transactional(readOnly=true)
Concept getTrueConcept()
Returns the TRUE concept

Returns:
true concept
Expected behavior:
return the true concept

getFalseConcept

@Transactional(readOnly=true)
Concept getFalseConcept()
Returns the FALSE concept

Returns:
false concept
Expected behavior:
return the false concept

convertBooleanConceptToCoded

@Authorized(value="Manage Concepts")
void convertBooleanConceptToCoded(Concept conceptToChange)
                                  throws APIException
Changes the datatype of a concept from boolean to coded when it has observations it is associated to.

Parameters:
conceptToChange - the concept which to change
Throws:
APIException
Expected behavior:
convert the datatype of a boolean concept to coded, fail if the datatype of the concept is not boolean, explicitly add true concept as a value_Coded answer, explicitly add false concept as a value_Coded answer

hasAnyObservation

@Transactional(readOnly=true)
@Authorized(value="View Concepts")
boolean hasAnyObservation(ConceptName conceptName)
                          throws APIException
Checks if there are any observations (including voided observations) using a conceptName.

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
Since:
Version 1.7

OpenMRS-1.7.x

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