As a solution I am working on creating tcl code to check each message to insure that a MRN is present in PID-3.1, and if there is not a MRN then I want to kill the message. However, before killing the message I would like to receive an email with the HL7 message in there so that I can notify the appropriate people that a patient isn’t being registered correctly.
This is what I have right now:
if {[cequal $pid_3_1 “”]} {
system “echo “Subject: No MRN is Message\n.” | sendmail
lappend dispList “KILL $mh”
return $dispList
} else {
lappend dispList “CONTINUE $mh”
return $dispList
}
I am able to get an email generated, but I am having trouble getting the HL7 message in the email so I am just looking for some help with that portion of the code. Thanks in advance!