Currently the job will only mark the case as a referral if the case originates in Primero. However, cases might originate in Oscar and be shared with Primero (Oscar case --> Primero case), and then individual services can be shared back from Primero to Oscar (Primero referral service --> Oscar case).
Background
Currently the job will only mark the case as a referral if the case originates in Primero. However, cases might originate in Oscar and be shared with Primero (Oscar case --> Primero case), and then individual services can be shared back from Primero to Oscar (Primero referral service --> Oscar case).
Change Request
Modify the mapping on L302 in
f1-j2-casesToOscar.js
to check if the Primero case contains services where"service_response_type": "referral_to_oscar"
. Only if Primeroservices
contains this value, then should we mark Oscaris_referred
as true. https://github.com/OpenFn/unicef-cambodia/blob/1ef487b2cd411b2a0ae68a2d1ac7386ce1187534/jobs/f1-j2-casesToOscar.js#L203expression.js
f1-j2-casesToOscar.js
using language-httpstate.json
This state has 3 cases where I expect the following...
31de2d0
with services that have referrals --> should send case whereis_referred: true
to Oscar2e3732f
with NO services --> should send case whereis_referred: false
to Oscarcedb069
with services but NO referrals --> should send case whereis_referred: false
to Oscar