OpenFn / unicef-cambodia

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

Update Oscar since_date query cursor #63

Closed aleksa-krolls closed 3 years ago

aleksa-krolls commented 3 years ago

Background

We learned that the Oscar API will not respond with all expected data if the since_date query parameter uses a timestamp that is anything other than 00:00:00. We cannot filter Oscar cases and referrals by any specific hour/minute/second.

Request

Please update the date/time cursor referenced in L38 f2-j1 to always return the current date but with the timestamp 00:00:00 --> e.g., 2020-10-14 00:00:00 (fyi, currently, I've set it as this hardcoded date/time value to unblock testing)

https://github.com/OpenFn/unicef-cambodia/blob/8ad3bfddb1662ddb3b9fe87bf33131e96e115f05/jobs/f2-j1-getOscarCases.js#L36-L38

We recognize that OpenFn will be processing more cases per request than if it was filtering by the hour, but there is no easy Oscar-side fix. We will note this API learning in our documentation.

state

oscar production creds

adaptor

language-http

expression

f2-j1-getOscarCases.js

output

For example, if the job runs at 2020-10-14 20:45:13 --> set the lastQueryDate cursor to 2020-10-14 00:00:00 no matter the time of day.