Sample REST call for Death

I am looking for sample REST call for a the “cause of death” section of patient registration. +1 if it shows death, causeofdeath and dateofdeath from the Person REST call in OpenMRS.

@judy

From peeking at the code, you should be able to POST to the person/uuid-of-person resource like:

{
    "dead": true,
    "causeOfDeath": "uuid-of-a-concept",
    "deathDate": "2015-07-06"
}
2 Likes

Thanks @darius

I have this sample but say the cause of death is a text box - how would that work ?And how would a user know beforehand what concept to add in this field . I guess what i am asking is how to post the cause of death as a text field

As far as I know this is not well-supported by the API.

What you’d need to do in this case is to store the person.causeOfDeath as the concept for “other, non-coded”, and you’d need to save the cause of death as a text obs like this one: http://maternalconceptlab.com/search.php?q=id:160218&source=openmrs

(If coded is good enough, I would assume that your UI has a concept search widget that lets the user type text, and ultimately selects a concept +/- name…)

1 Like

@larslemos does it work if you post to person instead of patient?

1 Like

Thank you @pascal it works :eyeglasses:

1 Like