Duplicate UUIDs in OpenMRS. Is the universe imploding?

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).

1 Like

I don’t know what went behind the original design decision, but looking at the DB schema, Patient doesn’t have a uuid, so that’s why this is happening!

Mark

2 Likes

Oh. Duh. Whew! So, the “Patient resource” is currently just a façade. That leaves open the posibility for Patient to get it’s own UUID when/if, like User & Provider, we move from the current 1:1 model to a many:1 model for Patient:Person.

Thanks Mark!

A person with multiple personalities :slight_smile:

1 Like