Details
-
Type:
Bug
-
Status: New
-
Priority:
Major
-
Resolution: Unresolved
-
Labels:None
-
Environment:
OpenMRS 2.3
mUzima 1.8.1 SNAPSHOT
I think the problem is universal across mUzima versions.
Description
As noted in PIH-mUzima calls with Joshua Byiringiro , currently a patient merged within OpenMRS will not be merged as more data comes in from mUzima. Within OpenMRS, when a two patients are merged, the patient being merged 'from' is voided with a person.void_reason of form
Merged with patient #2255 |
. mUzima (in my understanding) has a tablet-based uuid for each patient and maps this to the OpenMRS uuid of the patient with the table muzima_registration_data. Whether the patient is voided or not, mUzima module will add the information to the mapped patient in OpenMRS.
A possible solution to this is to add a check step before information from mUzima goes to the database. 1) is the person voided. 2), do the person have a void reason like "Merged with patient #%".
If TRUE-TRUE, (pseudo-SQL)
UPDATE muzima_registration_data.assigned_uuid=
(SELECT uuid from person where person_id=
RIGHT({{void reason}}, len(void_reason)-find("#",void_reason))
)
IF TRUE-FALSE, add patient to error queue with error: 'the patient has been voided within OpenMRS' and the options to "merge data with voided patient" or "select patient to merge data to". (The selecting patient I think is lower priority)
Background: so far, there are 17 patients in Rwanda cancer screening program for whom this would apply. I have not checked if any data since the merge has come from mUzima. Not the highest priority, but I hope this makes clear one option.