public interface PatientSetService extends OpenmrsService
Modifier and Type | Interface and Description |
---|---|
static class |
PatientSetService.BooleanOperator |
static class |
PatientSetService.GroupMethod |
static class |
PatientSetService.Modifier |
static class |
PatientSetService.PatientLocationMethod |
static class |
PatientSetService.TimeModifier |
Modifier and Type | Method and Description |
---|---|
Cohort |
convertPatientIdentifier(List<String> identifiers)
TODO write something here
|
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> form)
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> encType)
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,
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,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 Cohort 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 |
setPatientSetDAO(PatientSetDAO dao) |
onShutdown, onStartup
void setPatientSetDAO(PatientSetDAO dao)
Cohort getAllPatients() throws DAOException
DAOException
Cohort getPatientsByCharacteristics(String gender, Date minBirthdate, Date maxBirthdate) throws DAOException
DAOException
Cohort getPatientsByCharacteristics(String gender, Date minBirthdate, Date maxBirthdate, Integer minAge, Integer maxAge, Boolean aliveOnly, Boolean deadOnly) throws DAOException
gender
- minBirthdate
- maxBirthdate
- minAge
- maxAge
- aliveOnly
- deadOnly
- DAOException
Cohort getPatientsByCharacteristics(String gender, Date minBirthdate, Date maxBirthdate, Integer minAge, Integer maxAge, Boolean aliveOnly, Boolean deadOnly, Date effectiveDate) throws DAOException
gender
- minBirthdate
- maxBirthdate
- minAge
- maxAge
- aliveOnly
- deadOnly
- effectiveDate
- DAOException
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)
conceptId
- timeModifier
- modifier
- value
- fromDate
- toDate
- Cohort getPatientsHavingEncounters(EncounterType encounterType, Location location, Form form, Date fromDate, Date toDate, Integer minCount, Integer maxCount)
encounterType
- location
- form
- fromDate
- toDate
- minCount
- maxCount
- Cohort getPatientsHavingEncounters(List<EncounterType> encounterTypeList, Location location, Form form, Date fromDate, Date toDate, Integer minCount, Integer maxCount)
encounterTypeList
- location
- form
- fromDate
- toDate
- minCount
- maxCount
- Cohort getPatientsByProgramAndState(Program program, List<ProgramWorkflowState> stateList, Date fromDate, Date toDate)
program
- stateList
- fromDate
- toDate
- Cohort getPatientsHavingDateObs(Integer conceptId, Date startTime, Date endTime)
Cohort getPatientsHavingTextObs(Concept concept, String value, PatientSetService.TimeModifier timeModifier)
Cohort getPatientsHavingTextObs(Integer conceptId, String value, PatientSetService.TimeModifier timeModifier)
Cohort getPatientsHavingLocation(Location loc, PatientSetService.PatientLocationMethod method)
Cohort getPatientsHavingLocation(Integer locationId, PatientSetService.PatientLocationMethod method)
Cohort getPatientsHavingDrugOrder(Collection<Integer> patientIds, Collection<Integer> takingIds, Date onDate)
patientIds
- 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().)Cohort getPatientsHavingDrugOrder(Collection<Integer> patientIds, Collection<Integer> drugIds, PatientSetService.GroupMethod groupMethod, Date fromDate, Date toDate)
patientIds
- 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.)Cohort getPatientsHavingDrugOrder(List<Drug> drug, List<Concept> drugConcept, Date startDateFrom, Date startDateTo, Date stopDateFrom, Date stopDateTo, Boolean discontinued, List<Concept> discontinuedReason)
Cohort getPatientsHavingPersonAttribute(PersonAttributeType attribute, String value)
attribute
- if not null, look for this attributevalue
- if not null, look for this valueMap<Integer,String> getShortPatientDescriptions(Collection<Integer> patientIds)
Map<Integer,List<Obs>> getObservations(Cohort patients, Concept concept, Date fromDate, Date toDate)
Map<Integer,List<List<Object>>> getObservationsValues(Cohort patients, Concept c)
patients
- c
- Map<Integer,List<List<Object>>> getObservationsValues(Cohort patients, Concept c, List<String> attributes, Integer limit, boolean showMostRecentFirst)
c
The returned List< attribute value > is [obs value, attr value, attr value, attr value...] The returned List<List< attribute value >> represents the obs rows
patients
- 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
List<List<Object>>Map<patientId, List<List< attribute value >>>
Map<Integer,Encounter> getEncountersByType(Cohort patients, EncounterType encType)
patients
- Cohort of patients to searchencType
- the type of the encounterMap<Integer,Object> getEncounterAttrsByType(Cohort patients, List<EncounterType> encTypes, String attr)
patients
- Cohort of patients to searchencTypes
- List<EncounterType> to include in the searchattr
- String
of attributes to getMap<Integer,Encounter> getEncountersByType(Cohort patients, List<EncounterType> encType)
patients
- Cohort of patients to searchencType
- List<EncounterType> to include in the searchMap<Integer,Encounter> getEncounters(Cohort patients)
EncounterService.getAllEncounters(Cohort)
which gets a map of
patient matched against lists of all their encounters.patients
- Cohort of patients to searchEncounterService.getAllEncounters(Cohort)
Map<Integer,Encounter> getFirstEncountersByType(Cohort patients, EncounterType encType)
patients
- Cohort of patients to searchencType
- Map<Integer,Encounter> getFirstEncountersByType(Cohort patients, List<EncounterType> types)
patients
- Cohort of patients to searchtypes
- List<EncounterType> to include in the searchMap<Integer,Object> getFirstEncounterAttrsByType(Cohort patients, List<EncounterType> encTypes, String attr)
patients
- Cohort of patients to searchencTypes
- List<EncounterType> to include in the searchattr
- Map<Integer,Object> getPatientAttributes(Cohort patients, String className, String property, boolean returnAll)
patients
- Cohort of patients to searchclassName
- property
- returnAll
- Map<Integer,Object> getPatientAttributes(Cohort patients, String classNameDotProperty, boolean returnAll)
patients
- classNameDotProperty
- returnAll
- Map<Integer,Object> getPersonAttributes(Cohort patients, String attributeName, String joinClass, String joinProperty, String outputColumn, boolean returnAll)
patients
- attributeName
- joinClass
- joinProperty
- outputColumn
- returnAll
- Map<Integer,Map<String,Object>> getCharacteristics(Cohort patients)
patients
- Cohort of patients to look upMap<Integer,String> getPatientIdentifierStringsByType(Cohort patients, PatientIdentifierType type)
patients
- Cohort of patients to look uptype
- PatientIdentifierType to retrieveCohort convertPatientIdentifier(List<String> identifiers)
identifiers
- List of String patient identifiersList<Patient> getPatients(Collection<Integer> patientIds)
patientIds
- Map<Integer,PatientState> getCurrentStates(Cohort ps, ProgramWorkflow wf)
ps
- the patient's cohort objectwf
- the program workflow instanceMap<Integer,PatientProgram> getCurrentPatientPrograms(Cohort ps, Program program)
Map<Integer,PatientProgram> getPatientPrograms(Cohort ps, Program program)
ps
- the cohort to get data forprogram
- the program to look for enrollments inMap<Integer,List<Relationship>> getRelationships(Cohort ps, RelationshipType relType)
Map<Integer,List<Person>> getRelatives(Cohort ps, RelationshipType relType, boolean forwards)
Map<Integer,List<DrugOrder>> getCurrentDrugOrders(Cohort ps, Concept drugSet)
Map<Integer,List<DrugOrder>> getDrugOrders(Cohort ps, Concept drugSet)
List<Encounter> getEncountersByForm(Cohort patients, List<Form> form)
patients
- Cohort of the patients to filter by (null will return all encounters for all
patients)form
- List<Form> of the forms to filter byCohort getInverseOfCohort(Cohort cohort)
cohort
- Integer getCountOfPatients()
Copyright © 2016 OpenMRS Inc.. All rights reserved.