I am using ca.uhn.hl7v2.util.Terser
to create a HL7 message. For one of the HL7 fields I need to set the following value
"\home\one\two".
HL7 message type is MDM_T02(version is 2.3.1). Because "" is an escape character in hl7 messages if I try to use
public void methodOne() {
MDM_T02 mdmt02 = new MDM_T02();
Terser terser = new Terser(mdmt02);
terser.set("OBX-5-1", "\\\\usne-server\\Pathology\\Quantum");
}
In the HL7 message OBX-5-1 is printed as "\E\E\usne-server\E\Pathology\E\Quantum".
Can someone help me to print the proper message?
As @Amit Joshi mentioned, this has to do with HL7 escaping. You may want to try to change your escape character to one other than a backslash that is unlikely to appear in your message as your client appears to not be following it anyway.
This would be the 3rd character in MSH-2.