Originally posted by Weston Olmstead
I'm hoping someone could offer some advice on the best practice/preferred approach to the following. I have a file that is repeating with no delimiters. I'm using a TPS script I wrote to add the MSH, PID, PV1 segments and the CRLF on the end of the ZSEG2, and I've used the same TCL to format the file into having the HL7 format (instead of just ZSEG1, ZSEG2 files that repeat over and over).
This is all occuring on my inbound TPS pre-processing, and then I have a raw route to the outbound TCP/IP HL7. However, this is being sent from cloverleaf in one large TCP/IP message. I'm trying to covert these into seperate Hl7 messages in the outbound. Its also likely that I'm going to have to a translation on this file.
The format currently (after my TPS scripts) on the inbound thread is:
MSH <cr>
PID <cr>
PV1 <cr>
ZSEG1 <cr>
ZSEG2 <crlf>
MSH <cr>
PID <cr>
PV1 <cr>
ZSEG1 <cr>
ZSEG2 <crlf>
I've read on here about splitting this up into two messages in two ways:
1. Creating a xLate that does a "Suppress" at the start, and then iterates through each Hl7 message copying the inbound to the outbound and adding a continue inside the iterate. I've tried this with no success, but i may have been an issue on my part.
2. A TCL script to do what appears to be the same thing (split the message on rn, place it in a new variable, and add that variable do a msgset using the same MSGID and then adding it to a DISPLIST that contains all the continues. I'm a bit unclear on this one, as the sample scripts I've seen all appear to be using the same msg ID (doing a set MSGID2 [msgcopy] $msgID), unless the msgcopy function generates a new id. Even in this case, I dont know how many iterations i'm going to get in each file, it could be 1, it could be 100 (and vary by day).
What is the general consensus on how to approach this given the current format of my message (I've confirmed the message is in the above format after my TPS scripts using the TPS testing tool).
Any guidence is appreciated.