org.openmrs.api.impl
Class PatientSetServiceImpl

java.lang.Object
  extended by org.openmrs.api.impl.PatientSetServiceImpl
All Implemented Interfaces:
PatientSetService

public class PatientSetServiceImpl
extends java.lang.Object
implements PatientSetService


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.openmrs.api.PatientSetService
PatientSetService.BooleanOperator, PatientSetService.GroupMethod, PatientSetService.Modifier, PatientSetService.PatientLocationMethod, PatientSetService.TimeModifier
 
Field Summary
 org.apache.commons.logging.Log log
           
 
Constructor Summary
PatientSetServiceImpl()
           
 
Method Summary
 Cohort convertPatientIdentifier(java.util.List<java.lang.String> identifiers)
          TODO write something here
 java.lang.String exportXml(Cohort ps)
          Export a set of patients to an XML
 java.lang.String exportXml(java.lang.Integer patientId)
           
 Cohort getAllPatients()
           
 java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.lang.Object>> getCharacteristics(Cohort patients)
          TODO write something here
 java.util.Map<java.lang.Integer,java.util.List<DrugOrder>> getCurrentDrugOrders(Cohort ps, Concept drugSet)
           
 java.util.Map<java.lang.Integer,PatientProgram> getCurrentPatientPrograms(Cohort ps, Program program)
           
 java.util.Map<java.lang.Integer,PatientState> getCurrentStates(Cohort ps, ProgramWorkflow wf)
           
 java.util.Map<java.lang.Integer,java.util.List<DrugOrder>> getDrugOrders(Cohort ps, Concept drugSet)
           
 java.util.Map<java.lang.Integer,java.lang.Object> getEncounterAttrsByType(Cohort patients, java.util.List<EncounterType> encTypes, java.lang.String attr)
          TODO write something here
 java.util.Map<java.lang.Integer,Encounter> getEncounters(Cohort patients)
          TODO write something here
 java.util.List<Encounter> getEncountersByForm(Cohort patients, java.util.List<Form> forms)
          Gets a list of encounters associated with the given form, filtered by the given patient set.
 java.util.Map<java.lang.Integer,Encounter> getEncountersByType(Cohort patients, EncounterType encType)
          TODO write something here
 java.util.Map<java.lang.Integer,Encounter> getEncountersByType(Cohort patients, java.util.List<EncounterType> types)
          TODO write something here
 java.util.Map<java.lang.Integer,java.lang.Object> getFirstEncounterAttrsByType(Cohort patients, java.util.List<EncounterType> encTypes, java.lang.String attr)
          TODO write something here
 java.util.Map<java.lang.Integer,Encounter> getFirstEncountersByType(Cohort patients, EncounterType encType)
          TODO write something here
 java.util.Map<java.lang.Integer,Encounter> getFirstEncountersByType(Cohort patients, java.util.List<EncounterType> types)
          TODO write something here
 java.util.Map<java.lang.Integer,java.util.List<Obs>> getObservations(Cohort patients, Concept concept)
           
 java.util.Map<java.lang.Integer,java.util.List<Obs>> getObservations(Cohort patients, Concept concept, java.util.Date fromDate, java.util.Date toDate)
          Date range is inclusive of both endpoints
 java.util.Map<java.lang.Integer,java.util.List<java.util.List<java.lang.Object>>> getObservationsValues(Cohort patients, Concept c)
          TODO write something here
 java.util.Map<java.lang.Integer,java.util.List<java.util.List<java.lang.Object>>> getObservationsValues(Cohort patients, Concept c, java.util.List<java.lang.String> attributes)
          Returns a mapping from patient id to obs for concept c
 java.util.Map<java.lang.Integer,java.lang.Object> getPatientAttributes(Cohort patients, java.lang.String classNameDotProperty, boolean returnAll)
          TODO write something here
 java.util.Map<java.lang.Integer,java.lang.Object> getPatientAttributes(Cohort patients, java.lang.String className, java.lang.String property, boolean returnAll)
          TODO write something here
 java.util.Map<java.lang.Integer,PatientIdentifier> getPatientIdentifiersByType(Cohort patients, PatientIdentifierType type)
          Gets a map of patient identifiers by identifier type, indexed by patient primary key.
 java.util.Map<java.lang.Integer,PatientProgram> getPatientPrograms(Cohort ps, Program program)
           
 java.util.List<Patient> getPatients(java.util.Collection<java.lang.Integer> patientIds)
          TODO write something here
 Cohort getPatientsByCharacteristics(java.lang.String gender, java.util.Date minBirthdate, java.util.Date maxBirthdate)
           
 Cohort getPatientsByCharacteristics(java.lang.String gender, java.util.Date minBirthdate, java.util.Date maxBirthdate, java.lang.Integer minAge, java.lang.Integer maxAge, java.lang.Boolean aliveOnly, java.lang.Boolean deadOnly)
          Get patients by specified gender, birthdate range, age range, and alive status (all optional)
 Cohort getPatientsByCharacteristics(java.lang.String gender, java.util.Date minBirthdate, java.util.Date maxBirthdate, java.lang.Integer minAge, java.lang.Integer maxAge, java.lang.Boolean aliveOnly, java.lang.Boolean deadOnly, java.util.Date effectiveDate)
          Get patients by specified gender, birthdate range, age range, and alive status (all optional)
 Cohort getPatientsByProgramAndState(Program program, java.util.List<ProgramWorkflowState> stateList, java.util.Date fromDate, java.util.Date toDate)
          Gets patients who are enrolled in the given program or in the given state(s) at the specified time
 Cohort getPatientsHavingDateObs(java.lang.Integer conceptId, java.util.Date startTime, java.util.Date endTime)
           
 Cohort getPatientsHavingDrugOrder(java.util.Collection<java.lang.Integer> patientIds, java.util.Collection<java.lang.Integer> takingIds, java.util.Date onDate)
          Returns a PatientSet of patient who had drug orders for a set of drugs active on a certain date.
 Cohort getPatientsHavingDrugOrder(java.util.Collection<java.lang.Integer> patientIds, java.util.Collection<java.lang.Integer> drugIds, PatientSetService.GroupMethod groupMethod, java.util.Date fromDate, java.util.Date toDate)
          Returns a Cohort of patient who had drug orders for a set of drugs active between a pair of dates.
 Cohort getPatientsHavingDrugOrder(java.util.List<Drug> drug, java.util.List<Concept> drugConcept, java.util.Date startDateFrom, java.util.Date startDateTo, java.util.Date stopDateFrom, java.util.Date stopDateTo, java.lang.Boolean discontinued, java.util.List<Concept> discontinuedReason)
           
 Cohort getPatientsHavingEncounters(EncounterType encounterType, Location location, Form form, java.util.Date fromDate, java.util.Date toDate, java.lang.Integer minCount, java.lang.Integer maxCount)
          Searches for patients who have encounters as described by the arguments to this method
 Cohort getPatientsHavingEncounters(java.util.List<EncounterType> encounterTypeList, Location location, Form form, java.util.Date fromDate, java.util.Date toDate, java.lang.Integer minCount, java.lang.Integer maxCount)
          Gets patients who have encounters as described by the parameters specified (all optional)
 Cohort getPatientsHavingLocation(java.lang.Integer locationId)
           
 Cohort getPatientsHavingLocation(java.lang.Integer locationId, PatientSetService.PatientLocationMethod method)
           
 Cohort getPatientsHavingLocation(Location loc)
           
 Cohort getPatientsHavingLocation(Location loc, PatientSetService.PatientLocationMethod method)
           
 Cohort getPatientsHavingNumericObs(java.lang.Integer conceptId, PatientSetService.TimeModifier timeModifier, PatientSetService.Modifier modifier, java.lang.Number value, java.util.Date fromDate, java.util.Date toDate)
           
 Cohort getPatientsHavingObs(java.lang.Integer conceptId, PatientSetService.TimeModifier timeModifier, PatientSetService.Modifier modifier, java.lang.Object value, java.util.Date fromDate, java.util.Date toDate)
          Searches for patients who have observations as described by the arguments to this method
 Cohort getPatientsHavingPersonAttribute(PersonAttributeType attribute, java.lang.String value)
          At least one of attribute and value must be non-null
 Cohort getPatientsHavingTextObs(Concept concept, java.lang.String value, PatientSetService.TimeModifier timeModifier)
           
 Cohort getPatientsHavingTextObs(java.lang.Integer conceptId, java.lang.String value, PatientSetService.TimeModifier timeModifier)
           
 Cohort getPatientsInProgram(Program program, java.util.Date fromDate, java.util.Date toDate)
           
 java.util.Map<java.lang.Integer,java.lang.Object> getPersonAttributes(Cohort patients, java.lang.String attributeName, java.lang.String joinClass, java.lang.String joinProperty, java.lang.String outputColumn, boolean returnAll)
           
 java.util.Map<java.lang.Integer,java.util.List<Relationship>> getRelationships(Cohort ps, RelationshipType relType)
           
 java.util.Map<java.lang.Integer,java.util.List<Person>> getRelatives(Cohort ps, RelationshipType relType, boolean forwards)
           
 java.util.Map<java.lang.Integer,java.lang.String> getShortPatientDescriptions(java.util.Collection<java.lang.Integer> patientIds)
           
 void onShutdown()
          Clean up after this class.
 void setPatientSetDAO(PatientSetDAO dao)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public final org.apache.commons.logging.Log log
Constructor Detail

PatientSetServiceImpl

public PatientSetServiceImpl()
Method Detail

setPatientSetDAO

public void setPatientSetDAO(PatientSetDAO dao)
Specified by:
setPatientSetDAO in interface PatientSetService

onShutdown

public void onShutdown()
Clean up after this class. Set the static var to null so that the classloader can reclaim the space.

See Also:
BaseOpenmrsService.onShutdown()

exportXml

public java.lang.String exportXml(Cohort ps)
Description copied from interface: PatientSetService
Export a set of patients to an XML

Specified by:
exportXml in interface PatientSetService
Parameters:
ps - The set you want to export as XML
Returns:
an XML representation of this patient-set, including patient characteristics, and observations

exportXml

public java.lang.String exportXml(java.lang.Integer patientId)
Specified by:
exportXml in interface PatientSetService

getAllPatients

public Cohort getAllPatients()
                      throws DAOException
Specified by:
getAllPatients in interface PatientSetService
Throws:
DAOException

getPatientsByCharacteristics

public Cohort getPatientsByCharacteristics(java.lang.String gender,
                                           java.util.Date minBirthdate,
                                           java.util.Date maxBirthdate)
                                    throws DAOException
Specified by:
getPatientsByCharacteristics in interface PatientSetService
Throws:
DAOException

getPatientsByCharacteristics

public Cohort getPatientsByCharacteristics(java.lang.String gender,
                                           java.util.Date minBirthdate,
                                           java.util.Date maxBirthdate,
                                           java.lang.Integer minAge,
                                           java.lang.Integer maxAge,
                                           java.lang.Boolean aliveOnly,
                                           java.lang.Boolean deadOnly)
                                    throws DAOException
Description copied from interface: PatientSetService
Get patients by specified gender, birthdate range, age range, and alive status (all optional)

Specified by:
getPatientsByCharacteristics in interface PatientSetService
Returns:
Cohort with all matching patients
Throws:
DAOException

getPatientsByCharacteristics

public Cohort getPatientsByCharacteristics(java.lang.String gender,
                                           java.util.Date minBirthdate,
                                           java.util.Date maxBirthdate,
                                           java.lang.Integer minAge,
                                           java.lang.Integer maxAge,
                                           java.lang.Boolean aliveOnly,
                                           java.lang.Boolean deadOnly,
                                           java.util.Date effectiveDate)
                                    throws DAOException
Description copied from interface: PatientSetService
Get patients by specified gender, birthdate range, age range, and alive status (all optional)

Specified by:
getPatientsByCharacteristics in interface PatientSetService
Returns:
Cohort with all matching patients
Throws:
DAOException

getPatientsHavingDateObs

public Cohort getPatientsHavingDateObs(java.lang.Integer conceptId,
                                       java.util.Date startTime,
                                       java.util.Date endTime)
Specified by:
getPatientsHavingDateObs in interface PatientSetService

getPatientsHavingNumericObs

public Cohort getPatientsHavingNumericObs(java.lang.Integer conceptId,
                                          PatientSetService.TimeModifier timeModifier,
                                          PatientSetService.Modifier modifier,
                                          java.lang.Number value,
                                          java.util.Date fromDate,
                                          java.util.Date toDate)
Specified by:
getPatientsHavingNumericObs in interface PatientSetService

getPatientsHavingObs

public Cohort getPatientsHavingObs(java.lang.Integer conceptId,
                                   PatientSetService.TimeModifier timeModifier,
                                   PatientSetService.Modifier modifier,
                                   java.lang.Object value,
                                   java.util.Date fromDate,
                                   java.util.Date toDate)
Description copied from interface: PatientSetService
Searches for patients who have observations as described by the arguments to this method

Specified by:
getPatientsHavingObs in interface PatientSetService
Returns:
all patients with observations matching the arguments to this method

getPatientsHavingEncounters

public Cohort getPatientsHavingEncounters(EncounterType encounterType,
                                          Location location,
                                          Form form,
                                          java.util.Date fromDate,
                                          java.util.Date toDate,
                                          java.lang.Integer minCount,
                                          java.lang.Integer maxCount)
Description copied from interface: PatientSetService
Searches for patients who have encounters as described by the arguments to this method

Specified by:
getPatientsHavingEncounters in interface PatientSetService
Returns:
all patients with encounters matching the arguments to this method

getPatientsHavingEncounters

public Cohort getPatientsHavingEncounters(java.util.List<EncounterType> encounterTypeList,
                                          Location location,
                                          Form form,
                                          java.util.Date fromDate,
                                          java.util.Date toDate,
                                          java.lang.Integer minCount,
                                          java.lang.Integer maxCount)
Description copied from interface: PatientSetService
Gets patients who have encounters as described by the parameters specified (all optional)

Specified by:
getPatientsHavingEncounters in interface PatientSetService
Returns:
Cohort with matching Patients

getPatientsByProgramAndState

public Cohort getPatientsByProgramAndState(Program program,
                                           java.util.List<ProgramWorkflowState> stateList,
                                           java.util.Date fromDate,
                                           java.util.Date toDate)
Description copied from interface: PatientSetService
Gets patients who are enrolled in the given program or in the given state(s) at the specified time

Specified by:
getPatientsByProgramAndState in interface PatientSetService
Returns:
Cohort with matching Patients

getPatientsInProgram

public Cohort getPatientsInProgram(Program program,
                                   java.util.Date fromDate,
                                   java.util.Date toDate)
Specified by:
getPatientsInProgram in interface PatientSetService

getPatientsHavingTextObs

public Cohort getPatientsHavingTextObs(Concept concept,
                                       java.lang.String value,
                                       PatientSetService.TimeModifier timeModifier)
Specified by:
getPatientsHavingTextObs in interface PatientSetService

getPatientsHavingTextObs

public Cohort getPatientsHavingTextObs(java.lang.Integer conceptId,
                                       java.lang.String value,
                                       PatientSetService.TimeModifier timeModifier)
Specified by:
getPatientsHavingTextObs in interface PatientSetService

getPatientsHavingLocation

public Cohort getPatientsHavingLocation(Location loc)
Specified by:
getPatientsHavingLocation in interface PatientSetService

getPatientsHavingLocation

public Cohort getPatientsHavingLocation(Location loc,
                                        PatientSetService.PatientLocationMethod method)
Specified by:
getPatientsHavingLocation in interface PatientSetService

getPatientsHavingLocation

public Cohort getPatientsHavingLocation(java.lang.Integer locationId)
Specified by:
getPatientsHavingLocation in interface PatientSetService

getPatientsHavingLocation

public Cohort getPatientsHavingLocation(java.lang.Integer locationId,
                                        PatientSetService.PatientLocationMethod method)
Specified by:
getPatientsHavingLocation in interface PatientSetService

getPatientsHavingDrugOrder

public Cohort getPatientsHavingDrugOrder(java.util.Collection<java.lang.Integer> patientIds,
                                         java.util.Collection<java.lang.Integer> takingIds,
                                         java.util.Date onDate)
Returns a PatientSet of patient who had drug orders for a set of drugs active on a certain date. Can also be used to find patient with no drug orders on that date.

Specified by:
getPatientsHavingDrugOrder in interface PatientSetService
Parameters:
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().)
Returns:
Cohort of Patients matching criteria

getPatientsHavingDrugOrder

public Cohort getPatientsHavingDrugOrder(java.util.Collection<java.lang.Integer> patientIds,
                                         java.util.Collection<java.lang.Integer> drugIds,
                                         PatientSetService.GroupMethod groupMethod,
                                         java.util.Date fromDate,
                                         java.util.Date toDate)
Description copied from interface: PatientSetService
Returns a Cohort of patient who had drug orders for a set of drugs active between a pair of dates. Can also be used to find patient with no drug orders on that date.

Specified by:
getPatientsHavingDrugOrder in interface PatientSetService
Parameters:
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.)
Returns:
Cohort with matching Patients

getPatientsHavingDrugOrder

public Cohort getPatientsHavingDrugOrder(java.util.List<Drug> drug,
                                         java.util.List<Concept> drugConcept,
                                         java.util.Date startDateFrom,
                                         java.util.Date startDateTo,
                                         java.util.Date stopDateFrom,
                                         java.util.Date stopDateTo,
                                         java.lang.Boolean discontinued,
                                         java.util.List<Concept> discontinuedReason)
Specified by:
getPatientsHavingDrugOrder in interface PatientSetService
Returns:
A Cohort of patients who had drug order for particular drugs or generics, with start dates within a range, with end dates within a range, and a reason for discontinuation.

getPatientsHavingPersonAttribute

public Cohort getPatientsHavingPersonAttribute(PersonAttributeType attribute,
                                               java.lang.String value)
Description copied from interface: PatientSetService
At least one of attribute and value must be non-null

Specified by:
getPatientsHavingPersonAttribute in interface PatientSetService
Parameters:
attribute - if not null, look for this attribute
value - if not null, look for this value
Returns:
Cohort of patients who have a person attribute (optionally) with attributeType of attribute and (optionally) value of value.

getShortPatientDescriptions

public java.util.Map<java.lang.Integer,java.lang.String> getShortPatientDescriptions(java.util.Collection<java.lang.Integer> patientIds)
Specified by:
getShortPatientDescriptions in interface PatientSetService

getObservations

public java.util.Map<java.lang.Integer,java.util.List<Obs>> getObservations(Cohort patients,
                                                                            Concept concept)
Specified by:
getObservations in interface PatientSetService

getObservations

public java.util.Map<java.lang.Integer,java.util.List<Obs>> getObservations(Cohort patients,
                                                                            Concept concept,
                                                                            java.util.Date fromDate,
                                                                            java.util.Date toDate)
Date range is inclusive of both endpoints

Specified by:
getObservations in interface PatientSetService

getObservationsValues

public java.util.Map<java.lang.Integer,java.util.List<java.util.List<java.lang.Object>>> getObservationsValues(Cohort patients,
                                                                                                               Concept c)
Description copied from interface: PatientSetService
TODO write something here

Specified by:
getObservationsValues in interface PatientSetService
Returns:
Map>

getObservationsValues

public java.util.Map<java.lang.Integer,java.util.List<java.util.List<java.lang.Object>>> getObservationsValues(Cohort patients,
                                                                                                               Concept c,
                                                                                                               java.util.List<java.lang.String> attributes)
Description copied from interface: PatientSetService
Returns a mapping from patient id to obs for concept c

The returned List< attribute value > is [obs value, attr value, attr value, attr value...] The returned List> represents the obs rows

Specified by:
getObservationsValues in interface PatientSetService
attributes - list of attributes
Returns:
Map>>

getEncountersByType

public java.util.Map<java.lang.Integer,Encounter> getEncountersByType(Cohort patients,
                                                                      EncounterType encType)
Description copied from interface: PatientSetService
TODO write something here

Specified by:
getEncountersByType in interface PatientSetService
Parameters:
patients - Cohort of patients to search
encType - the type of the encounter
Returns:
Map of patientId to encounters matching a specific type

getEncounterAttrsByType

public java.util.Map<java.lang.Integer,java.lang.Object> getEncounterAttrsByType(Cohort patients,
                                                                                 java.util.List<EncounterType> encTypes,
                                                                                 java.lang.String attr)
Description copied from interface: PatientSetService
TODO write something here

Specified by:
getEncounterAttrsByType in interface PatientSetService
Parameters:
patients - Cohort of patients to search
encTypes - List to include in the search
attr - String of attributes to get
Returns:
Map of encounter attributes

getEncountersByType

public java.util.Map<java.lang.Integer,Encounter> getEncountersByType(Cohort patients,
                                                                      java.util.List<EncounterType> types)
Description copied from interface: PatientSetService
TODO write something here

Specified by:
getEncountersByType in interface PatientSetService
Parameters:
patients - Cohort of patients to search
types - List to include in the search
Returns:
Map of patientId to encounters matching a specific type

getEncounters

public java.util.Map<java.lang.Integer,Encounter> getEncounters(Cohort patients)
Description copied from interface: PatientSetService
TODO write something here

Specified by:
getEncounters in interface PatientSetService
Parameters:
patients - Cohort of patients to search
Returns:
Map of all encounters for specified patients.

getFirstEncountersByType

public java.util.Map<java.lang.Integer,Encounter> getFirstEncountersByType(Cohort patients,
                                                                           EncounterType encType)
Description copied from interface: PatientSetService
TODO write something here

Specified by:
getFirstEncountersByType in interface PatientSetService
Parameters:
patients - Cohort of patients to search
Returns:
Map of patientId to first encounters of specified patients, from a specific type

getFirstEncounterAttrsByType

public java.util.Map<java.lang.Integer,java.lang.Object> getFirstEncounterAttrsByType(Cohort patients,
                                                                                      java.util.List<EncounterType> encTypes,
                                                                                      java.lang.String attr)
Description copied from interface: PatientSetService
TODO write something here

Specified by:
getFirstEncounterAttrsByType in interface PatientSetService
Parameters:
patients - Cohort of patients to search
encTypes - List to include in the search
Returns:
Map of patientId to first encounters properties

getFirstEncountersByType

public java.util.Map<java.lang.Integer,Encounter> getFirstEncountersByType(Cohort patients,
                                                                           java.util.List<EncounterType> types)
Description copied from interface: PatientSetService
TODO write something here

Specified by:
getFirstEncountersByType in interface PatientSetService
Parameters:
patients - Cohort of patients to search
types - List to include in the search
Returns:
Map of patientId to first encounters of specified patients, from a specific list of types

getPatientAttributes

public java.util.Map<java.lang.Integer,java.lang.Object> getPatientAttributes(Cohort patients,
                                                                              java.lang.String className,
                                                                              java.lang.String property,
                                                                              boolean returnAll)
Description copied from interface: PatientSetService
TODO write something here

Specified by:
getPatientAttributes in interface PatientSetService
Parameters:
patients - Cohort of patients to search
Returns:
Map of patientId to patient properties
See Also:
PatientSetService.getPatientAttributes(Cohort, String, String, boolean)

getPatientAttributes

public java.util.Map<java.lang.Integer,java.lang.Object> getPatientAttributes(Cohort patients,
                                                                              java.lang.String classNameDotProperty,
                                                                              boolean returnAll)
Description copied from interface: PatientSetService
TODO write something here

Specified by:
getPatientAttributes in interface PatientSetService
Returns:
Map of patientId to patient properties

getPatientIdentifiersByType

public java.util.Map<java.lang.Integer,PatientIdentifier> getPatientIdentifiersByType(Cohort patients,
                                                                                      PatientIdentifierType type)
Description copied from interface: PatientSetService
Gets a map of patient identifiers by identifier type, indexed by patient primary key.

Specified by:
getPatientIdentifiersByType in interface PatientSetService
Parameters:
patients - Cohort of patients to look up
type - PatientIdentifierType to retrieve
Returns:
Map of patient identifiers and PatientIdentifierTypes, for all patients in the specified cohort

getPersonAttributes

public java.util.Map<java.lang.Integer,java.lang.Object> getPersonAttributes(Cohort patients,
                                                                             java.lang.String attributeName,
                                                                             java.lang.String joinClass,
                                                                             java.lang.String joinProperty,
                                                                             java.lang.String outputColumn,
                                                                             boolean returnAll)
Specified by:
getPersonAttributes in interface PatientSetService
Returns:
Map of patientId to person properties
See Also:
PatientSetService.getPersonAttributes(org.openmrs.Cohort, java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean)

getCharacteristics

public java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.lang.Object>> getCharacteristics(Cohort patients)
Description copied from interface: PatientSetService
TODO write something here

Specified by:
getCharacteristics in interface PatientSetService
Parameters:
patients - Cohort of patients to look up
Returns:
Map> with characteristics of specified patients

convertPatientIdentifier

public Cohort convertPatientIdentifier(java.util.List<java.lang.String> identifiers)
Description copied from interface: PatientSetService
TODO write something here

Specified by:
convertPatientIdentifier in interface PatientSetService
Parameters:
identifiers - List of String patient identifiers
Returns:
Cohort of patients matching specified identifiers

getPatients

public java.util.List<Patient> getPatients(java.util.Collection<java.lang.Integer> patientIds)
Description copied from interface: PatientSetService
TODO write something here

Specified by:
getPatients in interface PatientSetService
Returns:
List of matching patients

getRelationships

public java.util.Map<java.lang.Integer,java.util.List<Relationship>> getRelationships(Cohort ps,
                                                                                      RelationshipType relType)
Specified by:
getRelationships in interface PatientSetService

getRelatives

public java.util.Map<java.lang.Integer,java.util.List<Person>> getRelatives(Cohort ps,
                                                                            RelationshipType relType,
                                                                            boolean forwards)
Specified by:
getRelatives in interface PatientSetService

getCurrentStates

public java.util.Map<java.lang.Integer,PatientState> getCurrentStates(Cohort ps,
                                                                      ProgramWorkflow wf)
Specified by:
getCurrentStates in interface PatientSetService

getCurrentPatientPrograms

public java.util.Map<java.lang.Integer,PatientProgram> getCurrentPatientPrograms(Cohort ps,
                                                                                 Program program)
Specified by:
getCurrentPatientPrograms in interface PatientSetService

getPatientPrograms

public java.util.Map<java.lang.Integer,PatientProgram> getPatientPrograms(Cohort ps,
                                                                          Program program)
Specified by:
getPatientPrograms in interface PatientSetService

getCurrentDrugOrders

public java.util.Map<java.lang.Integer,java.util.List<DrugOrder>> getCurrentDrugOrders(Cohort ps,
                                                                                       Concept drugSet)
Specified by:
getCurrentDrugOrders in interface PatientSetService
Returns:
all active drug orders whose drug concept is in the given set (or all drugs if that's null)

getDrugOrders

public java.util.Map<java.lang.Integer,java.util.List<DrugOrder>> getDrugOrders(Cohort ps,
                                                                                Concept drugSet)
Specified by:
getDrugOrders in interface PatientSetService
Returns:
all drug orders whose drug concept is in the given set (or all drugs if that's null)

getEncountersByForm

public java.util.List<Encounter> getEncountersByForm(Cohort patients,
                                                     java.util.List<Form> forms)
Gets a list of encounters associated with the given form, filtered by the given patient set.

Specified by:
getEncountersByForm in interface PatientSetService
Parameters:
patients - the patients to filter by (null will return all encounters for all patients)
forms - the forms to filter by

OpenMRS-1.7.x

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