Hello Nico,

You are completely right this is the Mirth Connect internal schema, i
thought that was the
HL7.org official schema but i was wrong. I will consider if i should/need
transform the XML to another schema or not. I will try the James sugestion.
Cheers,
Paulo.

On 19 March 2012 19:14, <nic...@skynet.be> wrote:

> Hi Paulo, James,
>
>
> HAPI is generating the right XML format according to the v2 specs.
>
> You can verify this by validating the generated instances against the xml
> schema provided by HL7.org.
>
> The xml you're referring to Paul (root node HL7Message) is a
> custom/internal format used by Mirth Connect.
>
>
> Hope this helps
>
> Best Regards
>
> Nico
>
>
> ------------------------------
> Hi Paulo,
>
> I'm not an expert in HL7 XML encoding syntax, but I just checked and the
> latest version of the spec that I have a copy of shows HAPI's current
> behaviour as being correct. It says "The message structure ID is used as a
> root element for the XML instance documents."
>
> This may have changed though, as the document I have (HL7 Version 2: XML
> Encoding Syntax Release 1) is dated from June 2003. Do you (or anyone on
> the list) know differently?
>
> All of that said, it would probably be possible to implement that
> behaviour you describe by subclassing DefaultXMLParser and then overriding
> encodeDocument(String)<http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/parser/DefaultXMLParser.html#97>so
>  that it calls the super implementation and then modifies the name of the
> root element that is returned.
>
> If by chance you do this and want to contribute it as an example for the
> HAPI documentation, that would be awesome!
>
> Cheers,
> James
>
> On Mon, Mar 19, 2012 at 11:21 AM, Paulo Ferreira <
> ferreira.rob...@gmail.com> wrote:
>
>> 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 ** (for example) and not with **. 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
>>
>>
>
>
>
------------------------------------------------------------------------------
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