OpenFn / lwala

2 stars 3 forks source link

Incorrect transformation in 514_Update_Person_in_SF job #50

Closed ritazagoni closed 3 years ago

ritazagoni commented 3 years ago

Request

  1. There is a transformation error in the MOH514 Update Person in SF job.

In this message on line 33 we recieve the following value: "No_FPmethod_reason": "intentions_of_getting_pregnant". This should be transformed to Intentions of getting pregnant but the erroneous result is 'intentions of getting The client is pregnant'.

Transformation rules: pregnant --> The client is pregnant intentions_of_getting_pregnant --> Intentions of getting pregnant lack_of_access_to_fp_information > Lack of access to FP information

i think the problem lies in this piece of code where we replace the word pregnant but not checking for whole word. So we're picking up pregnant from intentions_of_getting_pregnant.

  1. Also please add: intentions_of_getting_pregnant and `lack_of_access_to_fp_information (see Transformation rules above) to the job (they were probably added later to CommCare hence the problem and missing cleaning).

For Salesforce, if multiple values are selected... then should be separated by a semi-colon (e.g., Field__c: 'Value1; Value2')

See issue and fix for the same problem in MOH513 Enroll Household job: https://github.com/OpenFn/lwala/issues/49

Expression

Job: https://github.com/OpenFn/lwala/blob/master/commcare-salesforce-jobs/MOH514-Update-Person-in-SF-Production.js

Failed run to test: https://www.openfn.org/projects/pdbmj5/runs/r893abg3

Message: https://www.openfn.org/projects/pdbmj5/messages/mqpj6kk9

State:

See LP for Lwala Salesforce Production

Adaptor

language-salesforce

ritazagoni commented 3 years ago

See similar previous issue for other job for reference: https://github.com/OpenFn/lwala/issues/49

aleksa-krolls commented 3 years ago

@ritazagoni to make sure we do this properly this time, can you please draft an Excel mapping table for these values? To do this....

  1. For every relevant CommCare MOH form, export the list of choice values for this question. (I want to 100% make sure these choice values are the same across forms.) See here for how to export form contents.
  2. Log into SF to confirm which picklist values are configured for this field on Person__c

Then we can hand off to Mamadou a very specific mapping table spec to implement... as well as flag if it should be slightly different between forms/jobs. Thanks!!

ritazagoni commented 3 years ago

@lakhassane confirming that form values are same as in the referred MOH513 Enroll Household job, see values here: https://docs.google.com/spreadsheets/d/1RacnVeCqNC21PZ1TLkmjcvdMgUtiPhLZ-cfxB6RZrUs/edit#gid=107763190

lakhassane commented 3 years ago

@ritazagoni I made the transformation https://www.openfn.org/projects/pdbmj5/runs/rwabd53x