Hi @lnfregos
I will try to explain on the real example below:
- I have get json TEI from DHIS 2 Demo - Sierra Leone*
- This is part of JSON file
{
"created": "2019-08-21T13:25:51.247",
"orgUnit": "DiszpKrYNg8",
"createdAtClient": "2019-03-19T01:12:40.850",
"trackedEntityInstance": "QGyxOe1zewj",
"lastUpdated": "2019-08-21T13:31:41.331",
"trackedEntityType": "Zy2SEgA61ys",
"lastUpdatedAtClient": "2019-03-19T01:12:40.850",
"inactive": false,
"deleted": false,
"featureType": "NONE",
"programOwners": [
{
"ownerOrgUnit": "DiszpKrYNg8",
"program": "qDkgAbB5Jlk",
"trackedEntityInstance": "QGyxOe1zewj"
}
],
"enrollments": [
{
"storedBy": "belen_test",
"created": "2019-08-21T13:25:53.570",
"orgUnit": "DiszpKrYNg8",
"createdAtClient": "2019-03-10T15:45:18.847",
"program": "qDkgAbB5Jlk",
"trackedEntityInstance": "QGyxOe1zewj",
"enrollment": "PvJFfKjNWbq",
"lastUpdated": "2019-08-21T13:31:41.328",
"trackedEntityType": "Zy2SEgA61ys",
"lastUpdatedAtClient": "2019-08-21T13:31:41.328",
"orgUnitName": "Ngelehun CHC",
"enrollmentDate": "2023-03-10T00:00:00.000",
"followup": false,
"deleted": false,
"incidentDate": "2023-03-10T15:45:18.845",
"status": "COMPLETED",
"notes": [
],
"relationships": [
],
"attributes": [
],
"events": [
{
"storedBy": "belen_test",
"dueDate": "2023-03-12T00:00:00.000",
"createdAtClient": "2019-03-10T15:45:19.043",
"program": "qDkgAbB5Jlk",
"event": "AiJUOyxiF3C",
"programStage": "C0aLZo75dgJ",
"orgUnit": "DiszpKrYNg8",
"trackedEntityInstance": "QGyxOe1zewj",
"enrollment": "PvJFfKjNWbq",
"enrollmentStatus": "COMPLETED",
"status": "COMPLETED",
line 8 “trackedEntityInstance”: “QGyxOe1zewj” should be same inside ENROLLMENTS section lines 29 and inside EVENTS section line 58,
Also the line 30 “enrollment”: “PvJFfKjNWbq” of ENROLLMENTS section should be the same for the line 59 in the EVENTS section
Regards, Ulanbek