OpenFn / primero-progres

Interoperability solution for UNICEF <> UNHCR interagency referrals between Primero and Progres v4 systems.
https://openfn.github.io/primero-progres/
0 stars 2 forks source link

Update mapping for Service Referral Notes on Flow 1-1 #37

Closed daissatou2 closed 3 years ago

daissatou2 commented 3 years ago

Background, context, and business value

service_referral_notes concatenates three fields with a comma. Currently when these fields are not present in state we still add commas and send to Primero. service_referral_notes on this run is equal to ', , ' when it should be an empty string.

The specific request, in as few words as possible

Update job mapping to only add a comma only if the field is present. Consider that only 1 (or 2) of the three fields might be defined... sometimes all three fields are not present in state.

state.json

See LP Primero Gambella open_function API user

https://www.openfn.org/projects/p5am6e/messages/0615eae7-d5d3-7eb4-91bc-db715e10efa6

Expression

https://github.com/OpenFn/primero-progres/blob/master/jobs/1.upsertExtracts.js

lakhassane commented 3 years ago

@daissatou2 I updated the mapping.