Question

The HL7 receiver I am sending to is expecting a very specific end of file marker in a TCP Message:

<FS><CR>

Where <FS> is ascii 28 and <CR> is ascii 13.

We are using Mirth 2.x as our HL7 engine. The <CR> (Carriage Return) is fairly straight forward.

But how do I send the The File separator?

Was it helpful?

Solution

Here is how I was able to solve this problem.

In the source transformer I defined "Start of File" and "End of File" variables like this:

channelMap.put('SOF',String.fromCharCode(11)); // Start Of File: returns \v (vertical tab));
channelMap.put('EOF',String.fromCharCode(28,13)); // End Of File: returns <FS><CR>);

In the destination template I then did this:

${SOF}${message.encodedData}${EOF}

I wrote the messages out to temporary file and opened them in a Hex Editor. I was able to confirm that the a 0x0B (Ascii 11) was written prior to the message and the message closed with 0x1C 0x0D (Ascii 28, Ascii 13)

OTHER TIPS

I'd recommend using the LLP Sender in Mirth. It can be configured to use different separator chars if needed.

My guess is that the two bytes you are seeing are the end of of segment and the end of message chars.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top