dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #38083
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19442: Analytics, simplification
------------------------------------------------------------
revno: 19442
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-06-18 09:39:44 +0200
message:
Analytics, simplification
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 2015-06-18 06:21:45 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java 2015-06-18 07:39:44 +0000
@@ -506,14 +506,6 @@
return this;
}
-
- /**
- * Returns the index of the data element dimension in the dimension map.
- */
- public int getDataElementDimensionIndex()
- {
- return getDimensionIdentifiersAsList().indexOf( DATAELEMENT_DIM_ID );
- }
/**
* Returns the index of the data set dimension in the dimension map.
=== 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 2015-06-18 06:57:14 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java 2015-06-18 07:39:44 +0000
@@ -298,10 +298,7 @@
if ( !params.getIndicators().isEmpty() )
{
DataQueryParams dataSourceParams = params.instance();
- dataSourceParams.removeDimension( DATAELEMENT_DIM_ID );
- dataSourceParams.removeDimension( DATASET_DIM_ID );
- dataSourceParams.removeDimension( PROGRAM_DATAELEMENT_DIM_ID );
- dataSourceParams.removeDimension( PROGRAM_ATTRIBUTE_DIM_ID );
+ dataSourceParams.removeDimensions( DATAELEMENT_DIM_ID, DATASET_DIM_ID, PROGRAM_DATAELEMENT_DIM_ID, PROGRAM_ATTRIBUTE_DIM_ID );
List<Indicator> indicators = asTypedList( dataSourceParams.getIndicators() );
@@ -371,10 +368,7 @@
if ( !params.getDataElements().isEmpty() )
{
DataQueryParams dataSourceParams = params.instance();
- dataSourceParams.removeDimension( INDICATOR_DIM_ID );
- dataSourceParams.removeDimension( DATASET_DIM_ID );
- dataSourceParams.removeDimension( PROGRAM_DATAELEMENT_DIM_ID );
- dataSourceParams.removeDimension( PROGRAM_ATTRIBUTE_DIM_ID );
+ dataSourceParams.removeDimensions( INDICATOR_DIM_ID, DATASET_DIM_ID, PROGRAM_DATAELEMENT_DIM_ID, PROGRAM_ATTRIBUTE_DIM_ID );
Map<String, Object> aggregatedDataMap = getAggregatedDataValueMapObjectTyped( dataSourceParams );
@@ -399,9 +393,7 @@
if ( !params.getProgramDataElements().isEmpty() || !params.getProgramAttributes().isEmpty() )
{
DataQueryParams dataSourceParams = params.instance();
- dataSourceParams.removeDimension( INDICATOR_DIM_ID );
- dataSourceParams.removeDimension( DATASET_DIM_ID );
- dataSourceParams.removeDimension( DATAELEMENT_DIM_ID );
+ dataSourceParams.removeDimensions( INDICATOR_DIM_ID, DATASET_DIM_ID, DATAELEMENT_DIM_ID );
EventQueryParams eventQueryParams = EventQueryParams.fromDataQueryParams( dataSourceParams );
@@ -428,10 +420,7 @@
DataQueryParams dataSourceParams = params.instance();
dataSourceParams.ignoreDataApproval(); // No approval for reporting rates
- dataSourceParams.removeDimension( INDICATOR_DIM_ID );
- dataSourceParams.removeDimension( DATAELEMENT_DIM_ID );
- dataSourceParams.removeDimension( PROGRAM_DATAELEMENT_DIM_ID );
- dataSourceParams.removeDimension( PROGRAM_ATTRIBUTE_DIM_ID );
+ dataSourceParams.removeDimensions( INDICATOR_DIM_ID, DATAELEMENT_DIM_ID, PROGRAM_DATAELEMENT_DIM_ID, PROGRAM_ATTRIBUTE_DIM_ID );
dataSourceParams.setAggregationType( AggregationType.COUNT );
if ( !COMPLETENESS_DIMENSION_TYPES.containsAll( dataSourceParams.getDimensionTypes() ) )