Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Changeset 3795

Show
Ignore:
Timestamp:
04/02/08 15:57:11 (9 months ago)
Author:
bwolfe
Message:

report_api_refactoring: Fixing some of the compile errors

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs/branches/report_api_refactoring/src/api/org/openmrs/Cohort.java

    r3791 r3795  
    4747        } 
    4848         
     49        /** 
     50         * Convenience constructor to create a Cohort object that 
     51         * has an primarykey/internal identifier of <code>cohortId</code> 
     52         *  
     53         * @param cohortId the internal identifier for this cohort 
     54         */ 
     55        public Cohort(Integer cohortId) { 
     56                this.cohortId = cohortId; 
     57        } 
     58         
    4959        public Cohort(Set<Integer> memberIds) { 
    5060                this.memberIds = memberIds; 
  • openmrs/branches/report_api_refactoring/src/api/org/openmrs/api/impl/CohortServiceImpl.java

    r3791 r3795  
    125125     * @see org.openmrs.api.CohortService#evaluate(org.openmrs.cohort.CohortDefinition, org.openmrs.report.EvaluationContext) 
    126126     */ 
    127     @Override 
    128127    public Cohort evaluate(CohortDefinition definition, EvaluationContext evalContext) throws APIException { 
    129128            CohortDefinitionProvider provider = getCohortDefinitionProvider(definition.getClass()); 
     
    136135     * @see org.openmrs.api.CohortService#getAllPatientsCohortDefinition() 
    137136     */ 
    138     @Override 
    139137    public CohortDefinition getAllPatientsCohortDefinition() { 
    140138            PatientSearch ps = new PatientSearch(); 
     
    146144     * @see org.openmrs.api.CohortService#getCohortDefinition(java.lang.Class, java.lang.Integer) 
    147145     */ 
    148     @Override 
    149146    public CohortDefinition getCohortDefinition(Class<CohortDefinition> clazz, Integer id) { 
    150147        CohortDefinitionProvider provider = getCohortDefinitionProvider(clazz); 
     
    155152     * @see org.openmrs.api.CohortService#getCohortDefinitions() 
    156153     */ 
    157     @Override 
    158154    public List<CohortDefinition> getAllCohortDefinitions() { 
    159155            List<CohortDefinition> ret = new ArrayList<CohortDefinition>(); 
     
    167163     * @see org.openmrs.api.CohortService#purgeCohortDefinition(org.openmrs.cohort.CohortDefinition) 
    168164     */ 
    169     @Override 
    170165    public void purgeCohortDefinition(CohortDefinition definition) { 
    171166        CohortDefinitionProvider provider = getCohortDefinitionProvider(definition.getClass()); 
     
    176171     * @see org.openmrs.api.CohortService#registerCohortDefinitionProvider(java.lang.Class) 
    177172     */ 
    178     @Override 
    179173    public void registerCohortDefinitionProvider(Class<? extends CohortDefinitionProvider> providerClass) { 
    180174            try { 
     
    190184     * @see org.openmrs.api.CohortService#removeCohortDefinitionProvider(java.lang.Class) 
    191185     */ 
    192     @Override 
    193186    public void removeCohortDefinitionProvider(Class<? extends CohortDefinitionProvider> providerClass) { 
    194187        for (Iterator<CohortDefinitionProvider> i = cohortDefinitionProviders.values().iterator(); i.hasNext(); ) { 
     
    201194     * @see org.openmrs.api.CohortService#saveCohortDefinition(org.openmrs.cohort.CohortDefinition) 
    202195     */ 
    203     @Override 
    204196    public CohortDefinition saveCohortDefinition(CohortDefinition definition) throws APIException { 
    205197        CohortDefinitionProvider provider = getCohortDefinitionProvider(definition.getClass()); 
  • openmrs/branches/report_api_refactoring/src/api/org/openmrs/cohort/api/impl/PatientSearchCohortDefinitionProvider.java

    r3794 r3795  
    3939     * @see org.openmrs.cohort.api.CohortDefinitionProvider#getClassHandled() 
    4040     */ 
    41     @Override 
    4241    public Class<? extends CohortDefinition> getClassHandled() { 
    4342            return PatientSearch.class; 
     
    4746         * @see org.openmrs.cohort.api.CohortDefinitionProvider#evaluate(org.openmrs.cohort.CohortDefinition, org.openmrs.report.EvaluationContext) 
    4847         */ 
    49         @Override 
    5048        public Cohort evaluate(CohortDefinition cohortDefinition, EvaluationContext evaluationContext) { 
    5149                PatientSearch search = (PatientSearch) cohortDefinition; 
     
    5957         * @see org.openmrs.cohort.api.CohortDefinitionProvider#getAllCohortDefinitions() 
    6058         */ 
    61         @Override 
    6259        public List<CohortDefinition> getAllCohortDefinitions() { 
    6360                List<CohortDefinition> ret = new ArrayList<CohortDefinition>(); 
     
    7269         * @see org.openmrs.cohort.api.CohortDefinitionProvider#getCohortDefinition(java.lang.Integer) 
    7370         */ 
    74         @Override 
    7571        public CohortDefinition getCohortDefinition(Integer id) { 
    7672                PatientSearchReportObject psro = (PatientSearchReportObject) Context.getReportObjectService().getReportObject(id); 
     
    8177         * @see org.openmrs.cohort.api.CohortDefinitionProvider#purgeCohortDefinition(org.openmrs.cohort.CohortDefinition) 
    8278         */ 
    83         @Override 
    8479        public void purgeCohortDefinition(CohortDefinition cohortDefinition) { 
    8580                throw new APIException("Not Yet Implemented"); 
     
    8984         * @see org.openmrs.cohort.api.CohortDefinitionProvider#saveCohortDefinition(org.openmrs.cohort.CohortDefinition) 
    9085         */ 
    91         @Override 
    9286        public CohortDefinition saveCohortDefinition(CohortDefinition cohortDefinition) { 
    9387                throw new APIException("Not Yet Implemented"); 
  • openmrs/branches/report_api_refactoring/test/api/org/openmrs/test/hackathon/PepfarReportSerializationTest.java

    r3762 r3795  
    2424import org.openmrs.Location; 
    2525import org.openmrs.User; 
    26 import org.openmrs.cohort.StaticCohort; 
     26import org.openmrs.Cohort; 
    2727import org.openmrs.dataset.CohortDataSetDefinition; 
    2828import org.openmrs.dataset.DataSetDefinition; 
     
    5656                cohortDataSetDef.setName("Sheet1"); 
    5757                 
    58                 cohortDataSetDef.addStrategy("1.a", new StaticCohort()); 
     58                cohortDataSetDef.addStrategy("1.a", new Cohort()); 
    5959                pepfarReportSchema.setDataSetDefinitions(dataSets); 
    6060                 
     
    7070                 
    7171                // add the rows (cohort) to the report 
    72                 StaticCohort inputStaticCohort = new StaticCohort(1); 
    73                 inputStaticCohort.addPersonId(1001); 
    74                 inputStaticCohort.addPersonId(1002); 
    75                 inputStaticCohort.addPersonId(1003); 
     72                Cohort inputStaticCohort = new Cohort(1); 
     73                inputStaticCohort.addMember(1001); 
     74                inputStaticCohort.addMember(1002); 
     75                inputStaticCohort.addMember(1003); 
    7676                pepfarReportSchema.setCohort(inputStaticCohort); 
    7777                 
     
    9595                assertTrue("The # of params shouldn't be: " + deserializedSchema.getParameters().size(), deserializedSchema.getParameters().size() == 3); 
    9696                assertTrue("The name shouldn't be: " + deserializedSchema.getName(), deserializedSchema.getName().equals("PEPFAR report")); 
    97                 int size = deserializedSchema.getCohort().getPersonIds(null).size(); 
     97                int size = deserializedSchema.getCohort().getMemberIds(null).size(); 
    9898                assertTrue("There should be 3 patients in the static cohort, not: " + size, size == 3); 
    9999