In this case, the <patient_id> source and value ('EMPI" / 100000) is already mapped to a PATIENT_NUM, but the <patient_map_id>s are not, so use that PATIENT_NUM for any of the <patient_map_id>s that are not already mapped.
Example:
<pid>
<patient_id source="EMPI">1000000</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 |
1000000 |
EMPI |
528 |
A |
528 |
HIVE |
528 |
A |
The rows in the PATIENT_MAPPING table after the update:
PATIENT_IDE |
PATIENT_IDE_SOURCE |
PATIENT_NUM |
PATIENT_IDE_STATUS |
1000000 |
EMPI |
528 |
A |
528 |
HIVE |
528 |
A |
123 |
MGH |
528 |
A |
777 |
BWH |
528 |
A |