Hi David,
We do this for A44s changed to A35s. I am including an attachment of the tcl code we use. Try this.
Good Luck.
######################################################################
# Name: Cloverleaf Template
# Purpose:
# UPoC type: tps
# Args: tps keyedlist containing the following keys:
# MODE run mode (“start”, “run” or “time”)
# MSGID message handle
# ARGS user-supplied arguments:
#
#
# Returns: tps disposition list:
#
#
proc A44_to_A35 { 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 addMsg [msgcreate -class engine -type data -recover]
set splitMsg [split $msg r]
set msgTest [lindex [split [lindex [split [lindex $splitMsg [lsearch
-glob $splitMsg “MSH|*”]] |] 8] ^] 1]
if {$msgTest == “A44”} {
set test [lindex [split [lindex $splitMsg [lsearch -glob $splitMsg
“PV1|*”]] |] 2]
foreach seg $splitMsg {
set splitSeg [split $seg |]
set segID [string range $seg 0 2]
switch -exact $segID {
MSH { regsub -all A44 $seg A35 newSeg
regsub -all A44 $seg $type addSeg
append mergeMsg $newSeg[format %c 13]
append adtMsg $addSeg[format %c 13]
}
EVN { regsub -all A44 $seg A35 newSeg
regsub -all A44 $seg $type addSeg
append mergeMsg $newSeg[format %c 13]
append adtMsg $addSeg[format %c 13]
}
PID { append mergeMsg $seg[format %c 13]
append adtMsg $seg[format %c 13]
}
PV1 { append mergeMsg $seg[format %c 13]
append adtMsg $seg[format %c 13]
}
DG1 { append mergeMsg $seg[format %c 13]
append adtMsg $seg[format %c 13]
}
MRG { append mergeMsg $seg[format %c 13]
}
}
}
set mergeMsg [string trimright $mergeMsg r]
set adtMsg [string trimright $adtMsg r]
# set fullMsg $adtMsgn$mergeMsgn
msgset $mh $adtMsg
msgset $addMsg $mergeMsg
lappend dispList “CONTINUE $mh”
lappend dispList “CONTINUE $addMsg”
} else { lappend dispList “CONTINUE $mh” }
}
time {
# Timer-based processing
# N.B.: there may or may not be a MSGID key in args
}
default {
error “Unknown mode ‘$mode’ in blank”
}
}
return $dispList
}