Reproducing Forms from the Death Report

With the standard death report form, the contact object receives the attribute “date_of_death” (see screenshot of base_settings.json) which can then be accessed to disable other forms for instance. Is it possible to modify the death report form for other purposes, for instance a withdrawal of a contact? If yes, how would the attribute be added to the contact?

If not possible, could one somehow rename the “deceased” label in the user interface of the CHT app? Currently all contacts with a submitted death report appear listed in the deceased list in a household.

image

Hi @cht-user

Currently, death_reporting does exactly what you’ve described: adds a date_of_death property on the contact, which is recognized by the frontend: it adds the deceased label and shows the contact in the deceased list.
That’s the whole extent of death_reporting.

You could opt for changing translations for “Deceased” to better suit your use-case: cht-core/api/resources/translations/messages-en.properties at master · medic/cht-core · GitHub

Could you please elaborate on the workflow you were going for? What do you want to replace “deceased” with? Could muting be a better option for you?

2 Likes

Hi diana,

thanks for the answer. Our workflow would be to deactivate contacts when they leave a village or withdraw from the study. For this we would want to achieve the same effect as the death report, just with the difference that the label “deceased” should be changed.
However, I could not locate the translations file in the link (folder “resources/translations” in “api” does not exist). Is this file already in version 3.17?

Our other option for our purpose would be to use seperate forms for each scenario (move out & withdrawal) which then deactivate all tasks until a respective undo form is submitted. Of course this solution isn’t as elegant as the modified death report.

Oh, sorry for the confusion around translations, I had assumed you were already familiar with methods of changing translations, and I just indicated the keys that need to be changed.

This should cover directions on how to change translations: translations/ | Community Health Toolkit

The labels can be changed entirely with translations, if the rest of the workflow is suitable. I suggest you also look into muting, if you conclude that death_reporting is unfitting.

1 Like

No worries! I just tried this solution and it works perfectly, thank you for your help!

1 Like

Hi,
How do you undo the death report once the “date_of_death” attribute has already been added to the contact object?
I noticed that deleting the death report does not remove the “date_of_death” attribute from the contact object.
How do you enable the mute feature on the cht app? I’m using version 4.0.1 and I’ve looks like its not activated.
Thank you.
Erick
Thank you.

Hi @ewafula

You should be able to undo the death reporting using another form, that you have configured to do that in the same transition. This is mentioned in the documentation for ‘death_reporting’ https://docs.communityhealthtoolkit.org/apps/tutorials/death-reporting/#undoing-a-death-report

Add a new form, i believe the default config has a ‘undo_death_report’ form, and set it as the ‘undo_deceased_forms’ in your transition config.

Hi @ewafula… the feature documentation for muting can be found here and there’s a link at the bottom of that page to the technical documentation. Let us know if you have any questions!

Thank you @diana , I’ve added the undo death report crf and updated the app_settings.json with the following:
“death_reporting”: {
“mark_deceased_forms”: [
“death_report”
],
“date_field”: “fields.death_details.date_of_death”,
“undo_deceased_forms”: [
“undo_death_report”
]
},
I’m not sure why when I undo the death report the status is not changed from deceased.

Hi @ewafula

Could you please verify that the transition is still working? You can check this by submitting a death_report against another contact, and check if they are getting the deceased label in the webapp.
Except for the strange quote characters, I think your config is ok.

Hi @diana ,
Sorry for the late reply.
The Deceased label is being added on the webapp, However when you undo the death report. The label is not dropped and no action allowed.
Thank you.
Erick

Hi @ewafula

I apologize for the very late reply.

Could you please share some sample contents of your “undo_death_report” form?
Thanks!

Hi @diana
I’m using the undo_death_report" form adopted from default app.


Thank you.
Erick

Hi @ewafula

Thanks for sharing. Could you please share the sample contents of such a submitted report?

Here is the submitted report
image

Thanks for sharing @ewafula

I can’t tell directly from your snapshot if the report has all the necessary connecting fields. It would be helpful if you could share the JSON contents.

Alternatively, is your instance available online so I could check directly?

To get the JSON contents, all you need to do is access the document in the database directly, and you can do that even in the browser.
With the report opened (just as in the screenshot), copy the URL and replace #/reports with medic, so your URL will be like: https://<host>/medic/<uuid>.

I’m trying to make sure that:

  • the report has the structure to link to the contact that was marked as deceased
  • Sentinel is processing the document according to config

Thanks!

Here is the json document.
As you review this you can also help me on how to delete the csv docs once they have been uploaded.
Thank you

{
“_id”: “295f75cb-2be2-4575-85ed-b19de49d1939”,
“_rev”: “1-81064672ba26138765cc5f796484737b”,
“form”: “undo_death_report”,
“type”: “data_record”,
“content_type”: “xml”,
“reported_date”: 1678880657525,
“contact”: {
“_id”: “1d848e16-25ea-43fa-bdc3-f6ed0122b078”,
“parent”: {
“_id”: “465fb75a-a83b-44ba-a384-c77e0e70b5e9”
}
},
“from”: “+254723878787”,
“form_version”: {
“time”: 1678527601912,
“sha256”: “cc896d37ee064258c13f37ffd9e838ba0b33c5c56fe7713c7a7b9f647d29f85e”
},
“hidden_fields”: [
“patient_age_in_years”,
“patient_age_in_months”,
“patient_age_in_days”,
“patient_uuid”,
“patient_id”,
“patient_name”,
“patient_short_name”,
“patient_display_name”,
“data”,
“meta”
],
“fields”: {
“inputs”: {
“meta”: {
“location”: {
“lat”: “”,
“long”: “”,
“error”: “”,
“message”: “”
},
“deprecatedID”: “”
},
“source”: “contact”,
“source_id”: “”,
“contact”: {
“_id”: “1e77888d-ce0a-4c77-91e0-d8925da6abe3”,
“name”: “Paul”,
“short_name”: “”,
“patient_id”: “04900”,
“date_of_birth”: “2003-02-19”,
“sex”: “male”,
“parent”: {
“_id”: “ec61a17b-a521-41d4-9eca-86444d0c3e0f”,
“parent”: {
“contact”: {
“name”: “”,
“phone”: “”
}
}
}
}
},
“patient_age_in_years”: “20”,
“patient_age_in_months”: “240”,
“patient_age_in_days”: “7329”,
“patient_uuid”: “1e77888d-ce0a-4c77-91e0-d8925da6abe3”,
“patient_id”: “04900”,
“patient_name”: “Paul”,
“patient_short_name”: “”,
“patient_display_name”: “Paul”,
“undo”: {
“undo_information”: “yes”
},
“data”: {
“__confirm_undo”: “yes”,
“meta”: {
“__patient_uuid”: “1e77888d-ce0a-4c77-91e0-d8925da6abe3”,
“__patient_id”: “04900”,
“__household_uuid”: “ec61a17b-a521-41d4-9eca-86444d0c3e0f”,
“__source”: “contact”,
“__source_id”: “”
}
},
“meta”: {
“instanceID”: “uuid:8e23c60c-1bbd-4047-b784-2062f45bb13d”
}
},
“geolocation_log”: [
{
“timestamp”: 1678880657533,
“recording”: {
“code”: 1,
“message”: “User denied Geolocation”
}
}
],
“geolocation”: {
“code”: 1,
“message”: “User denied Geolocation”
}
}

Hi @ewafula

I don’t see anything wrong with your report. I suspect it is is the contact “Paul” (04900) that you wanted to undo the death_report for, is that correct?
I’ve checked the workflow locally, and for me the date_of_death is field is removed after Sentinel processes the undo.

Can you please check that:

  1. Sentinel is running and it’s up to date
  2. If you are logged in as an offline user, you are fully synced? It takes a little time before the contact gets updated on the server, and then the client device needs to download it again.

Thanks!

Thank you.
Any insights on this?

Hi @ewafula

I’m not sure which CSV docs you are referring to. Can you please elaborate?