OpenFn / unicef-cambodia

UNICEF Cambodia - Primero Interoperability
https://openfn.github.io/unicef-cambodia/
1 stars 2 forks source link

Update how f1-j2-casesToOscar.js maps "referral_status" field #117

Closed daissatou2 closed 2 years ago

daissatou2 commented 2 years ago

Feature Request

Background, context, and business value

@aleksa-krolls we need to update this code using the new referral_id. We are currently only syncing decisions for the most recent Primero referral. Instead, the job should sync any new decisions for any referral (regardless of the order in which it was received).

The specific request, in as few words as possible

A clear and concise description of what you want to happen.

state.json

f1-j1-getPrimeroCasesV2.js

{
  "configuration": ["SEE LAST PASS: 'Primero V2 Cambodia Demo (openfn_cp_user)'"],
}

f1-j2-casesToOscar.js

{
  "configuration": ["SEE LAST PASS: 'Oscar Staging (api only user)'"],
  "data": "Data generated from F1-J1 job run",
}

expression.js

f1-j2-casesToOscar.js

daissatou2 commented 2 years ago

@aleksa-krolls creating this placeholder GH issue for us to think about when Kiry resolves the API error/we get more clarity on next steps.

aleksa-krolls commented 2 years ago

@daissatou2 fyi - I think I resolved this in the commit for #116 - no longer only checking for the most recent Primero service. Instead, we send any decision where status is accepted or exited (aka !== 'Referred'). See below. https://github.com/OpenFn/unicef-cambodia/commit/9aea5a11eb9c4edd69774da08a0d4edf8c67c1dd#diff-597dbdf1623947cf04f72f9f6dd113973ab3184eda28e5af44a355869da2c4adR239-R244