In this "f2" flow, we get case data from OSCaR and upload to Primero. This recent run failed on prod because the calculated age was not within the range of 0 and 130: https://www.openfn.org/projects/pdngk6/runs/r89r3g3e
Please be careful to only use these credentials for testing...f2-j1 to get data: Oscar Staging API userf2-j2 to upload to primero: Primero Alpha Cambodia - Staging API user
Issue
In this "f2" flow, we get case data from OSCaR and upload to Primero. This recent run failed on prod because the calculated
age
was not within the range of 0 and 130: https://www.openfn.org/projects/pdngk6/runs/r89r3g3eThis could have been because we received a bad quality date value for
date_of_birth
or because the validation was only recently added. https://github.com/OpenFn/unicef-cambodia/blob/07a7a1330709e85e0f37082a70deb66a37a68198/jobs/f2-j2-upsertCasesToPrimero.js#L352-L361Please modify this age calculation logic to return
0
as a default valueif age > 30 || age < 1 || date_of_birth === undefined
.adaptor
UPDATE: Note that this is Primero
v1
so uselanguage-primero@v1.2.0
expression
Flow job triggered by
f2-j1
... https://github.com/OpenFn/unicef-cambodia/blob/master/jobs/f2-j2-upsertCasesToPrimero.jsstate
Please be careful to only use these credentials for testing...
f2-j1
to get data:Oscar Staging API user
f2-j2
to upload to primero:Primero Alpha Cambodia - Staging API user
See here for
f2-j1
state ... this is sampleoutput.json
fromf2-j1
that you can use as state forf2-j2
. https://github.com/OpenFn/unicef-cambodia/blob/master/sample_data/sample-f2-j1-output.json NOTE that this state includes 3 cases: 1 with validdate_of_birth
, 1 with very old out of range dob, and 1 withnull
dob.