(<patient> not found, generate [max + 1])
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:
New <patient_id> source / value pair = 'MGH' / 123
Select max(patient_num) from patient_mapping = 527
New patient_num = max(patient_num) + 1 = 528
<span style="color: #0000ff"><</span><span style="color: #a31515">pid</span><span style="color: #0000ff">></span>
<span style="color: #0000ff"><</span><span style="color: #a31515">patient_map_id</span> <span style="color: #ff0000">source</span>="<span style="color: #0000ff">MGH</span>"<span style="color: #0000ff">></span>123<span style="color: #0000ff"></</span><span style="color: #a31515">patient_map_id</span><span style="color: #0000ff">></span>
<span style="color: #0000ff"></</span><span style="color: #a31515">pid</span><span style="color: #0000ff">></span>
The rows in the PATIENT_MAPPING table will appear as follows:
PATIENT_IDE |
PATIENT_IDE_SOURCE |
PATIENT_NUM |
PATIENT_IDE_STATUS |
123 |
MGH |
528 |
A |
528 |
HIVE |
528 |
A |