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.
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 theworkflow
status might !=refer_to_oscar
, and yet there might be a referral --> therefore a change in the OpenFngetCases()
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 ALLpending
referrals for Oscar, regardless of the case'sworkflow
status andservice_implemented_on
fields.Also includes handling for Primero API paging and minor error-handling/ console.log improvements.