In this case the PATIENT_NUM (528) has been added to the mapping table, but the <patient_map_id> from BOTH BWH and MGH have not been added; so the hive id (PATIENT_NUM) is applied to all of the <patient_map_id>s that are not currently mapped for this patient.
Example:
<pid>
<patient_id source="HIVE">528</patient_id>
<patient_map_id source="MGH">123</patient_map_id>
<patient_map_id source="BWH">777</patient_map_id>
</pid>
The rows in the PATIENT_MAPPING table before the update:
PATIENT_IDE |
PATIENT_IDE_SOURCE |
PATIENT_NUM |
PATIENT_IDE_STATUS |
528 |
HIVE |
528 |
A |
The rows in the PATIENT_MAPPING table after the update:
PATIENT_IDE |
PATIENT_IDE_SOURCE |
PATIENT_NUM |
PATIENT_IDE_STATUS |
528 |
HIVE |
528 |
A |
123 |
MGH |
528 |
A |
777 |
BWH |
528 |
A |