Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using carriage return <cr> in a HL7 message

The carriage return character (alias <cr>, \r or \x0d) is the designated segment terminator in a HL7 message.

Therefore this character is prohibited to be used in a field. However, some data may consist of line breaks. How is a line break encoded then? What is the way to go here? What's best practice?

There are some options I see:

  1. Use line feed (\n) instead
  2. Use this special escape sequence \.br\
  3. Escape it like this \x0d\
  4. Something different?

Which of these options are valid? What can I expect to see in a HL7 message? How should I encode line breaks in my own HL7 messages?

like image 375
RamboNo5 Avatar asked Aug 11 '14 09:08

RamboNo5


1 Answers

In formatted text fields FT your number 2 is the valid solution.

A different approach e.g. in reports or observation is to put every line in TX fields in a single segment and repeat the segments or to repeat the data fields with ~ .

In binary encapsulated data fields ED you have to use the relevant encoding e.g. Hex or Base64.

This does not exclude that you will see different ways may they be valid or not

like image 67
sqlab Avatar answered Sep 18 '22 08:09

sqlab