Currently run is failing when we try to create 2 events (each belonging to different programStage): "Tracked entity instance: TbBCJzZbPuA has multiple active enrollments in program: w9MSPn5oSqp"
The specific request, in as few words as possible
We need to make sure to link events to existing enrollments to avoid this error. Please:
Update the Get TEIs step to ensure enrollments are returned when we query existing TEIs. Adding this parameter works on postman: ?fields=*,enrollments[*]
Background, context, and business value
Currently run is failing when we try to create 2 events (each belonging to different programStage):
"Tracked entity instance: TbBCJzZbPuA has multiple active enrollments in program: w9MSPn5oSqp"
The specific request, in as few words as possible
We need to make sure to link
events
to existingenrollments
to avoid this error. Please:Update the
Get TEIs
step to ensureenrollments
are returned when we query existing TEIs. Adding this parameter works on postman:?fields=*,enrollments[*]
If this works, then find the
trackedEntityInstance.enrollments[x].enrollment
id whereenrollments[x].program == 'w9MSPn5oSqp'
to map in the next stepUpdate the
Create events
step to add thisenrollment
id to the main payloadInput
Run WF2 with
{ "lastRunDateTime": "2024-09-16T00:00:00.000Z" }
to generate data. See #2 for credentials.Try testing for patient
Katrina
... so you can update yourGet Encounters
step to use this query for the time being:encounters?q=Katrina
Toggl
MSF 2024