web stats
Mirth XML Transformer - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-11-2013, 08:51 AM
rutzelt rutzelt is offline
What's HL7?
 
Join Date: Feb 2012
Posts: 4
rutzelt is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 03-11-2013, 08:52 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,116
narupley is on a distinguished road
Default

Quote:
Originally Posted by rutzelt View Post
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.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #3  
Old 03-11-2013, 09:38 AM
rutzelt rutzelt is offline
What's HL7?
 
Join Date: Feb 2012
Posts: 4
rutzelt is on a distinguished road
Default

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
Reply With Quote
  #4  
Old 03-12-2013, 11:34 AM
rutzelt rutzelt is offline
What's HL7?
 
Join Date: Feb 2012
Posts: 4
rutzelt is on a distinguished road
Default

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.
Reply With Quote
  #5  
Old 03-29-2013, 09:31 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,116
narupley is on a distinguished road
Default

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.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
Reply

Tags
namespace, transformer, xml

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:53 AM.


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