SHR sometimes duplicates patient identifiers


I ran into a bug while working with the SHR, when one submits a document that contains a CDA where the source patient id in the embedded CDA document differs from the external Id in the XDS.b wrapper, the source id will always be added to the existing patient which results in multiple duplicates. The bug is actually in OpenMRS, I created this OpenMRS ticket TRUNK-5089 to get it fixed, I also created a jira issue in the SHR’s XDS repository module to have a temporary fix and issued a pull request for it, you can find it at