public class DWRConceptService extends Object
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log |
Constructor and Description |
---|
DWRConceptService() |
Modifier and Type | Method and Description |
---|---|
String |
convertBooleanConceptToCoded(Integer conceptId)
Converts the datatype of a concept that already has Obs referencing it from boolean to coded
to support addition of more coded answers
|
List<String> |
createConceptReferenceTerm(String code,
Integer conceptSourceId,
String name)
Process calls to create new reference terms
|
List<Object> |
findBatchOfConceptReferenceTerms(String phrase,
Integer sourceId,
Integer start,
Integer length,
boolean includeRetired)
Gets a list of conceptListItems matching the given arguments
|
List<Object> |
findBatchOfConcepts(String phrase,
boolean includeRetired,
List<String> includeClassNames,
List<String> excludeClassNames,
List<String> includeDatatypeNames,
List<String> excludeDatatypeNames,
Integer start,
Integer length)
Gets a list of conceptListItems matching the given arguments
|
List<Object> |
findConceptAnswers(String text,
Integer conceptId,
boolean includeVoided,
boolean includeDrugConcepts)
Find a list of
ConceptListItem or ConceptDrugListItem s that are answers to
the given question. |
List<Object> |
findConcepts(String phrase,
boolean includeRetired,
List<String> includeClassNames,
List<String> excludeClassNames,
List<String> includeDatatypeNames,
List<String> excludeDatatypeNames,
boolean includeDrugConcepts)
Gets a list of conceptListItems matching the given arguments
|
Map<String,Object> |
findCountAndConceptReferenceTerms(String phrase,
Integer sourceId,
Integer start,
Integer length,
boolean includeRetired,
boolean getMatchCount) |
Map<String,Object> |
findCountAndConcepts(String phrase,
boolean includeRetired,
List<String> includeClassNames,
List<String> excludeClassNames,
List<String> includeDatatypeNames,
List<String> excludeDatatypeNames,
Integer start,
Integer length,
boolean getMatchCount)
Returns a map of results with the values as count of matches and a partial list of the
matching concepts (depending on values of start and length parameters) while the keys are are
'count' and 'objectList' respectively, if the length parameter is not specified, then all
matches will be returned from the start index if specified.
|
List<Object> |
findDrugs(String phrase,
boolean includeRetired) |
List<ConceptListItem> |
findProposedConcepts(String text) |
List<ConceptListItem> |
getAnswersForQuestion(Integer conceptId) |
ConceptListItem |
getConcept(Integer conceptId)
Get a
ConceptListItem by its internal database id. |
String |
getConceptNumericUnits(Integer conceptId) |
ConceptReferenceTermListItem |
getConceptReferenceTerm(Integer conceptReferenceTermId)
Get a
ConceptReferenceTerm by its internal database id. |
List<Object> |
getConceptSet(Integer conceptId) |
ConceptDrugListItem |
getDrug(Integer drugId) |
List<Object> |
getDrugs(Integer conceptId,
boolean showConcept) |
List<ConceptListItem> |
getQuestionsForAnswer(Integer conceptId) |
boolean |
isValidNumericValue(Float value,
Integer conceptId) |
public List<Object> findConcepts(String phrase, boolean includeRetired, List<String> includeClassNames, List<String> excludeClassNames, List<String> includeDatatypeNames, List<String> excludeDatatypeNames, boolean includeDrugConcepts)
phrase
- the concept name string to match againstincludeRetired
- boolean if false, will exclude retired conceptsincludeClassNames
- List of ConceptClasses to restrict toexcludeClassNames
- List of ConceptClasses to leave out of resultsincludeDatatypeNames
- List of ConceptDatatypes to restrict toexcludeDatatypeNames
- List of ConceptDatatypes to leave out of resultsincludeDrugConcepts
- Specifies if drugs with matching conceptNames should be includedpublic List<Object> findBatchOfConcepts(String phrase, boolean includeRetired, List<String> includeClassNames, List<String> excludeClassNames, List<String> includeDatatypeNames, List<String> excludeDatatypeNames, Integer start, Integer length)
phrase
- the concept name string to match againstincludeRetired
- boolean if false, will exclude retired conceptsincludeClassNames
- List of ConceptClasses to restrict toexcludeClassNames
- List of ConceptClasses to leave out of resultsincludeDatatypeNames
- List of ConceptDatatypes to restrict toexcludeDatatypeNames
- List of ConceptDatatypes to leave out of resultsstart
- the beginning indexlength
- the number of matching concepts to returnpublic ConceptListItem getConcept(Integer conceptId)
ConceptListItem
by its internal database id.conceptId
- the id to look forConceptListItem
or null if conceptId is not foundpublic List<ConceptListItem> findProposedConcepts(String text)
public List<Object> findConceptAnswers(String text, Integer conceptId, boolean includeVoided, boolean includeDrugConcepts) throws Exception
ConceptListItem
or ConceptDrugListItem
s that are answers to
the given question. The given question is determined by the given conceptId
text
- the text to search for within the answersconceptId
- the conceptId of the question conceptincludeVoided
- (this argument is ignored now. searching for voided answers is not
logical)includeDrugConcepts
- if true, drug concepts are searched tooConceptListItem
or ConceptDrugListItem
answers that match the
queryException
- if given conceptId is not foundpublic List<ConceptListItem> getQuestionsForAnswer(Integer conceptId)
public ConceptDrugListItem getDrug(Integer drugId)
public List<Object> findDrugs(String phrase, boolean includeRetired) throws APIException
APIException
public List<ConceptListItem> getAnswersForQuestion(Integer conceptId)
public String convertBooleanConceptToCoded(Integer conceptId)
conceptId
- the conceptId of the concept to be convertedpublic Map<String,Object> findCountAndConcepts(String phrase, boolean includeRetired, List<String> includeClassNames, List<String> excludeClassNames, List<String> includeDatatypeNames, List<String> excludeDatatypeNames, Integer start, Integer length, boolean getMatchCount) throws APIException
phrase
- concept name or conceptIdincludeRetired
- boolean if false, will exclude retired conceptsincludeClassNames
- List of ConceptClasses to restrict toexcludeClassNames
- List of ConceptClasses to leave out of resultsincludeDatatypeNames
- List of ConceptDatatypes to restrict toexcludeDatatypeNames
- List of ConceptDatatypes to leave out of resultsstart
- the beginning indexlength
- the number of matching concepts to returngetMatchCount
- Specifies if the count of matches should be included in the returned mapAPIException
public ConceptReferenceTermListItem getConceptReferenceTerm(Integer conceptReferenceTermId)
ConceptReferenceTerm
by its internal database id.conceptReferenceTermId
- the id to look forConceptReferenceTermListItem
or null if conceptReferenceTermId is not foundpublic List<Object> findBatchOfConceptReferenceTerms(String phrase, Integer sourceId, Integer start, Integer length, boolean includeRetired)
phrase
- the string to search againstsourceId
- the id of concept source where to look up reference termsstart
- the beginning indexlength
- the number of matching concept reference terms to returnincludeRetired
- Specifies if retired concept reference terms should be included or notList
of ConceptReferenceTermListItem
public Map<String,Object> findCountAndConceptReferenceTerms(String phrase, Integer sourceId, Integer start, Integer length, boolean includeRetired, boolean getMatchCount) throws APIException
phrase
- query the string to match against the reference term namessourceId
- the id for the concept source from which the terms should be looked upincludeRetired
- specifies if the retired terms should be includedstart
- beginning index for the batchlength
- number of terms to return in the batchgetMatchCount
- Specifies if the count of matches should be included in the returned mapAPIException
public List<String> createConceptReferenceTerm(String code, Integer conceptSourceId, String name)
code
- the unique code for the reference termconceptSourceId
- the concept source for the termname
- the unique name for the reference termCopyright © 2015 OpenMRS Inc.. All rights reserved.