dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #22772
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11051: Analytics, added constraint that data sets canno be specified as filters. Having multiple data se...
------------------------------------------------------------
revno: 11051
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-05-28 15:48:36 +0200
message:
Analytics, added constraint that data sets canno be specified as filters. Having multiple data sets with various period types as filter for a table does not make sense.
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
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultQueryPlanner.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-05-28 11:35:56 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java 2013-05-28 13:48:36 +0000
@@ -539,7 +539,7 @@
}
/**
- * Generates all permutations of the dimension and filter options for this query.
+ * Generates all permutations of the dimension options for this query.
* Ignores the data element, category option combo and indicator dimensions.
*/
public List<List<DimensionItem>> getDimensionItemPermutations()
=== 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-05-28 11:35:56 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java 2013-05-28 13:48:36 +0000
@@ -322,9 +322,9 @@
if ( target != null && entry.getValue() != null )
{
PeriodType queryPt = PeriodType.getPeriodTypeFromIsoString( dataRow.get( periodIndex ) );
- PeriodType dataPt = dsPtMap.get( dataRow.get( dataSetIndex ) );
+ PeriodType dataSetPt = dsPtMap.get( dataRow.get( dataSetIndex ) );
- target = target * queryPt.getPeriodSpan( dataPt );
+ target = target * queryPt.getPeriodSpan( dataSetPt );
double value = entry.getValue() * PERCENT / target;
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultQueryPlanner.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultQueryPlanner.java 2013-05-28 11:35:56 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultQueryPlanner.java 2013-05-28 13:48:36 +0000
@@ -116,6 +116,11 @@
{
violation = "Indicators cannot be specified as filter";
}
+
+ if ( params.getFilters().contains( new BaseDimensionalObject( DATASET_DIM_ID ) ) )
+ {
+ violation = "Data sets cannot be specified as filter";
+ }
if ( params.getFilters().contains( new BaseDimensionalObject( CATEGORYOPTIONCOMBO_DIM_ID ) ) )
{