web stats
XML data to variable always empty - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 07-08-2015, 03:16 PM
sr.brunet sr.brunet is offline
What's HL7?
 
Join Date: Sep 2014
Posts: 1
sr.brunet is on a distinguished road
Default XML data to variable always empty

Dear Community,

I'm stuck with this, I will appreciate any help.

I have a Webservice sender that does a Patient Query, the response is a RSP_K21 embedded in an XML with its SOAP envelope.

Something like this:

Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<ConsultaPacientesResponse xmlns="http://tempuri.org">
<ConsultaPacientesResult>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;RSP_K21 xmlns="urn:hl7-org:v2xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
&gt;&lt;MSH&gt;&lt;MSH.1&gt;|&lt;
/MSH.1&gt;&lt;MSH.2&gt;^~\&amp;amp;&lt;
/MSH.2&gt;&lt;MSH.3&gt;&lt;HD.1&gt;LIS&lt;
/HD.1&gt;&lt;/MSH.3&gt;&

...And so on
To make it readable, I do this in the response transformer:

var respuesta = msg..*::ConsultaPacientesResult;
logger.debug(respuesta);

And "respuesta" looks like this:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<RSP_K21 xmlns="urn:hl7-org:v2xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<MSH>
		<MSH.1>|</MSH.1>
		<MSH.2>^~\&amp;</MSH.2>
		<MSH.3>
			<HD.1>LIS</HD.1>
		</MSH.3>
		<MSH.4>
			<HD.1>LAB</HD.1>
		</MSH.4>
... And so on.
I need to store in a channel variable some of the fields of this XML. But always, no matter what I do, it always contains an empty string. I tried diffent notations but no way... I cannot access data within this tags.

I think this is a common issue within begginers but i'm not able to find the solution anywhere.

THANKS!!!

BTW, I'm using MIRTH 3.2.2.7694
Reply With Quote
Reply

Tags
data, response, tags, variable, 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 05:00 PM.


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