dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20906
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9758: Analytics, removing coc header if de is not present
------------------------------------------------------------
revno: 9758
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-02-07 09:41:13 +0200
message:
Analytics, removing coc header if de is not present
modified:
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.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-02-01 14:57:34 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java 2013-02-07 07:41:13 +0000
@@ -122,12 +122,18 @@
/**
* Creates a list of dimensions for use as headers. Will replace any of
* the indicator, data element or data set dimensions with the common
- * data x dimension.
+ * data x dimension. If the category option combo dimension is given but
+ * not the data element dimension, the former will be removed.
*/
public List<Dimension> getHeaderDimensions()
{
List<Dimension> list = new ArrayList<Dimension>( dimensions );
+ if ( list.contains( new Dimension( CATEGORYOPTIONCOMBO_DIM_ID ) ) && !list.contains( new Dimension( DATAELEMENT_DIM_ID ) ) )
+ {
+ list.remove( new Dimension( CATEGORYOPTIONCOMBO_DIM_ID ) );
+ }
+
ListIterator<Dimension> iter = list.listIterator();
dimensions : while ( iter.hasNext() )