OpenFn / primero-progres

Interoperability solution for UNICEF <> UNHCR interagency referrals between Primero and Progres v4 systems.
https://openfn.github.io/primero-progres/
0 stars 2 forks source link

Flow 1: Case with `closed` status is not being sent to DTP #20

Closed aleksa-krolls closed 3 years ago

aleksa-krolls commented 3 years ago

Bug

See this run and look at case 4f83f02. If you see L33: status: 'closed'

And yet... on the last line of the log: All cases have "open" status. No decisions to send to DTP

We need to make sure we send closed cases to DTP... because this mean the caseworker has "rejected" the case and we have to send a decision back to DTP.

expression

https://github.com/OpenFn/primero-progres/blob/master/jobs/1.b.sendReferrals.js

state

Run job Flow1-2 to recreate: https://www.openfn.org/projects/p5am6e/jobs/jv89rx

output

I expect case 4f83f02 to be detected as "closed", triggering a decision HTTP post to be sent to DTP.

lakhassane commented 3 years ago

@aleksa-krolls that one is not exactly a bug. The thing (problem?) is we first filtered by status (open/closed) but also by services_section (progres_interventionnumber). There is no case in the whole list that has the progres_interventionnumber. I will improve the log of data so you could see the content of services_section and maybe improve the feedback log to say 'All cases have "open" status or don\'t hold progres_interventionnumber. No decisions to send to DTP' (lemme know if something else is better)

aleksa-krolls commented 3 years ago

thanks @lakhassane ... I didn't notice that filter, thanks. I have adjusted and re-run, but this still isn't quite working.

See this run (https://www.openfn.org/projects/p5am6e/runs/rg5ra9pm) and search for case 4f83f02. This case matches my filter, so I expect a decision to be sent... but nothing happens. The job just seems to stop running and says Finished after the cases are fetched.

lakhassane commented 3 years ago

@aleksa-krolls I corrected as discussed. Here is the run https://www.openfn.org/projects/p5am6e/runs/rzd6jdnx In this one I don't think there is a case matching the filter