OpenFn / openfn-lime-pilot

MSF LIME Project - OpenFn Workflows for Iraq Pilot
1 stars 1 forks source link

wf2 no longer creates events #41

Closed aleksa-krolls closed 1 month ago

aleksa-krolls commented 1 month ago

Describe the bug and expected behavior

See run where the workflow stops after Get TEIs step... not sure if your fix earlier this week broke something.

To Reproduce

  1. Re-run wf2 with the input { "lastRunDateTime": "2024-09-30T00:00:00.000Z"}.
  2. This will return the following OMRS patients (Jordan, Anna, and Katrina)... ALL of them have encounters created after the cursor date.
    uuids of patients to sync to dhis2 :: 
    9ef373a2-3267-4171-89ce-5b5dd0da0b3c, 
    1908003e-0ac5-43c3-b0c6-a727702bb5a4, 
    716e3fce-5483-4cce-99e9-cd2fae999a67

Input

Same creds as #2

I'm testing on the staging branch

Toggl

MSF 2024

aleksa-krolls commented 1 month ago

@mtuchi as discussed, I think the Upsert TEIs step no longer works...

On old runs the logs used to tell me if the TEI was created or updated. Also would be really helpful to log the DHIS2 importSummary or at least the trackedEntityInstance id if a record was found.

Preparing upsert via 'get' then 'create' OR 'update'...
ADA Preparing get operation...
ADA Using latest available version of the DHIS2 api on this server.
ADA Sending get request to https://dhis2-uat.ocg.msf.org/api/trackedEntityInstances
ADA  with params: {"filter":["AYbfTPYMNJH:Eq:44c50e80-d50a-4ada-ab6c-214d3c8caf83"],"ou":"OPjuJMZFLop","program":"w9MSPn5oSqp"}
ADA Retrieved trackedEntityInstances
mtuchi commented 1 month ago

I have found the problem and pushed a fix on staging. The upsert was not working because of the typo in the path. (It was suppose to be patientsUpsert.

I have updated the workflow and it's working as expected now