If the <patient_id> source in the <patient> object is not 'HIVE' and the PATIENT_ID source ('MGH') and value ('123') combination do not exist, then a new PATIENT_NUM with value max (patient_num)+1 will be generated. All the PATIENT_NUMs for this patient will receive this value. The new patient number must also be added to the PATIENT_DIMENSION table
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 will appear as follows:
PATIENT_IDE |
PATIENT_IDE_SOURCE |
PATIENT_NUM |
PATIENT_IDE_STATUS |
528 |
HIVE |
528 |
A |
123 |
MGH |
528 |
A |
777 |
BWH |
528 |
A |