Error While Marking Patient Deceased

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

Are you able to reproduce it here? https://qa-refapp.openmrs.org/openmrs/module/webservices/rest/test.htm

If yes, share the Body content and URI

Sorry for the late reply, I was a bit involved in university vivas. Yes, there is an error while sending causeOfDeathNonCoded here.

uri: /openmrs/ws/rest/v1/patient/8673ee4f-e2ab-4077-ba55-4980f408773e

body content:

{“identifiers”:[{“identifier”:“100GEJ”}],“person”:{“addresses”:[{“address1”:“Address10351”,“cityVillage”:“City0351”,“country”:“India”,“postalCode”:“60351”,“preferred”:true,“stateProvince”:“State0351”}],“birthdate”:“1972-04-04”,“birthdateEstimated”:false,“causeOfDeathNonCoded”:“Eating banana”,“dead”:true,“gender”:“M”,“names”:[{“familyName”:“Wilson”,“givenName”:“John”}]}}

error:

error! msg: error errorThrown: Internal Server Error req: [object Object]

By looking at the server side log, your json is not properly formatted.

I made causeOfDeathNonCoded empty and dead:false, then the same worked successfully.

Can you share the body content?

this was the body content i tried.

Which one?

Body content with cause of death creating error

{“identifiers”:[{“identifier”:“100GEJ”}],“person”:{“addresses”:[{“address1”:“Address10351”,“cityVillage”:“City0351”,“country”:“India”,“postalCode”:“60351”,“preferred”:true,“stateProvince”:“State0351”}],“birthdate”:“1972-04-04”,“birthdateEstimated”:false,“causeOfDeathNonCoded”:“Eating banana”,“dead”:true,“gender”:“M”,“names”:[{“familyName”:“Wilson”,“givenName”:“John”}]}}

body content working fine

{“identifiers”:[{“identifier”:“100GEJ”}],“person”:{“addresses”:[{“address1”:“Address10351”,“cityVillage”:“City0351”,“country”:“India”,“postalCode”:“60351”,“preferred”:true,“stateProvince”:“State0351”}],“birthdate”:“1972-04-04”,“birthdateEstimated”:false,“causeOfDeathNonCoded”:“”,“dead”:false,“gender”:“M”,“names”:[{“familyName”:“Wilson”,“givenName”:“John”}]}}

Can you use pastebin for both body contents?

Returns error - https://pastebin.com/qEX7p7x4 Returns success - https://pastebin.com/zNu4tgQc

Even the one you claim to return success results into an internal server error when i do a POST from here: https://qa-refapp.openmrs.org/openmrs/module/webservices/rest/test.htm

Can you again try with these(They are returning success)

content - https://pastebin.com/zNu4tgQc

URI - /openmrs/ws/rest/v1/patient/8673ee4f-e2ab-4077-ba55-4980f408773e

type - POST

now, changing to dead:true and adding a text in causeOfDeathNonCoded results into server error thereby stopping me from using free text from android client

Create a ticket and raise a pull request where you should add this method to this class.

Created the ticket, please make this ready and I will send a PR