Person to Patient

I was wondering if OpenMRS has a way to convert from a person to a patient. This is what I would like to do

  1. A person is registered as tentative beneficiary.
  2. Some surveys captured against them. (in Obs against some questionaires), without any encounter association. Obs allows capturing data against a person. (unlike say an encounter)
  3. At some later point, the person is considered for a program, and at this point, need to be converted to a patient.

Does OpenMRS allow this sort of conversion? Or have you done anything of this sort?

1 Like

Is this helpful? https://github.com/openmrs/openmrs-core/blob/master/api/src/test/java/org/openmrs/api/PatientServiceTest.java#L713-L735

Thanks Daniel. I too assumed that programatically this is doable. I am guessing there is no exposed API which does this already.

Also, I was wondering if anyone has done this before and in what context.

Angshu, given that patient has additional required info (i.e. an identifier), can you suggest a more concise/intuitive API than the code snippet Daniel linked?

-Darius (by phone)

I meant more of an HTTP API. I can imagine it to be a http POST with the specified identifier type and optionally location uuid. I am also interested to see if someone else have used such conversion and in what context? Would there be more gotchas converting person to patient while there are data captured?

I think that REST API already exists, as:

POST .../patient
{
    "person": "uuid-of-existing-person",
    "identifiers": [ ... ]
}

See: https://github.com/openmrs/openmrs-module-webservices.rest/blob/2.20.0/omod-1.9/src/test/java/org/openmrs/module/webservices/rest/web/v1_0/controller/openmrs1_9/PatientController1_9Test.java#L89

From the very first OpenMRS projects this was an intended workflow: a person is originally created as a contact of an HIV patient; later on that person is seen in clinic, and their record is upgraded to a patient record. I think that AMPATH did/does this (though maybe through legacy UI screens). @ayeung or @jdick can you comment on whether AMPATH uses the workflow of “upgrading” an existing person record to a patient record (either because they were contacts, or just had lab results)?

So, I would not expect big gotchas.

FYI in the long run (Platform 3+) the intention is for Patient to no longer extend Person, but rather you’d have 0+ Patient records pointing to it. (Like is currently the way that User works.) But no design/planning has been done for this, and I don’t think it has any impact on what you’re asking here.

@darius, I don’t believe we are still following that workflow. So this should change should be ok for us. Thanks for letting us know.

One of the possible scenarios is a person is created through setting up relationship with a patient. That related person later goes to clinic and becomes patient.