Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   Mirth XML Transformer (http://www.mirthcorp.com/community/forums/showthread.php?t=8442)

rutzelt 03-11-2013 08:51 AM

Mirth XML Transformer
 
I currently have an XML source that I simply want to interrogate and print out a debug statement. I find that the moment I introduce a transformer to my XML channel, it modifies the output. I use a Javascript step for my transformer. Here are my findings:

No XML transformer:
XML IN -> XML OUT (identical)

Introduce transformer:
XML IN
<log the XML in the transformer> (i.e. logger.info(message.toString());
XML OUT (smaller in size than the original without the original stylesheet).

I need to preserve my XML payload from input through output. If it gets modified, my consumer cannot process it correctly.

Any ideas?

Thanks in advance,
Tom

narupley 03-11-2013 08:52 AM

Quote:

Originally Posted by rutzelt (Post 31206)
I currently have an XML source that I simply want to interrogate and print out a debug statement. I find that the moment I introduce a transformer to my XML channel, it modifies the output. I use a Javascript step for my transformer. Here are my findings:

No XML transformer:
XML IN -> XML OUT (identical)

Introduce transformer:
XML IN
<log the XML in the transformer> (i.e. logger.info(message.toString());
XML OUT (smaller in size than the original without the original stylesheet).

I need to preserve my XML payload from input through output. If it gets modified, my consumer cannot process it correctly.

Any ideas?

Thanks in advance,
Tom

Can you post a sample message? By default "strip namespaces" is turned on, so that may be the issue.

rutzelt 03-11-2013 09:38 AM

Thanks for the quick response. I made sure to uncheck 'strip namespaces' in my channel.

Here is an example source (XML):

<?xml-stylesheet type='text/xsl' href='http://cdastyle.e-mds.com/cda2.xsl'?>
<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:mif="urn:hl7-org:v3/mif" xmlns:sdtc="urn:hl7-org:sdtc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hl7-org:v3 http://xreg2.nist.gov:8080/hitspValidation/schema/cdar2c32/infrastructure/cda/C32_CDA.xsd">
<realmCode code="US"/>
<typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/>
<templateId root="2.16.840.1.113883.3.27.1776" assigningAuthorityName="CDA/R2"/>
<templateId root="2.16.840.1.113883.10.20.1" assigningAuthorityName="CCD"/>
<templateId root="2.16.840.1.113883.3.88.11.32.1" assigningAuthorityName="HITSP/C32"/>
<templateId root="2.16.840.1.113883.10.20.3" assigningAuthorityName="CDA4CDT"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.3" assigningAuthorityName="XDS-MS Referral Summary"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.2" extension="IHE"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.5" extension="PHR Extract"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.1"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.10" extension="ED Referral Specification"/>
<id root="3153ABA9-8CDB-4A81-B441-0D52FA34E323"/>
<code code="34133-9" codeSystem="2.16.840.1.113883.6.1" displayName="Summarization of episode note"/>
<title>Chart Summary</title>
</ClinicalDocument>

This is the processed result:
<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:mif="urn:hl7-org:v3/mif" xmlns:sdtc="urn:hl7-org:sdtc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hl7-org:v3 http://xreg2.nist.gov:8080/hitspValidation/schema/cdar2c32/infrastructure/cda/C32_CDA.xsd">
<realmCode code="US"/>
<typeId extension="POCD_HD000040" root="2.16.840.1.113883.1.3"/>
<templateId assigningAuthorityName="CDA/R2" root="2.16.840.1.113883.3.27.1776"/>
<templateId assigningAuthorityName="CCD" root="2.16.840.1.113883.10.20.1"/>
<templateId assigningAuthorityName="HITSP/C32" root="2.16.840.1.113883.3.88.11.32.1"/>
<templateId assigningAuthorityName="CDA4CDT" root="2.16.840.1.113883.10.20.3"/>
<templateId assigningAuthorityName="XDS-MS Referral Summary" root="1.3.6.1.4.1.19376.1.5.3.1.1.3"/>
<templateId extension="IHE" root="1.3.6.1.4.1.19376.1.5.3.1.1.2"/>
<templateId extension="PHR Extract" root="1.3.6.1.4.1.19376.1.5.3.1.1.5"/>
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.1"/>
<templateId extension="ED Referral Specification" root="1.3.6.1.4.1.19376.1.5.3.1.1.10"/>
<id root="3153ABA9-8CDB-4A81-B441-0D52FA34E323"/>
<code code="34133-9" codeSystem="2.16.840.1.113883.6.1" displayName="Summarization of episode note"/>
<title>Chart Summary</title>
</ClinicalDocument>

As you can see, it has been modified even though I did not instruct our transformer to transform the message in any way. I might want to do that in the future however.

If I remove the transformer step, the output is identical to the input.

Thanks,
Tom

rutzelt 03-12-2013 11:34 AM

I forgot to mention, I'm using the latest version of Mirth, Windows 7 64-bit, and Java 7.

It appears that there could be a bug in the "strip namepaces" function. Have you been able to reproduce the issue? I can do it with an extremely simple case.

Thanks.

narupley 03-29-2013 09:31 AM

Just to update, I've created an issue for this: MIRTH-2441. I've looked through it and am not quite sure why it's happening, though my initial guess is that it may be a limitation of Rhino's implementation of E4X.


All times are GMT -8. The time now is 11:23 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation