In HAPI 0.4.1 PipeParser was not escaping becase the
line that calls Escape was somehow deleted. Not
knowing that escape support was supposed to be there,
Stefan Köhler sent me an extenion to PipeParser that
supports escapes. This functionality belongs in Escape
rather than PipeParser, but it sounds like his escape
implementation may be more sophisticated than ours.
It recognizes type differences, so the type would have
to be passed as an arg to Escape.
Here is Stefan's explanation of his changes to
PipeParser.
"1. Replaced static method encodePrimitive
2. Added static method formattedEncoding
The functionality is identical to PipeParser, except:
1. Given a proper datatype of a field to be
encoded (i.e. TX, FT, ST, CF, and of course the variant
type to really catch OBX-5) escaping of HL7-reserved
characters is not done if and only if
1. An escape sequence is found which is valid for
the datatype (i.e. \H\ is valid for FT-fields but not
for ST-fields, while \S\ is...)
2. The sequence passes some minimal syntax checks
(ok: \M014f\, \M014F\, \M123456\ but not: \M1g\ -
improper hex val -, \M12\ - hex val too short for
\Mxxyyzz\ sequence, and so on...)
2. Unspecified escape sequences (for the datatype)
in HL7-Standard (based on version 2.4) lead to usual
escaping
3. Component and Repetition separators are not
escaped in FT/Variant fields.
Recognition of sequences is done from the left to the
right of a candidate primitive. It doesn't work, of
course, if an improper usage of escape sequences is
applied."
Unfortunately I've lost his implementation. I'll mail
him back and see if he still has it, otherwise I'll
close this request.
Logged In: YES
user_id=230410
Stefan has replied (see attached).