← Back to team overview

dhis2-devs team mailing list archive

Re: Attempting to retrieve data in ADX format

 

Hi Lorill,

thanks for bringing this up. I had a look and the problem was that the demo
database misses codes for most categories. Seems ADX requires codes to be
present also for categories and category options which are associated with
data elements in the data set.

The other problem was that the ADX code swallowed the exception instead of
returning it through the API. I have done a fix now in trunk and 2.23 for
this where 409 and a message is returned. I am now getting this:

{"httpStatus":"Conflict","httpStatusCode":409,"status":"ERROR","message":"Category
code for Commodities is missing or invalid: null"}


So to fix this, I suggest you upgrade to latest 2.23 and make sure that
codes are present also for categories and category options in you local
system.

Thanks for reporting and for reproducing on the demo.

best regards,

Lars





On Wed, Apr 27, 2016 at 11:49 PM, Lorill Crees <lcrees@xxxxxxxxxx> wrote:

> Hi,
>
> I'm playing around with retrieving data in ADX format. I've been looking
> at the documentation here:
>
> http://dhis2.github.io/dhis2-docs/master/en/developer/html/ch01s16.html#d0e3574
>
> I've been unable to retrieve any actual data - I can only receive an empty
> adx tag.
>
> Here are some examples from play.dhis2.com:
>
> Doing a straight GET using UIDs with this URL:
> https://play.dhis2.org/demo/api/dataValueSets?orgUnit=
> jNb63DIHuwU&dataSet=ULowA8V3ucd&startDate=2015-01-01&endDate=2015-12-31
>
> will return data values. EG:
> {
>     "dataValues": [
>         {
>             "dataElement": "JIazHXNSnFJ",
>             "period": "201501",
> ....
>
> However, doing a GET using Codes and adding the "Accept:
> application/xml+adx"  in the header with this URL:
>
>
> https://play.dhis2.org/demo/api/dataValueSets?orgUnit=OU_573&dataSet=DS_1153709&startDate=2015-01-01&endDate=2015-12-31
>
> only returns this empty tag:
> <adx
>     xmlns="urn:ihe:qrph:adx:2015"/>
>
> Is there something I'm doing wrong here? How can I get the data in this
> example returned in ADX format?
>
> Thanks,
>
> Lorill
>
> _______________________________________________
> 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
>
>


-- 
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
http://www.dhis2.org <https://www.dhis2.org/>

Follow ups

References