Wouter Langenberg · Jul 9, 2018

\X000D\ as a carriage return in HL7 messages

I'm receiving HL7 message containing the escape sequence \X00D\ indicating a carriage return. In the HL7 documentation I find that this is a valid escape sequence but when I read the intersystems documentation it states that only \X0D\ is valid.

What is the best way to work around this? I think that intersystems should change the UnescapeEx method in the EnsLib.HL7.Segment so that it complies with the standards.

0 2 475 2


Hi Wouter,

I'm not looking at any HL7 documentation at the moment, but I think \X0D\ is the valid escape sequence. The X denotes that this is one or more hex characters and the 0D is hex for carriage return. The value 00D would not be a valid hex value.

I forgot an extra 0 .. its \X000D\ . So it says 0D (CR) in Unicode. Instead of 2 digits what intersystems understands it's 4 digits as is permitted by the specs.