####################################################################### Name: tpsSplitHL7# Purpose: <description># UPoC type: tps# Args: tps keyedlist containing the following keys:# MODE run mode ("start", "run" or "time")# MSGID message handle# ARGS user-supplied arguments:# <describe user-supplied args here>## Returns: tps disposition list:# <describe dispositions used here>#proc tpsSplitHL7 { args } { keylget args MODE mode ;# Fetch mode set 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 allMessages [split $msg xb] foreach oneMessage $allMessages { regsub -all -- {x1c} $oneMessage {} oneMessage if {$oneMessage != ""} { #puts [join $oneMessage xd] set new_mh [msgcopy $mh] #msgset $new_mh [join $oneMessage xd] msgset $new_mh $oneMessage lappend dispList "CONTINUE $new_mh" } } lappend dispList "KILL $mh" } 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}