The EMR API module provides it's own "mergePatients" functionality that provides additional merge functionality on top of the core Patient Service mergePatients:
This provides two main pieces of functionality:
1) The ability to define custom PatientMergeAction
2) It merges any overlapping visits between the two patients
We'd like to migrate both of these into OpenMRS Core. TRUNK-5220 handles PatientMergeAction, this ticket is about adding the functionality to merge overlapping visits to the PatientService mergePatients method.