Closed aleksa-krolls closed 3 years ago
@taylordowns2000 since our last changes, I'm seeing some failures with the error TypeError [Error]: Cannot read property 'substring' of undefined
.
See run failure in f1-j2
: https://www.openfn.org/projects/pdngk6/runs/rbgb4p7b
See triggering run of job f1-j1
: https://www.openfn.org/projects/pdngk6/runs/r89jray9
Run f1-j1
: https://www.openfn.org/projects/pdngk6/jobs/jyazq6
Use Primero Alpha Cambodia
and Oscar Production Demo
.
Request
Change the Oscar
organization_name
mapping. We've been hardcoding this todemo
for testing, but now are preparing for go-live and want to change this mapping to determine how referrals are assigned in Oscar.services_section
contains a service record whereservice_response_type: 'referral_from_oscar'
--> if yes, maporganization_name: c.services_section[*].oscar_referring_organization
, but only return agency name substring (e.g.,agency-demo
-->demo
). Stop flow.services_section
contains a service record whereservice_response_type: 'referral_to_oscar'
--> if yes, maporganization_name: c.services_section[*].service_implementing_agency
, but only return agency name substring (e.g.,agency-demo
-->demo
). Stop flow.organization_name: c.owned_by_agency
, but only return agency name substring (e.g.,agency-demo
-->demo
).Consider that
services_section
might have multiple records, so please follow the order of operations above.state
Oscar creds:
Oscar Production Demo
(api.user...) Use this state file to test each scenario (it has 3 cases): https://github.com/OpenFn/unicef-cambodia/blob/master/sample_data/state-f1-j2.jsonexpression
https://github.com/OpenFn/unicef-cambodia/blob/4e0546c17c2c29e0ee4ea3cbfef08f34fe02e128/jobs/f1-j2-casesToOscar.js#L192-L194
adaptor
language-http
output
service_implementing_agency
received from Primero. This should outputorganization_name: demo
when upserting cases in Oscar.oscar_referring_organization
. This should outputorganization_name: demo
when upserting cases in Oscar.services_section
--> still returnsdemo
because we mapowned_by_agency
.