# Allowing free Text for Death Reason

**URL:** <https://talk.openmrs.org/t/allowing-free-text-for-death-reason/17051>\
**Category:** Bahmni\
**Created:** [March 21, 2018, 10:23am UTC](https://talk.openmrs.org/t/allowing-free-text-for-death-reason/17051 "2018-03-21T10:23:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![shubhangi](https://talk.openmrs.org/letter_avatar/shubhangi/32/5_5575768a8748004e209b776fc1b2916d.png) [@shubhangi](https://talk.openmrs.org/u/shubhangi)\
**Post date:** [March 21, 2018, 10:23am UTC](https://talk.openmrs.org/t/allowing-free-text-for-death-reason/17051/1 "2018-03-21T10:23:59Z")

</div>

Hi,

Death is a person level event. In Bahmni registration app we can mark a patient as death. But there is a compulsory field called reason of death in this section which we need to fill. This field is currently coded class. Death reasons could be multiple and there can be multiple reason based on minute differences in condition due to which a patient dies. Is it possible to convert this field into a non coded / free text field a other fields on the registration page? This will allow users add an exact diagnosis / condition due to which death happened.

---

<div class="post-metadata">

**Author:** ![akanter](https://talk.openmrs.org/user_avatar/talk.openmrs.org/akanter/32/331_2.png) [@akanter](https://talk.openmrs.org/u/akanter)\
**Post date:** [March 21, 2018, 7:30pm UTC](https://talk.openmrs.org/t/allowing-free-text-for-death-reason/17051/2 "2018-03-21T19:30:41Z")

</div>

I would argue for multiple concepts and potentially for an other/free text addition, but would not recommend removing the coded concepts as this is a primary role of the EMR (to document vital statistics) and these require coded concepts.

---

<div class="post-metadata">

**Author:** ![darius](https://talk.openmrs.org/user_avatar/talk.openmrs.org/darius/32/8082_2.png) [@darius](https://talk.openmrs.org/u/darius)\
**Post date:** [March 22, 2018, 9:58pm UTC](https://talk.openmrs.org/t/allowing-free-text-for-death-reason/17051/3 "2018-03-22T21:58:34Z")

</div>

@shubhangi, in the underlying OpenMRS Platform, `Person.causeOfDeath` is coded: [https://github.com/openmrs/openmrs-core/blob/2.1.2/api/src/main/resources/org/openmrs/api/db/hibernate/Person.hbm.xml#L51](https://github.com/openmrs/openmrs-core/blob/2.1.2/api/src/main/resources/org/openmrs/api/db/hibernate/Person.hbm.xml#L51)

So, it would be possible to change this in Bahmni, but not totally straightforward. And to do so we’d probably want to extend the underlying OpenMRS platform to support free-text for this as well.

---

<div class="post-metadata">

**Author:** ![shubhangi](https://talk.openmrs.org/letter_avatar/shubhangi/32/5_5575768a8748004e209b776fc1b2916d.png) [@shubhangi](https://talk.openmrs.org/u/shubhangi)\
**Post date:** [April 2, 2018, 12:38pm UTC](https://talk.openmrs.org/t/allowing-free-text-for-death-reason/17051/4 "2018-04-02T12:38:20Z")

</div>

@akanter agree with you. It would be good to have ability to add other/free text along with coded reasons of death. this appears more like current diagnosis entry field. @darius how can this be achieved? Can you guide?

---

<div class="post-metadata">

**Author:** ![angshuonline](https://talk.openmrs.org/user_avatar/talk.openmrs.org/angshuonline/32/4925_2.png) [@angshuonline](https://talk.openmrs.org/u/angshuonline)\
**Post date:** [April 2, 2018, 12:58pm UTC](https://talk.openmrs.org/t/allowing-free-text-for-death-reason/17051/5 "2018-04-02T12:58:04Z")

</div>

Like Darius mentioned, it will require forking OpenMRS Core, and also changing Bahmni. The effort is not small, and unlikely to find a place easily in the product - which means that the effort of maintenance will be large!

Simpler way might be

- just define a form “death note” and allow someone to fill either a coded concept or a free text.
- hide the “death information” in registration!
- show the details from the “death note” in the patient dashboard or report

---

<div class="post-metadata">

**Author:** ![shubhangi](https://talk.openmrs.org/letter_avatar/shubhangi/32/5_5575768a8748004e209b776fc1b2916d.png) [@shubhangi](https://talk.openmrs.org/u/shubhangi)\
**Post date:** [April 2, 2018, 1:08pm UTC](https://talk.openmrs.org/t/allowing-free-text-for-death-reason/17051/6 "2018-04-02T13:08:41Z")

</div>

@angshuonline thanks. Was wondering if it was possible easily to create it on registration page because death is a person level event and not visit/encunter level. Template setting is easier, will probably go ahead with it.

---

<div class="post-metadata">

**Author:** ![burke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/burke/32/17_2.png) [@burke](https://talk.openmrs.org/u/burke)\
**Post date:** [April 2, 2018, 8:21pm UTC](https://talk.openmrs.org/t/allowing-free-text-for-death-reason/17051/7 "2018-04-02T20:21:48Z")

</div>

> [@angshuonline](#):
>
> Like Darius mentioned, it will require forking OpenMRS Core, and also changing Bahmni. The effort is not small, and unlikely to find a place easily in the product - which means that the effort of maintenance will be large!

Why is this so large?

- Add `person.caused_of_death_non_coded` _varchar(255)_ as we did for [Orders’ order reason](https://docs.openmrs.org/datamodel/openmrs-data-model-1.11.html#..*non_coded)
- In [`Person`](https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/Person.java), add _getCauseOfDeathNonCoded()_ and _setCauseOfDeathNonCode(String)_.

That’s not a big PR is it? 🙂

#### Optionally…

- Set `Person.CAUSE_OF_DEATH_NON_CODED` to “non coded” concept (I’m assuming we have this in a global property)
- Add a convenience method like _setCauseOfDeath(String)_ that would automatically set the coded value to `Person.CAUSE_OF_DEATH_NON_CODED`
- Consider a convenience method like _isCauseOfDeathCoded()_ to avoid forcing a client to know about `Person.CAUSE_OF_DEATH_NON_CODED`

---

<div class="post-metadata">

**Author:** ![angshuonline](https://talk.openmrs.org/user_avatar/talk.openmrs.org/angshuonline/32/4925_2.png) [@angshuonline](https://talk.openmrs.org/u/angshuonline)\
**Post date:** [April 3, 2018, 6:36am UTC](https://talk.openmrs.org/t/allowing-free-text-for-death-reason/17051/8 "2018-04-03T06:36:54Z")

</div>

Oh, I didn’t expect OpenMRS core to agree to supporting non-coded, textual cause of death. The maintenance effort if not accepted onto the core would be big.

---

<div class="post-metadata">

**Author:** ![burke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/burke/32/17_2.png) [@burke](https://talk.openmrs.org/u/burke)\
**Post date:** [April 3, 2018, 11:30am UTC](https://talk.openmrs.org/t/allowing-free-text-for-death-reason/17051/9 "2018-04-03T11:30:44Z")

</div>

> [@angshuonline](#):
>
> Oh, I didn’t expect OpenMRS core to agree to supporting non-coded, textual cause of death. The maintenance effort if not accepted onto the core would be big.

Making cause of death free text by default would be a mistake (make the data much harder to use compared to encouraging a codified value). But allowing an option of “Other, Non-Coded” where free text is used when there is no code available for the cause of death is reasonable (e.g., these free text entries could be monitored to discover missing concepts).
