1

I am using Java to create a A28 Message in HL7 XML Format. The output I want is : XYZCompany . Was able to add the Non-Standard Segment ZD1 by using: String aP = adt.addNonstandardSegment("ZD1"); Then added ZD1.1 Field using Terser. Now trying to add XON.1 Component: Terser te = new Terser(adt); String str =("XYZ Company");

str = StringEscapeUtils.escapeXml11(str);

te.set("ZD1-1-1" , str );

But, it doesn't print XYZCompany It prints <XON.1>NAVY</XON.1> . Questions: 1) Is it right to use the Terser to set the ZD1.1 Field with XON.1 Component using this methid? 2) Do I have to use a Custom ZD1 class with set and get methods for the output (XYZ Company) as desired? 3) If a custom ZD1 class needs to be defined, how to associate it with the adt message Object so the encoding works? . Please let me know if you have an example Custom Z Segment creation along with its Fields and components.

Thank you in advance.

0 Answers0