Open aleksa-krolls opened 3 months ago
@aleksa-krolls should i branch off from main
or staging ?, Because the project link on v1 uses staging branch and not main
hey @mtuchi pls branch off main
... and we can overwrite staging
with your changes. (I don't trust what's currently on staging
... so we should "refresh" that branch.)
Hiya @Aleksa Krolls there is a potential performance implication when using getCases with the { withReferrals: true }
What this does is fetch referrals for each retrieved case which can take a while if there is a lot of cases fetched.
I am currently experimenting pagination with a small batch, I will share more tomorrow
@mtuchi feel free to query in smaller batches (less than 1000
)... we have long-running jobs enabled on platform
@josephjclark This is ready for code review now, See #131
@aleksa-krolls i have tested the changes locally with the lastRunDateTIme: 2024-06-20T07:12:25.383Z
. Although i am getting cases from primero but when we filter to get oscarRefs
i am getting empty results. Let me know if you need to sync to test this.
FYI. The changes in #131 uses @openfn/language-primero@2.11.7
hey @mtuchi fyi I've asked @daissatou2 for help testing here - and then I will do a final review/merge to prod when I get back online
@mtuchi I want to test this on the staging project but it looks like the PR was created against main. Can you please create the PR against staging?
@daissatou2 i think we need to overwrite what is on staging right now because i did ask @aleksa-krolls which branch to use and she suggested we use main
@aleksa-krolls we tested this together locally and it passed. I created a case & referral on Primero and we ran the workflow. We did not merge the PR per Mtuchi's last comment.
@mtuchi as discussed, pls refresh staging
branch based on the main
branch... and then we can merge your PR to staging
@aleksa-krolls i have refreshed staging
branch and change the branch base from master
to stagin
in #131
Request
Primero API requests are now limited to a maximum of
1,000
records. While it's rare that we an API query returns more than 1,000 records, we should proactively update our OpenFn jobs to consider this limit and to handle paging if more than 1k records do exist.In the job
V2/f1-j1-getPrimeroCasesV2.js
, we need to (1) change the parameter per to one thousandper: 1000
and then (2) handle scenarios where multiple pages of data may be returnedexpression.js
Please branch off main and update the job
V2/f1-j1-getPrimeroCasesV2.js
. MAKE SURE TO ONLY UPDATE JOB IN V2 FOLDER: https://github.com/OpenFn/unicef-cambodia/blob/master/jobs/V2/f1-j1-getPrimeroCasesV2.jsQuery to update: https://github.com/OpenFn/unicef-cambodia/blob/57237db68676e1eb1d6acf73fd36e506a227c391/jobs/V2/f1-j1-getPrimeroCasesV2.js#L19-L29
state
Primero (to generate state):
To test
Feel free to run locally. When ready to test, pls merge to the
staging
branch so that we can test on the Staging platform project: https://www.openfn.org/projects/primero-oscar-cambodia-io-staging/jobs/jywagaToggl
UNICEF Cambodia Primero IO Support [2024]