Hi Guys,
In the destination section I am updating the PID.3.4 but also need to delete a specific string of text in PID.3.1.
Below is the source message I need to clear the text '_STG' from PID.3.1. Any suggestions?
Source Message:
MSH|^~\&|SpeechReport|G2|||20210720064453.2044||OR U^R01^ORU_R01|c26b66b1-33d8-4627-9b61-48cc59c96205||2.4 PID|||789_STG^^^MRN^MRN~NHS1234^^^NHS^NHS||PATIENT 2^FAKE||19860818|M|||...^^^^^^^^RJ7MRN
OBR|1|21H00890002|21H00890002|HIST|||||||||||||||| ||20210720064442|||F|||||||Admin&SOL Administrator|Admin&SOL Administrator
OBX|1|FT|21H00890002|#DDCLIN|test|||N|||F
To Be Message:
MSH|^~\&|SpeechReport|G2|||20210720064453.2044||OR U^R01^ORU_R01|c26b66b1-33d8-4627-9b61-48cc59c96205||2.4
PID|||789^^^RJ7MRN^MRN~NHS1234^^^NHS^NHS||PATIENT 2^FAKE||19860818|M|||...^^^^^^^^RJ7MRN
OBR|1|21H00890002|21H00890002|HIST|||||||||||||||| ||20210720064442|||F|||||||Admin&SOL Administrator|Admin&SOL Administrator
OBX|1|FT|21H00890002|#DDCLIN|test|||N|||F
Code for the replacement only:
for (var PatientListIteration=0; PatientListIteration < msg['PID']['PID.11'].length(); PatientListIteration++) {
if ( msg['PID']['PID.11'][PatientListIteration]['PID.11.9'].toString() == "RJ7MRN") {
tmp['PID']['PID.3'][PatientListIteration]['PID.3.4'] = "RJ7MRN"
}
}
Thanks in advance
In the destination section I am updating the PID.3.4 but also need to delete a specific string of text in PID.3.1.
Below is the source message I need to clear the text '_STG' from PID.3.1. Any suggestions?
Source Message:
MSH|^~\&|SpeechReport|G2|||20210720064453.2044||OR U^R01^ORU_R01|c26b66b1-33d8-4627-9b61-48cc59c96205||2.4 PID|||789_STG^^^MRN^MRN~NHS1234^^^NHS^NHS||PATIENT 2^FAKE||19860818|M|||...^^^^^^^^RJ7MRN
OBR|1|21H00890002|21H00890002|HIST|||||||||||||||| ||20210720064442|||F|||||||Admin&SOL Administrator|Admin&SOL Administrator
OBX|1|FT|21H00890002|#DDCLIN|test|||N|||F
To Be Message:
MSH|^~\&|SpeechReport|G2|||20210720064453.2044||OR U^R01^ORU_R01|c26b66b1-33d8-4627-9b61-48cc59c96205||2.4
PID|||789^^^RJ7MRN^MRN~NHS1234^^^NHS^NHS||PATIENT 2^FAKE||19860818|M|||...^^^^^^^^RJ7MRN
OBR|1|21H00890002|21H00890002|HIST|||||||||||||||| ||20210720064442|||F|||||||Admin&SOL Administrator|Admin&SOL Administrator
OBX|1|FT|21H00890002|#DDCLIN|test|||N|||F
Code for the replacement only:
for (var PatientListIteration=0; PatientListIteration < msg['PID']['PID.11'].length(); PatientListIteration++) {
if ( msg['PID']['PID.11'][PatientListIteration]['PID.11.9'].toString() == "RJ7MRN") {
tmp['PID']['PID.3'][PatientListIteration]['PID.3.4'] = "RJ7MRN"
}
}
Thanks in advance
Comment