iNTERFACEWARE Products Manual > Installing and Using Chameleon > Troubleshooting > Segment Terminator Linefeed Problems |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
The HL7 standard states very precisely that each segment should be terminated with just one 0x0D (ASCII 13) character. A very common problem occurs when developers receive HL7 data from log files or do transfers of HL7 data via FTP using the ASCII mode. When HL7 messages are saved in log files, the segment terminators are often converted to 0x0A (ASCII 10) characters or 0x0D 0x0A characters. What makes this confusing is that:
If the 0x0D characters are missing at the end of each segment altogether, Chameleon ends up treating the message as one large MSH segment. This usually violates the segment grammar for the message so you get an error message such as the following:
If the 0x0D characters are present but followed by 0x0A characters, Chameleon will not be able to identify the second segment in the message. This is because it's trying to match a four character identifier, where the first character is 0x0A. The error message you typically see is that there is no such segment defined for this message, even though at first glance the segment appears to be present in your message definition file. Fortunately there is a very easy way to diagnose this problem. When an exception is thrown in Chameleon, a large error report is generated about the exception. One especially useful part of that report is the hexadecimal dump which shows the exact characters that were given to the parser. One can inspect this printout visually to determine how each segment is terminated and whether there are illegal 0x0A characters there, or if the 0x0D characters are missing. This following example error printout shows a message which incorrectly has additional 0x0A characters at the end of each segment.
There are four ways to resolve this issue:
|