=== modified file 'src/docbkx/en/dhis2_user_man_web_api.xml' --- src/docbkx/en/dhis2_user_man_web_api.xml 2013-09-28 14:03:02 +0000 +++ src/docbkx/en/dhis2_user_man_web_api.xml 2013-09-28 16:32:42 +0000 @@ -2110,19 +2110,63 @@ In order to query events captured in DHIS 2 you can work with the analytics/events/query resource. This resource lets you retrieve events based on a program and optionally a program stage, and lets - you retrieve and filter events on any event item. Event items include data elements, person - attributes and person identifiers. The query analytics resource will simply return events - matching a set of criteria and does not perform any aggregation. + you retrieve and filter events on any event dimensions. Event items include data elements, + person attributes, person identifiers, organisation units and periods. The query analytics + resource will simply return events matching a set of criteria and does not perform any + aggregation. The event dimensions are listed in the table below. + + Event dimensions + + + + + + + Dimension + Dimension id + Description + + + + + Data elements + <uid> + Data element identifiers + + + Person attributes + <uid>, GENDER, ISDEAD + Person attribute identifiers and the fixed person attributes GENDER and + ISDEAD + + + Person identifiers + <uid> + Person identifier identifiers + + + Organisation units + ou + Organisation unit identifiers + + + Periods + pe + ISO periods and relative periods, see "date and period format" + + + +
Request query parameters The analytics event API let you specify a range of query parameters. Query parameters - + - - + + Query parameter @@ -2157,11 +2201,13 @@ Date in yyyy-MM-dd format - ou + dimension Yes - Organisation unit identifiers in a single parameter value separated by - ":". - Organisation unit identifiers + Dimension identifier including data elements, person attributes, person + identifiers, periods and organisation units. Parameter can be repeated any number of + times. Filters can be applied to a dimension on the format + <item-id>:<operator>:<filter>. Filter values are case-insensitive. + Operators can be EQ | GT | GE | LT | LE | NE | LIKE | IN ouMode @@ -2171,15 +2217,6 @@ SELECTED refers to the selected organisation units only. DESCENDANTS, CHILDREN, SELECTED - - item - Yes - Item identifier including data elements, person attributes and person - identifiers. Can also be the fixed person attributes GENDER and ISDEAD. Parameter - can be repeated any number of times. Filters can be applied to an item on the format - <item-id>:<operator>:<filter>. Filter values are case-insensitive. - Operators can be EQ | GT | GE | LT | LE | NE | LIKE | IN - asc No @@ -2212,11 +2249,11 @@ Event queries should be on the format described below. Item identifiers can refer to any of data elements, person attributes and person identifiers. Items can optionally have a query operator and a filter. - api/analytics/events/query/<program-id>?startDate=yyyy-MM-dd&endDate=yyyy-MM-dd&ou=<ou-id>:<ou-id>&item=<item-id>&item=<item-id>:<operator>:<filter> + api/analytics/events/query/<program-id>?startDate=yyyy-MM-dd&endDate=yyyy-MM-dd&ou=<ou-id>;<ou-id>&item=<item-id>&item=<item-id>:<operator>:<filter> For example, to retrieve events from the "Inpatient morbidity and mortality" program between January and October 2012, where the "Gender" and "Age" data elements are included and the "Age" item is filtered on "18", you can use the following query: - api/analytics/events/query/eBAyeGv0exc?startDate=2012-01-01&endDate=2012-10-31&ou=O6uvpzGd5pu:fdc6uOvgoji&item=oZg33kd9taw&item=qrur9Dvnyt5:EQ:18 + api/analytics/events/query/eBAyeGv0exc?startDate=2012-01-01&endDate=2012-10-31&ou=O6uvpzGd5pu;fdc6uOvgoji&item=oZg33kd9taw&item=qrur9Dvnyt5:EQ:18 To retrieve events for the "Birth" program stage of the "Child programme" program between March and December 2012, where the "Weight" data element, filtered for values larger than 2000, and the "Address" person attribute are included: @@ -2421,18 +2458,18 @@ In order to get aggregated numbers of events captured in DHIS 2 you can work with the analytics/events/aggregate resource. This resource lets you retrieve aggregate data based on a program and optionally a - program stage, and lets you filter on any event item. Event items include data elements, - person attributes and person identifiers. + program stage, and lets you filter on any event dimension. Event dimensions include data + elements, person attributes, person identifiers, periods and organisation units. The aggregate events resource follows much of the same semantics as the event query resource which is described in the previous section. Please make sure you have read the mentioned section before progressing. Aggregate event queries should be on the format described below. - api/analytics/events/aggregate/<program-id>?startDate=yyyy-MM-dd&endDate=yyyy-MM-dd&ou=<ou-id>:<ou-id>&item=<item-id>&item=<item-id>:<operator>:<filter> + api/analytics/events/aggregate/<program-id>?startDate=yyyy-MM-dd&endDate=yyyy-MM-dd&dimension=ou:<ou-id>;<ou-id>&dimension=<item-id>&dimension=<item-id>:<operator>:<filter> For example, to retrieve aggregate numbers for events from the "Inpatient morbidity and mortality" program between January and October 2012, where the "Gender" and "Age" data elements are included, the "Age" item is filtered on "18" and the "Gender" item is filtered on "Female", you can use the following query: - api/analytics/events/aggregate/eBAyeGv0exc?startDate=2012-01-01&endDate=2012-10-31&ou=O6uvpzGd5pu:fdc6uOvgo7ji&item=oZg33kd9taw:EQ:Female&item=qrur9Dvnyt5:EQ:18 + api/analytics/events/aggregate/eBAyeGv0exc?startDate=2012-01-01&endDate=2012-10-31&dimension=ou:O6uvpzGd5pu;fdc6uOvgo7ji&dimension=oZg33kd9taw:EQ:Female&dimension=qrur9Dvnyt5:GT:50 The response will look similar to this: { "headers": [ @@ -2440,35 +2477,30 @@ "name": "oZg33kd9taw", "column": "Gender", "type": "java.lang.String", - "hidden": false, "meta": false }, { "name": "qrur9Dvnyt5", "column": "Age", "type": "java.lang.String", - "hidden": false, "meta": false }, { "name": "pe", "column": "Period", "type": "java.lang.String", - "hidden": false, "meta": false }, { "name": "ou", "column": "Organisation unit", "type": "java.lang.String", - "hidden": false, "meta": false }, { "name": "value", "column": "Value", "type": "java.lang.String", - "hidden": false, "meta": false } ], @@ -2477,30 +2509,51 @@ "eBAyeGv0exc": "Inpatient morbidity and mortality" } }, - "width": 4, - "height": 2, + "width": 5, + "height": 39, "rows": [ [ "Female", - "19", - "", - "O6uvpzGd5pu", - "51" - ], - [ - "Female", - "20", - "", - "O6uvpzGd5pu", - "83" - ], - [ - "Female", - "18", - "", - "O6uvpzGd5pu", - "57" - ] + "95", + "", + "O6uvpzGd5pu", + "2" + ], + [ + "Female", + "63", + "", + "O6uvpzGd5pu", + "2" + ], + [ + "Female", + "67", + "", + "O6uvpzGd5pu", + "1" + ], + [ + "Female", + "71", + "", + "O6uvpzGd5pu", + "1" + ], + [ + "Female", + "75", + "", + "O6uvpzGd5pu", + "14" + ], + [ + "Female", + "73", + "", + "O6uvpzGd5pu", + "5" + ], ] } The response tells us that for the "Gender" item filtered on "Female" and organisation