Forum Replies Created
-
AuthorReplies
-
Doing following in testing but also replacing the field seperators – | pipe after OBX.5. with F and I just want OBX.5 to be changed if | appears within OBX.5
set sep [csubstr $msg 3 1] ;# HL7 field separator
set sub [csubstr $msg 4 1] ;# HL7 subfield separator
set segments [split $msg r] ;# Get segments
set outbuf “” ;# Holds outbound message
foreach seg $segments {
if [cequal $seg “”] { continue } ;# Just in case
set segtype [csubstr $seg 0 3] ;# segment type
echo >>>>>> SEGTYPE $segtype
if [cequal $segtype OBX ] { ;# OBX?
set fields [split $seg $sep] ;# Fields
echo >>>>>>>>>>> $fields $seg $sep
set sep “|”
set obx5 [string trimright [join [lrange $fields 5 end] $sep] $sep]
# regsub -all “|” $obx5 “\F\” obx5
regsub -all — {(|)} $obx5 {\F\} obx5
set obx [join [lreplace $fields 5 end $obx5] $sep]
Need to do this just for OBX.5 The regsub
Thanks just had to add the set newmsg [join $newmsg “r”] before doing the msgset $mh $newmsg.
You Clovertecher’s are great!!!
Ran Robert’s through testing tool and works but for some reason the join does not work and I am looking at that now. When echo the message after the join does not display the joined message – it is blank.
Thanks for your info and I reall appreciate the suggestions.
Disregard the previous message. Found the problem.. Levy, THANK YOU!!!!!
Levy, It worked like a charm when I put through the testing tool.
Levy Lazarre wrote:Frank,
A sample would be useful.
What does the data look like when yyyy is blank? Is it xx–zzz or xx-zzz?
looks like xx–zzzzz so when populate with PV1.7 would have the 2nd number and look like xxx-yyyy-zzzzzz
-
AuthorReplies