...
USE-CASE DIAGRAM FOR THE REGISTRATION MODULE
Master Patient Index Developer Notes
Errors
Patient Identifier Collision
...
Situation:
- You have an OpenMRS server set up, it is configured to connect to an MPI through OpenHIM acting as the Interoperability Layer
- Using the registration app
- You create a patient
- It gives no errors and redirects you to the patient page
- Note that the patientId in the URL is actually the uuid of the person which can be found in the person table.
- The Patient ID in the dashboard is in this case the OpenMRS ID which is autogenerated by OpenMRS.
- However, you cannot find the patient you created in the MPI when you search by name
- But if you search by OpenMRS ID, you find a different patient, this patient has the same MPI Global Identifier Domain ID (In this case Open EMPI ID) as the patient you just created
- This can be checked by looking at the patient_identifier table
Explanation
The OpenMRS generated ID already exists in the MPI under a different patient, and the . The local OpenMRS generates generated the same OpenMRS ID for a new patient it is registering and submits it, the following will happensubmitted it. This will happen for example if you create two reference application distributions, connect both of them to the same MPI and start creating patients in both of them. There will be no errors. The local patient will be saved locally but with the MPI patient's Global Identifier Domain ID (E.g. ECID for ISantePlus or OpenEMPI ID for default OpenEMPI setup). The local patient will not be saved in the MPI.
Solution
In order to ensure that your multiple OpenMRS servers do not generate IDs that collide you could do one or more of the following:
- Legacy Admin UI → Manage Patient Identifier Sources → Configure
- Add different prefixes and or suffixes
- This can also be done directly on the database table:
- Additionally you could change the next_sequence_value for the different servers.