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.
You can access the patient resource via the following URL:
The patient resource has its own unique representation. The following properties are found in the patient resource representation. You can find more information about available properties at REST Web Service Resources in OpenMRS 1.8.
Person object which is associated with this patient
list of objects
List of unique patient identifiers
Identifiers can be expanded to:
Type of ID
Person must have at least one preferred ID
In order to create a patient you need to have an existing person or create one first with the following command:
From the above table you can also see that you will need to provide identifiers. Identifiers among other properties need to specify identifier type and location. You can find out about available patient identifier types requesting:
To find out about available locations request:
You will also need to have a pre-generated identifier for your patient. If you are developing against Reference Application or any distribution, which uses the IDGEN module for patient identifier generation, you will need to send a regular get request. Unfortunately it is not yet exposed as a rest resource (see IDGEN-42). You can use this request for example:
Finally you can create a patient for the existing person with UUID "11f40a1b-0337-4652-86fa-18d4461e38a0", identifierType "8d79403a-c2cc-11de-8d13-0010c6dffd0f" and location "8d6c993e-c2cc-11de-8d13-0010c6dffd0f" with the following command:
You can test the above commands using a command line tool like curl. You will need to call it as follows:
You can also follow this example implemented using jQuery.
The patient resource allows only for editing identifiers. You cannot change the associated person to some other person or any of person's properties. That said if you want to update the birthdate or any other property of a person you need to POST to the person resource.