← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10411: Remove unused methods (tracker).

 

------------------------------------------------------------
revno: 10411
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-03-25 10:32:55 +0700
message:
  Remove unused methods (tracker).
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java


--
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
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java	2013-03-11 16:07:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java	2013-03-25 03:32:55 +0000
@@ -116,18 +116,9 @@
         I18n i18n );
 
     // -------------------------------------------------------------------------
-    // Activity plans
+    // Statistical
     // -------------------------------------------------------------------------
-
-    List<ProgramStageInstance> activityPlanList( Program program, Collection<Integer> orgunitIds, Date startDate,
-        Date endDate, Collection<Integer> statusList, Integer min, Integer max );
-
-    Grid activityPlans( Program program, Collection<Integer> orgunitIds, Date startDate, Date endDate,
-        Collection<Integer> statusList, Integer min, Integer max, I18n i18n );
-
-    int getActiveInstanceCount( Program program, Collection<Integer> orgunitIds, Date startDate, Date endDate,
-        Collection<Integer> statusList );
-
+    
     Collection<ProgramStageInstance> getProgramStageInstances( Program program, Collection<Integer> orgunitIds,
         Date startDate, Date endDate, Boolean completed );
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java	2013-03-11 16:07:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java	2013-03-25 03:32:55 +0000
@@ -110,13 +110,7 @@
     // -------------------------------------------------------------------------
     // Activity plans
     // -------------------------------------------------------------------------
-
-    List<ProgramStageInstance> getActiveInstance( Program program, Collection<Integer> orgunitIds, Date startDate,
-        Date endDate, Collection<Integer> statusList, Integer max, Integer min );
-
-    int getActiveInstanceCount( Program program, Collection<Integer> orgunitIds, Date startDate, Date endDate,
-        Collection<Integer> statusList );
-
+    
     Collection<ProgramStageInstance> get( Program program, Collection<Integer> orgunitIds, Date startDate,
         Date endDate, Boolean completed );
 

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java	2013-03-13 07:26:34 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java	2013-03-25 03:32:55 +0000
@@ -42,15 +42,12 @@
 import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.patient.Patient;
-import org.hisp.dhis.patient.PatientIdentifier;
-import org.hisp.dhis.patient.PatientIdentifierType;
 import org.hisp.dhis.patientdatavalue.PatientDataValue;
 import org.hisp.dhis.patientdatavalue.PatientDataValueService;
 import org.hisp.dhis.patientreport.TabularReportColumn;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.sms.outbound.OutboundSms;
 import org.hisp.dhis.system.grid.ListGrid;
-import org.hisp.dhis.system.util.DateUtils;
 import org.springframework.transaction.annotation.Transactional;
 
 /**
@@ -491,76 +488,6 @@
             deSum, deFilters, periods, aggregateType, limit, useCompletedEvents, format, i18n );
     }
 
-    public List<ProgramStageInstance> activityPlanList( Program program, Collection<Integer> orgunitIds,
-        Date startDate, Date endDate, Collection<Integer> statusList, Integer min, Integer max )
-    {
-        return programStageInstanceStore.getActiveInstance( program, orgunitIds, startDate, endDate, statusList, max,
-            min );
-    }
-
-    @Override
-    public Grid activityPlans( Program program, Collection<Integer> orgunitIds, Date startDate, Date endDate,
-        Collection<Integer> statusList, Integer min, Integer max, I18n i18n )
-    {
-        List<ProgramStageInstance> stageInstances = programStageInstanceStore.getActiveInstance( program, orgunitIds,
-            startDate, endDate, statusList, max, min );
-
-        Grid grid = new ListGrid();
-        grid.setTitle( program.getDisplayName() );
-        grid.setSubtitle( i18n.getString( "from" ) + " : " + DateUtils.getMediumDateString( startDate ) + " "
-            + i18n.getString( "to" ) + " : " + DateUtils.getMediumDateString( endDate ) );
-
-        List<PatientIdentifierType> identifierTypes = program.getPatientIdentifierTypes();
-
-        // Header
-        grid.addHeader( new GridHeader( i18n.getString( "date_scheduled" ), false, false ) );
-        grid.addHeader( new GridHeader( i18n.getString( "orgunit" ), false, false ) );
-        grid.addHeader( new GridHeader( i18n.getString( "full_name" ), false, false ) );
-        grid.addHeader( new GridHeader( i18n.getString( "phone_number" ), false, false ) );
-        grid.addHeader( new GridHeader( i18n.getString( "program_stage" ), false, false ) );
-
-        for ( ProgramStageInstance stageInstance : stageInstances )
-        {
-            Patient patient = stageInstance.getProgramInstance().getPatient();
-            String displayPatientName = patient.getFullName();
-            for ( PatientIdentifierType identifierType : identifierTypes )
-            {
-                for ( PatientIdentifier identifier : patient.getIdentifiers() )
-                {
-                    if ( identifier.getIdentifierType() != null
-                        && identifier.getIdentifierType().getId() == identifierType.getId() )
-                    {
-                        displayPatientName = identifier.getIdentifier();
-                        break;
-                    }
-                }
-            }
-
-            grid.addRow();
-            grid.addValue( DateUtils.getMediumDateString( stageInstance.getDueDate() ) );
-            if ( stageInstance.getExecutionDate() != null )
-            {
-                grid.addValue( stageInstance.getOrganisationUnit().getName() );
-            }
-            else
-            {
-                grid.addValue( patient.getOrganisationUnit().getName() );
-            }
-            grid.addValue( displayPatientName );
-            grid.addValue( patient.getPhoneNumber() );
-            grid.addValue( stageInstance.getProgramStage().getDisplayName() );
-        }
-
-        return grid;
-    }
-
-    @Override
-    public int getActiveInstanceCount( Program program, Collection<Integer> orgunitIds, Date startDate, Date endDate,
-        Collection<Integer> statusList )
-    {
-        return programStageInstanceStore.getActiveInstanceCount( program, orgunitIds, startDate, endDate, statusList );
-    }
-
     @Override
     public int getOverDueEventCount( ProgramStage programStage, Collection<Integer> orgunitIds, Date startDate,
         Date endDate )

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java	2013-03-20 13:45:53 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java	2013-03-25 03:32:55 +0000
@@ -42,7 +42,6 @@
 
 import org.hibernate.Criteria;
 import org.hibernate.Query;
-import org.hibernate.criterion.Disjunction;
 import org.hibernate.criterion.Order;
 import org.hibernate.criterion.Projections;
 import org.hibernate.criterion.Restrictions;
@@ -696,24 +695,6 @@
         return grid;
     }
 
-    @SuppressWarnings( "unchecked" )
-    public List<ProgramStageInstance> getActiveInstance( Program program, Collection<Integer> orgunitIds,
-        Date startDate, Date endDate, Collection<Integer> statusList, Integer max, Integer min )
-    {
-        return getActiveInstanceCriteria( program, orgunitIds, startDate, endDate, statusList, max, min ).list();
-    }
-
-    @SuppressWarnings( "unchecked" )
-    public int getActiveInstanceCount( Program program, Collection<Integer> orgunitIds, Date startDate, Date endDate,
-        Collection<Integer> statusList )
-    {
-        Criteria criteria = getActiveInstanceCriteria( program, orgunitIds, startDate, endDate, statusList, null, null );
-
-        List<ProgramStageInstance> list = criteria.list();
-
-        return list != null ? list.size() : 0;
-    }
-
     public int getOverDueCount( ProgramStage programStage, Collection<Integer> orgunitIds, Date startDate, Date endDate )
     {
         Calendar yesterday = Calendar.getInstance();
@@ -2157,61 +2138,5 @@
             ex.printStackTrace();
         }
     }
-
-    private Criteria getActiveInstanceCriteria( Program program, Collection<Integer> orgunitIds, Date startDate,
-        Date endDate, Collection<Integer> statusList, Integer max, Integer min )
-    {
-        Criteria criteria = getCriteria();
-        criteria.createAlias( "programInstance", "programInstance" );
-        criteria.createAlias( "programStage", "programStage" );
-        criteria.createAlias( "programInstance.patient", "patient" );
-        criteria.createAlias( "patient.organisationUnit", "regOrgunit" );
-        criteria.add( Restrictions.eq( "programInstance.program", program ) );
-        criteria.add( Restrictions.isNull( "programInstance.endDate" ) );
-
-        Disjunction disjunction = Restrictions.disjunction();
-
-        for ( Integer status : statusList )
-        {
-            switch ( status )
-            {
-            case ProgramStageInstance.COMPLETED_STATUS:
-                disjunction.add( Restrictions.and( Restrictions.eq( "completed", true ),
-                    Restrictions.between( "executionDate", startDate, endDate ),
-                    Restrictions.in( "organisationUnit.id", orgunitIds ) ) );
-                break;
-            case ProgramStageInstance.VISITED_STATUS:
-                disjunction.add( Restrictions.and( Restrictions.eq( "completed", false ),
-                    Restrictions.between( "executionDate", startDate, endDate ),
-                    Restrictions.in( "organisationUnit.id", orgunitIds ) ) );
-                break;
-            case ProgramStageInstance.FUTURE_VISIT_STATUS:
-                disjunction.add( Restrictions.and( Restrictions.isNull( "executionDate" ),
-                    Restrictions.between( "dueDate", new Date(), endDate ),
-                    Restrictions.in( "regOrgunit.id", orgunitIds ) ) );
-                break;
-            case ProgramStageInstance.LATE_VISIT_STATUS:
-                disjunction.add( Restrictions.and( Restrictions.isNull( "executionDate" ),
-                    Restrictions.between( "dueDate", startDate, new Date() ),
-                    Restrictions.in( "regOrgunit.id", orgunitIds ) ) );
-                break;
-            default:
-                break;
-            }
-        }
-
-        criteria.add( disjunction );
-
-        if ( min != null && max != null )
-        {
-            criteria.setFirstResult( min );
-            criteria.setMaxResults( max );
-        }
-
-        criteria.addOrder( Order.asc( "executionDate" ) );
-        criteria.addOrder( Order.asc( "dueDate" ) );
-        criteria.addOrder( Order.asc( "programStage.minDaysFromStart" ) );
-
-        return criteria;
-    }
+    
 }