=== modified file 'src/docbkx/en/dhis2_user_man_web_api.xml' --- src/docbkx/en/dhis2_user_man_web_api.xml 2013-09-29 20:16:56 +0000 +++ src/docbkx/en/dhis2_user_man_web_api.xml 2013-09-29 21:14:02 +0000 @@ -2272,8 +2272,8 @@ api/analytics/events/query/eBAyeGv0exc?startDate=2012-01-01&endDate=2012-10-31&dimension=ou:O6uvpzGd5pu;fdc6uOvgoji&dimension=oZg33kd9taw&dimension=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: - api/analytics/events/query/IpHINAT79UW?stage=A03MvHHogjR&startDate=2012-03-01&endDate=2012-12-31&dimension=ou:O6uvpzGd5pu&dimension=UXz7xuGCEhU:GT:2000&dimension=AMpUYgxuCaE + 2000: + api/analytics/events/query/IpHINAT79UW?stage=A03MvHHogjR&startDate=2012-03-01&endDate=2012-12-31&dimension=ou:O6uvpzGd5pu&dimension=UXz7xuGCEhU:GT:2000 Fixed person attributes can be specified as dimensions as well. Currently the GENDER and ISDEAD attributes are suppored and can be included and filtered on like this: api/analytics/events/query/IpHINAT79UW?stage=A03MvHHogjR&startDate=2012-03-01&endDate=2012-12-31&dimension=ou:O6uvpzGd5pu&dimension=UXz7xuGCEhU:GT:2000&dimension=ISDEAD&dimension=GENDER:EQ:F @@ -2470,23 +2470,34 @@
Event aggregate analytics - 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 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. + 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 + dimension. In other words, it does not return the event information itself, rather the + aggregate numbers of events matching the request query. Event dimensions include data + elements, person attributes, person identifiers, periods and organisation units. Aggregate event queries should be on the format described below. 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" dimension 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&dimension=ou:O6uvpzGd5pu;fdc6uOvgo7ji&dimension=oZg33kd9taw:EQ:Female&dimension=qrur9Dvnyt5:GT:50 + api/analytics/events/aggregate/eBAyeGv0exc?startDate=2012-01-01&endDate=2012-10-31&dimension=ou:O6uvpzGd5pu&dimension=oZg33kd9taw:EQ:Female&dimension=qrur9Dvnyt5:GT:50 + To retrieve data for fixed and relative periods instead of start and end date, in this + case May 2012 and last 12 months, and the organisation unit associated with the current + user, you can use the following query: + api/analytics/events/aggregate/eBAyeGv0exc?dimension=pe:201205;LAST_12_MONTHS&dimension=ou:USER_ORGUNIT;fdc6uOvgo7ji&dimension=oZg33kd9taw + In order to specify "Female" as a filter for "Gender" for the data response, meaning + "Gender" will not be part of the response but will filter the aggregate numbers in it, you + can use the following syntax: + api/analytics/events/aggregate/eBAyeGv0exc?dimension=pe:2012;&dimension=ou:O6uvpzGd5pu&filter=oZg33kd9taw:EQ:Female + To specify the "Bo" organisation unit and the period "2012" as filters, and the "Mode of + discharge" and Gender" as dimensions, where "Gender" is filtered on the "Male" item, you can + use a query like this: + api/analytics/events/aggregate/eBAyeGv0exc?filter=pe:2012&filter=ou:O6uvpzGd5pu&dimension=fWIAEtYVEGk&dimension=oZg33kd9taw:EQ:Male
- Reponse formats + Response formats The default response representation format is JSON. The requests must be using the HTTP GET method. The response will look similar to this: @@ -2575,8 +2586,6 @@ ], ] } - The response tells us that for the "Gender" dimension filtered on "Female" and - organisation unit with identifier "O6uvpzGd5pu" there are 57 cases.