How to handle &
Gary,
Eric has quoted the general rule on how to escape any value, but the
value you have selected can be escaped
First is that the subcomponent seperator character... delimiter 4 in
the MSH defines the subcojmponen seperator character, which is
generally the & - ampersand.
Secondly, any reserved character in the delimiters list default defined
as:
Field Seperator - |
Component Seperator - ^
Repetition Seperator - ~ (tilde)
Escape Character - \
Subcomponent Seperator - &
If these values need to be placed in the message, they can be displayed
as the following escape sequences (remember that the Escape Character
is defined in the MSH, but is \ by default). The values should only
appear in "Text" fields of data types TX, FT and CF per the spec, but I
have seen them in other fields.
\F\ field separator
\S\ component separator
\T\ subcomponent separator
\R\ repetition separator
\E\ escape character
\Xdddd...\ hexadecimal data
So, you must have the & defined as the SubComponent Seperator in your
MSH.
You have two choices to encode that value, as Eric has stated:
\X26\ using the generic hexadecimal data
Or the specific Subcomponent escape sequence:
\T\
Specifically, you cannot have the MSH Delimiters appear in the message
anywhere other than used as a delimiter.
Also be very careful, some receivers have not implemented HL7 escape
rules at all. Make sure through testing that they can decode the escape
sequences correctly.
Thanks,
Tom
Neudesic
|