I have a channel that will receive different set of messages. It will receive
ADT - A01, A04, A18
ORM
ORU
ZPD
My issue is that the MSH segment under MSH.9 it only has MSH.9.1 it doesn?t contain the message type. I have performed a replace for the ORM, ORU and ZPD message and it works fine. I tried doing the same thing with the ADT segment by creating an IF Statement, but now the channel doesn?t want to deploy.
The following is what I have done in the preprocessing script with the ADT events, but it doesn?t work.
If message.IndexOf("EVN|A04"){
message = message.replace("|ADT|","|ADT^A04|");
}
If message.IndexOf("EVN|A08"){
message = message.replace("|ADT|","|ADT^A08|");
}
If message.IndexOf("EVN|A18"){
message = message.replace("|ADT|","|ADT^A18|");
}
message = message.replace("|ORM|","|ORM^O01|");
message = message.replace("|ORU|","|ORU^R01|");
message = message.replace("|ZPD|","|ZPD^ZPD|");
return message;
Like I mentioned before, the ORM, ORU and ZPD replace work fine, but once I add the ADT with the If statement it doesn?t work.
Could someone tell me what I?m doing wrong?
Thanks
Kelvin
ADT - A01, A04, A18
ORM
ORU
ZPD
My issue is that the MSH segment under MSH.9 it only has MSH.9.1 it doesn?t contain the message type. I have performed a replace for the ORM, ORU and ZPD message and it works fine. I tried doing the same thing with the ADT segment by creating an IF Statement, but now the channel doesn?t want to deploy.
The following is what I have done in the preprocessing script with the ADT events, but it doesn?t work.
If message.IndexOf("EVN|A04"){
message = message.replace("|ADT|","|ADT^A04|");
}
If message.IndexOf("EVN|A08"){
message = message.replace("|ADT|","|ADT^A08|");
}
If message.IndexOf("EVN|A18"){
message = message.replace("|ADT|","|ADT^A18|");
}
message = message.replace("|ORM|","|ORM^O01|");
message = message.replace("|ORU|","|ORU^R01|");
message = message.replace("|ZPD|","|ZPD^ZPD|");
return message;
Like I mentioned before, the ORM, ORU and ZPD replace work fine, but once I add the ADT with the If statement it doesn?t work.
Could someone tell me what I?m doing wrong?
Thanks
Kelvin
Comment