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)
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.
Example output when since_date: 2020-10-14 13:23:17 (timestamp is not 00:00:00, so no services are returned --> incorrect result)
Example output when since_date: 2020-10-14 00:00:00 (services returned as expected!)
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 than00: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 timestamp00: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 thelastQueryDate
cursor to2020-10-14 00:00:00
no matter the time of day.since_date: 2020-10-14 13:23:17
(timestamp is not00:00:00
, so no services are returned --> incorrect result)since_date: 2020-10-14 00:00:00
(services returned as expected!)