← Back to team overview

dhis2-users team mailing list archive

Re: Getting program stage sections and their data elements from web API

 

Hi Pamond,

I am not sure I get your point. If you wanted only data elements, then you
can use only programId.  Or do you want event data?

See if the following helps

https://apps.dhis2.org/dev/api/programs.json?filter=id:eq:IpHINAT79UW&fields=id,name,programStages[id,name,programStageDataElements[dataElement[id,name]]]&paging=false

https://apps.dhis2.org/dev/api/events.json?trackedEntityInstance=oi3PMIGYJH8&program=IpHINAT79UW&paging=false&skipMeta=true


---
Thank you,
Abyot.

On Thu, Dec 11, 2014 at 3:14 PM, Pamod Amarakoon <pamodm@xxxxxxxxx> wrote:
>
> Hi Abyot,
>
> Is it possible to extend this to return data elements associated with a
> each visit(stage) when only a trackedEntityInstanceID and programId is
> provided.
>
> Thank you
>
> Pamod
>
> On Thu, Dec 11, 2014 at 1:45 PM, Abyot Gizaw <abyota@xxxxxxxxx> wrote:
>
>> Hi,
>>
>> For example, the following returns id and name for program stage, program
>> stage sections, program stage section data elements.
>>
>>
>> api/programStages/XXXXX.json?fields=id,name,programStageSections[id,name,programStageDataElements[dataElement[id,name]]]
>>
>> Play around with the *fields *parameter to match the properties you want
>> the server to return.
>>
>> ---
>> Thank you,
>> Abyot.
>>
>> On Fri, Dec 5, 2014 at 6:02 PM, Blai Samitier <blaisami@xxxxxxxxxxx>
>> wrote:
>>
>>> Hello,
>>>
>>> I am using the web API to get information from events, and I want to
>>> classify the data elements with the program stage sections I defined in the
>>> program stage.
>>>
>>> My problem is that I can't find the resource that gives me the program
>>> Stage Section with their data elements. I can only find the name of the
>>> sections in /api/programStages/xxxx/programStageSections, but not the data
>>> elements they contain.
>>>
>>> Thanks!
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~dhis2-users
>>> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~dhis2-users
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-users
>> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-users
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
>
> --
> Pamod
>
>

Follow ups

References