# Error While Marking Patient Deceased

**URL:** <https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826>\
**Category:** Development\
**Created:** [June 3, 2020, 5:18pm UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826 "2020-06-03T17:18:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![rishabh997](https://talk.openmrs.org/user_avatar/talk.openmrs.org/rishabh997/32/11441_2.png) [@rishabh997](https://talk.openmrs.org/u/rishabh997)\
**Post date:** [June 3, 2020, 5:18pm UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/1 "2020-06-03T17:18:25Z")

</div>

I went through the previous Talk thread and found out that we were trying to implement **free text** in **causeOfDeath** column. So I have the following query:

1. Can we send free text now or still need to use conceptID
2. There is no concept.causeOfDeath in the demo server so I tried adding one using [This Wiki Page](https://bahmni.atlassian.net/wiki/spaces/BAH/pages/32014497/Configure+Death+Reasons) but UI Framework Error shows up. So how can I add one?
3. Is it necessary to send cause along with the date and a boolean value?

cc: @f4ww4z @dkayiwa @burke @gcliff

---

<div class="post-metadata">

**Author:** ![rishabh997](https://talk.openmrs.org/user_avatar/talk.openmrs.org/rishabh997/32/11441_2.png) [@rishabh997](https://talk.openmrs.org/u/rishabh997)\
**Post date:** [June 3, 2020, 5:38pm UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/2 "2020-06-03T17:38:12Z")

</div>

Also, in the [wiki page for person](https://wiki.openmrs.org/display/docs/Person), we have a variable: **causeOfDeathNonCoded** : String representation of the cause of death. Used when the cause of death does not exist as a Concept but we don’t have this variable under [rest api docs](https://rest.openmrs.org/#create-a-person), so can I use this while sending and receiving requests from android client???

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [June 3, 2020, 8:35pm UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/3 "2020-06-03T20:35:47Z")

</div>

@rishabh997 thanks for the digging into this. i recommed adopting both **causeOfDeathNonCoded** string and **causeOfDeathCoded** concept in order to tally with the existing pattern in the person data model . I have yet looked deep in to the rest model but if its only **causeOfDeathNonCoded** and no concept cause of death then you can open up a card for it in order to maintain uniformity

---

<div class="post-metadata">

**Author:** ![ibacher](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ibacher/32/19751_2.png) [@ibacher](https://talk.openmrs.org/u/ibacher)\
**Post date:** [June 4, 2020, 6:52pm UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/4 "2020-06-04T18:52:57Z")

</div>

> [@rishabh997](#):
>
> 1. Can we send free text now or still need to use conceptID

I would note that it is always preferable to capture a coded piece of data where possible. Using non-coded or free text should be avoided as much as possible.

> [@rishabh997](#):
>
> There is no concept.causeOfDeath in the demo server so I tried adding one using [This Wiki Page](https://bahmni.atlassian.net/wiki/spaces/BAH/pages/32014497/Configure+Death+Reasons) but UI Framework Error shows up. So how can I add one?

Assuming you mean [https://demo.openmrs.org](https://demo.openmrs.org), the setting is `concept.causeOfDeath`, which has a default value of 5002. See [here](https://demo.openmrs.org/openmrs/adminui/systemadmin/globalproperties/manageGlobalProperties.page#/list).

> [@rishabh997](#):
>
> Is it necessary to send cause along with the date and a boolean value?

It looks like the minimum you can send is a boolean indicating dead or not and a cause of death. Strictly speaking, you don’t need to provide a date of death, but it would be good to include this if you have it.

---

<div class="post-metadata">

**Author:** ![ssmusoke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ssmusoke/32/8020_2.png) [@ssmusoke](https://talk.openmrs.org/u/ssmusoke)\
**Post date:** [June 5, 2020, 6:08am UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/5 "2020-06-05T06:08:17Z")

</div>

Bringing @slubwama to this discussion as he worked on the Coreapps widget for marking a patient as dead

@slubwama1

---

<div class="post-metadata">

**Author:** ![rishabh997](https://talk.openmrs.org/user_avatar/talk.openmrs.org/rishabh997/32/11441_2.png) [@rishabh997](https://talk.openmrs.org/u/rishabh997)\
**Post date:** [June 6, 2020, 4:51am UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/6 "2020-06-06T04:51:16Z")

</div>

> [@ibacher](#):
>
> Assuming you mean [https://demo.openmrs.org](https://demo.openmrs.org), the setting is `concept.causeOfDeath` , which has a default value of 5002. See [here](https://demo.openmrs.org/openmrs/adminui/systemadmin/globalproperties/manageGlobalProperties.page#/list).

So how can we add strings or add codes to check them on the deceased page?

> [@ibacher](#):
>
> minimum you can send is a boolean indicating dead or not and a cause of death

This indicates that **cause** is necessary (both coded and non-coded will work)

> [@gcliff](#):
>
> **causeOfDeathCoded** concept in order to tally with the existing pattern in the person data model

working on receiving concepts from server, in case they are not present, ill add the free text.

---

<div class="post-metadata">

**Author:** ![rishabh997](https://talk.openmrs.org/user_avatar/talk.openmrs.org/rishabh997/32/11441_2.png) [@rishabh997](https://talk.openmrs.org/u/rishabh997)\
**Post date:** [June 9, 2020, 7:00pm UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/7 "2020-06-09T19:00:11Z")

</div>

I was using causeOfDeathNonCoded variable to mark patient dead but I am getting following response from server…

**Response I sent:**

{ “identifiers”: [{ “identifier”: “100J19” }], “person”: { “addresses”: [{ “address1”: “kamue”, “cityVillage”: “shs”, “country”: “India”, “postalCode”: “kansk”, “preferred”: true, “stateProvince”: “shsa” }], “birthdate”: “2020-06-01”, “birthdateEstimated”: false, **"causeOfDeathNonCoded": “Eating BANANA Maaaannnn”,****"dead": true,** “gender”: “M”, “names”: [{ “familyName”: “mishra”, “givenName”: “myself” }] } }

**The response I Received:** { “error”: { “message”: “[Some properties are not allowed to be set: causeOfDeathNonCoded]”, “code”: “org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource:690”, “detail”: "org.openmrs.module.webservices.rest.web.response.ConversionException: Some properties are not allowed to be set: causeOfDeathNonCoded\n\tat org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource.setConvertedProperties(BaseDelegatingResource.java:690)\n\tat org.openmrs.module.webservices.rest.web.v1\_0.resource.openmrs1\_8.PatientResource1\_8.getPatientForUpdate(PatientResource1\_8.java:351)\n\tat org.openmrs.module.webservices.rest.web.v1\_0.resource.openmrs1\_8.PatientResource1\_8.update(PatientResource1\_8.java:341)\n\tat org.openmrs.module.webservices.rest.web.v1\_0.controller.MainResourceController.update(MainResourceController.java:134)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:177)\n\tat org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:446)\n\tat org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:434)\n\tat org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)\n\tat org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)\n\tat org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)\n\tat org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:650)\n\tat org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:731)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.jav

Can you help me here, please cc: @dkayiwa @burke @gcliff @ibacher

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [June 9, 2020, 8:02pm UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/8 "2020-06-09T20:02:45Z")

</div>

@rishabh997 i see from the logs the converter is failing to convert the string **Eating BANANA Maaaannnn** throwing a `ConversionException`, the rest api `person resource` doesn’t seem to support this which goes back to what i had earlier on proposed that this needs a card to implement it first in the rest module then we can leverage the new functionality in your use case.

By the way does it work when you use a concept mapping,something like this **“causeOfDeathNonCoded”: “concept name/concept uuid”**?

@ibacher @dkayiwa whats your take on this ?

---

<div class="post-metadata">

**Author:** ![rishabh997](https://talk.openmrs.org/user_avatar/talk.openmrs.org/rishabh997/32/11441_2.png) [@rishabh997](https://talk.openmrs.org/u/rishabh997)\
**Post date:** [June 9, 2020, 8:26pm UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/9 "2020-06-09T20:26:38Z")

</div>

I didnt tried using concepts, since there are no concepts of causeOfDeath in demo server. I tried adding one following the instructions on [https://bahmni.atlassian.net/wiki/spaces/BAH/pages/32014497/Configure+Death+Reasons](https://bahmni.atlassian.net/wiki/spaces/BAH/pages/32014497/Configure+Death+Reasons) but failed to create one

---

<div class="post-metadata">

**Author:** ![sharif](https://talk.openmrs.org/user_avatar/talk.openmrs.org/sharif/32/11982_2.png) [@sharif](https://talk.openmrs.org/u/sharif)\
**Post date:** [June 10, 2020, 6:14am UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/10 "2020-06-10T06:14:51Z")

</div>

> [@rishabh997](#):
>
> I didnt tried using concepts, since there are no concepts of causeOfDeath in demo server.

@rishabh997 why dont you try creating the concept and try using it,as the second option

---

<div class="post-metadata">

**Author:** ![rishabh997](https://talk.openmrs.org/user_avatar/talk.openmrs.org/rishabh997/32/11441_2.png) [@rishabh997](https://talk.openmrs.org/u/rishabh997)\
**Post date:** [June 10, 2020, 12:22pm UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/11 "2020-06-10T12:22:28Z")

</div>

I created a Concept [EATING BANANA](https://demo.openmrs.org/openmrs/dictionary/concept.htm?conceptId=165864) and added it to [Global Properties](https://demo.openmrs.org/openmrs/admin/maintenance/globalProps.form) but still, there are no options to mark the patient deceased [here](https://demo.openmrs.org/openmrs/coreapps/markPatientDead.page?patientId=5d563591-dbca-4f5b-a776-a344101b4449&returnUrl=%2Fopenmrs%2Fcoreapps%2Fclinicianfacing%2Fpatient.page%3FpatientId%3D5d563591-dbca-4f5b-a776-a344101b4449%26). Can you please look into it, or create a concept so I can see it as an example.

---

<div class="post-metadata">

**Author:** ![ibacher](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ibacher/32/19751_2.png) [@ibacher](https://talk.openmrs.org/u/ibacher)\
**Post date:** [June 10, 2020, 1:37pm UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/12 "2020-06-10T13:37:22Z")

</div>

@rishabh997 See [here](https://demo.openmrs.org/openmrs/dictionary/concept.htm?conceptId=165860) and [here](https://demo.openmrs.org/openmrs/dictionary/concept.htm?conceptId=165861) for how to setup these concepts. Basically, `causeOfDeath` points to a question and the answers to that question are the valid `causeOfDeath` codes.

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [June 10, 2020, 1:52pm UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/13 "2020-06-10T13:52:17Z")

</div>

@rishabh997 can these links help out

[Mark Patient as Dead - #11 by dkayiwa](https://talk.openmrs.org/t/mark-patient-as-dead/6279/11)

> [@What concept(s) are you using for cause of death for your implementations?](https://talk.openmrs.org/t/what-concept-s-are-you-using-for-cause-of-death-for-your-implementations/17523):
>
> Hi, I’m working on submitting a case report for a patient and I need to submit death info about them specifically the cause of death, in OpenMRS in order to mark a patient as dead, you need to specify the cause death and you’d need to first configure what the question concepts is, I’m curious to know what concept(s) implementations are using out there. Thanks in advance! Wyclif

> [@Why do we require a cause of death concept to mark patient as dead?](https://talk.openmrs.org/t/why-do-we-require-a-cause-of-death-concept-to-mark-patient-as-dead/18130):
>
> Continuing the discussion from [Mark Patient as Dead](https://talk.openmrs.org/t/mark-patient-as-dead/6279/11): [person.cause\_of\_death](https://docs.openmrs.org/datamodel/openmrs-data-model-1.11.html#person.cause_of_death) is part of the data model. Why do we then require a “Cause of death” concept to be defined before a person can be marked as dead? If we create an observation for cause of death, could it be optional (i.e., if a concept hasn’t been defined, then don’t create an observation)? Tickets like [TRUNK-3269](https://issues.openmrs.org/browse/TRUNK-3269) suggest that we’re using observations for recording cause of death. Why is that? Also, [searching JIRA](https://issues.openmrs.org/browse/HTML-177?jql=text%20~%20%22cause%20of%20death%22), it doesn’t look lik…

---

<div class="post-metadata">

**Author:** ![rishabh997](https://talk.openmrs.org/user_avatar/talk.openmrs.org/rishabh997/32/11441_2.png) [@rishabh997](https://talk.openmrs.org/u/rishabh997)\
**Post date:** [June 10, 2020, 2:30pm UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/14 "2020-06-10T14:30:21Z")

</div>

Thanks a lot, @ibacher.@gcliff, I already went through all the talks thread having causeOfDeath keyword in them but couldn’t find any help. ☹So, basically right now, I need to fetch the related concepts in Android and use them to mark them detonated.

> [@gcliff](#):
>
> implement it first in the rest module then we can leverage the new functionality in your use case.

I will use the **causeOfDeath(coded)** and show an error toast until this is implemented. But we really need the `person resource API` to be able to process **causeOfDeathNonCoded** as it will be handy when there are no concepts stored in reference application. cc: @dkayiwa, what’s your say on this. Thanks

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [June 10, 2020, 3:46pm UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/15 "2020-06-10T15:46:47Z")

</div>

Are you talking about a REST api for simply marking a patient as dead?

---

<div class="post-metadata">

**Author:** ![rishabh997](https://talk.openmrs.org/user_avatar/talk.openmrs.org/rishabh997/32/11441_2.png) [@rishabh997](https://talk.openmrs.org/u/rishabh997)\
**Post date:** [June 10, 2020, 4:23pm UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/16 "2020-06-10T16:23:53Z")

</div>

yes, but by using **causeOfDeathNonCoded**. I got some errors while marking patient dead when I was sending boolean value **dead** and cause of death **causeOfDeathNonCoded**

> [@Error While Marking Patient Deceased](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/7):
>
> I was using causeOfDeathNonCoded variable to mark patient dead but I am getting following response from server… Response I sent: { “identifiers”: [{ “identifier”: “100J19” }], “person”: { “addresses”: [{ “address1”: “kamue”, “cityVillage”: “shs”, “country”: “India”, “postalCode”: “kansk”, “preferred”: true, “stateProvince”: “shsa” }], “birthdate”: “2020-06-01”, “birthdateEstimated”: false, "causeOfDeathNonCoded": “Eating BANANA Maaaannnn”, "dead": true, “gender”: “M”, “names”: [ { “family…

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [June 11, 2020, 12:39pm UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/17 "2020-06-11T12:39:40Z")

</div>

Which openmrs platform version are you running?

---

<div class="post-metadata">

**Author:** ![rishabh997](https://talk.openmrs.org/user_avatar/talk.openmrs.org/rishabh997/32/11441_2.png) [@rishabh997](https://talk.openmrs.org/u/rishabh997)\
**Post date:** [June 11, 2020, 4:52pm UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/18 "2020-06-11T16:52:51Z")

</div>

I was using [https://demo.openmrs.org/openmrs/](https://demo.openmrs.org/openmrs/) for rest api services

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [June 15, 2020, 10:55am UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/19 "2020-06-15T10:55:57Z")

</div>

This looks like the ticket the ticket that added this feature: [https://issues.openmrs.org/browse/RESTWS-713](https://issues.openmrs.org/browse/RESTWS-713)

Are you able to reproduce this problem here? [https://qa-refapp.openmrs.org/](https://qa-refapp.openmrs.org/)

If yet, can you share the exact url that you are posting to and the data that you are posting?

---

<div class="post-metadata">

**Author:** ![rishabh997](https://talk.openmrs.org/user_avatar/talk.openmrs.org/rishabh997/32/11441_2.png) [@rishabh997](https://talk.openmrs.org/u/rishabh997)\
**Post date:** [June 15, 2020, 9:22pm UTC](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826/20 "2020-06-15T21:22:05Z")

</div>

on qa-refapp, the coded cause of death worked absolutely fine, but when I am sending the following data through rest

 ![Screenshot_2020-06-16-02-49-00-81_0b570628ec88a4202b7916ec2df1bebf](https://talk.openmrs.org/uploads/default/original/2X/e/e1e53615942dab04c83db41194b74cbd2cc31847.jpeg)

on the following url

 ![Screenshot_2020-06-16-02-53-10-58_0b570628ec88a4202b7916ec2df1bebf](https://talk.openmrs.org/uploads/default/original/2X/3/3126a60a44dab8efec8eac73dcb8d5b9e9b67d8e.jpeg)

I am getting this error [Pastebin](https://pastebin.com/T8Z5eijG)

[Next page](https://talk.openmrs.org/t/error-while-marking-patient-deceased/28826.md?page=2)
