Error While Marking Patient Deceased

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 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

Also, in the wiki page for 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, so can I use this while sending and receiving requests from android client???

1 Like

@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

1 Like

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.

Assuming you mean https://demo.openmrs.org, the setting is concept.causeOfDeath, which has a default value of 5002. See here.

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.

2 Likes

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

@slubwama1

2 Likes

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

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

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

1 Like

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

@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 ?

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 but failed to create one

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

I created a Concept EATING BANANA and added it to Global Properties but still, there are no options to mark the patient deceased here. Can you please look into it, or create a concept so I can see it as an example.

@rishabh997 See here and here for how to setup these concepts. Basically, causeOfDeath points to a question and the answers to that question are the valid causeOfDeath codes.

@rishabh997 can these links help out

Mark Patient as Dead - #11 by dkayiwa

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

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

1 Like

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

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

Which openmrs platform version are you running?

I was using https://demo.openmrs.org/openmrs/ for rest api services

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

Are you able to reproduce this problem here? 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?

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

on the following url

I am getting this error Pastebin