OpenFn / unicef-cambodia

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

f2-j2: Merge services with Primero before uploading Oscar cases #59

Closed aleksa-krolls closed 3 years ago

aleksa-krolls commented 3 years ago

Background

In previous testing, Oscar would always send us cases with services. With Rotati's latest changes, we are now sometimes receiving Oscar cases with no services linked. Now that Oscar sometimes sends us cases without services, we found in testing that when we send an Oscar case with no services --> Primero, then this overwrites (and thereby deletes) any existing services in Primero.

Change Request

Merge services and transitions using services.uuid before upserting a case to Primero. This will ensure that (1) existing Primero services will remain in tact as is, and (2) append new Oscar services to the Primero case.

Primero remains the system of record. If a Primero service exists with the matching uuid of an incoming Oscar service, then the Primero service should remain unchanged --> drop this Oscar service from the update sent to Primero.

taylordowns2000 commented 3 years ago

This is closed by https://github.com/OpenFn/language-primero/releases/tag/v1.1.0