I was testing a REST call to demo.openmrs.org and was surprised to see a Patient resource with the identical UUID for a Person resource:
{
"uuid": "c77c858d-3978-4135-8c4b-d85d34d3e811",
"display": "10012R - dijk van John",
"identifiers": [ ... ],
"person": {
"uuid": "c77c858d-3978-4135-8c4b-d85d34d3e811",
"display": "dijk van John",
"gender": "M",
"age": 37,
...
"links": [
{
"rel": "self",
"uri": "NEED-TO-CONFIGURE/ws/rest/v1/person/c77c858d-3978-4135-8c4b-d85d34d3e811"
},
...
],
},
"links": [
{
"rel": "self",
"uri": "NEED-TO-CONFIGURE/ws/rest/v1/patient/c77c858d-3978-4135-8c4b-d85d34d3e811"
},
...
],
}
I thought UUIDs were, by definition, universally unique to a resource. Why does the patient resource report the same UUID as the person? What is there were two or more duplicate patient records for the same person? Would they all share the same UUID? Or is the REST API simply substituting the Person UUID when reporting a Patient resource?
I realize that, due to historical events, we currently still assume Patient == Person in many places, but this duplicate UUID seems to take it too far and will cause problems in the future, since we will eventually reach a point where (like User & Provider) there may be multiple Patient resources for a given individual (e.g., registrations from different systems).