Error While Marking Patient Deceased

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