Affects Version/s: None
Fix Version/s: OpenMRS 2.2
Sprint:Registration Sprint 1
As a health clinic administrator, I would like to be able to merge electronic records. This is useful in situations where duplicate records have been created for a single patient or when a patient has a temporary record created that needs to be merged with a permanent one.
There should be two ways users can merge records:
- They should be prompted to merge a temporary record with a permanent one when they are viewing a temporary record.
- They should be able to go into the merge facility as a separate function and merge any two patients
When merging as a separate function, the system should prompt for the 2 patient records to be merged. The system should accept any identifier for this and ideally allow for name searching. When merging a temporary record with a permanent one, the system should only prompt for the identifier of the permanent one.
When the merging is being done, the following information should be displayed in order to aid the user in confirming that they are merging the correct patients:
- All patient identifiers
- Other demographic information (address, gender, telephone#, birth date)
- Information on their last activity in the system (e.g. “Last Seen 1-Feb-2014 at Outpatient Clinic”)
- Whether they currently have an active visit
- # of visits patient has had
After bringing up the records to merge, the user should be able to which record is the preferred one. This is the record whose demographic information will be on the resulting record. All activity (encounters, observations) from both records should be retained. The system should warn the user that merging cannot be undone and give them a chance to cancel before merging.
- Only users with the appropriate permissions will be able to merge patients
- Merge functionality should be available as a separate function
- When viewing a temporary record, the system should prompt the user (in obtrusive way) to merge with a permanent record.
- When merging 2 permanent records, the system should prompt for the identifiers of the 2 records
- When merging a temporary record with a permanent record, the system should prompt for the permanent record
- The system should list all of the pertinent information (listed above) for each record to be merged
- After viewing the records’ information, the user should be able to cancel and choose different records to merge
- The user should be able to choose which of the records being merged should be the preferred record.
- The system should retain the demographic information from the preferred record.
- The user should not be able to choose a temporary record as the preferred record
- The system should warn the user that merging cannot be done
- When merging, all of the activity from both records should be retained on the resulting record. (all identifiers, all activity, encounters, observations etc…)
- This functionality is completely implemented in the emr module that PIH uses at Mirebalais. See controller and views.
- In this ticket we should copy that implementation into the coreapps module. We should also add an app to the referenceapplication module similar to what PIH defines in the mirebalais module.
- Also make sure that if a link to merging appears in the patient header (for unknown patients) then make sure this point to the correct new URL in the coreapps module (and not the old one in the emr module)
- Also note that it's important to merge patients using the AdtService.mergePatients function in the emrapi module (the linked code already does this) rather than just call the openmrs-core version of patient merging, e.g. to do things like ensure that the resulting merged patient is not marked as Unknown.