dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #13724
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4477: Data mart, filtering out future periods
------------------------------------------------------------
revno: 4477
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-08-29 21:26:15 +0200
message:
Data mart, filtering out future periods
modified:
dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataMartTask.java
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataSetCompletenessTask.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-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java 2011-08-28 17:52:59 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java 2011-08-29 19:26:15 +0000
@@ -52,9 +52,11 @@
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.period.Period;
import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.system.filter.PastAndCurrentPeriodFilter;
import org.hisp.dhis.system.util.Clock;
import org.hisp.dhis.system.util.ConcurrentUtils;
import org.hisp.dhis.system.util.ConversionUtils;
+import org.hisp.dhis.system.util.FilterUtils;
import org.hisp.dhis.system.util.PaginatedList;
import org.hisp.dhis.system.util.SystemUtils;
import org.springframework.transaction.annotation.Transactional;
@@ -191,6 +193,14 @@
clock.logTime( "Filtered data elements, number of operands: " + allOperands.size() );
// ---------------------------------------------------------------------
+ // Filter out future periods
+ // ---------------------------------------------------------------------
+
+ FilterUtils.filter( periods, new PastAndCurrentPeriodFilter() );
+
+ clock.logTime( "Number of periods: " + periods.size() );
+
+ // ---------------------------------------------------------------------
// Remove operands without data
// ---------------------------------------------------------------------
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataMartTask.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataMartTask.java 2011-02-03 20:15:02 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataMartTask.java 2011-08-29 19:26:15 +0000
@@ -70,7 +70,7 @@
Collection<Integer> indicatorIds = ConversionUtils.getIdentifiers( Indicator.class, indicatorService.getAllIndicators() );
Collection<Integer> organisationUnitIds = ConversionUtils.getIdentifiers( OrganisationUnit.class, organisationUnitService.getAllOrganisationUnits() );
- RelativePeriods relatives = new RelativePeriods( false, true, true, true, true, true, true );
+ RelativePeriods relatives = new RelativePeriods( false, true, true, true, false, false, false );
dataMartService.export( dataElementIds, indicatorIds, new HashSet<Integer>(), organisationUnitIds, relatives, true );
}
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataSetCompletenessTask.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataSetCompletenessTask.java 2011-02-03 20:15:02 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataSetCompletenessTask.java 2011-08-29 19:26:15 +0000
@@ -63,7 +63,7 @@
Collection<Integer> dataSetIds = ConversionUtils.getIdentifiers( DataSet.class, dataSetService.getAllDataSets() );
Collection<Integer> organisationUnitIds = ConversionUtils.getIdentifiers( OrganisationUnit.class, organisationUnitService.getAllOrganisationUnits() );
- RelativePeriods relatives = new RelativePeriods( false, true, true, true, true, true, true );
+ RelativePeriods relatives = new RelativePeriods( false, true, true, true, false, false, false );
completenessService.exportDataSetCompleteness( dataSetIds, relatives, organisationUnitIds );
}