← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12335: Analytics, enabled days keyword in indicators

 

------------------------------------------------------------
revno: 12335
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-09-30 15:56:22 +0200
message:
  Analytics, enabled days keyword in indicators
modified:
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.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-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2013-09-29 15:24:12 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2013-09-30 13:56:22 +0000
@@ -58,6 +58,7 @@
 import static org.hisp.dhis.period.PeriodType.getPeriodTypeFromIsoString;
 import static org.hisp.dhis.reporttable.ReportTable.IRT2D;
 import static org.hisp.dhis.reporttable.ReportTable.addIfEmpty;
+import static org.hisp.dhis.system.util.DateUtils.daysBetween;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -250,8 +251,10 @@
                     if ( valueMap != null )
                     {
                         Period period = filterPeriod != null ? filterPeriod : (Period) DimensionItem.getPeriodItem( options );
+
+                        int days = daysBetween( period.getStartDate(), period.getEndDate() );
                         
-                        Double value = expressionService.getIndicatorValue( indicator, period, valueMap, constantMap, null );
+                        Double value = expressionService.getIndicatorValue( indicator, period, valueMap, constantMap, days );
                         
                         if ( value != null )
                         {