Last active
March 30, 2023 07:49
-
-
Save aleksa-krolls/9ef6835ec096c8b2b083d2384cf37530 to your computer and use it in GitHub Desktop.
This is the payload OpenFn sends to Oscar API for an existing client `yoaz-2258`. See below for the output in Oscar (with dupe services).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"organization": { | |
"external_id": "86f084b7-6cfc-40f7-abf9-2a8b6f35dbf3", | |
"external_id_display": "f35dbf3", | |
"global_id": "01GWRMBDA85FY15JR6EE7XG99Y", | |
"level_of_risk": "no action", | |
"mosvy_number": "", | |
"given_name": "Ryan", | |
"family_name": "Reynolds", | |
"gender": "male", | |
"date_of_birth": "2018-01-01", | |
"location_current_village_code": "02070103", | |
"address_current_village_code": "02070103", | |
"reason_for_referral": "ref 4-1", | |
"external_case_worker_name": "openfn", | |
"external_case_worker_id": "", | |
"external_case_worker_mobile": "000000000", | |
"resource": "Primero", | |
"is_referred": true, | |
"organization_name": "cif", | |
"organization_id": "cif", | |
"services": [ | |
{ | |
"uuid": "7e04a877-29d5-4154-8226-bb54b382efd9", | |
"name": "Kinship care" | |
} | |
], | |
"date_of_referral": "2023-03-30" | |
} | |
}, | |
{ | |
"organization": { | |
"external_id": "86f084b7-6cfc-40f7-abf9-2a8b6f35dbf3", | |
"external_id_display": "f35dbf3", | |
"global_id": "01GWRMBDA85FY15JR6EE7XG99Y", | |
"level_of_risk": "no action", | |
"mosvy_number": "", | |
"given_name": "Ryan", | |
"family_name": "Reynolds", | |
"gender": "male", | |
"date_of_birth": "2018-01-01", | |
"location_current_village_code": "02070103", | |
"address_current_village_code": "02070103", | |
"reason_for_referral": "ref 4-1", | |
"external_case_worker_name": "openfn", | |
"external_case_worker_id": "", | |
"external_case_worker_mobile": "000000000", | |
"resource": "Primero", | |
"is_referred": true, | |
"organization_name": "cif", | |
"organization_id": "cif", | |
"services": [ | |
{ | |
"uuid": "5925f7ff-a082-4633-b138-83faaccd061a", | |
"name": "Family reunification" | |
} | |
], | |
"date_of_referral": "2023-03-30" | |
} | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If the above^ payload is sent via POST request to OSCaR API
'/api/v1/organizations/clients/upsert/'
multiple times, then:client
is being upserted ✅uuid
is provided) ❌Rather, the services (with the same
uuid
s) are being duplicated - see below payload.Output in Oscar