dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #24972
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12294: Event analytics, using dimension instead of item for consistency
------------------------------------------------------------
revno: 12294
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2013-09-28 17:06:20 +0200
message:
Event analytics, using dimension instead of item for consistency
modified:
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsService.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/MockAnalyticsService.java
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventAnalyticsService.java
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventQueryParams.java
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java
dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/event/data/EventQueryPlannerTest.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/EventAnalyticsController.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js
--
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/AnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsService.java 2013-09-11 20:04:18 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsService.java 2013-09-28 15:06:20 +0000
@@ -28,11 +28,13 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.hisp.dhis.common.BaseAnalyticalObject;
+import org.hisp.dhis.common.DimensionalObject;
import org.hisp.dhis.common.Grid;
import org.hisp.dhis.i18n.I18nFormat;
@@ -160,4 +162,24 @@
* @return a data query parameter object created based on the given BaseAnalyticalObject.
*/
DataQueryParams getFromAnalyticalObject( BaseAnalyticalObject object, I18nFormat format );
+
+ /**
+ * Returns a list of persisted DimensionalObjects generated from the given
+ * dimension identifier and list of dimension options. The dx dimension
+ * will be exploded into concrete in|de|ds object identifiers and returned
+ * as separate DimensionalObjects.
+ *
+ * For the pe dimension items, relative periods represented by enums will be
+ * replaced by real ISO periods relative to the current date. For the ou
+ * dimension items, the user organisation unit enums
+ * USER_ORG_UNIT|USER_ORG_UNIT_CHILDREN will be replaced by the persisted
+ * organisation units for the current user.
+ *
+ * @param dimension the dimension identifier.
+ * @param items the dimension items.
+ * @param relativePeriodDate the date to use for generating relative periods, can be null.
+ * @parma format the I18nFormat, can be null.
+ * @return list of DimensionalObjects.
+ */
+ List<DimensionalObject> getDimension( String dimension, List<String> items, Date relativePeriodDate, I18nFormat format );
}
=== 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-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java 2013-09-28 15:06:20 +0000
@@ -656,29 +656,7 @@
return params;
}
- // -------------------------------------------------------------------------
- // Supportive methods
- // -------------------------------------------------------------------------
-
- /**
- * Returns a list of persisted DimensionalObjects generated from the given
- * dimension identifier and list of dimension options. The dx dimension
- * will be exploded into concrete in|de|ds object identifiers and returned
- * as separate DimensionalObjects.
- *
- * For the pe dimension items, relative periods represented by enums will be
- * replaced by real ISO periods relative to the current date. For the ou
- * dimension items, the user organisation unit enums
- * USER_ORG_UNIT|USER_ORG_UNIT_CHILDREN will be replaced by the persisted
- * organisation units for the current user.
- *
- * @param dimension the dimension identifier.
- * @param items the dimension items.
- * @param relativePeriodDate the date to use for generating relative periods, can be null.
- * @parma format the I18nFormat, can be null.
- * @return list of DimensionalObjects.
- */
- private List<DimensionalObject> getDimension( String dimension, List<String> items, Date relativePeriodDate, I18nFormat format )
+ public List<DimensionalObject> getDimension( String dimension, List<String> items, Date relativePeriodDate, I18nFormat format )
{
if ( DATA_X_DIM_ID.equals( dimension ) )
{
@@ -918,7 +896,11 @@
throw new IllegalQueryException( "Dimension identifier does not reference any dimension: " + dimension );
}
-
+
+ // -------------------------------------------------------------------------
+ // Supportive methods
+ // -------------------------------------------------------------------------
+
private DataQueryParams replaceIndicatorsWithDataElements( DataQueryParams params, int indicatorIndex )
{
List<Indicator> indicators = asTypedList( params.getIndicators() );
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/MockAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/MockAnalyticsService.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/MockAnalyticsService.java 2013-09-28 15:06:20 +0000
@@ -28,6 +28,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -37,6 +38,7 @@
import org.hisp.dhis.analytics.AnalyticsService;
import org.hisp.dhis.analytics.DataQueryParams;
import org.hisp.dhis.common.BaseAnalyticalObject;
+import org.hisp.dhis.common.DimensionalObject;
import org.hisp.dhis.common.Grid;
import org.hisp.dhis.i18n.I18nFormat;
@@ -89,4 +91,11 @@
{
throw new NotImplementedException();
}
+
+ @Override
+ public List<DimensionalObject> getDimension( String dimension, List<String> items, Date relativePeriodDate,
+ I18nFormat format )
+ {
+ throw new NotImplementedException();
+ }
}
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventAnalyticsService.java 2013-09-27 18:32:05 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventAnalyticsService.java 2013-09-28 15:06:20 +0000
@@ -41,9 +41,9 @@
Grid getEvents( EventQueryParams params );
- EventQueryParams getFromUrl( String program, String stage, String startDate, String endDate, String ou, String ouMode,
- Set<String> item );
+ EventQueryParams getFromUrl( String program, String stage, String startDate, String endDate,
+ Set<String> dimension, String ouMode );
- EventQueryParams getFromUrl( String program, String stage, String startDate, String endDate, String ou, String ouMode,
- Set<String> item, Set<String> asc, Set<String> desc, Integer page, Integer pageSize );
+ EventQueryParams getFromUrl( String program, String stage, String startDate, String endDate,
+ Set<String> dimension, String ouMode, Set<String> asc, Set<String> desc, Integer page, Integer pageSize );
}
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventQueryParams.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventQueryParams.java 2013-09-27 18:32:05 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventQueryParams.java 2013-09-28 15:06:20 +0000
@@ -34,6 +34,11 @@
import java.util.List;
import java.util.Set;
+import org.hisp.dhis.common.BaseDimensionalObject;
+import org.hisp.dhis.common.DimensionType;
+import org.hisp.dhis.common.DimensionalObject;
+import org.hisp.dhis.common.NameableObject;
+import org.hisp.dhis.common.NameableObjectUtils;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramStage;
@@ -56,13 +61,13 @@
private Date endDate;
private List<QueryItem> items = new ArrayList<QueryItem>();
+
+ private List<DimensionalObject> dimensions = new ArrayList<DimensionalObject>();
private List<String> asc = new ArrayList<String>();
private List<String> desc = new ArrayList<String>();
- private List<OrganisationUnit> organisationUnits = new ArrayList<OrganisationUnit>();
-
private String organisationUnitMode;
private String tableName;
@@ -94,9 +99,9 @@
this.startDate = params.getStartDate();
this.endDate = params.getEndDate();
this.items = new ArrayList<QueryItem>( params.getItems() );
+ this.dimensions = new ArrayList<DimensionalObject>( params.getDimensions() );
this.asc = new ArrayList<String>( params.getAsc() );
this.desc = new ArrayList<String>( params.getDesc() );
- this.organisationUnits = new ArrayList<OrganisationUnit>( params.getOrganisationUnits() );
this.organisationUnitMode = params.getOrganisationUnitMode();
this.tableName = params.getTableName();
this.page = params.getPage();
@@ -113,12 +118,39 @@
{
return organisationUnitMode != null && organisationUnitMode.equalsIgnoreCase( mode );
}
+
+ public List<OrganisationUnit> getOrganisationUnits()
+ {
+ int index = dimensions.indexOf( new BaseDimensionalObject( DimensionalObject.ORGUNIT_DIM_ID ) );
+ return NameableObjectUtils.asTypedList( dimensions.get( index ).getItems() );
+ }
+
+ public void setOrganisationUnits( List<OrganisationUnit> organisationUnits )
+ {
+ setDimensionOptions( DimensionalObject.ORGUNIT_DIM_ID, DimensionType.ORGANISATIONUNIT, null, organisationUnits );
+ }
+
+ private EventQueryParams setDimensionOptions( String dimension, DimensionType type, String dimensionName, List<? extends NameableObject> options )
+ {
+ int index = dimensions.indexOf( new BaseDimensionalObject( dimension ) );
+
+ if ( index != -1 )
+ {
+ dimensions.set( index, new BaseDimensionalObject( dimension, type, dimensionName, options ) );
+ }
+ else
+ {
+ dimensions.add( new BaseDimensionalObject( dimension, type, dimensionName, options ) );
+ }
+
+ return this;
+ }
public Set<OrganisationUnit> getOrganisationUnitChildren()
{
Set<OrganisationUnit> children = new HashSet<OrganisationUnit>();
- for ( OrganisationUnit unit : organisationUnits )
+ for ( OrganisationUnit unit : getOrganisationUnits() )
{
children.addAll( unit.getChildren() );
}
@@ -210,6 +242,16 @@
return asc;
}
+ public List<DimensionalObject> getDimensions()
+ {
+ return dimensions;
+ }
+
+ public void setDimensions( List<DimensionalObject> dimensions )
+ {
+ this.dimensions = dimensions;
+ }
+
public void setAsc( List<String> asc )
{
this.asc = asc;
@@ -225,16 +267,6 @@
this.desc = desc;
}
- public List<OrganisationUnit> getOrganisationUnits()
- {
- return organisationUnits;
- }
-
- public void setOrganisationUnits( List<OrganisationUnit> organisationUnits )
- {
- this.organisationUnits = organisationUnits;
- }
-
public String getOrganisationUnitMode()
{
return organisationUnitMode;
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java 2013-09-28 13:59:45 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java 2013-09-28 15:06:20 +0000
@@ -39,6 +39,7 @@
import java.util.Set;
import org.hisp.dhis.analytics.AnalyticsService;
+import org.hisp.dhis.analytics.DataQueryParams;
import org.hisp.dhis.analytics.IllegalQueryException;
import org.hisp.dhis.analytics.event.EventAnalyticsManager;
import org.hisp.dhis.analytics.event.EventAnalyticsService;
@@ -100,6 +101,9 @@
@Autowired
private EventAnalyticsManager analyticsManager;
+
+ @Autowired
+ private AnalyticsService analyticsService;
// -------------------------------------------------------------------------
// EventAnalyticsService implementation
@@ -213,13 +217,13 @@
}
public EventQueryParams getFromUrl( String program, String stage, String startDate, String endDate,
- String ou, String ouMode, Set<String> item )
+ Set<String> dimension, String ouMode )
{
- return getFromUrl( program, stage, startDate, endDate, ou, ouMode, item, null, null, null, null );
+ return getFromUrl( program, stage, startDate, endDate, dimension, ouMode, null, null, null, null );
}
public EventQueryParams getFromUrl( String program, String stage, String startDate, String endDate,
- String ou, String ouMode, Set<String> item, Set<String> asc, Set<String> desc, Integer page, Integer pageSize )
+ Set<String> dimension, String ouMode, Set<String> asc, Set<String> desc, Integer page, Integer pageSize )
{
EventQueryParams params = new EventQueryParams();
@@ -260,26 +264,35 @@
throw new IllegalQueryException( "Start date is after end date: " + startDate + " - " + endDate );
}
- if ( item != null )
- {
- for ( String it : item )
- {
- if ( !it.contains( DIMENSION_NAME_SEP ) )
- {
- params.getItems().add( getItem( pr, it, null, null ) );
- }
- else // Filter
- {
- String[] split = it.split( DIMENSION_NAME_SEP );
-
- if ( split == null || split.length != 3 )
- {
- throw new IllegalQueryException( "Item filter has invalid format: " + it );
- }
-
- params.getItems().add( getItem( pr, split[0], split[1], split[2] ) );
- }
- }
+ for ( String it : dimension )
+ {
+ String dim = DataQueryParams.getDimensionFromParam( it );
+
+ if ( ORGUNIT_DIM_ID.equals( dim ) || PERIOD_DIM_ID.equals( dim ) )
+ {
+ List<String> items = DataQueryParams.getDimensionItemsFromParam( it );
+ params.getDimensions().addAll( analyticsService.getDimension( dim, items, null, null ) );
+ }
+ else if ( !it.contains( DIMENSION_NAME_SEP ) )
+ {
+ params.getItems().add( getItem( pr, it, null, null ) );
+ }
+ else // Filter
+ {
+ String[] split = it.split( DIMENSION_NAME_SEP );
+
+ if ( split == null || split.length != 3 )
+ {
+ throw new IllegalQueryException( "Item filter has invalid format: " + it );
+ }
+
+ params.getItems().add( getItem( pr, split[0], split[1], split[2] ) );
+ }
+ }
+
+ for ( OrganisationUnit unit : params.getOrganisationUnits() )
+ {
+ unit.setLevel( organisationUnitService.getLevelOfOrganisationUnit( unit.getUid() ) );
}
if ( asc != null )
@@ -297,24 +310,7 @@
params.getDesc().add( getSortItem( sort, pr ) );
}
}
-
- if ( ou != null )
- {
- String[] split = ou.split( DIMENSION_NAME_SEP );
-
- for ( String ouId : split )
- {
- OrganisationUnit orgUnit = organisationUnitService.getOrganisationUnit( ouId );
- if ( orgUnit != null )
- {
- orgUnit.setLevel( organisationUnitService.getLevelOfOrganisationUnit( orgUnit.getId() ) );
-
- params.getOrganisationUnits().add( orgUnit );
- }
- }
- }
-
if ( params.getOrganisationUnits().isEmpty() )
{
throw new IllegalQueryException( "At least one organisation unit must be specified" );
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java 2013-09-28 11:32:11 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java 2013-09-28 15:06:20 +0000
@@ -35,6 +35,7 @@
import java.util.Arrays;
+import org.hisp.dhis.analytics.DataQueryParams;
import org.hisp.dhis.analytics.event.EventAnalyticsManager;
import org.hisp.dhis.analytics.event.EventQueryParams;
import org.hisp.dhis.analytics.event.QueryItem;
@@ -279,7 +280,7 @@
}
else if ( operator.equals( "in" ) )
{
- String[] split = filter.split( ":" );
+ String[] split = filter.split( DataQueryParams.OPTION_SEP );
return "(" + TextUtils.getQuotedCommaDelimitedString( Arrays.asList( split ) ) + ")";
}
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/event/data/EventQueryPlannerTest.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/event/data/EventQueryPlannerTest.java 2013-09-27 18:32:05 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/event/data/EventQueryPlannerTest.java 2013-09-28 15:06:20 +0000
@@ -71,7 +71,7 @@
params.setProgram( prA );
params.setStartDate( new Cal( 2010, 6, 1 ).time() );
params.setEndDate( new Cal( 2012, 3, 20 ).time() );
- params.getOrganisationUnits().add( ouA );
+ params.setOrganisationUnits( Arrays.asList( ouA ) );
List<EventQueryParams> queries = EventQueryPlanner.planQuery( params );
@@ -96,7 +96,7 @@
params.setProgram( prA );
params.setStartDate( new Cal( 2010, 3, 1 ).time() );
params.setEndDate( new Cal( 2010, 9, 20 ).time() );
- params.getOrganisationUnits().add( ouA );
+ params.setOrganisationUnits( Arrays.asList( ouA ) );
List<EventQueryParams> queries = EventQueryPlanner.planQuery( params );
@@ -106,8 +106,7 @@
assertEquals( new Cal( 2010, 9, 20 ).time(), queries.get( 0 ).getEndDate() );
assertEquals( "analytics_event_2010_programuidA", queries.get( 0 ).getTableName() );
- }
-
+ }
@Test
public void testPlanQueryC()
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/EventAnalyticsController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/EventAnalyticsController.java 2013-09-27 18:32:05 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/EventAnalyticsController.java 2013-09-28 15:06:20 +0000
@@ -72,13 +72,12 @@
@RequestParam(required=false) String stage,
@RequestParam String startDate,
@RequestParam String endDate,
- @RequestParam String ou,
+ @RequestParam Set<String> dimension,
@RequestParam(required=false) String ouMode,
- @RequestParam Set<String> item,
Model model,
HttpServletResponse response ) throws Exception
{
- EventQueryParams params = analyticsService.getFromUrl( program, stage, startDate, endDate, ou, ouMode, item );
+ EventQueryParams params = analyticsService.getFromUrl( program, stage, startDate, endDate, dimension, ouMode );
contextUtils.configureResponse( response, ContextUtils.CONTENT_TYPE_JSON, CacheStrategy.RESPECT_SYSTEM_SETTING );
Grid grid = analyticsService.getAggregatedEventData( params );
@@ -93,13 +92,12 @@
@RequestParam(required=false) String stage,
@RequestParam String startDate,
@RequestParam String endDate,
- @RequestParam String ou,
+ @RequestParam Set<String> dimension,
@RequestParam(required=false) String ouMode,
- @RequestParam Set<String> item,
Model model,
HttpServletResponse response ) throws Exception
{
- EventQueryParams params = analyticsService.getFromUrl( program, stage, startDate, endDate, ou, ouMode, item );
+ EventQueryParams params = analyticsService.getFromUrl( program, stage, startDate, endDate, dimension, ouMode );
contextUtils.configureResponse( response, ContextUtils.CONTENT_TYPE_EXCEL, CacheStrategy.RESPECT_SYSTEM_SETTING, "events.xls", true );
Grid grid = analyticsService.getAggregatedEventData( params );
@@ -116,9 +114,8 @@
@RequestParam(required=false) String stage,
@RequestParam String startDate,
@RequestParam String endDate,
- @RequestParam String ou,
+ @RequestParam Set<String> dimension,
@RequestParam(required=false) String ouMode,
- @RequestParam Set<String> item,
@RequestParam(required=false) Set<String> asc,
@RequestParam(required=false) Set<String> desc,
@RequestParam(required=false) Integer page,
@@ -126,7 +123,7 @@
Model model,
HttpServletResponse response ) throws Exception
{
- EventQueryParams params = analyticsService.getFromUrl( program, stage, startDate, endDate, ou, ouMode, item, asc, desc, page, pageSize );
+ EventQueryParams params = analyticsService.getFromUrl( program, stage, startDate, endDate, dimension, ouMode, asc, desc, page, pageSize );
contextUtils.configureResponse( response, ContextUtils.CONTENT_TYPE_JSON, CacheStrategy.RESPECT_SYSTEM_SETTING );
Grid grid = analyticsService.getEvents( params );
@@ -141,9 +138,8 @@
@RequestParam(required=false) String stage,
@RequestParam String startDate,
@RequestParam String endDate,
- @RequestParam String ou,
+ @RequestParam Set<String> dimension,
@RequestParam(required=false) String ouMode,
- @RequestParam Set<String> item,
@RequestParam(required=false) Set<String> asc,
@RequestParam(required=false) Set<String> desc,
@RequestParam(required=false) Integer page,
@@ -151,7 +147,7 @@
Model model,
HttpServletResponse response ) throws Exception
{
- EventQueryParams params = analyticsService.getFromUrl( program, stage, startDate, endDate, ou, ouMode, item, asc, desc, page, pageSize );
+ EventQueryParams params = analyticsService.getFromUrl( program, stage, startDate, endDate, dimension, ouMode, asc, desc, page, pageSize );
contextUtils.configureResponse( response, ContextUtils.CONTENT_TYPE_EXCEL, CacheStrategy.RESPECT_SYSTEM_SETTING, "events.xls", true );
Grid grid = analyticsService.getEvents( params );
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2013-09-28 13:59:45 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2013-09-28 15:06:20 +0000
@@ -1892,16 +1892,22 @@
// Paging
p.page = TR.state.currentPage;
-
- // organisation unit
-
- p.ou = "";
+
+ // Get searching values
+
+ p.dimension = [];
+
+ // Organisation unit
+
+ var ou = "ou:";
for( var i in TR.state.orgunitIds){
- p.ou += TR.state.orgunitIds[i];
+ ou += TR.state.orgunitIds[i];
if( i<TR.state.orgunitIds.length - 1 ){
- p.ou +=":"
+ ou +=";"
}
}
+ p.dimension.push( ou );
+
if( Ext.getCmp('userOrgunit').getValue() == "true" ){
p.userOrganisationUnit = Ext.getCmp('userOrgunit').getValue();
}
@@ -1913,10 +1919,6 @@
p.useCompletedEvents = Ext.getCmp('completedEventsOpt').getValue();
}
- // Get searching values
-
- p.item = [];
-
// Filter
var idx = 0;
@@ -1948,7 +1950,7 @@
}
}
- p.item.push( filter );
+ p.dimension.push( filter );
}
});