OpenFn / primero-progres

Interoperability solution for UNICEF <> UNHCR interagency referrals between Primero and Progres v4 systems.
https://openfn.github.io/primero-progres/
0 stars 2 forks source link

Send each Primero referral as 1 Message to Inbox #9

Closed aleksa-krolls closed 3 years ago

aleksa-krolls commented 3 years ago

Background

See issue #3 for original specs for Flow 2 (Primero referrals --> DTP). Currently the Get Primero extract job will return all referrals in 1 Message if multiple cases are found. See this example Message that includes multiple referrals: https://www.openfn.org/projects/p5am6e/messages/mrbpg7ej

Request

Please only include 1 referral in each Message for optimized troubleshooting when we handoff to DTP in job 2.b.

expression

Pls send 1 post to Inbox per referral here https://github.com/OpenFn/primero-progres/blob/master/jobs/2.a.getCases.js#L21-L37

output.json

Desired output example with only 1 referral... pls don't change the structure of the json object, just limit the items returned in the _json array. https://www.openfn.org/projects/p5am6e/messages/m58dmzk5

To test

Please re-run this on prod to verify: https://www.openfn.org/projects/p5am6e/jobs/jv7rnp

lakhassane commented 3 years ago

@aleksa-krolls I need a bit of clarification here. Currently there is only one Message sent to inbox and it looks like this:

Screen Shot 2021-05-10 at 12 37 57

So Im not sure what is the needed change.

lakhassane commented 3 years ago

And the job you linked on the Test section is different from the one in expression section.

aleksa-krolls commented 3 years ago

@lakhassane Sorry I confused myself. I updated the expression above. If you run this job above... you'll see that multiple referrals are being included in 1 Message (see example). image

lakhassane commented 3 years ago

@aleksa-krolls I split the cases to send 1 by 1 for getCases. Was it the only job where it was needed?

aleksa-krolls commented 3 years ago

Looks great, thanks!