| 
 
 | 
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openmrs.api.db.hibernate.HibernatePatientSetDAO
public class HibernatePatientSetDAO
Hibernate specific implementation of the PatientSetDAO. 
 
 This class should not be instantiated. Rather, it is injected into the PatientSetService by
 Spring.
Context, 
PatientSetService, 
PatientSetDAO| Field Summary | |
|---|---|
protected  org.apache.commons.logging.Log | 
log
 | 
| Constructor Summary | |
|---|---|
HibernatePatientSetDAO()
 | 
|
| Method Summary | |
|---|---|
 Cohort | 
convertPatientIdentifier(java.util.List<java.lang.String> identifiers)
 | 
 java.lang.String | 
exportXml(Cohort ps)
Deprecated.  | 
 java.lang.String | 
exportXml(java.lang.Integer patientId)
Deprecated.  | 
static java.util.List<java.lang.String> | 
findObsValueColumnName(Concept c)
 | 
 java.util.Map<java.lang.Integer,java.util.Collection<java.lang.Integer>> | 
getActiveDrugIds(java.util.Collection<java.lang.Integer> patientIds,
                 java.util.Date fromDate,
                 java.util.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  | 
 Cohort | 
getAllPatients()
 | 
 java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.lang.Object>> | 
getCharacteristics(Cohort patients)
 | 
 java.util.Map<java.lang.Integer,java.util.List<DrugOrder>> | 
getCurrentDrugOrders(Cohort patients,
                     java.util.List<Concept> drugConcepts)
 | 
 java.util.Map<java.lang.Integer,PatientState> | 
getCurrentStates(Cohort ps,
                 ProgramWorkflow wf)
 | 
 java.util.Map<java.lang.Integer,java.util.List<DrugOrder>> | 
getDrugOrders(Cohort patients,
              java.util.List<Concept> drugConcepts)
 | 
 java.util.Map<java.lang.Integer,java.lang.Object> | 
getEncounterAttrsByType(Cohort patients,
                        java.util.List<EncounterType> encTypes,
                        java.lang.String attr,
                        java.lang.Boolean earliestFirst)
 | 
 java.util.Map<java.lang.Integer,Encounter> | 
getEncounters(Cohort patients)
 | 
 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,
                    java.util.List<EncounterType> encTypes)
 | 
 java.util.Map<java.lang.Integer,Encounter> | 
getFirstEncountersByType(Cohort patients,
                         java.util.List<EncounterType> types)
 | 
 java.util.Map<java.lang.Integer,java.util.List<Obs>> | 
getObservations(Cohort patients,
                Concept concept,
                java.util.Date fromDate,
                java.util.Date toDate)
 | 
 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)
 | 
 java.util.Map<java.lang.Integer,java.lang.Object> | 
getPatientAttributes(Cohort patients,
                     java.lang.String className,
                     java.lang.String property,
                     boolean returnAll)
 | 
 java.util.Map<java.lang.Integer,PatientIdentifier> | 
getPatientIdentifierByType(Cohort patients,
                           java.util.List<PatientIdentifierType> types)
 | 
 java.util.Map<java.lang.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.  | 
 java.util.List<Patient> | 
getPatients(java.util.Collection<java.lang.Integer> patientIds)
 | 
 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)
 | 
 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)
 | 
 Cohort | 
getPatientsByProgramAndState(Program program,
                             java.util.List<ProgramWorkflowState> stateList,
                             java.util.Date fromDate,
                             java.util.Date toDate)
TODO: Fails to leave out patients who are voided Returns the set of patients that were in a 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(java.lang.Integer conceptId,
                         java.util.Date startTime,
                         java.util.Date endTime)
TODO: don't return voided patients Gets all patients with an obs's value_date column value within startTime and endTime | 
 Cohort | 
getPatientsHavingDrugOrder(java.util.List<Drug> drugList,
                           java.util.List<Concept> drugConceptList,
                           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(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)
TODO: don't return voided patients 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(java.lang.Integer locationId,
                          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)
 | 
 Cohort | 
getPatientsHavingPersonAttribute(PersonAttributeType attribute,
                                 java.lang.String value)
 | 
 Cohort | 
getPatientsHavingTextObs(java.lang.Integer conceptId,
                         java.lang.String value,
                         PatientSetService.TimeModifier timeModifier)
 | 
 Cohort | 
getPatientsInProgram(java.lang.Integer programId,
                     java.util.Date fromDate,
                     java.util.Date toDate)
TODO: Don't return voided patients Returns the set of patients that were ever in enrolled in a given program.  | 
 java.util.Map<java.lang.Integer,java.lang.Object> | 
getPersonAttributes(Cohort patients,
                    java.lang.String attributeTypeName,
                    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 patients,
                 RelationshipType relType)
 | 
 java.util.Map<java.lang.Integer,java.util.List<Person>> | 
getRelatives(Cohort patients,
             RelationshipType relType,
             boolean forwards)
 | 
 java.util.Map<java.lang.Integer,java.lang.String> | 
getShortPatientDescriptions(java.util.Collection<java.lang.Integer> patientIds)
 | 
 void | 
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Set sessionFactory.getCurrentSession() factory  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected final org.apache.commons.logging.Log log
| Constructor Detail | 
|---|
public HibernatePatientSetDAO()
| Method Detail | 
|---|
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
sessionFactory - SessionFactory to set
public java.lang.String exportXml(Cohort ps)
                           throws DAOException
exportXml in interface PatientSetDAODAOExceptionPatientSetDAO.exportXml(org.openmrs.Cohort)
public java.lang.String exportXml(java.lang.Integer patientId)
                           throws DAOException
exportXml in interface PatientSetDAODAOExceptionpublic Cohort getAllPatients()
getAllPatients in interface PatientSetDAO
public Cohort getPatientsByProgramAndState(Program program,
                                           java.util.List<ProgramWorkflowState> stateList,
                                           java.util.Date fromDate,
                                           java.util.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 date
public Cohort getPatientsInProgram(java.lang.Integer programId,
                                   java.util.Date fromDate,
                                   java.util.Date toDate)
getPatientsInProgram in interface PatientSetDAO
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)
getPatientsHavingObs in interface PatientSetDAO
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)
getPatientsHavingEncounters in interface PatientSetDAO
public Cohort getPatientsHavingDateObs(java.lang.Integer conceptId,
                                       java.util.Date startTime,
                                       java.util.Date endTime)
startTime and endTime
getPatientsHavingDateObs in interface PatientSetDAOconceptId - startTime - endTime - 
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)
getPatientsHavingNumericObs in interface PatientSetDAO
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
getPatientsByCharacteristics in interface PatientSetDAODAOException
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
getPatientsByCharacteristics in interface PatientSetDAODAOException
public java.util.Map<java.lang.Integer,java.lang.String> getShortPatientDescriptions(java.util.Collection<java.lang.Integer> patientIds)
                                                                              throws DAOException
getShortPatientDescriptions in interface PatientSetDAODAOException
public java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.lang.Object>> getCharacteristics(Cohort patients)
                                                                                                     throws DAOException
getCharacteristics in interface PatientSetDAODAOException
public java.util.Map<java.lang.Integer,java.util.List<Obs>> getObservations(Cohort patients,
                                                                            Concept concept,
                                                                            java.util.Date fromDate,
                                                                            java.util.Date toDate)
                                                                     throws DAOException
getObservations in interface PatientSetDAODAOException
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)
getObservationsValues in interface PatientSetDAOpublic static java.util.List<java.lang.String> findObsValueColumnName(Concept c)
public java.util.Map<java.lang.Integer,Encounter> getEncountersByType(Cohort patients,
                                                                      java.util.List<EncounterType> encTypes)
getEncountersByType in interface PatientSetDAO
public java.util.List<Encounter> getEncountersByForm(Cohort patients,
                                                     java.util.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 by
public java.util.Map<java.lang.Integer,java.lang.Object> getEncounterAttrsByType(Cohort patients,
                                                                                 java.util.List<EncounterType> encTypes,
                                                                                 java.lang.String attr,
                                                                                 java.lang.Boolean earliestFirst)
getEncounterAttrsByType in interface PatientSetDAOpublic java.util.Map<java.lang.Integer,Encounter> getEncounters(Cohort patients)
getEncounters in interface PatientSetDAO
public java.util.Map<java.lang.Integer,Encounter> getFirstEncountersByType(Cohort patients,
                                                                           java.util.List<EncounterType> types)
getFirstEncountersByType in interface PatientSetDAO
public java.util.Map<java.lang.Integer,java.lang.Object> getPatientAttributes(Cohort patients,
                                                                              java.lang.String className,
                                                                              java.lang.String property,
                                                                              boolean returnAll)
                                                                       throws DAOException
getPatientAttributes in interface PatientSetDAODAOException
public java.util.Map<java.lang.Integer,java.lang.Object> getPersonAttributes(Cohort patients,
                                                                             java.lang.String attributeTypeName,
                                                                             java.lang.String joinClass,
                                                                             java.lang.String joinProperty,
                                                                             java.lang.String outputColumn,
                                                                             boolean returnAll)
getPersonAttributes in interface PatientSetDAOPatientSetDAO.getPersonAttributes(org.openmrs.Cohort,
      java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean)
public Cohort getPatientsHavingTextObs(java.lang.Integer conceptId,
                                       java.lang.String value,
                                       PatientSetService.TimeModifier timeModifier)
                                throws DAOException
getPatientsHavingTextObs in interface PatientSetDAODAOException
public Cohort getPatientsHavingLocation(java.lang.Integer locationId,
                                        PatientSetService.PatientLocationMethod method)
                                 throws DAOException
getPatientsHavingLocation in interface PatientSetDAODAOException
public Cohort convertPatientIdentifier(java.util.List<java.lang.String> identifiers)
                                throws DAOException
convertPatientIdentifier in interface PatientSetDAODAOException
public java.util.List<Patient> getPatients(java.util.Collection<java.lang.Integer> patientIds)
                                    throws DAOException
getPatients in interface PatientSetDAODAOException
public java.util.Map<java.lang.Integer,java.util.Collection<java.lang.Integer>> getActiveDrugIds(java.util.Collection<java.lang.Integer> patientIds,
                                                                                                 java.util.Date fromDate,
                                                                                                 java.util.Date toDate)
                                                                                          throws DAOException
getActiveDrugIds in interface PatientSetDAODAOException
public java.util.Map<java.lang.Integer,PatientState> getCurrentStates(Cohort ps,
                                                                      ProgramWorkflow wf)
                                                               throws DAOException
getCurrentStates in interface PatientSetDAODAOException
public java.util.Map<java.lang.Integer,PatientProgram> getPatientPrograms(Cohort ps,
                                                                          Program program,
                                                                          boolean includeVoided,
                                                                          boolean includePast)
                                                                   throws DAOException
getPatientPrograms in interface PatientSetDAODAOException
public java.util.Map<java.lang.Integer,java.util.List<DrugOrder>> getCurrentDrugOrders(Cohort patients,
                                                                                       java.util.List<Concept> drugConcepts)
                                                                                throws DAOException
getCurrentDrugOrders in interface PatientSetDAODAOException
public java.util.Map<java.lang.Integer,java.util.List<DrugOrder>> getDrugOrders(Cohort patients,
                                                                                java.util.List<Concept> drugConcepts)
                                                                         throws DAOException
getDrugOrders in interface PatientSetDAODAOException
public java.util.Map<java.lang.Integer,java.util.List<Person>> getRelatives(Cohort patients,
                                                                            RelationshipType relType,
                                                                            boolean forwards)
getRelatives in interface PatientSetDAO
public java.util.Map<java.lang.Integer,java.util.List<Relationship>> getRelationships(Cohort patients,
                                                                                      RelationshipType relType)
getRelationships in interface PatientSetDAO
public Cohort getPatientsHavingPersonAttribute(PersonAttributeType attribute,
                                               java.lang.String value)
getPatientsHavingPersonAttribute in interface PatientSetDAO
public Cohort getPatientsHavingDrugOrder(java.util.List<Drug> drugList,
                                         java.util.List<Concept> drugConceptList,
                                         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)
getPatientsHavingDrugOrder in interface PatientSetDAO
public java.util.Map<java.lang.Integer,PatientIdentifier> getPatientIdentifierByType(Cohort patients,
                                                                                     java.util.List<PatientIdentifierType> types)
getPatientIdentifierByType in interface PatientSetDAOpatients - types - ListPatientIdentifiers
public Cohort getPatientsByRelationship(RelationshipType relType,
                                        boolean includeAtoB,
                                        boolean includeBtoA,
                                        Person target)
PatientSetDAO
getPatientsByRelationship in interface PatientSetDAOPatientSetDAO.getPatientsByRelationship(org.openmrs.RelationshipType,
      boolean, boolean, org.openmrs.Person)
  | 
OpenMRS-1.7.x | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||