Creating a patient without creating a person, using REST API

Tags: #<Tag:0x00007fa3ef422530> #<Tag:0x00007fa3ef422418>

Hello guys! i am trying to figuring out a way to create a patient directly without going through a series of steps mentioned here which uses two POSTs and multiple GET APIs.

https://wiki.openmrs.org/display/docs/Create+Patient

The page itself says that

This page is out of date. E.g. with modern versions of the OpenMRS REST API it is not necessary to create a person and then a patient in two separate POSTs.

So I am trying to figure out that modern POST API

@meullah i believe you can not create a patient with out a person because in the openmrs system a patient is an extension of a person. Every user authenticated in the system is a person and they can be a patient,provider or a system admin

your POST payload will look like this

{ “person”: “uuid”, “identifiers”: [ { “identifier”: “string”, “identifierType”: “uuid”, “location”: “uuid”, “preferred”: true } ] }

1 Like

@gcliff thanks, agreed to your point.

but i thought there might be another way as mentioned in the link above.

@meullah are you looking for something like this? https://github.com/openmrs/openmrs-module-webservices.rest/blob/master/omod-1.9/src/test/java/org/openmrs/module/webservices/rest/web/v1_0/controller/openmrs1_9/PatientController1_9Test.java#L103-L117

Thank you!