OpenFn / unicef-cambodia

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

Calculate age based on DOB #43

Closed aleksa-krolls closed 4 years ago

aleksa-krolls commented 4 years ago

We'll receive a date_of_birth from Oscar like... "date_of_birth": "2012/05/10",. Please add a calculation to return age based on DOB. Currently I have 0 as an age placeholder.

https://github.com/OpenFn/unicef-cambodia/blob/4ab6648ab61829ed454057b4d1c91eb78086afc5/jobs/f2-j2-upsertCasesToPrimero.js#L348 Here we return a null value if the case was already registered in Primero to prevent data overwrites.

taylordowns2000 commented 4 years ago

remember to handle for both '' and undefined