This issue adds support for a death reporting and confirmation workflow involving CHWs and managers. We need to support reporting death as well as reversing a death.
The basic workflow for reporting a death is as follows:
The basic workflow for reversing a death is as follows:
Summary of UI changes (these are applied once a death is confirmed). See the design spec for more info:
Screenshot 1

Screenshot 2

Screenshot 3

Screenshot 4

Screenshot 5

Screenshot 6

Screenshot 7

Code review please @SCdF
date_of_death.app_settings to have a death_reporting property with mark_deceased_forms and (optionally) undo_deceased_forms arrays. The arrays must contain a list of strings for all form types that should trigger that action. death_reporting transition.mark types is received then the transition looks the patient up using the patient_id in the report's fields and mark them as deceased. The undo types mark the patient as alive.{
"transitions": {
"death_reporting": true
},
"death_reporting": {
"mark_deceased_forms": [ "dc", "death-confirm" ],
"undo_deceased_forms": [ "uc" ]
}
}
A couple of questions came up as I was testing this feature: @sglangevin
According to the workflow, the 'report death' is only available to CHW's not to managers, it this meant to be a configuration thing ?
Not just for this but other forms/reports as well, should we hide submit report or particular reports/forms when the user (like manager in this case) cannot submit that report?

The enketo forms are configurable. We don't have a concept of permissions for sms forms. @sglangevin Is this required? It could be done generically so all forms could have a permission/role required?
No, that's not required for this feature. There are actually 3 scenarios here: CHW & supervisor on Medic app, CHW on SMS and supervisor on Medic app, and CHW & supervisor on SMS. The only case where we wouldn't be fully controlling this would be the 3rd one, and I think we'd just train each set of users on the appropriate set of forms. We can come back to the issue of permissions/roles for SMS forms in the future.
Sorry for the delay here - Bede had asked me to AT a while ago and I haven't gotten to it. So I think this actually fails AT because it requires the patient to have a Medic ID. We have many projects where we aren't using Sentinel and therefore don't have Medic IDs for every patient. In those cases, we need to be able to list the UUID and have the patient's profile updated based on their UUID as opposed to the Medic ID. @garethbowen I'm assigning this back to you. Sorry it's been so long since you worked on it.
One other small point of feedback. According to the mock-up, death confirmation reports should show up on the place page for the clinic level place the person belongs to.
@amandacilek @diannakane what should happen to other past reports about deceased people? Should those show up on the place page? Or only the death confirmation?
@vimemo Code review please. This is a change to a sentinel transition to allow it to work with UUIDs (used in xforms) or patient shortcodes (used in sms forms). Let me know if it doesn't make sense!
Thanks @vimemo - I've fixed and merged that PR. Now I have another one for you! This one is about the reports of deceased children showing up in the households reports list.
The death_reporting transition now accepts UUIDs as well as shortcode IDs. This value must be in the patient_id field. Place contacts show reports for deceased children as well as live children.
Returning to AT.
Do we need closed before 2.14 release @sglangevin ?
No - this is scheduled for 2.15 so it needs to be tested before the release of 2.15.
LGTM. Working well!
Most helpful comment
No, that's not required for this feature. There are actually 3 scenarios here: CHW & supervisor on Medic app, CHW on SMS and supervisor on Medic app, and CHW & supervisor on SMS. The only case where we wouldn't be fully controlling this would be the 3rd one, and I think we'd just train each set of users on the appropriate set of forms. We can come back to the issue of permissions/roles for SMS forms in the future.