- Timestamp:
- 05/09/08 10:53:35 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs/trunk/src/api/org/openmrs/api/db/PatientSetDAO.java
r4095 r4158 19 19 import java.util.Map; 20 20 21 import org.openmrs.Cohort; 21 22 import org.openmrs.Concept; 22 23 import org.openmrs.Drug; … … 42 43 import org.openmrs.api.PatientSetService.PatientLocationMethod; 43 44 import org.openmrs.api.PatientSetService.TimeModifier; 44 import org.openmrs.reporting.PatientSet;45 45 46 46 public interface PatientSetDAO { 47 47 48 public String exportXml( PatientSet ps) throws DAOException;48 public String exportXml(Cohort ps) throws DAOException; 49 49 50 50 public String exportXml(Integer patientId) throws DAOException; 51 51 52 public PatientSet getAllPatients();52 public Cohort getAllPatients(); 53 53 54 public PatientSet getPatientsByCharacteristics(String gender, Date minBirthdate, Date maxBirthdate, Integer minAge, Integer maxAge, Boolean aliveOnly, Boolean deadOnly) throws DAOException; 54 public Cohort getPatientsByCharacteristics(String gender, Date minBirthdate, Date maxBirthdate, Integer minAge, Integer maxAge, Boolean aliveOnly, Boolean deadOnly) throws DAOException; 55 56 public Cohort getPatientsByCharacteristics(String gender, Date minBirthdate, Date maxBirthdate, Integer minAge, Integer maxAge, Boolean aliveOnly, Boolean deadOnly, Date effectiveDate) throws DAOException; 55 57 56 public PatientSet getPatientsHavingDateObs(Integer conceptId, Date startTime, Date endTime);58 public Cohort getPatientsHavingDateObs(Integer conceptId, Date startTime, Date endTime); 57 59 58 public PatientSet getPatientsHavingNumericObs(Integer conceptId, TimeModifier timeModifier, PatientSetService.Modifier modifier, Number value, Date fromDate, Date toDate) throws DAOException;60 public Cohort getPatientsHavingNumericObs(Integer conceptId, TimeModifier timeModifier, PatientSetService.Modifier modifier, Number value, Date fromDate, Date toDate) throws DAOException; 59 61 60 public PatientSet getPatientsHavingObs(Integer conceptId, TimeModifier timeModifier, PatientSetService.Modifier modifier, Object value, Date fromDate, Date toDate) throws DAOException;62 public Cohort getPatientsHavingObs(Integer conceptId, TimeModifier timeModifier, PatientSetService.Modifier modifier, Object value, Date fromDate, Date toDate) throws DAOException; 61 63 62 public PatientSet getPatientsHavingEncounters(List<EncounterType> encounterTypeList, Location location, Form form, Date fromDate, Date toDate, Integer minCount, Integer maxCount) throws DAOException;64 public Cohort getPatientsHavingEncounters(List<EncounterType> encounterTypeList, Location location, Form form, Date fromDate, Date toDate, Integer minCount, Integer maxCount) throws DAOException; 63 65 64 public PatientSet getPatientsByProgramAndState(Program program, List<ProgramWorkflowState> stateList, Date fromDate, Date toDate) throws DAOException;66 public Cohort getPatientsByProgramAndState(Program program, List<ProgramWorkflowState> stateList, Date fromDate, Date toDate) throws DAOException; 65 67 66 public PatientSet getPatientsInProgram(Integer programId, Date fromDate, Date toDate) throws DAOException;68 public Cohort getPatientsInProgram(Integer programId, Date fromDate, Date toDate) throws DAOException; 67 69 68 public PatientSet getPatientsHavingTextObs(Integer conceptId, String value, TimeModifier timeModifier) throws DAOException;70 public Cohort getPatientsHavingTextObs(Integer conceptId, String value, TimeModifier timeModifier) throws DAOException; 69 71 70 public PatientSet getPatientsHavingLocation(Integer locationId, PatientLocationMethod method) throws DAOException;72 public Cohort getPatientsHavingLocation(Integer locationId, PatientLocationMethod method) throws DAOException; 71 73 72 74 public Map<Integer, String> getShortPatientDescriptions(Collection<Integer> patientIds) throws DAOException; 73 75 74 public Map<Integer, List<Obs>> getObservations( PatientSet patients, Concept concept, Date fromDate, Date toDate) throws DAOException;76 public Map<Integer, List<Obs>> getObservations(Cohort patients, Concept concept, Date fromDate, Date toDate) throws DAOException; 75 77 76 public Map<Integer, List<List<Object>>> getObservationsValues( PatientSet patients, Concept c, List<String> attributes);78 public Map<Integer, List<List<Object>>> getObservationsValues(Cohort patients, Concept c, List<String> attributes); 77 79 78 public Map<Integer, Encounter> getEncountersByType( PatientSet patients, List<EncounterType> encType);80 public Map<Integer, Encounter> getEncountersByType(Cohort patients, List<EncounterType> encType); 79 81 80 public Map<Integer, Object> getEncounterAttrsByType( PatientSet patients, List<EncounterType> encTypes, String attr, Boolean earliestFirst);82 public Map<Integer, Object> getEncounterAttrsByType(Cohort patients, List<EncounterType> encTypes, String attr, Boolean earliestFirst); 81 83 82 public Map<Integer, Encounter> getEncounters( PatientSet patients);84 public Map<Integer, Encounter> getEncounters(Cohort patients); 83 85 84 public Map<Integer, Encounter> getFirstEncountersByType( PatientSet patients, List<EncounterType> encType);86 public Map<Integer, Encounter> getFirstEncountersByType(Cohort patients, List<EncounterType> encType); 85 87 86 public Map<Integer, Object> getPatientAttributes( PatientSet patients, String className, String property, boolean returnAll);88 public Map<Integer, Object> getPatientAttributes(Cohort patients, String className, String property, boolean returnAll); 87 89 88 public Map<Integer, PatientIdentifier> getPatientIdentifierByType( PatientSet patients, List<PatientIdentifierType> types);90 public Map<Integer, PatientIdentifier> getPatientIdentifierByType(Cohort patients, List<PatientIdentifierType> types); 89 91 90 public Map<Integer, Map<String, Object>> getCharacteristics( PatientSet patients) throws DAOException;92 public Map<Integer, Map<String, Object>> getCharacteristics(Cohort patients) throws DAOException; 91 93 92 public PatientSet convertPatientIdentifier(List<String> identifiers) throws DAOException;94 public Cohort convertPatientIdentifier(List<String> identifiers) throws DAOException; 93 95 94 96 public List<Patient> getPatients(Collection<Integer> patientIds) throws DAOException; … … 96 98 public Map<Integer, Collection<Integer>> getActiveDrugIds(Collection<Integer> patientIds, Date fromDate, Date toDate) throws DAOException; 97 99 98 public Map<Integer, PatientState> getCurrentStates( PatientSet ps, ProgramWorkflow wf) throws DAOException;100 public Map<Integer, PatientState> getCurrentStates(Cohort ps, ProgramWorkflow wf) throws DAOException; 99 101 100 public Map<Integer, PatientProgram> getPatientPrograms( PatientSet ps, Program program, boolean includeVoided, boolean includePast) throws DAOException;102 public Map<Integer, PatientProgram> getPatientPrograms(Cohort ps, Program program, boolean includeVoided, boolean includePast) throws DAOException; 101 103 102 public Map<Integer, List<DrugOrder>> getCurrentDrugOrders( PatientSet ps, List<Concept> drugConcepts) throws DAOException;104 public Map<Integer, List<DrugOrder>> getCurrentDrugOrders(Cohort ps, List<Concept> drugConcepts) throws DAOException; 103 105 104 public Map<Integer, List<DrugOrder>> getDrugOrders( PatientSet ps, List<Concept> drugConcepts) throws DAOException;106 public Map<Integer, List<DrugOrder>> getDrugOrders(Cohort ps, List<Concept> drugConcepts) throws DAOException; 105 107 106 public Map<Integer, List<Relationship>> getRelationships( PatientSet ps, RelationshipType relType) throws DAOException;108 public Map<Integer, List<Relationship>> getRelationships(Cohort ps, RelationshipType relType) throws DAOException; 107 109 108 public Map<Integer, List<Person>> getRelatives( PatientSet ps, RelationshipType relType, boolean forwards) throws DAOException;110 public Map<Integer, List<Person>> getRelatives(Cohort ps, RelationshipType relType, boolean forwards) throws DAOException; 109 111 110 public Map<Integer, Object> getPersonAttributes( PatientSet patients, String attributeName, String joinClass, String joinProperty, String outputColumn, boolean returnAll);112 public Map<Integer, Object> getPersonAttributes(Cohort patients, String attributeName, String joinClass, String joinProperty, String outputColumn, boolean returnAll); 111 113 112 public PatientSet getPatientsHavingPersonAttribute(PersonAttributeType attribute, String value);114 public Cohort getPatientsHavingPersonAttribute(PersonAttributeType attribute, String value); 113 115 114 public PatientSet getPatientsHavingDrugOrder(List<Drug> drugList, List<Concept> drugConceptList, Date startDateFrom, Date startDateTo, Date stopDateFrom, Date stopDateTo, Boolean discontinued, List<Concept> discontinuedReason);116 public Cohort getPatientsHavingDrugOrder(List<Drug> drugList, List<Concept> drugConceptList, Date startDateFrom, Date startDateTo, Date stopDateFrom, Date stopDateTo, Boolean discontinued, List<Concept> discontinuedReason); 115 117 116 public List<Encounter> getEncountersByForm( PatientSet patients, List<Form> forms);118 public List<Encounter> getEncountersByForm(Cohort patients, List<Form> forms); 117 119 118 120 }