What's mean of programStageDataElement id?

I don’t know the mean of id in programStageDataElement id attribute , is there a relation to dataelement id?

<programStageDataElement lastUpdated=“2021-09-12T17:42:59.385” id=“vHdXuwSbKyd” created=“2020-05-03T22:46:29.712”>

true

false

false

false

false

Sharing(owner=null, publicAccess=null, external=false, users={}, userGroups={})

false

false

0

false

true

true

true

true

true

true

Hi @linxd

From what I see is that the programStageDataElement determines the relation between a dataElement and a programStage. All the attributes (displayInReports,skipSynchronization,externalAccess…etc) for a dataElement can be different from one program stage to another; additionally, since there can be many programStageDataElements in a programStage, each programStageDataElement must have a unique ID. Therefore, the dataElement ID must be different from the programStageDataElement ID because they are two different objects.

To make it simpler, the programStageDataElement is a description for certain attributes the dataElement will have in a programStage. I hope that the distinction is clearer now. :smiley:

Please let me know if this answers your question and whether you need more info. Thank you so much! (:

Thanks. not sure , but, when use the programStageDataElement-id?
when import events, refer to the datavalues ,which one to using?

1 Like

Yes, no need to use the programStageDataElement ID, only use the DataElement ID.

For example, I will get the API for an event program in play.dhis2.org

Then I will use this link (https://play.dhis2.org/2.36.3/api/29/events?program=bMcwwoVnbSR) to check the info, and then add .csv after the word events like (https://play.dhis2.org/2.36.3/api/29/events.csv?program=bMcwwoVnbSR) if you check the columns order is the same in the docs (webapi_import_parameters | Tracker - DHIS2 Documentation).

I hope this helps!

Thanks.

1 Like