Community Health Toolkit

Death form does not get synced the contact profile takes time to turn grey and hide the death report. ced right away

We have discovered that our CHVs sometimes submit multiple death reports for a single contact because they get confused if the form got submitted or not since it takes time for the contact profile to turn grey.

When a CHV submits a death report, a field called date_of_death is added in the contact’s document. Hence, in the death_report.properties.json , we ensure that the form does not appear if date_of_death field is available. Here’s the code:

{
“title”: [
{
“locale”: “en”,
“content”: “Death Report”
},
{
“locale”: “sw”,
“content”: “Taarifa ya kifo”
}
],
“icon”: “death”,
“context”: {
“person”: true,
“place”: false,
“expression”: “contact && contact.type === ‘person’ && contact.parent && contact.parent.parent && contact.parent.parent.parent && !contact.date_of_death”
}
}

While this check works after the contact profile turns grey, the problem occurs between the time a death form is submitted to when the profile changes. I observed that there is a delay of at least 30 seconds to a minute before the contact’s profile turns grey and the death form disappears. In this short time frame, I was able to submit another death report (which should not be the case).

Has anyone experienced this and if so, how did you go about resolving it?

2 Likes

Death reporting is defined as a sentinel transition and is processed server-side process. This introduces a delay from when the data is submitted, synced to the server, processed and updates pull down to the phone. During this period, the contact is still in the ‘alive’ state.

In 3.13 through issue 6737 we are looking at improving how we do muting client-side and may be useful for you if the death reporting form is also included as part of the muting forms.

In the mean time, you could write code to process the submitted forms to work out if a contact is deceased or not and store this state in contact summary which can be used in form context expressions.

3 Likes