OpenFn / unicef-cambodia

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

fixes issue where Primero query issue when `workflow` field does not indicate new referral #126

Closed aleksa-krolls closed 1 year ago

aleksa-krolls commented 1 year ago

Historically, we relied on the Primero case field workflow to indicate when a new referral was ready to be sent to the Oscar system via OpenFn. In July 2023, UNICEF confirmed that this field was not reliable to use as a query filter, because sometimes the workflow status might != refer_to_oscar, and yet there might be a referral --> therefore a change in the OpenFn getCases() Primero query was decided.

This change further addresses the related issue where OpenFn sometimes is not correctly getting all new referrals for Oscar if the service_implemented_on fields are populated on the service form. With this change, OpenFn should now get ALL pending referrals for Oscar, regardless of the case's workflow status and service_implemented_on fields.

Also includes handling for Primero API paging and minor error-handling/ console.log improvements.