← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2954: Improved performance of completeness report

 

------------------------------------------------------------
revno: 2954
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-03-01 20:44:03 +0100
message:
  Improved performance of completeness report
modified:
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/impl/AbstractDataSetCompletenessService.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-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/impl/AbstractDataSetCompletenessService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/impl/AbstractDataSetCompletenessService.java	2011-03-01 19:32:40 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/impl/AbstractDataSetCompletenessService.java	2011-03-01 19:44:03 +0000
@@ -226,9 +226,9 @@
         int days = (Integer) systemSettingManager.getSystemSetting( KEY_COMPLETENESS_OFFSET, DEFAULT_COMPLETENESS_OFFSET );        
         Date deadline = getDeadline( period, days );
         
-        final Collection<Integer> children = getIdentifiers( OrganisationUnit.class, organisationUnitService.getOrganisationUnitWithChildren( organisationUnitId ) );
+        final Collection<Integer> children = organisationUnitService.getOrganisationUnitHierarchy().getChildren( organisationUnitId );
         
-        final Collection<DataSet> dataSets = dataSetService.getAllDataSets(); // getDataSetsBySources( children ); TODO fix?
+        final Collection<DataSet> dataSets = dataSetService.getAllDataSets();
         
         final Collection<DataSetCompletenessResult> results = new ArrayList<DataSetCompletenessResult>();
         
@@ -270,11 +270,9 @@
         
         final Collection<DataSetCompletenessResult> results = new ArrayList<DataSetCompletenessResult>();
         
-        Collection<Integer> children = null;
-        
         for ( final OrganisationUnit unit : units )
         {
-            children = getIdentifiers( OrganisationUnit.class, organisationUnitService.getOrganisationUnitWithChildren( unit.getId() ) );
+            final Collection<Integer> children = organisationUnitService.getOrganisationUnitHierarchy().getChildren( unit.getId() );
             
             final DataSetCompletenessResult result = new DataSetCompletenessResult();
 
@@ -298,8 +296,8 @@
     }
 
     public DataSetCompletenessResult getDataSetCompleteness( Period period, Date deadline, OrganisationUnit unit, DataSet dataSet )
-    {        
-        final Collection<Integer> children = getIdentifiers( OrganisationUnit.class, organisationUnitService.getOrganisationUnitWithChildren( unit.getId() ) );
+    {
+        final Collection<Integer> children = organisationUnitService.getOrganisationUnitHierarchy().getChildren( unit.getId() );
         
         final DataSetCompletenessResult result = new DataSetCompletenessResult();