← Back to team overview

dhis2-devs team mailing list archive

Re: defining datavalueset reports for dhis2 web api

 

Hi Bob,

This is very interesting.
Much closer to xforms where the form is sent without the dataValues and can
be filled with values and sent back.

Some comments:
1.) I wonder though why you are sending all the dataElements in the xml??
Is that required or we should be able to generate only those required on a
dataSet or section of a form?
2.) There should be a dataType field for the elements or are u suggesting
"chatty" conversation to get the types??

Other than that I wonder if the client has to deal with the transform. Or
was this just an example to generate it and will be done on the server-side.
I would suggest that the client should be able to set Accept headers and
get the template in formats that you mentioned in your email...

---
Regards,
Saptarshi PURKAYASTHA

My Tech Blog:  http://sunnytalkstech.blogspot.com
You Live by CHOICE, Not by CHANCE


On 16 July 2012 12:57, Bob Jolliffe <bobjolliffe@xxxxxxxxx> wrote:

> Sharing some thoughts about using the web-api for facility reporting ....
>
> Setting up a client to produce datavalueset reports using the web api
> gets a bit complicated when you are using categorycombos.  The problem
> is that you can retrieve the metadata for a dataset, but that just
> gives you the list of dataelements to report - but finding out which
> categoryoptioncombos are required for each dataelement involves quite
> a bit more querying of the api.
>
> Creating an sdmx style data structure definition is difficult because
> of the "raggedness" of our datasets (they are not neat datacubes with
> uniform dimensionality).  So another way to approach this is to
> acquire report templates for each datavalueset - ie. retrieve the
> template from dhis and the client is then only required to configure
> itself to provide the values for each row in the template.
>
> The web api doesn't provide these directly, but they are easy enough
> to generate off the metadata.  At a minimum you require the datasets,
> the dataelements and the categoryoptioncombos.  If the client is a
> facility based system (like openmrs) then its really not necessary to
> get the list of 1000's of orgunits.
>
> Using the attached xsl and the url below is my first stab at this:
>
> curl -v -X GET -u admin:district
> "
> http://apps.dhis2.org/demo/api/metaData.xml?assumeTrue=false&categoryOptionCombos=true&dataElements=true&dataSets=true
> "
> | xsltproc dxf2template.xslt - |xmllint --format -
>
> The resulting output (also attached) is I think the minimum
> information required to fully configure a datavalueset producer based
> on a template, using dxf2, sdmx, csv, xforms  or what have you.  I am
> assuming that a facility already 'knows' its facility identifier or
> code.
>
> Bob
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References