OpenFn / openfn-lime-pilot

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

wf2 - query encounters for each patient #25

Closed aleksa-krolls closed 1 month ago

aleksa-krolls commented 1 month ago

Background, context, and business value

We've learned that we need to add a query in order to get encounters... no way to get all encounters. So we need to query encounters by patient. https://rest.openmrs.org/#list-encounters

The specific request, in as few words as possible

Change the Get encounters step to send the request /encounter?patient={uid} for each patient fetched in the step prior

Input

Run WF2 with { "lastRunDateTime": "2024-09-16T00:00:00.000Z" } to generate data. See #2 for credentials.

Toggl

MSF 2024

aleksa-krolls commented 1 month ago

@mtuchi the next issue to start work on after #24

aleksa-krolls commented 1 month ago

@mtuchi to test this...

  1. In the first step searchPatient({ q: 'Katrina'... to just get Katrina
  2. And then go get encounters for each patient. You should find 2 encounters for Katrina.
  3. They should be synced as 2 events to this record: https://dhis2-uat.ocg.msf.org/dhis-web-tracker-capture/index.html#/dashboard?tei=WIyi7b8gj3q&program=w9MSPn5oSqp&ou=OPjuJMZFLop
mtuchi commented 1 month ago

EOD Update I have updated wf2 to fetch all patient encounters. See #27. @aleksa-krolls I have tested this locally it's working expected, Feel free to merge to staging for testing on app