We need to make some mapping updated based on the data received from Primero before we send decisions to Progres.
1. In Flow1-1 catch and success jobs, update case_id mapping to include #{service-12-digit-substring}
The case_id syntax is correct in Flow1-2 (see here where we combine the Primero case_id and substring of the service unique_id.
This needs to be applied in Flow1-1 (success) and Flow1-1 (catch) to follow the same syntax. See issue #34 for the original spec.
For Flow1-1, run this first Flow1-1. Send Referrals to Primero job to generate state for the other 2 flow jobs Flow1-1 (catch) and Flow1-1 (success)...
For Flow1-2, run this job to generate state and use a date manual cursor in order to find referrals in the request results: last_updated_at=2021-11-02T15%3A00%3A20.709Z..
config
Flow1-1. Send Referrals to Primero
See LP for Primero Gambella Demo (open_function)
Flow1-1. Send Upload Error to DTP (catch)
See LP DTP - ReceiveDecisionOutgoingReferral (staging)
Flow1-1. Send Upload Success to DTP (success)
See LP DTP - ReceiveDecisionOutgoingReferral (staging)
Flow1-2. Send Decision to DTPSee OpenFn cred:DTP-sendDecision (open_function)
expression
There are a couple of jobs in this flow where we need to make these changes...
@aleksa-krolls as discussed I removed the unique_id substring from case_id for 1.b.sendReferrals.js.
So what's left is to double check if we actually the unique_id for the error and success flow jobs.
Request
We need to make some mapping updated based on the data received from Primero before we send decisions to Progres.
1. In
Flow1-1
catch and success jobs, updatecase_id
mapping to include#{service-12-digit-substring}
Thecase_id
syntax is correct inFlow1-2
(see here where we combine the Primerocase_id
and substring of the serviceunique_id
. This needs to be applied inFlow1-1 (success)
andFlow1-1 (catch)
to follow the same syntax. See issue #34 for the original spec.2. Map service-level
progres_interventionnumber
field in Decision sent to Progres Currently when we send decisions to Progres, we are trying to mapprogres_interventionnumber
from the case-level. https://github.com/OpenFn/primero-progres/blob/d4666cd406146eb08f305b77291d3583708c5a62/jobs/1.b.sendReferrals.js#L59However, this field is actually captured on the service-level within the
services_section
array. Please update this mapping to pull the value from the correct source key. See JSON we expect to see instate.data
: https://github.com/OpenFn/primero-progres/blob/master/sampleData/getPrimeroCases.json#L66state
For
Flow1-1
, run this firstFlow1-1. Send Referrals to Primero
job to generate state for the other 2 flow jobsFlow1-1 (catch)
andFlow1-1 (success)
...For
Flow1-2
, run this job to generate state and use a date manual cursor in order to find referrals in the request results:last_updated_at=2021-11-02T15%3A00%3A20.709Z..
config
Flow1-1. Send Referrals to Primero
See LP forPrimero Gambella Demo (open_function)
Flow1-1. Send Upload Error to DTP (catch)
See LPDTP - ReceiveDecisionOutgoingReferral (staging)
Flow1-1. Send Upload Success to DTP (success)
See LPDTP - ReceiveDecisionOutgoingReferral (staging)
Flow1-2. Send Decision to DTP
See OpenFn cred:DTP-sendDecision (open_function)
expression
There are a couple of jobs in this flow where we need to make these changes...
Flow1-1. Send Upload Error to DTP (catch)
(update onlyprogres_interventionnumber
; we fail to create a Service in Primero in this scenario, so can't change thecase_id
mapping) https://github.com/OpenFn/primero-progres/blob/master/jobs/1.dtpReferralFails.js#L26-L28Flow1-1. Send Upload Success to DTP (success)
(update both mappings) https://github.com/OpenFn/primero-progres/blob/master/jobs/1.dtpReferralSucceeds.js#L9-L10Flow1-2. Send Decision to DTP
(updateprogres_interventionnumber
mapping) https://github.com/OpenFn/primero-progres/blob/master/jobs/1.b.sendReferrals.js#L59adaptor
primero
Testing notes
Feel free to run on platform
STAGING
project: https://www.openfn.org/projects/primero-progres-v4-staging/jobs