- This topic has 10 replies, 5 voices, and was last updated 16 years, 9 months ago by .
-
Topic
-
Hello- I writing a tps proc to a kill a message base on a field OBR4:1 and then email the HL7 message. I have been successful in both cases, but I have an issue with how the hl7 message looks in the email body. We are on version 5.5 rev1 and operation system is AIX 5.3. Here is my proc:
Code:
proc tpsRAD_invalid_alias { args } {
keylget args MODE mode ;# Fetch modeset dispList {} ;# Nothing to return
switch -exact — $mode {
start {
# Perform special init functions
# N.B.: there may or may not be a MSGID key in args
}run {
# ‘run’ mode always has a MSGID; fetch and process it
keylget args MSGID mh
set msg [ msgget $mh ]
set segmentList [ split $msg r ]
set newmsg [ join $segmentList n ]
puts “Message joined by newline: $newmsg”
set segment [lindex [ lregexp $segmentList ^OBR ] 0 ]
set fieldsep [ string index $msg 3 ]
set fieldList [ split $segment $fieldsep ]
puts $fieldList
set OBR4 [ lindex $fieldList 4 ]
puts “This is OBR4: $OBR4”
set OBR4_1 [ string range $OBR4 0 1 ]
puts “This is first two characters of OBR4: $OBR4_1”
set email_subject “Invalid Cerner Radiology Order Alias Received”
if { [ string equal $OBR4_1 “CD” ] } {
set msgdisp “KILL $mh”
system echo “$newmsg” | mailx -s “$email_subject” gatkinson@bwmc.umms.org
} else {
set msgdisp “CONTINUE $mh”
}
lappend dispList $msgdisp
}time {
# Timer-based processing
# N.B.: there may or may not be a MSGID key in args
}
shutdown {
# Doing some clean-up work
}
}return $dispList
}
I tried sending message with segments join as (r) and also as (n), but both cases I always get this in the email body:Code:
MSH|^~&|HNAM|ARUNDEL|CHARGES|STAR|20071128093049||ORM^O01|Q24865496T168
MSH|94335||2.3
PID|1|1028681^^^^^STAR|1028681^^^^^STAR||CONTROL^TEMPORARY^LAKOF||192304
PID|1|21|F|CONTROL^TEMPORARY^LAKOF|1|6 SUNRISE CT^^GLEN
PID|1|BURNIE^MD^21060^US^^^02|02|(410)236-4577|NONE|E|W||730600009^^^^^S
PID|1|TAR|5467896|||||||||Not of Span/Hispanic||N
PV1|1|Inpatient|CCU^CCU^06^BWMC^^^NAH|Direct|||1058^Badro,
PV1|1|Inpatient|M.D.^Bassim~1058^Badro, M.D.^Bassim|||CAR||||*Phy
PV1|1|Inpatient|Ref/Home|||1058^Badro, M.D.^Bassim~1058^Badro,
PV1|1|Inpatient|M.D.^Bassim|IPA||1|||||||||||||||||||BWMC|||||2007110215
PV1|1|Inpatient|1400
PV2||C||||||||0|||CD:28952855||||||||||^^589723
ZVI||||CHEST PAIN NOS|||||2
ORC|NW|IR-07-0000085|||Ordered||||20071128093000|^Costanzo^Jennifer||105
ORC|NW|IR-07-0000085|||Ordered||||20071128093000|8^Badro,
ORC|NW|IR-07-0000085|||Ordered||||20071128093000|M.D.^Bassim~1058^Badro,
ORC|NW|IR-07-0000085|||Ordered||||20071128093000|M.D.^Bassim|NAH
ORC|NW|IR-07-0000085|||Ordered||||20071128093000|Pharmacy||2007112809304
ORC|NW|IR-07-0000085|||Ordered||||20071128093000|5|||Written^Written|^Co
ORC|NW|IR-07-0000085|||Ordered||||20071128093000|stanzo^Jennifer
OBR|1|IR-07-0000085||CD:28989428^IR Needle Bx/Special
OBR|1|IR-07-0000085||Procedure||||||||CD:312689^Standard
OBR|1|IR-07-0000085||Precautions|||Rad Type&Rad Type|1058^Badro,
OBR|1|IR-07-0000085||M.D.^Bassim~1058^Badro,
OBR|1|IR-07-0000085||M.D.^Bassim||||19781737|CD:28799302|20071128093046|
OBR|1|IR-07-0000085|||CD:28907525|||1^^0^20071128093000^^R|||CD:319451|^
OBR|1|IR-07-0000085||Tumor
What have others done to email HL7 messages as they come into the engine? And does anyone have any ideas why segment names repeat?
Thanks for you time!
Gary
- The forum ‘Cloverleaf’ is closed to new topics and replies.