← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7705: Remove unused classes.

 

------------------------------------------------------------
revno: 7705
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-07-26 09:25:06 +0700
message:
  Remove unused classes.
removed:
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/aggregation/
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/aggregation/DefaultPatientDataValueAggregationEngine.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/aggregation/PatientDataValueAggregationEngine.java
  dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patientdatavalue/aggregation/
  dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patientdatavalue/aggregation/PatientDataValueAggregationEngineTest.java
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== removed directory 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/aggregation'
=== removed file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/aggregation/DefaultPatientDataValueAggregationEngine.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/aggregation/DefaultPatientDataValueAggregationEngine.java	2012-02-11 13:58:02 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/aggregation/DefaultPatientDataValueAggregationEngine.java	1970-01-01 00:00:00 +0000
@@ -1,123 +0,0 @@
-package org.hisp.dhis.patientdatavalue.aggregation;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-
-import org.amplecode.quick.StatementManager;
-import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.patient.PatientService;
-import org.hisp.dhis.period.Period;
-import org.hisp.dhis.period.PeriodService;
-import org.hisp.dhis.period.PeriodType;
-import org.hisp.dhis.system.util.DateUtils;
-import org.hisp.dhis.system.util.TextUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-
-@SuppressWarnings( "unused" )
-public class DefaultPatientDataValueAggregationEngine
-    implements PatientDataValueAggregationEngine
-{
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private PatientService patientService;
-
-    public void setPatientService( PatientService patientService )
-    {
-        this.patientService = patientService;
-    }
-
-    private PeriodService periodService;
-
-    public void setPeriodService( PeriodService periodService )
-    {
-        this.periodService = periodService;
-    }
-
-    private StatementManager statementManager;
-
-    public void setStatementManager( StatementManager statementManager )
-    {
-        this.statementManager = statementManager;
-    }
-
-    // -------------------------------------------------------------------------
-    // Implementation Action
-    // -------------------------------------------------------------------------
-
-    public void aggregate( Date startDate, Date endDate, OrganisationUnit organisationUnit )
-    {
-        Collection<DataElement> dataElements = null;
-
-        Collection<Integer> patients = null;
-
-        Collection<Period> periods = periodService.getPeriodsBetweenDates( startDate, endDate );
-    }
-
-    private void aggregate( DataElement dataElement, Period period,
-        Collection<Integer> patients )
-    {
-        // ---------------------------------------------------------------------
-        // sum - int
-        // ---------------------------------------------------------------------
-
-        String sql = "SELECT sum( value ) " + "FROM patientdatavalue " + "WHERE dataelementid = '"
-            + dataElement.getId() + "' " + "AND datetime > '" + DateUtils.getMediumDateString( period.getStartDate() )
-            + " " + "AND datetime <= " + DateUtils.getMediumDateString( period.getEndDate() ) + " "
-            + "AND patientid IN (" + TextUtils.getCommaDelimitedString( patients ) + ")";
-
-        // ---------------------------------------------------------------------
-        // sum - bool
-        // ---------------------------------------------------------------------
-
-        sql = "SELECT count( * ) " + "FROM patientdatavalue " + "WHERE dataelementid = '" + dataElement.getId() + "' "
-            + "AND datetime > '" + DateUtils.getMediumDateString( period.getStartDate() ) + " " + "AND datetime <= "
-            + DateUtils.getMediumDateString( period.getEndDate() ) + " " + "AND patientid IN ("
-            + TextUtils.getCommaDelimitedString( patients ) + ") " + "AND value='T'";
-    }
-
-    private Collection<Period> filterPeriods( Collection<Period> periods, PeriodType periodType )
-    {
-        Collection<Period> filteredPeriods = new ArrayList<Period>();
-
-        for ( Period period : periods )
-        {
-            if ( period.getPeriodType().equals( periodType ) )
-            {
-                filteredPeriods.add( period );
-            }
-        }
-
-        return filteredPeriods;
-    }
-}

=== removed file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/aggregation/PatientDataValueAggregationEngine.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/aggregation/PatientDataValueAggregationEngine.java	2012-01-11 05:31:53 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/aggregation/PatientDataValueAggregationEngine.java	1970-01-01 00:00:00 +0000
@@ -1,39 +0,0 @@
-package org.hisp.dhis.patientdatavalue.aggregation;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Date;
-
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-
-public interface PatientDataValueAggregationEngine
-{
-    String ID = PatientDataValueAggregationEngine.class.getName();
-
-    public void aggregate( Date startDate, Date endDate, OrganisationUnit organisationUnit );
-}

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml	2012-06-24 14:29:16 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml	2012-07-26 02:25:06 +0000
@@ -292,17 +292,7 @@
 		<property name="tabularReportStore"
 			ref="org.hisp.dhis.patientreport.PatientTabularReportStore" />
 	</bean>
-
-	<!-- Aggregation engine -->
-
-	<bean
-		id="org.hisp.dhis.patientdatavalue.aggregation.PatientDataValueAggregationEngine"
-		class="org.hisp.dhis.patientdatavalue.aggregation.DefaultPatientDataValueAggregationEngine">
-		<property name="statementManager" ref="statementManager" />
-		<property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
-		<property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
-	</bean>
-
+	
 	<!-- DeletionHandlers -->
 
 	<bean id="org.hisp.dhis.patient.PatientIdentifierDeletionHandler"

=== removed directory 'dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patientdatavalue/aggregation'
=== removed file 'dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patientdatavalue/aggregation/PatientDataValueAggregationEngineTest.java'
--- dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patientdatavalue/aggregation/PatientDataValueAggregationEngineTest.java	2012-02-11 13:58:02 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patientdatavalue/aggregation/PatientDataValueAggregationEngineTest.java	1970-01-01 00:00:00 +0000
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2004-2009, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.hisp.dhis.patientdatavalue.aggregation;
-
-import org.hisp.dhis.DhisSpringTest;
-import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.dataelement.DataElementCategoryService;
-import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.patient.Patient;
-import org.hisp.dhis.patient.PatientService;
-import org.hisp.dhis.patientdatavalue.PatientDataValue;
-import org.hisp.dhis.patientdatavalue.PatientDataValueStore;
-import org.junit.Test;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */   
-@SuppressWarnings( "unused" ) //TODO
-public class PatientDataValueAggregationEngineTest
-    extends DhisSpringTest
-{
-    private PatientDataValueStore patientDataValueStore;
-    
-    private PatientService patientService;
-    
-    private OrganisationUnitService organisationUnitService;
-    
-    private PatientDataValueAggregationEngine aggregationEngine;
-    
-    private DataElement dataElementA;
-    private DataElement dataElementB;
-    
-    private Patient patientA;
-    private Patient patientB;
-    
-    private PatientDataValue valueA;
-    private PatientDataValue valueB;
-    private PatientDataValue valueC;    
-    private PatientDataValue valueD;  
-    
-    private OrganisationUnit organisationUnit;
-    
-    @Override
-    public void setUpTest()
-    {
-        patientDataValueStore = (PatientDataValueStore) getBean( PatientDataValueStore.ID );
-        
-        dataElementService = (DataElementService) getBean( DataElementService.ID );
-        
-        categoryService = (DataElementCategoryService) getBean( DataElementCategoryService.ID );
-        
-        patientService = (PatientService) getBean( PatientService.ID );
-        
-        organisationUnitService = (OrganisationUnitService) getBean ( OrganisationUnitService.ID );
-        
-        aggregationEngine = (PatientDataValueAggregationEngine) getBean( PatientDataValueAggregationEngine.ID );
-        
-        dataElementA = createDataElement( 'A' );
-        dataElementB = createDataElement( 'B' );
-        
-        dataElementService.addDataElement( dataElementA );
-        dataElementService.addDataElement( dataElementB );
-        
-        organisationUnit = createOrganisationUnit( 'A' );
-        organisationUnitService.addOrganisationUnit( organisationUnit );
-        
-        patientA = createPatient( 'A', organisationUnit );
-        patientB = createPatient( 'B', organisationUnit );
-        
-        patientService.savePatient( patientA );
-        patientService.savePatient( patientB );
-        
-    }
-    
-    @Test
-    public void aggregate()
-    {
-         
-    }
-}