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:
Can we send free text now or still need to use conceptID
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?
Is it necessary to send cause along with the date and a boolean value?
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???
@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
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.
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
@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”?
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.
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.
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
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