Previously we were asked to only fetch cases tagged with oscar referrals from Primero. Now that some of the Oscar cases synced will not have referrals, we need to change how we are going to request data from Primero... only now has Primero confirmed that what we need must be achieved by 2 GET requests rather than only 1 request.
Change request
Modify f1-j1-getPrimeroCases.js to send 2 getCases(...) requests to Primero to fetch services with referral_to_oscar as well as any oscar cases that might not have referrals (oscar_number: 'range||*.*').
We then need to combine the response to pass all cases returned to f1-j2-casesToOscar.js.
// #1 - Request oscar referrals only
getCases(
{
remote: true,
scope: {
or: {
transitions_created_at: `or_op||date_range||${
state.lastCreated || '25-09-2020' // TEST CURSOR
}.01-01-4020`,
transitions_changed_at: `or_op||date_range||${
state.lastUpdated || '25-09-2020 00:00' // TEST CURSOR
}.01-01-4020 00:00`,
},
service_response_types: 'list||referral_to_oscar', //only pulls cases with referral services
},
per: 1000,
},
// #2 - Request all oscar cases
getCases(
{
remote: true,
scope: {
or: {
transitions_created_at: `or_op||date_range||${
state.lastCreated || '25-09-2020' // TEST CURSOR
}.01-01-4020`,
transitions_changed_at: `or_op||date_range||${
state.lastUpdated || '25-09-2020 00:00' // TEST CURSOR
}.01-01-4020 00:00`,
},
oscar_number: 'range||*.*', //pulls all oscar cases that might not have referrals
},
per: 1000,
},
The flow 1 should work just as it did before... only now it will have more cases as inputs now that we're requesting more info from Primero. To test... run the full flow 1 end-to-end.
Background
Previously we were asked to only fetch cases tagged with oscar referrals from Primero. Now that some of the Oscar cases synced will not have referrals, we need to change how we are going to request data from Primero... only now has Primero confirmed that what we need must be achieved by 2 GET requests rather than only 1 request.
Change request
Modify
f1-j1-getPrimeroCases.js
to send 2getCases(...)
requests to Primero to fetch services withreferral_to_oscar
as well as any oscar cases that might not have referrals (oscar_number: 'range||*.*'
). We then need to combine the response to pass all cases returned tof1-j2-casesToOscar.js
.state.json
Use Primero Alpha staging.
adaptor
language-primero
expression.js
f1-j1-getPrimeroCases.js
side effects
The flow 1 should work just as it did before... only now it will have more cases as inputs now that we're requesting more info from Primero. To test... run the full flow 1 end-to-end.