Hello,


Hi need to convert an ASCII message to HL7 XML, i already do this with
HAPI, but the XML proceduced is not the HL7 XML standard schema. The XML
root starts with <ORU_R01> (for example) and not with <HL7Message>. My
method use the HAPI library and it is written like this. Can you help me
please?


public InputStream transformMessageToInputStream(InputStream message)
   throws Exception {
  try {
   return new ByteArrayInputStream(new DefaultXMLParser().encode(
     new PipeParser().parse(StreamToStringUtility.getInstance()
       .convert(message, false))).getBytes("UTF-8"));
  } catch (Exception e) {
   throw MessageTransformationException.getInstance()
     .definesException(
       this.getClass().getName()
         .concat(".transformDocument()"), "", false,
       LoggingSeverity.ERROR);
  }
 }

Cheers,
Paulo Ferreira.
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to