Getting program stage sections and their data elements from web API

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!

1 Like

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.

···

On Fri, Dec 5, 2014 at 6:02 PM, Blai Samitier blaisami@hotmail.com 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@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp


Thank you,

Abyot.

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@gmail.com 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.


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp


Thank you,

Abyot.

On Fri, Dec 5, 2014 at 6:02 PM, Blai Samitier blaisami@hotmail.com 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@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Pamod

Thank you Abyot! That works perfect.

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

···

On Thu, Dec 11, 2014 at 3:14 PM, Pamod Amarakoon pamodm@gmail.com 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


Thank you,

Abyot.

On Thu, Dec 11, 2014 at 1:45 PM, Abyot Gizaw abyota@gmail.com 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.


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Pamod


Thank you,

Abyot.

On Fri, Dec 5, 2014 at 6:02 PM, Blai Samitier blaisami@hotmail.com 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@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Hi Abyot,

yes about event data.

eg: Get event data element values of a tracked entity instance across different programme stages of a programme. For example get height and weight of a child in past clinic visits to be displayed on a graph.

Thank you

···

On Fri, Dec 12, 2014 at 3:46 PM, Abyot Gizaw abyota@gmail.com wrote:

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@gmail.com 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@gmail.com 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.


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Pamod


Thank you,

Abyot.

On Fri, Dec 5, 2014 at 6:02 PM, Blai Samitier blaisami@hotmail.com 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@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Pamod