Handling Duplicate Patient Identifiers

Hi all,

I’m excited to inform you that the mergepatientdata module can actually work now.

Wanna give it a try?

Clone its repo, build the module and install it on refApp 2.* . Then your set to go, Just go the mergepatient data Dashboard and export/import Patient data :blush:

Discovered Challenge

As for refApp, its very possible to create Patients in one instance that have exactly the same Patient Identifiers with other Patients in another instance. However this is no worry in the usual application. The challenge arises when we try to Merge Data from one instance to another.

How does sync2 handle such incidences?

With sync2, it exports/imports data through REST injections by delegating either FHIR/rest.webservices module. When such an incidence is hit upon, The found old Patient(Patient the has exactly the same Identifier with that trying to be merged in) is deleted from system and replaced with a new one :smile: .

How does mergepatientdata handle such incidences?

Currently, Its just skipping those Patients that are having conflicting Identifiers. This is were I really need your Tech advise. I just created two fresh server, and created new Patients there.

Server1

Server2

Like you could see, all these Patients from have Conflicting Identifiers, on tying to merge Patients from server1 to server2, the Operation obviously fails with this audit.

How should we handle such cases? Should we borrow ideas from sync2? Is so, isn’t it prone to data loss :slight_smile:

cc: @ssmusoke, @dkayiwa

How about using the same approach as the metadatasharing module when importing metadata? https://wiki.openmrs.org/display/docs/User's+Guide+for+Metadata+Sharing+Module