public class PatientSetServiceImpl extends Object implements PatientSetService
PatientSetService.BooleanOperator, PatientSetService.GroupMethod, PatientSetService.Modifier, PatientSetService.PatientLocationMethod, PatientSetService.TimeModifier| Modifier and Type | Field and Description |
|---|---|
org.apache.commons.logging.Log |
log |
| Constructor and Description |
|---|
PatientSetServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
Cohort |
convertPatientIdentifier(List<String> identifiers)
TODO write something here
|
String |
exportXml(Cohort ps)
Export a set of patients to an XML
|
String |
exportXml(Integer patientId) |
Cohort |
getAllPatients() |
Map<Integer,Map<String,Object>> |
getCharacteristics(Cohort patients)
TODO write something here
|
Integer |
getCountOfPatients() |
Map<Integer,List<DrugOrder>> |
getCurrentDrugOrders(Cohort ps,
Concept drugSet) |
Map<Integer,PatientProgram> |
getCurrentPatientPrograms(Cohort ps,
Program program) |
Map<Integer,PatientState> |
getCurrentStates(Cohort ps,
ProgramWorkflow wf)
Gets statistical information about current states of patients within given cohort for specific program workflow
|
Map<Integer,List<DrugOrder>> |
getDrugOrders(Cohort ps,
Concept drugSet) |
Map<Integer,Object> |
getEncounterAttrsByType(Cohort patients,
List<EncounterType> encTypes,
String attr)
TODO write something here
|
Map<Integer,Encounter> |
getEncounters(Cohort patients)
This method returns a map of patients matched against their most recent encounters given a
Cohort of patients, see
EncounterService.getAllEncounters(Cohort) which gets a map of
patient matched against lists of all their encounters. |
List<Encounter> |
getEncountersByForm(Cohort patients,
List<Form> forms)
Gets a list of encounters associated with the given form, filtered by the given patient set.
|
Map<Integer,Encounter> |
getEncountersByType(Cohort patients,
EncounterType encType)
TODO write something here
|
Map<Integer,Encounter> |
getEncountersByType(Cohort patients,
List<EncounterType> types)
TODO write something here
|
Map<Integer,Object> |
getFirstEncounterAttrsByType(Cohort patients,
List<EncounterType> encTypes,
String attr)
TODO write something here
|
Map<Integer,Encounter> |
getFirstEncountersByType(Cohort patients,
EncounterType encType)
TODO write something here
|
Map<Integer,Encounter> |
getFirstEncountersByType(Cohort patients,
List<EncounterType> types)
TODO write something here
|
Cohort |
getInverseOfCohort(Cohort cohort)
Equivalent to Cohort.subtract(PatientSetService.getAllPatients(), cohort) but may eventually
perform faster by delegating to the database.
|
Map<Integer,List<Obs>> |
getObservations(Cohort patients,
Concept concept) |
Map<Integer,List<Obs>> |
getObservations(Cohort patients,
Concept concept,
Date fromDate,
Date toDate)
Date range is inclusive of both endpoints
|
Map<Integer,List<List<Object>>> |
getObservationsValues(Cohort patients,
Concept c)
TODO write something here
|
Map<Integer,List<List<Object>>> |
getObservationsValues(Cohort patients,
Concept c,
List<String> attributes)
Deprecated.
|
Map<Integer,List<List<Object>>> |
getObservationsValues(Cohort patients,
Concept c,
List<String> attributes,
Integer limit,
boolean showMostRecentFirst)
Returns a mapping from patient id to obs for concept
c |
Map<Integer,Object> |
getPatientAttributes(Cohort patients,
String classNameDotProperty,
boolean returnAll)
TODO write something here
|
Map<Integer,Object> |
getPatientAttributes(Cohort patients,
String className,
String property,
boolean returnAll)
TODO write something here
|
Map<Integer,PatientIdentifier> |
getPatientIdentifiersByType(Cohort patients,
PatientIdentifierType type)
The PatientIdentifer object in the returned map now ONLY contains the identifier string, no
other data is available
|
Map<Integer,String> |
getPatientIdentifierStringsByType(Cohort patients,
PatientIdentifierType type)
Gets a map of patient identifiers values by identifier type, indexed by patient primary key.
|
Map<Integer,PatientProgram> |
getPatientPrograms(Cohort ps,
Program program)
Gets program enrollment data for the given cohort in the given program.
|
List<Patient> |
getPatients(Collection<Integer> patientIds)
TODO write something here
|
Cohort |
getPatients(Integer start,
Integer size)
Get a batch of patients that are not voided in the database
|
Cohort |
getPatientsByCharacteristics(String gender,
Date minBirthdate,
Date maxBirthdate) |
Cohort |
getPatientsByCharacteristics(String gender,
Date minBirthdate,
Date maxBirthdate,
Integer minAge,
Integer maxAge,
Boolean aliveOnly,
Boolean deadOnly)
Get patients by specified gender, birthdate range, age range, and alive status (all optional)
|
Cohort |
getPatientsByCharacteristics(String gender,
Date minBirthdate,
Date maxBirthdate,
Integer minAge,
Integer maxAge,
Boolean aliveOnly,
Boolean deadOnly,
Date effectiveDate)
Get patients by specified gender, birthdate range, age range, and alive status (all optional)
|
Cohort |
getPatientsByProgramAndState(Program program,
List<ProgramWorkflowState> stateList,
Date fromDate,
Date toDate)
Gets patients who are enrolled in the given program or in the given state(s) at the specified
time
|
Cohort |
getPatientsHavingDateObs(Integer conceptId,
Date startTime,
Date endTime) |
Cohort |
getPatientsHavingDrugOrder(Collection<Integer> patientIds,
Collection<Integer> takingIds,
Date onDate)
Returns a PatientSet of patient who had drug orders for a set of drugs active on a certain
date.
|
Cohort |
getPatientsHavingDrugOrder(Collection<Integer> patientIds,
Collection<Integer> drugIds,
PatientSetService.GroupMethod groupMethod,
Date fromDate,
Date toDate)
Returns a Cohort of patient who had drug orders for a set of drugs active between a pair of
dates.
|
Cohort |
getPatientsHavingDrugOrder(List<Drug> drug,
List<Concept> drugConcept,
Date startDateFrom,
Date startDateTo,
Date stopDateFrom,
Date stopDateTo,
Boolean discontinued,
List<Concept> discontinuedReason) |
Cohort |
getPatientsHavingEncounters(EncounterType encounterType,
Location location,
Form form,
Date fromDate,
Date toDate,
Integer minCount,
Integer maxCount)
Searches for patients who have encounters as described by the arguments to this method
|
Cohort |
getPatientsHavingEncounters(List<EncounterType> encounterTypeList,
Location location,
Form form,
Date fromDate,
Date toDate,
Integer minCount,
Integer maxCount)
Gets patients who have encounters as described by the parameters specified (all optional)
|
Cohort |
getPatientsHavingLocation(Integer locationId) |
Cohort |
getPatientsHavingLocation(Integer locationId,
PatientSetService.PatientLocationMethod method) |
Cohort |
getPatientsHavingLocation(Location loc) |
Cohort |
getPatientsHavingLocation(Location loc,
PatientSetService.PatientLocationMethod method) |
Cohort |
getPatientsHavingNumericObs(Integer conceptId,
PatientSetService.TimeModifier timeModifier,
PatientSetService.Modifier modifier,
Number value,
Date fromDate,
Date toDate) |
Cohort |
getPatientsHavingObs(Integer conceptId,
PatientSetService.TimeModifier timeModifier,
PatientSetService.Modifier modifier,
Object value,
Date fromDate,
Date toDate)
Searches for patients who have observations as described by the arguments to this method
|
Cohort |
getPatientsHavingPersonAttribute(PersonAttributeType attribute,
String value)
At least one of attribute and value must be non-null
|
Cohort |
getPatientsHavingTextObs(Concept concept,
String value,
PatientSetService.TimeModifier timeModifier) |
Cohort |
getPatientsHavingTextObs(Integer conceptId,
String value,
PatientSetService.TimeModifier timeModifier) |
Cohort |
getPatientsInProgram(Program program,
Date fromDate,
Date toDate) |
Map<Integer,Object> |
getPersonAttributes(Cohort patients,
String attributeName,
String joinClass,
String joinProperty,
String outputColumn,
boolean returnAll) |
Map<Integer,List<Relationship>> |
getRelationships(Cohort ps,
RelationshipType relType) |
Map<Integer,List<Person>> |
getRelatives(Cohort ps,
RelationshipType relType,
boolean forwards) |
Map<Integer,String> |
getShortPatientDescriptions(Collection<Integer> patientIds) |
void |
onShutdown()
Clean up after this class.
|
void |
setPatientSetDAO(PatientSetDAO dao) |
public void setPatientSetDAO(PatientSetDAO dao)
setPatientSetDAO in interface PatientSetServicepublic void onShutdown()
BaseOpenmrsService.onShutdown()public String exportXml(Cohort ps)
PatientSetServiceexportXml in interface PatientSetServiceps - The set you want to export as XMLpublic String exportXml(Integer patientId)
exportXml in interface PatientSetServicepublic Cohort getAllPatients() throws DAOException
getAllPatients in interface PatientSetServiceDAOExceptionpublic Cohort getInverseOfCohort(Cohort cohort)
PatientSetServicegetInverseOfCohort in interface PatientSetServicepublic Cohort getPatientsByCharacteristics(String gender, Date minBirthdate, Date maxBirthdate) throws DAOException
getPatientsByCharacteristics in interface PatientSetServiceDAOExceptionpublic Cohort getPatientsByCharacteristics(String gender, Date minBirthdate, Date maxBirthdate, Integer minAge, Integer maxAge, Boolean aliveOnly, Boolean deadOnly) throws DAOException
PatientSetServicegetPatientsByCharacteristics in interface PatientSetServiceDAOExceptionpublic Cohort getPatientsByCharacteristics(String gender, Date minBirthdate, Date maxBirthdate, Integer minAge, Integer maxAge, Boolean aliveOnly, Boolean deadOnly, Date effectiveDate) throws DAOException
PatientSetServicegetPatientsByCharacteristics in interface PatientSetServiceDAOExceptionpublic Cohort getPatientsHavingDateObs(Integer conceptId, Date startTime, Date endTime)
getPatientsHavingDateObs in interface PatientSetServicepublic Cohort getPatientsHavingNumericObs(Integer conceptId, PatientSetService.TimeModifier timeModifier, PatientSetService.Modifier modifier, Number value, Date fromDate, Date toDate)
getPatientsHavingNumericObs in interface PatientSetServicepublic Cohort getPatientsHavingObs(Integer conceptId, PatientSetService.TimeModifier timeModifier, PatientSetService.Modifier modifier, Object value, Date fromDate, Date toDate)
PatientSetServicegetPatientsHavingObs in interface PatientSetServicepublic Cohort getPatientsHavingEncounters(EncounterType encounterType, Location location, Form form, Date fromDate, Date toDate, Integer minCount, Integer maxCount)
PatientSetServicegetPatientsHavingEncounters in interface PatientSetServicepublic Cohort getPatientsHavingEncounters(List<EncounterType> encounterTypeList, Location location, Form form, Date fromDate, Date toDate, Integer minCount, Integer maxCount)
PatientSetServicegetPatientsHavingEncounters in interface PatientSetServicepublic Cohort getPatientsByProgramAndState(Program program, List<ProgramWorkflowState> stateList, Date fromDate, Date toDate)
PatientSetServicegetPatientsByProgramAndState in interface PatientSetServicepublic Cohort getPatientsInProgram(Program program, Date fromDate, Date toDate)
getPatientsInProgram in interface PatientSetServicepublic Cohort getPatientsHavingTextObs(Concept concept, String value, PatientSetService.TimeModifier timeModifier)
getPatientsHavingTextObs in interface PatientSetServicepublic Cohort getPatientsHavingTextObs(Integer conceptId, String value, PatientSetService.TimeModifier timeModifier)
getPatientsHavingTextObs in interface PatientSetServicepublic Cohort getPatientsHavingLocation(Location loc)
getPatientsHavingLocation in interface PatientSetServicepublic Cohort getPatientsHavingLocation(Location loc, PatientSetService.PatientLocationMethod method)
getPatientsHavingLocation in interface PatientSetServicepublic Cohort getPatientsHavingLocation(Integer locationId)
getPatientsHavingLocation in interface PatientSetServicepublic Cohort getPatientsHavingLocation(Integer locationId, PatientSetService.PatientLocationMethod method)
getPatientsHavingLocation in interface PatientSetServicepublic Cohort getPatientsHavingDrugOrder(Collection<Integer> patientIds, Collection<Integer> takingIds, Date onDate)
getPatientsHavingDrugOrder in interface PatientSetServicepatientIds - Collection of patientIds you're interested in. NULL means all patients.takingIds - Collection of drugIds the patient is taking. (Or the empty set to mean
"any drug" or NULL to mean "no drugs")onDate - Which date to look at the patients' drug orders. (NULL defaults to now().)public Cohort getPatientsHavingDrugOrder(Collection<Integer> patientIds, Collection<Integer> drugIds, PatientSetService.GroupMethod groupMethod, Date fromDate, Date toDate)
PatientSetServicegetPatientsHavingDrugOrder in interface PatientSetServicepatientIds - Collection of patientIds you're interested in. NULL means all patients.drugIds - Collection of drugIds the patient is taking. (Or the empty set to mean
"any drug" or NULL to mean "no drugs")groupMethod - whether to do NONE, ALL, or ANY of the list of specified ids.fromDate - Beginning of date range to look at (NULL defaults to toDate if that isn't
null, or now() if it is.)toDate - End of date range to look at (NULL defaults to fromDate if that isn't null, or
now() if it is.)public Cohort getPatientsHavingDrugOrder(List<Drug> drug, List<Concept> drugConcept, Date startDateFrom, Date startDateTo, Date stopDateFrom, Date stopDateTo, Boolean discontinued, List<Concept> discontinuedReason)
getPatientsHavingDrugOrder in interface PatientSetServicepublic Cohort getPatientsHavingPersonAttribute(PersonAttributeType attribute, String value)
PatientSetServicegetPatientsHavingPersonAttribute in interface PatientSetServiceattribute - if not null, look for this attributevalue - if not null, look for this valuepublic Map<Integer,String> getShortPatientDescriptions(Collection<Integer> patientIds)
getShortPatientDescriptions in interface PatientSetServicepublic Map<Integer,List<Obs>> getObservations(Cohort patients, Concept concept)
getObservations in interface PatientSetServicepublic Map<Integer,List<Obs>> getObservations(Cohort patients, Concept concept, Date fromDate, Date toDate)
getObservations in interface PatientSetServicepublic Map<Integer,List<List<Object>>> getObservationsValues(Cohort patients, Concept c)
PatientSetServicegetObservationsValues in interface PatientSetService@Deprecated public Map<Integer,List<List<Object>>> getObservationsValues(Cohort patients, Concept c, List<String> attributes)
getObservationsValues in interface PatientSetServicepublic Map<Integer,List<List<Object>>> getObservationsValues(Cohort patients, Concept c, List<String> attributes, Integer limit, boolean showMostRecentFirst)
PatientSetServicec
The returned List< attribute value > is [obs value, attr value, attr value, attr value...]
The returned List> represents the obs rows
getObservationsValues in interface PatientSetServicepatients - the cohort to restrict to. if null, then all patients are fetchedc - the concept to look for in obs.concept_idattributes - list of attributeslimit - the number of patients to limit the results to. If null or less than zero, return allshowMostRecentFirst - if true, obs with the highest obsDatetime will be first in the ListMap>> public Map<Integer,Encounter> getEncountersByType(Cohort patients, EncounterType encType)
PatientSetServicegetEncountersByType in interface PatientSetServicepatients - Cohort of patients to searchencType - the type of the encounterpublic Map<Integer,Object> getEncounterAttrsByType(Cohort patients, List<EncounterType> encTypes, String attr)
PatientSetServicegetEncounterAttrsByType in interface PatientSetServicepatients - Cohort of patients to searchencTypes - Listattr - String of attributes to getpublic Map<Integer,Encounter> getEncountersByType(Cohort patients, List<EncounterType> types)
PatientSetServicegetEncountersByType in interface PatientSetServicepatients - Cohort of patients to searchtypes - Listpublic Map<Integer,Encounter> getEncounters(Cohort patients)
PatientSetServiceEncounterService.getAllEncounters(Cohort) which gets a map of
patient matched against lists of all their encounters.getEncounters in interface PatientSetServicepatients - Cohort of patients to searchEncounterService.getAllEncounters(Cohort)public Map<Integer,Encounter> getFirstEncountersByType(Cohort patients, EncounterType encType)
PatientSetServicegetFirstEncountersByType in interface PatientSetServicepatients - Cohort of patients to searchpublic Map<Integer,Object> getFirstEncounterAttrsByType(Cohort patients, List<EncounterType> encTypes, String attr)
PatientSetServicegetFirstEncounterAttrsByType in interface PatientSetServicepatients - Cohort of patients to searchencTypes - Listpublic Map<Integer,Encounter> getFirstEncountersByType(Cohort patients, List<EncounterType> types)
PatientSetServicegetFirstEncountersByType in interface PatientSetServicepatients - Cohort of patients to searchtypes - Listpublic Map<Integer,Object> getPatientAttributes(Cohort patients, String className, String property, boolean returnAll)
PatientSetServicegetPatientAttributes in interface PatientSetServicepatients - Cohort of patients to searchPatientSetService.getPatientAttributes(Cohort, String, String, boolean)public Map<Integer,Object> getPatientAttributes(Cohort patients, String classNameDotProperty, boolean returnAll)
PatientSetServicegetPatientAttributes in interface PatientSetServicepublic Map<Integer,PatientIdentifier> getPatientIdentifiersByType(Cohort patients, PatientIdentifierType type)
PatientSetServicegetPatientIdentifiersByType in interface PatientSetServicepublic Map<Integer,String> getPatientIdentifierStringsByType(Cohort patients, PatientIdentifierType type)
PatientSetServicegetPatientIdentifierStringsByType in interface PatientSetServicepatients - Cohort of patients to look uptype - PatientIdentifierType to retrievepublic Map<Integer,Object> getPersonAttributes(Cohort patients, String attributeName, String joinClass, String joinProperty, String outputColumn, boolean returnAll)
getPersonAttributes in interface PatientSetServicePatientSetService.getPersonAttributes(org.openmrs.Cohort,
java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean)public Map<Integer,Map<String,Object>> getCharacteristics(Cohort patients)
PatientSetServicegetCharacteristics in interface PatientSetServicepatients - Cohort of patients to look uppublic Cohort convertPatientIdentifier(List<String> identifiers)
PatientSetServiceconvertPatientIdentifier in interface PatientSetServiceidentifiers - List of String patient identifierspublic List<Patient> getPatients(Collection<Integer> patientIds)
PatientSetServicegetPatients in interface PatientSetServicepublic Map<Integer,List<Relationship>> getRelationships(Cohort ps, RelationshipType relType)
getRelationships in interface PatientSetServicepublic Map<Integer,List<Person>> getRelatives(Cohort ps, RelationshipType relType, boolean forwards)
getRelatives in interface PatientSetServicepublic Map<Integer,PatientState> getCurrentStates(Cohort ps, ProgramWorkflow wf)
PatientSetServicegetCurrentStates in interface PatientSetServiceps - the patient's cohort objectwf - the program workflow instancepublic Map<Integer,PatientProgram> getCurrentPatientPrograms(Cohort ps, Program program)
getCurrentPatientPrograms in interface PatientSetServicepublic Map<Integer,PatientProgram> getPatientPrograms(Cohort ps, Program program)
PatientSetServicegetPatientPrograms in interface PatientSetServiceps - the cohort to get data forprogram - the program to look for enrollments inpublic Map<Integer,List<DrugOrder>> getCurrentDrugOrders(Cohort ps, Concept drugSet)
getCurrentDrugOrders in interface PatientSetServicepublic Map<Integer,List<DrugOrder>> getDrugOrders(Cohort ps, Concept drugSet)
getDrugOrders in interface PatientSetServicepublic List<Encounter> getEncountersByForm(Cohort patients, List<Form> forms)
getEncountersByForm in interface PatientSetServicepatients - the patients to filter by (null will return all encounters for all patients)forms - the forms to filter bypublic Integer getCountOfPatients()
getCountOfPatients in interface PatientSetServicepublic Cohort getPatients(Integer start, Integer size)
PatientSetServicegetPatients in interface PatientSetServicestart - the starting indexsize - the number of patients to get in this batchCopyright © 2018 OpenMRS LLC.. All Rights Reserved.