← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9071: Remove option Organisation unit group set aggregation level from Automate Aggregate.

 

------------------------------------------------------------
revno: 9071
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-11-16 10:50:03 +0700
message:
  Remove option Organisation unit group set aggregation level from Automate Aggregate.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/scheduling/CaseAggregateConditionTask.java
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/schedule/GetScheduleAggQueryBuilderParamsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/schedule/ScheduleCaseAggregateConditionAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/scheduling.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewScheduledCaseAggTasks.vm


--
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/setting/SystemSettingManager.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java	2012-11-15 14:32:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java	2012-11-16 03:50:03 +0000
@@ -75,7 +75,6 @@
     final String KEY_PHONE_NUMBER_AREA_CODE = "phoneNumberAreaCode";
     final String KEY_MULTI_ORGANISATION_UNIT_FORMS = "multiOrganisationUnitForms";
     final String KEY_SCHEDULE_AGGREGATE_QUERY_BUILDER_TASKS = "scheduleAggregateQueryBuilder";
-    final String KEY_AGGREGATE_QUERY_BUILDER_ORGUNITGROUPSET_AGG_LEVEL = "aggQueryBuilderorgUnitGroupSetAggregationLevel";
     final String KEY_CONFIGURATION = "keyConfig";
     final String KEY_ACCOUNT_RECOVERY = "keyAccountRecovery";
 

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java	2012-11-12 05:15:33 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java	2012-11-16 03:50:03 +0000
@@ -892,7 +892,8 @@
     private String getConditionForProgram( String programId, String operator, int orgunitId, String startDate,
         String endDate )
     {
-        String sql = "SELECT distinct(pi.patientid) FROM programinstance as pi ";
+        String sql = "SELECT distinct(pi.patientid) FROM programinstance as pi "
+        	   + "inner join patient psi on psi.patientid=pi.patientid ";
 
         if ( operator.equals( AGGRERATION_SUM ) )
         {
@@ -900,7 +901,7 @@
                 + "INNER JOIN programstageinstance psi ON pi.programinstanceid=psi.programinstanceid ";
         }
 
-        return sql + "WHERE pi.programid=" + programId + " " + "AND psi.organisationunitid = " + orgunitId
+        return sql + "WHERE pi.programid=" + programId + " " + " AND psi.organisationunitid = " + orgunitId
             + " AND pi.enrollmentdate >= '" + startDate + "' AND pi.enrollmentdate <= '" + endDate + "' ";
     }
 

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/scheduling/CaseAggregateConditionTask.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/scheduling/CaseAggregateConditionTask.java	2012-10-26 08:30:46 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/scheduling/CaseAggregateConditionTask.java	2012-11-16 03:50:03 +0000
@@ -27,9 +27,6 @@
 
 package org.hisp.dhis.patient.scheduling;
 
-import static org.hisp.dhis.setting.SystemSettingManager.DEFAULT_ORGUNITGROUPSET_AGG_LEVEL;
-import static org.hisp.dhis.setting.SystemSettingManager.KEY_AGGREGATE_QUERY_BUILDER_ORGUNITGROUPSET_AGG_LEVEL;
-
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
@@ -52,7 +49,6 @@
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.period.RelativePeriods;
-import org.hisp.dhis.setting.SystemSettingManager;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.jdbc.support.rowset.SqlRowSet;
 
@@ -72,8 +68,6 @@
 
     private DataValueService dataValueService;
 
-    private SystemSettingManager systemSettingManager;
-
     private JdbcTemplate jdbcTemplate;
 
     private DataElementService dataElementService;
@@ -106,13 +100,12 @@
 
     public CaseAggregateConditionTask( OrganisationUnitService organisationUnitService,
         CaseAggregationConditionService aggregationConditionService, DataValueService dataValueService,
-        SystemSettingManager systemSettingManager, JdbcTemplate jdbcTemplate, DataElementService dataElementService,
-        DataElementCategoryService categoryService, DataSetService dataSetService )
+        JdbcTemplate jdbcTemplate, DataElementService dataElementService, DataElementCategoryService categoryService,
+        DataSetService dataSetService )
     {
         this.organisationUnitService = organisationUnitService;
         this.aggregationConditionService = aggregationConditionService;
         this.dataValueService = dataValueService;
-        this.systemSettingManager = systemSettingManager;
         this.jdbcTemplate = jdbcTemplate;
         this.dataElementService = dataElementService;
         this.categoryService = categoryService;
@@ -126,9 +119,7 @@
     @Override
     public void run()
     {
-        int level = (Integer) systemSettingManager.getSystemSetting(
-            KEY_AGGREGATE_QUERY_BUILDER_ORGUNITGROUPSET_AGG_LEVEL, DEFAULT_ORGUNITGROUPSET_AGG_LEVEL );
-        Collection<OrganisationUnit> orgunits = organisationUnitService.getOrganisationUnitsAtLevel( level );
+        Collection<OrganisationUnit> orgunits = organisationUnitService.getAllOrganisationUnits();
 
         // ---------------------------------------------------------------------
         // Get Period list in system-setting
@@ -195,7 +186,7 @@
                             // -----------------------------------------------------
                             // Update dataValue
                             // -----------------------------------------------------
-                            else if ( (double)resultValue != Double.parseDouble( dataValue.getValue() ) )
+                            else if ( (double) resultValue != Double.parseDouble( dataValue.getValue() ) )
                             {
                                 dataValue.setValue( "" + resultValue );
                                 dataValue.setTimestamp( new Date() );

=== 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-11-08 16:07:27 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml	2012-11-16 03:50:03 +0000
@@ -449,7 +449,6 @@
 		<constructor-arg ref="org.hisp.dhis.caseaggregation.CaseAggregationConditionService" />
 		<constructor-arg ref="org.hisp.dhis.datavalue.DataValueService" />
 		<constructor-arg ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
-		<constructor-arg ref="org.hisp.dhis.setting.SystemSettingManager" />
 		<constructor-arg ref="jdbcTemplate" />
 		<constructor-arg ref="org.hisp.dhis.dataelement.DataElementService" />
 		<constructor-arg ref="org.hisp.dhis.dataelement.DataElementCategoryService" />

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/schedule/GetScheduleAggQueryBuilderParamsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/schedule/GetScheduleAggQueryBuilderParamsAction.java	2012-10-25 13:31:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/schedule/GetScheduleAggQueryBuilderParamsAction.java	2012-11-16 03:50:03 +0000
@@ -27,15 +27,7 @@
 
 package org.hisp.dhis.patient.action.schedule;
 
-import static org.hisp.dhis.setting.SystemSettingManager.DEFAULT_ORGUNITGROUPSET_AGG_LEVEL;
-import static org.hisp.dhis.setting.SystemSettingManager.KEY_AGGREGATE_QUERY_BUILDER_ORGUNITGROUPSET_AGG_LEVEL;
-
-import java.util.List;
-
-import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
-import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.patient.scheduling.CaseAggregateConditionSchedulingManager;
-import org.hisp.dhis.setting.SystemSettingManager;
 import org.hisp.dhis.system.scheduling.Scheduler;
 
 import com.opensymphony.xwork2.Action;
@@ -53,52 +45,17 @@
     // Dependencies
     // -------------------------------------------------------------------------
 
-    private SystemSettingManager systemSettingManager;
-
-    public void setSystemSettingManager( SystemSettingManager systemSettingManager )
-    {
-        this.systemSettingManager = systemSettingManager;
-    }
-
     private CaseAggregateConditionSchedulingManager schedulingManager;
 
     public void setSchedulingManager( CaseAggregateConditionSchedulingManager schedulingManager )
     {
         this.schedulingManager = schedulingManager;
     }
-
-    private OrganisationUnitService organisationUnitService;
-
-    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
-    {
-        this.organisationUnitService = organisationUnitService;
-    }
-
+    
     // -------------------------------------------------------------------------
     // Output
     // -------------------------------------------------------------------------
 
-    private String scheduledPeriodType;
-
-    public String getScheduledPeriodType()
-    {
-        return scheduledPeriodType;
-    }
-
-    private Integer orgUnitGroupSetAggLevel;
-
-    public Integer getOrgUnitGroupSetAggLevel()
-    {
-        return orgUnitGroupSetAggLevel;
-    }
-
-    private String aggQueryBuilderStrategy;
-
-    public String getAggQueryBuilderStrategy()
-    {
-        return aggQueryBuilderStrategy;
-    }
-
     private String status;
 
     public String getStatus()
@@ -113,13 +70,6 @@
         return running;
     }
 
-    private List<OrganisationUnitLevel> levels;
-
-    public List<OrganisationUnitLevel> getLevels()
-    {
-        return levels;
-    }
-
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -128,15 +78,10 @@
     public String execute()
         throws Exception
     {
-        orgUnitGroupSetAggLevel = (Integer) systemSettingManager.getSystemSetting(
-            KEY_AGGREGATE_QUERY_BUILDER_ORGUNITGROUPSET_AGG_LEVEL, DEFAULT_ORGUNITGROUPSET_AGG_LEVEL );
-
         status = schedulingManager.getTaskStatus();
 
         running = Scheduler.STATUS_RUNNING.equals( status );
 
-        levels = organisationUnitService.getOrganisationUnitLevels();
-
         return SUCCESS;
     }
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/schedule/ScheduleCaseAggregateConditionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/schedule/ScheduleCaseAggregateConditionAction.java	2012-10-25 13:31:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/schedule/ScheduleCaseAggregateConditionAction.java	2012-11-16 03:50:03 +0000
@@ -27,13 +27,10 @@
 
 package org.hisp.dhis.patient.action.schedule;
 
-import static org.hisp.dhis.setting.SystemSettingManager.KEY_AGGREGATE_QUERY_BUILDER_ORGUNITGROUPSET_AGG_LEVEL;
-
 import java.util.HashMap;
 import java.util.Map;
 
 import org.hisp.dhis.patient.scheduling.CaseAggregateConditionSchedulingManager;
-import org.hisp.dhis.setting.SystemSettingManager;
 import org.hisp.dhis.system.scheduling.Scheduler;
 
 import com.opensymphony.xwork2.Action;
@@ -54,13 +51,6 @@
     // Dependencies
     // -------------------------------------------------------------------------
 
-    private SystemSettingManager systemSettingManager;
-
-    public void setSystemSettingManager( SystemSettingManager systemSettingManager )
-    {
-        this.systemSettingManager = systemSettingManager;
-    }
-
     private CaseAggregateConditionSchedulingManager schedulingManager;
 
     public void setSchedulingManager( CaseAggregateConditionSchedulingManager schedulingManager )
@@ -78,14 +68,7 @@
     {
         this.execute = execute;
     }
-
-    private Integer orgUnitGroupSetAggLevel;
-
-    public void setOrgUnitGroupSetAggLevel( Integer orgUnitGroupSetAggLevel )
-    {
-        this.orgUnitGroupSetAggLevel = orgUnitGroupSetAggLevel;
-    }
-
+    
     private String aggQueryBuilderStrategy;
 
     public void setAggQueryBuilderStrategy( String aggQueryBuilderStrategy )
@@ -124,10 +107,7 @@
             schedulingManager.executeTasks();
         }
         else
-        {
-            systemSettingManager.saveSystemSetting( KEY_AGGREGATE_QUERY_BUILDER_ORGUNITGROUPSET_AGG_LEVEL,
-                orgUnitGroupSetAggLevel );
-
+        {       
             if ( Scheduler.STATUS_RUNNING.equals( schedulingManager.getTaskStatus() ) )
             {
                 schedulingManager.stopTasks();

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml	2012-11-12 07:04:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml	2012-11-16 03:50:03 +0000
@@ -925,18 +925,12 @@
 	<bean id="org.hisp.dhis.patient.action.schedule.GetScheduleAggQueryBuilderParamsAction"
 		class="org.hisp.dhis.patient.action.schedule.GetScheduleAggQueryBuilderParamsAction"
 		scope="prototype">
-		<property name="systemSettingManager"
-			ref="org.hisp.dhis.setting.SystemSettingManager" />
 		<property name="schedulingManager" ref="org.hisp.dhis.patient.scheduling.CaseAggregateConditionSchedulingManager" />
-		<property name="organisationUnitService"
-			ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
 	</bean>
 	
 	<bean id="org.hisp.dhis.patient.action.schedule.ScheduleCaseAggregateConditionAction"
 		class="org.hisp.dhis.patient.action.schedule.ScheduleCaseAggregateConditionAction"
 		scope="prototype">
-		<property name="systemSettingManager"
-			ref="org.hisp.dhis.setting.SystemSettingManager" />
 		<property name="schedulingManager" ref="org.hisp.dhis.patient.scheduling.CaseAggregateConditionSchedulingManager" />
 	</bean>
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/scheduling.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/scheduling.js	2012-10-30 06:12:34 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/scheduling.js	2012-11-16 03:50:03 +0000
@@ -47,7 +47,6 @@
 {
 	$.post( 'scheduleCaseAggTasks.action',{
 		execute:false,
-		orgUnitGroupSetAggLevel:getFieldValue("orgUnitGroupSetAggLevel"),
 		aggQueryBuilderStrategy:getFieldValue("aggQueryBuilderStrategy")
 	}, function( json ){
 		var status = json.scheduleTasks.status;
@@ -74,7 +73,6 @@
 	{
 		$.post( 'scheduleCaseAggTasks.action',{
 			execute:true,
-			orgUnitGroupSetAggLevel:getFieldValue("orgUnitGroupSetAggLevel"),
 			aggQueryBuilderStrategy:getFieldValue("aggQueryBuilderStrategy")
 		},function( json ){
 			setMessage(i18n_execute_success);

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewScheduledCaseAggTasks.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewScheduledCaseAggTasks.vm	2012-11-02 15:59:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewScheduledCaseAggTasks.vm	2012-11-16 03:50:03 +0000
@@ -21,19 +21,6 @@
 	<td style="height:10px"></td>
 </tr>
 <tr>
-	<th>$i18n.getString( "organisation_unit_group_set_aggregation_level" )</th>
-</tr>
-<tr>
-	<td>
-		<select id="orgUnitGroupSetAggLevel" name="orgUnitGroupSetAggLevel" class="scheduling" style="width:100%">
-		<option value="0"#if( $orgUnitGroupSetAggLevel && $orgUnitGroupSetAggLevel == 0 ) selected="selected"#end>[$i18n.getString( "no_aggregation" )]</option>
-		#foreach( $level in $levels )
-		<option value="$level.level"#if( $orgUnitGroupSetAggLevel && $orgUnitGroupSetAggLevel == $level.level ) selected="selected"#end>$encoder.htmlEncode( $level.name )</option>
-		#end
-		</select>
-	</td>
-</tr>
-<tr>
 	<td style="height:10px"></td>
 </tr>
 <tr>