Hi everyone,
What would be the best approach to access a sub array using the each operation in a job to push to DHIS2. Below is an example of the input used with all patient identifiable information removed.
{
"mergedData": [
{
"addressNum": "true",
"aefiEvents": [
{
"aefiDate": "2021-03-04",
"chills": "true",
"fatigue": "false",
"flu": "false",
"headache": "true",
"jointPain": "false",
"musclePain": "true",
"other": "false",
"otherlist": "",
"patientid": 6,
"tenderness": "false",
"treatment": null,
"vomitting": "false"
}
],
"vaccineEvents": [
{
"batchnum": "4120z023",
"comment": null,
"coviddose": 1,
"covidgiven": "true",
"dateoccured": "2021-03-04",
"expirydate": "2021-05-29",
"nextdate": "2021-04-29",
"patientid": 6,
"route": "FG1QINt7D0z"
},
{
"batchnum": "4120z023",
"comment": null,
"coviddose": 2,
"covidgiven": "true",
"dateoccured": "2021-04-29",
"expirydate": "2021-05-29",
"nextdate": null,
"patientid": 6,
"route": "FG1QINt7D0z"
}
],
"village": "GIRAUDEL"
}
]
}
The job to create patients and events run successfully. However we are unable to reference the data in “vaccinesEvents” and “aefiEvents” similar to the following:
{ attribute: “jCdBujEEITq”, value: dataValue(“patientId”)},
Line 46 has an attempt at accessing sub array vaccineEvents.
Thank you!