I want to retrieve data values for a given period for all children and grand children of a top level orgUnit for a fixed list of data elements using the dataValues resource of the WebAPI. I don’t want to import the whole dataset, just the data captured by the data elements I’m interested in. Am not sure this is possible.
I successfully imported the dataelements and corresponding category combos from one dhis2 instance to another. Now i want the data values for only those data elements imported using the WebAPI.
Is there a way to specify more than 1 data element identifier in the Data values query parameters?
I’ve tried using;
I figured it out. Both /api/26/dataValueSets end point and /api/26/dataValues endpoint according to the documentation don’t provide for that. Forgive me I was so used to those resources.
However, the The analyticsdataValueSet resource available at the /api/26/analytics/dataValueSet endpoint allows for returning aggregated data in the data value set format - what i wanted. See documentation here
I can then use the Data (dx), Period (pe), Organisation unit (ou) dimension query parameters to control data, period and orgUnits to get what i want. I also include the category dimension in the query string (dimension=co) to make sure my payload has data broken down by category option combinations rather than totals;