public class HibernatePatientSetDAO extends Object implements PatientSetDAO
Context,
PatientSetService,
PatientSetDAO| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
log |
| Constructor and Description |
|---|
HibernatePatientSetDAO() |
| Modifier and Type | Method and Description |
|---|---|
Cohort |
convertPatientIdentifier(List<String> identifiers) |
static List<String> |
findObsValueColumnName(Concept c) |
Map<Integer,Collection<Integer>> |
getActiveDrugIds(Collection<Integer> patientIds,
Date fromDate,
Date toDate)
Returns a Map from patientId to a Collection of drugIds for drugs active for the patients on
that date If patientIds is null then do this for all patients Does not return anything for
voided patients
|
Cohort |
getAllPatients() |
Map<Integer,Map<String,Object>> |
getCharacteristics(Cohort patients) |
Integer |
getCountOfPatients() |
Map<Integer,List<DrugOrder>> |
getCurrentDrugOrders(Cohort patients,
List<Concept> drugConcepts) |
Map<Integer,PatientState> |
getCurrentStates(Cohort ps,
ProgramWorkflow wf) |
Map<Integer,List<DrugOrder>> |
getDrugOrders(Cohort patients,
List<Concept> drugConcepts) |
Map<Integer,Object> |
getEncounterAttrsByType(Cohort patients,
List<EncounterType> encTypes,
String attr,
Boolean earliestFirst) |
Map<Integer,Encounter> |
getEncounters(Cohort patients) |
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,
List<EncounterType> encTypes) |
Map<Integer,Encounter> |
getFirstEncountersByType(Cohort patients,
List<EncounterType> types) |
Map<Integer,List<Obs>> |
getObservations(Cohort patients,
Concept concept,
Date fromDate,
Date toDate) |
Map<Integer,List<List<Object>>> |
getObservationsValues(Cohort patients,
Concept c,
List<String> attributes,
Integer limit,
boolean showMostRecentFirst) |
Map<Integer,Object> |
getPatientAttributes(Cohort patients,
String className,
String property,
boolean returnAll) |
Map<Integer,String> |
getPatientIdentifierByType(Cohort patients,
List<PatientIdentifierType> types) |
Map<Integer,PatientProgram> |
getPatientPrograms(Cohort ps,
Program program,
boolean includeVoided,
boolean includePast)
This method assumes the patient is not simultaneously enrolled in the program more than once.
|
List<Patient> |
getPatients(Collection<Integer> patientIds) |
Cohort |
getPatients(Integer start,
Integer size) |
Cohort |
getPatientsByCharacteristics(String gender,
Date minBirthdate,
Date maxBirthdate,
Integer minAge,
Integer maxAge,
Boolean aliveOnly,
Boolean deadOnly) |
Cohort |
getPatientsByCharacteristics(String gender,
Date minBirthdate,
Date maxBirthdate,
Integer minAge,
Integer maxAge,
Boolean aliveOnly,
Boolean deadOnly,
Date effectiveDate) |
Cohort |
getPatientsByProgramAndState(Program program,
List<ProgramWorkflowState> stateList,
Date fromDate,
Date toDate)
given program, workflow, and state, within a given date range
|
Cohort |
getPatientsByRelationship(RelationshipType relType,
boolean includeAtoB,
boolean includeBtoA,
Person target)
Returns the cohort of patients matching a particular relationship search.
|
Cohort |
getPatientsHavingDateObs(Integer conceptId,
Date startTime,
Date endTime)
within
startTime and endTime |
Cohort |
getPatientsHavingDrugOrder(List<Drug> drugList,
List<Concept> drugConceptList,
Date startDateFrom,
Date startDateTo,
Date stopDateFrom,
Date stopDateTo,
Boolean discontinued,
List<Concept> orderReason) |
Cohort |
getPatientsHavingEncounters(List<EncounterType> encounterTypeList,
Location location,
Form form,
Date fromDate,
Date toDate,
Integer minCount,
Integer maxCount)
Returns the set of patients that have encounters, with several optional parameters:
of type encounterType
at a given location
from filling out a specific form
on or after fromDate
on or before toDate
patients with at least minCount of the given encounters
patients with up to maxCount of the given encounters
|
Cohort |
getPatientsHavingLocation(Integer locationId,
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) |
Cohort |
getPatientsHavingPersonAttribute(PersonAttributeType attribute,
String value) |
Cohort |
getPatientsHavingTextObs(Integer conceptId,
String value,
PatientSetService.TimeModifier timeModifier) |
Cohort |
getPatientsInProgram(Integer programId,
Date fromDate,
Date toDate)
a given program.
|
Map<Integer,Object> |
getPersonAttributes(Cohort patients,
String attributeTypeName,
String joinClass,
String joinProperty,
String outputColumn,
boolean returnAll) |
Map<Integer,List<Relationship>> |
getRelationships(Cohort patients,
RelationshipType relType) |
Map<Integer,List<Person>> |
getRelatives(Cohort patients,
RelationshipType relType,
boolean forwards) |
Map<Integer,String> |
getShortPatientDescriptions(Collection<Integer> patientIds) |
void |
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Set sessionFactory.getCurrentSession() factory
|
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
sessionFactory - SessionFactory to setpublic Cohort getAllPatients()
getAllPatients in interface PatientSetDAOpublic Cohort getPatientsByProgramAndState(Program program, List<ProgramWorkflowState> stateList, Date fromDate, Date toDate)
getPatientsByProgramAndState in interface PatientSetDAOprogram - The program the patient must have been instateList - List of states the patient must have been in (implies a workflow) (can be
null)fromDate - If not null, then only patients in the given program/workflow/state on or
after this datetoDate - If not null, then only patients in the given program/workflow/state on or
before this datepublic Cohort getPatientsInProgram(Integer programId, Date fromDate, Date toDate)
getPatientsInProgram in interface PatientSetDAOpublic Cohort getPatientsHavingObs(Integer conceptId, PatientSetService.TimeModifier timeModifier, PatientSetService.Modifier modifier, Object value, Date fromDate, Date toDate)
getPatientsHavingObs in interface PatientSetDAOpublic Cohort getPatientsHavingEncounters(List<EncounterType> encounterTypeList, Location location, Form form, Date fromDate, Date toDate, Integer minCount, Integer maxCount)
Returns the set of patients that have encounters, with several optional parameters: of type encounterType at a given location from filling out a specific form on or after fromDate on or before toDate patients with at least minCount of the given encounters patients with up to maxCount of the given encounters
getPatientsHavingEncounters in interface PatientSetDAOpublic Cohort getPatientsHavingDateObs(Integer conceptId, Date startTime, Date endTime)
startTime and endTimegetPatientsHavingDateObs in interface PatientSetDAOconceptId - startTime - endTime - public Cohort getPatientsHavingNumericObs(Integer conceptId, PatientSetService.TimeModifier timeModifier, PatientSetService.Modifier modifier, Number value, Date fromDate, Date toDate)
getPatientsHavingNumericObs in interface PatientSetDAOpublic Cohort getPatientsByCharacteristics(String gender, Date minBirthdate, Date maxBirthdate, Integer minAge, Integer maxAge, Boolean aliveOnly, Boolean deadOnly) throws DAOException
getPatientsByCharacteristics in interface PatientSetDAODAOExceptionpublic Cohort getPatientsByCharacteristics(String gender, Date minBirthdate, Date maxBirthdate, Integer minAge, Integer maxAge, Boolean aliveOnly, Boolean deadOnly, Date effectiveDate) throws DAOException
getPatientsByCharacteristics in interface PatientSetDAODAOExceptionpublic Map<Integer,String> getShortPatientDescriptions(Collection<Integer> patientIds) throws DAOException
getShortPatientDescriptions in interface PatientSetDAODAOExceptionpublic Map<Integer,Map<String,Object>> getCharacteristics(Cohort patients) throws DAOException
getCharacteristics in interface PatientSetDAODAOExceptionpublic Map<Integer,List<Obs>> getObservations(Cohort patients, Concept concept, Date fromDate, Date toDate) throws DAOException
getObservations in interface PatientSetDAODAOExceptionpublic Map<Integer,List<List<Object>>> getObservationsValues(Cohort patients, Concept c, List<String> attributes, Integer limit, boolean showMostRecentFirst)
getObservationsValues in interface PatientSetDAOpublic Map<Integer,Encounter> getEncountersByType(Cohort patients, List<EncounterType> encTypes)
getEncountersByType in interface PatientSetDAOpublic List<Encounter> getEncountersByForm(Cohort patients, List<Form> forms)
getEncountersByForm in interface PatientSetDAOpatients - the patients to filter by (null will return all encounters for all patients)forms - the forms to filter bypublic Map<Integer,Object> getEncounterAttrsByType(Cohort patients, List<EncounterType> encTypes, String attr, Boolean earliestFirst)
getEncounterAttrsByType in interface PatientSetDAOpublic Map<Integer,Encounter> getEncounters(Cohort patients)
getEncounters in interface PatientSetDAOpublic Map<Integer,Encounter> getFirstEncountersByType(Cohort patients, List<EncounterType> types)
getFirstEncountersByType in interface PatientSetDAOpublic Map<Integer,Object> getPatientAttributes(Cohort patients, String className, String property, boolean returnAll) throws DAOException
getPatientAttributes in interface PatientSetDAODAOExceptionpublic Map<Integer,Object> getPersonAttributes(Cohort patients, String attributeTypeName, String joinClass, String joinProperty, String outputColumn, boolean returnAll)
public Cohort getPatientsHavingTextObs(Integer conceptId, String value, PatientSetService.TimeModifier timeModifier) throws DAOException
getPatientsHavingTextObs in interface PatientSetDAODAOExceptionpublic Cohort getPatientsHavingLocation(Integer locationId, PatientSetService.PatientLocationMethod method)
getPatientsHavingLocation in interface PatientSetDAOpublic Cohort convertPatientIdentifier(List<String> identifiers) throws DAOException
convertPatientIdentifier in interface PatientSetDAODAOExceptionpublic List<Patient> getPatients(Collection<Integer> patientIds) throws DAOException
getPatients in interface PatientSetDAODAOExceptionpublic Map<Integer,Collection<Integer>> getActiveDrugIds(Collection<Integer> patientIds, Date fromDate, Date toDate) throws DAOException
getActiveDrugIds in interface PatientSetDAODAOExceptionpublic Map<Integer,PatientState> getCurrentStates(Cohort ps, ProgramWorkflow wf) throws DAOException
getCurrentStates in interface PatientSetDAODAOExceptionpublic Map<Integer,PatientProgram> getPatientPrograms(Cohort ps, Program program, boolean includeVoided, boolean includePast) throws DAOException
getPatientPrograms in interface PatientSetDAODAOExceptionpublic Map<Integer,List<DrugOrder>> getCurrentDrugOrders(Cohort patients, List<Concept> drugConcepts) throws DAOException
getCurrentDrugOrders in interface PatientSetDAODAOExceptionpublic Map<Integer,List<DrugOrder>> getDrugOrders(Cohort patients, List<Concept> drugConcepts) throws DAOException
getDrugOrders in interface PatientSetDAODAOExceptionpublic Map<Integer,List<Person>> getRelatives(Cohort patients, RelationshipType relType, boolean forwards)
getRelatives in interface PatientSetDAOpublic Map<Integer,List<Relationship>> getRelationships(Cohort patients, RelationshipType relType)
getRelationships in interface PatientSetDAOpublic Cohort getPatientsHavingPersonAttribute(PersonAttributeType attribute, String value)
getPatientsHavingPersonAttribute in interface PatientSetDAOpublic Cohort getPatientsHavingDrugOrder(List<Drug> drugList, List<Concept> drugConceptList, Date startDateFrom, Date startDateTo, Date stopDateFrom, Date stopDateTo, Boolean discontinued, List<Concept> orderReason)
getPatientsHavingDrugOrder in interface PatientSetDAOpublic Map<Integer,String> getPatientIdentifierByType(Cohort patients, List<PatientIdentifierType> types)
getPatientIdentifierByType in interface PatientSetDAOpatients - types - List<PatientIdentifierTypes> of types to getPatientIdentifierspublic Cohort getPatientsByRelationship(RelationshipType relType, boolean includeAtoB, boolean includeBtoA, Person target)
PatientSetDAOgetPatientsByRelationship in interface PatientSetDAOPatientSetDAO.getPatientsByRelationship(org.openmrs.RelationshipType,
boolean, boolean, org.openmrs.Person)public Integer getCountOfPatients()
getCountOfPatients in interface PatientSetDAOpublic Cohort getPatients(Integer start, Integer size)
getPatients in interface PatientSetDAOCopyright © 2016 OpenMRS Inc.. All rights reserved.