Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register
Show
Ignore:
Timestamp:
05/09/08 10:53:35 (2 months ago)
Author:
bwolfe
Message:

Merging report-api-refactoring to trunk [2696]:[4157]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs/trunk/src/api/org/openmrs/api/PatientSetService.java

    r4095 r4158  
    1919import java.util.Map; 
    2020 
     21import org.openmrs.Cohort; 
    2122import org.openmrs.Concept; 
    2223import org.openmrs.Drug; 
     
    4142import org.openmrs.api.db.DAOException; 
    4243import org.openmrs.api.db.PatientSetDAO; 
    43 import org.openmrs.reporting.PatientAnalysis; 
    44 import org.openmrs.reporting.PatientSet; 
    4544import org.springframework.transaction.annotation.Transactional; 
    4645 
     
    5554         */ 
    5655        @Transactional(readOnly=true) 
    57         public String exportXml(PatientSet ps); 
     56        public String exportXml(Cohort ps); 
    5857 
    5958        @Transactional(readOnly=true) 
     
    6160 
    6261        @Transactional(readOnly=true) 
    63         public PatientSet getAllPatients() throws DAOException; 
    64  
    65         @Transactional(readOnly=true) 
    66         public PatientSet getPatientsByCharacteristics(String gender, 
     62        public Cohort getAllPatients() throws DAOException; 
     63 
     64        @Transactional(readOnly=true) 
     65        public Cohort getPatientsByCharacteristics(String gender, 
    6766                        Date minBirthdate, Date maxBirthdate) throws DAOException; 
    6867 
    6968        @Transactional(readOnly=true) 
    70         public PatientSet getPatientsByCharacteristics(String gender, 
     69        public Cohort getPatientsByCharacteristics(String gender, 
    7170                        Date minBirthdate, Date maxBirthdate, Integer minAge, 
    7271                        Integer maxAge, Boolean aliveOnly, Boolean deadOnly) 
    7372                        throws DAOException; 
    74  
    75         @Transactional(readOnly=true) 
    76         public PatientSet getPatientsHavingNumericObs(Integer conceptId, 
     73         
     74        @Transactional(readOnly=true) 
     75        public Cohort getPatientsByCharacteristics(String gender, 
     76                        Date minBirthdate, Date maxBirthdate, Integer minAge, 
     77                        Integer maxAge, Boolean aliveOnly, Boolean deadOnly, Date effectiveDate) 
     78                        throws DAOException; 
     79 
     80        @Transactional(readOnly=true) 
     81        public Cohort getPatientsHavingNumericObs(Integer conceptId, 
    7782                        TimeModifier timeModifier, PatientSetService.Modifier modifier, 
    7883                        Number value, Date fromDate, Date toDate); 
    7984         
    8085        @Transactional(readOnly=true) 
    81         public PatientSet getPatientsHavingObs(Integer conceptId, 
     86        public Cohort getPatientsHavingObs(Integer conceptId, 
    8287                        TimeModifier timeModifier, Modifier modifier, Object value, 
    8388                        Date fromDate, Date toDate); 
    8489         
    8590        @Transactional(readOnly=true) 
    86         public PatientSet getPatientsHavingEncounters(EncounterType encounterType, Location location, Form form, Date fromDate, Date toDate, Integer minCount, Integer maxCount); 
    87          
    88         @Transactional(readOnly=true) 
    89         public PatientSet getPatientsHavingEncounters(List<EncounterType> encounterTypeList, Location location, Form form, Date fromDate, Date toDate, Integer minCount, Integer maxCount); 
    90          
    91         @Transactional(readOnly=true) 
    92         public PatientSet getPatientsByProgramAndState(Program program, List<ProgramWorkflowState> stateList, Date fromDate, Date toDate); 
    93  
    94         @Transactional(readOnly=true) 
    95         public PatientSet getPatientsInProgram(Program program, Date fromDate, Date toDate); 
    96          
    97         @Transactional(readOnly=true) 
    98         public PatientSet getPatientsHavingDateObs(Integer conceptId, Date startTime, Date endTime); 
    99          
    100         @Transactional(readOnly=true) 
    101         public PatientSet getPatientsHavingTextObs(Concept concept, String value, TimeModifier timeModifier); 
    102  
    103         @Transactional(readOnly=true) 
    104         public PatientSet getPatientsHavingTextObs(Integer conceptId, String value, TimeModifier timeModifier); 
    105          
    106         @Transactional(readOnly=true) 
    107         public PatientSet getPatientsHavingLocation(Location loc); 
    108          
    109         @Transactional(readOnly=true) 
    110         public PatientSet getPatientsHavingLocation(Location loc, PatientLocationMethod method); 
    111  
    112         @Transactional(readOnly=true) 
    113         public PatientSet getPatientsHavingLocation(Integer locationId); 
    114          
    115         @Transactional(readOnly=true) 
    116         public PatientSet getPatientsHavingLocation(Integer locationId, PatientLocationMethod method); 
    117  
    118         /** 
    119          * Returns a PatientSet of patient who had drug orders for a set of drugs active on a certain date. 
     91        public Cohort getPatientsHavingEncounters(EncounterType encounterType, Location location, Form form, Date fromDate, Date toDate, Integer minCount, Integer maxCount); 
     92         
     93        @Transactional(readOnly=true) 
     94        public Cohort getPatientsHavingEncounters(List<EncounterType> encounterTypeList, Location location, Form form, Date fromDate, Date toDate, Integer minCount, Integer maxCount); 
     95         
     96        @Transactional(readOnly=true) 
     97        public Cohort getPatientsByProgramAndState(Program program, List<ProgramWorkflowState> stateList, Date fromDate, Date toDate); 
     98 
     99        @Transactional(readOnly=true) 
     100        public Cohort getPatientsInProgram(Program program, Date fromDate, Date toDate); 
     101         
     102        @Transactional(readOnly=true) 
     103        public Cohort getPatientsHavingDateObs(Integer conceptId, Date startTime, Date endTime); 
     104         
     105        @Transactional(readOnly=true) 
     106        public Cohort getPatientsHavingTextObs(Concept concept, String value, TimeModifier timeModifier); 
     107 
     108        @Transactional(readOnly=true) 
     109        public Cohort getPatientsHavingTextObs(Integer conceptId, String value, TimeModifier timeModifier); 
     110         
     111        @Transactional(readOnly=true) 
     112        public Cohort getPatientsHavingLocation(Location loc); 
     113         
     114        @Transactional(readOnly=true) 
     115        public Cohort getPatientsHavingLocation(Location loc, PatientLocationMethod method); 
     116 
     117        @Transactional(readOnly=true) 
     118        public Cohort getPatientsHavingLocation(Integer locationId); 
     119         
     120        @Transactional(readOnly=true) 
     121        public Cohort getPatientsHavingLocation(Integer locationId, PatientLocationMethod method); 
     122 
     123        /** 
     124         * Returns a Cohort of patient who had drug orders for a set of drugs active on a certain date. 
    120125         * Can also be used to find patient with no drug orders on that date. 
    121126         * @param patientIds Collection of patientIds you're interested in. NULL means all patients. 
     
    124129         */ 
    125130        @Transactional(readOnly=true) 
    126         public PatientSet getPatientsHavingDrugOrder( 
     131        public Cohort getPatientsHavingDrugOrder( 
    127132                        Collection<Integer> patientIds, Collection<Integer> takingIds, 
    128133                        Date onDate); 
    129134 
    130135        /** 
    131          * Returns a PatientSet of patient who had drug orders for a set of drugs active between a pair of dates. 
     136         * Returns a Cohort of patient who had drug orders for a set of drugs active between a pair of dates. 
    132137         * Can also be used to find patient with no drug orders on that date. 
    133138         * @param patientIds Collection of patientIds you're interested in. NULL means all patients. 
     
    138143         */ 
    139144        @Transactional(readOnly=true) 
    140         public PatientSet getPatientsHavingDrugOrder( 
     145        public Cohort getPatientsHavingDrugOrder( 
    141146                        Collection<Integer> patientIds, Collection<Integer> drugIds, GroupMethod groupMethod, 
    142147                        Date fromDate, Date toDate); 
    143148         
    144149        /** 
    145          * @return A PatientSet 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.  
    146          */ 
    147         @Transactional(readOnly=true) 
    148         public PatientSet getPatientsHavingDrugOrder( 
     150         * @return 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.  
     151         */ 
     152        @Transactional(readOnly=true) 
     153        public Cohort getPatientsHavingDrugOrder( 
    149154                        List<Drug> drug, List<Concept> drugConcept, 
    150155                        Date startDateFrom, Date startDateTo, 
     
    156161         * @param attribute if not null, look for this attribute 
    157162         * @param value if not null, look for this value 
    158          * @return PatientSet of patients who have a person attribute (optionally) with attributeType of attribute and (optionally) value of value. 
    159          */ 
    160         @Transactional(readOnly=true) 
    161         public PatientSet getPatientsHavingPersonAttribute(PersonAttributeType attribute, String value); 
     163         * @return Cohort of patients who have a person attribute (optionally) with attributeType of attribute and (optionally) value of value. 
     164         */ 
     165        @Transactional(readOnly=true) 
     166        public Cohort getPatientsHavingPersonAttribute(PersonAttributeType attribute, String value); 
    162167         
    163168        @Transactional(readOnly=true) 
     
    166171 
    167172        @Transactional(readOnly=true) 
    168         public Map<Integer, List<Obs>> getObservations(PatientSet patients, 
     173        public Map<Integer, List<Obs>> getObservations(Cohort patients, 
    169174                        Concept concept); 
    170175 
     
    173178         */ 
    174179        @Transactional(readOnly=true) 
    175         public Map<Integer, List<Obs>> getObservations(PatientSet patients, 
     180        public Map<Integer, List<Obs>> getObservations(Cohort patients, 
    176181                        Concept concept, Date fromDate, Date toDate); 
    177182 
     
    185190         */ 
    186191        @Transactional(readOnly=true) 
    187         public Map<Integer, List<List<Object>>> getObservationsValues(PatientSet patients, Concept c); 
     192        public Map<Integer, List<List<Object>>> getObservationsValues(Cohort patients, Concept c); 
    188193         
    189194        /** 
     
    199204         */ 
    200205        @Transactional(readOnly=true) 
    201         public Map<Integer, List<List<Object>>> getObservationsValues(PatientSet patients, Concept c, List<String> attributes); 
     206        public Map<Integer, List<List<Object>>> getObservationsValues(Cohort patients, Concept c, List<String> attributes); 
    202207         
    203208        /** 
     
    208213         */ 
    209214        @Transactional(readOnly=true) 
    210         public Map<Integer, Encounter> getEncountersByType(PatientSet patients, EncounterType encType); 
     215        public Map<Integer, Encounter> getEncountersByType(Cohort patients, EncounterType encType); 
    211216         
    212217        /** 
     
    217222         * @return 
    218223         */ 
    219         public Map<Integer, Object> getEncounterAttrsByType(PatientSet patients, List<EncounterType> encTypes, String attr); 
     224        public Map<Integer, Object> getEncounterAttrsByType(Cohort patients, List<EncounterType> encTypes, String attr); 
    220225         
    221226        /** 
     
    226231         */ 
    227232        @Transactional(readOnly=true) 
    228         public Map<Integer, Encounter> getEncountersByType(PatientSet patients, List<EncounterType> encType); 
    229  
    230          
    231  
    232         /** 
    233          *  
    234          * @param patients 
    235          * @return 
    236          */ 
    237         @Transactional(readOnly=true) 
    238         public Map<Integer, Encounter> getEncounters(PatientSet patients); 
     233        public Map<Integer, Encounter> getEncountersByType(Cohort patients, List<EncounterType> encType); 
     234 
     235         
     236 
     237        /** 
     238         *  
     239         * @param patients 
     240         * @return 
     241         */ 
     242        @Transactional(readOnly=true) 
     243        public Map<Integer, Encounter> getEncounters(Cohort patients); 
    239244         
    240245        /** 
     
    246251        @Transactional(readOnly=true) 
    247252        public Map<Integer, Encounter> getFirstEncountersByType( 
    248                         PatientSet patients, EncounterType encType); 
     253                        Cohort patients, EncounterType encType); 
    249254         
    250255        /** 
     
    255260         */ 
    256261        @Transactional(readOnly=true) 
    257         public Map<Integer, Encounter> getFirstEncountersByType(PatientSet patients, List<EncounterType> types); 
     262        public Map<Integer, Encounter> getFirstEncountersByType(Cohort patients, List<EncounterType> types); 
    258263         
    259264 
     
    266271         */ 
    267272        @Transactional(readOnly=true) 
    268         public Map<Integer, Object> getFirstEncounterAttrsByType(PatientSet patients, List<EncounterType> encTypes, String attr); 
     273        public Map<Integer, Object> getFirstEncounterAttrsByType(Cohort patients, List<EncounterType> encTypes, String attr); 
    269274         
    270275         
     
    278283         */ 
    279284        @Transactional(readOnly=true) 
    280         public Map<Integer, Object> getPatientAttributes(PatientSet patients, 
     285        public Map<Integer, Object> getPatientAttributes(Cohort patients, 
    281286                        String className, String property, boolean returnAll); 
    282287 
     
    289294         */ 
    290295        @Transactional(readOnly=true) 
    291         public Map<Integer, Object> getPatientAttributes(PatientSet patients, 
     296        public Map<Integer, Object> getPatientAttributes(Cohort patients, 
    292297                        String classNameDotProperty, boolean returnAll); 
    293298 
     
    302307         * @return 
    303308         */@Transactional(readOnly=true) 
    304         public Map<Integer, Object> getPersonAttributes(PatientSet patients, 
     309        public Map<Integer, Object> getPersonAttributes(Cohort patients, 
    305310                        String attributeName, String joinClass, String joinProperty, String outputColumn, boolean returnAll); 
    306311         
     
    312317        @Transactional(readOnly=true) 
    313318        public Map<Integer, Map<String, Object>> getCharacteristics( 
    314                         PatientSet patients); 
     319                        Cohort patients); 
    315320 
    316321        /** 
     
    321326         */ 
    322327        @Transactional(readOnly=true) 
    323         public Map<Integer, PatientIdentifier> getPatientIdentifiersByType(PatientSet patients, PatientIdentifierType type); 
     328        public Map<Integer, PatientIdentifier> getPatientIdentifiersByType(Cohort patients, PatientIdentifierType type); 
    324329 
    325330 
     
    330335         */ 
    331336        @Transactional(readOnly=true) 
    332         public PatientSet convertPatientIdentifier(List<String> identifiers); 
     337        public Cohort convertPatientIdentifier(List<String> identifiers); 
    333338         
    334339        /** 
     
    344349         * @param ps 
    345350         */ 
    346         public void setMyPatientSet(PatientSet ps); 
    347  
    348         /** 
    349          *  
    350          * @return 
    351          */ 
    352         @Transactional(readOnly=true) 
    353         public PatientSet getMyPatientSet(); 
     351        public void setMyPatientSet(Cohort ps); 
     352 
     353        /** 
     354         *  
     355         * @return 
     356         */ 
     357        @Transactional(readOnly=true) 
     358        public Cohort getMyPatientSet(); 
    354359 
    355360        /** 
     
    368373 
    369374        @Transactional(readOnly=true) 
    370         public Map<Integer, PatientState> getCurrentStates(PatientSet ps, 
     375        public Map<Integer, PatientState> getCurrentStates(Cohort ps, 
    371376                        ProgramWorkflow wf); 
    372377 
    373378        @Transactional(readOnly=true) 
    374379        public Map<Integer, PatientProgram> getCurrentPatientPrograms( 
    375                         PatientSet ps, Program program); 
    376  
    377         @Transactional(readOnly=true) 
    378         public Map<Integer, PatientProgram> getPatientPrograms(PatientSet ps, 
     380                        Cohort ps, Program program); 
     381 
     382        @Transactional(readOnly=true) 
     383        public Map<Integer, PatientProgram> getPatientPrograms(Cohort ps, 
    379384                        Program program); 
    380385         
    381386        @Transactional(readOnly=true) 
    382         public Map<Integer, List<Relationship>> getRelationships(PatientSet ps, RelationshipType relType); 
    383  
    384         @Transactional(readOnly=true) 
    385         public Map<Integer, List<Person>> getRelatives(PatientSet ps, RelationshipType relType, boolean forwards); 
     387        public Map<Integer, List<Relationship>> getRelationships(Cohort ps, RelationshipType relType); 
     388 
     389        @Transactional(readOnly=true) 
     390        public Map<Integer, List<Person>> getRelatives(Cohort ps, RelationshipType relType, boolean forwards); 
    386391         
    387392        /** 
     
    389394         */ 
    390395        @Transactional(readOnly=true) 
    391         public Map<Integer, List<DrugOrder>> getCurrentDrugOrders(PatientSet ps, 
     396        public Map<Integer, List<DrugOrder>> getCurrentDrugOrders(Cohort ps, 
    392397                        Concept drugSet); 
    393398 
     
    396401         */ 
    397402        @Transactional(readOnly=true) 
    398         public Map<Integer, List<DrugOrder>> getDrugOrders(PatientSet ps, 
     403        public Map<Integer, List<DrugOrder>> getDrugOrders(Cohort ps, 
    399404                        Concept drugSet); 
    400          
    401         public void setMyPatientAnalysis(PatientAnalysis pa); 
    402  
    403         @Transactional(readOnly=true) 
    404         public PatientAnalysis getMyPatientAnalysis(); 
    405405 
    406406        /** 
     
    411411         */ 
    412412        @Transactional(readOnly=true) 
    413         public List<Encounter> getEncountersByForm(PatientSet patients, List<Form> form); 
    414                  
    415          
     413        public List<Encounter> getEncountersByForm(Cohort patients, List<Form> form); 
    416414         
    417415