← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9543: Analytics, indicator supported done for now

 

------------------------------------------------------------
revno: 9543
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-01-17 15:59:00 +0100
message:
  Analytics, indicator supported done for now
modified:
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java
  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/DataQueryParams.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2013-01-17 14:26:35 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2013-01-17 14:59:00 +0000
@@ -180,9 +180,11 @@
     /**
      * Returns the index of the indicator dimension in the dimension map.
      */
-    public int getIndicatorDimensionIndex()
+    public int getDataElementOrIndicatorDimensionIndex()
     {
-        return getAllDimensionNamesAsList().indexOf( INDICATOR_DIM_ID );
+        List<String> dims = getAllDimensionNamesAsList();
+        
+        return dims.contains( DATAELEMENT_DIM_ID ) ? dims.indexOf( DATAELEMENT_DIM_ID ) : dims.indexOf( INDICATOR_DIM_ID );
     }
     
     /**

=== 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-01-17 14:26:35 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2013-01-17 14:59:00 +0000
@@ -133,7 +133,7 @@
         {         
             Map<String, Double> constantMap = constantService.getConstantMap();
 
-            int indicatorIndex = params.getIndicatorDimensionIndex();
+            int indicatorIndex = params.getDataElementOrIndicatorDimensionIndex();
             
             DataQueryParams dataSourceParams = setDataElementsFromIndicators( params );