My solution a year ago was to throw the MSH, PID, and PV1 segments into a “header” variable and then use foreach to iterate through each FT1 segment. I then join the header variable and the FT1 into a new message and then use “msgcreate -recover” to make a brand new message.
The problem is that when I test this tcl proc using the route testing tool, the engine panics and crashes, but when I run this script inside a process, it performs fine. Can someone help me understand what is happening?