|
Avoiding Escaping Delimiter Characters For a FieldSome HL7 messages may contain special delimiter characters such as ^ or ~. For each delimiter character, HL7 has a system for escaping them (see Delimiter Escape Sequences). However, in certain cases you may be required to not escape delimiter characters for a field. For example, let's assume that you need to send multiple fields from an OBX segment to another application. The application requires the OBX.5 field to contain a ~ character for each new line. If you did not avoid escaping the ~ for the OBX field, your line would start with \R\ (HL7 escape sequence) instead of ~ . Fortunately, you can use Python to easily replace any escaped characters for an outbound value of a field from an HL7 message.
To use Python to replace escaped characters:
![]() Segment Window - OBX Segment
![]() Editing Script Window
This line of code replaces all new OBX.5 lines so that they contain a ~ instead of \R\ at the beginning of each new line. |