web stats
variable not populating - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-02-2016, 06:41 AM
jreber jreber is offline
What's HL7?
 
Join Date: Jan 2016
Posts: 2
jreber is on a distinguished road
Default variable not populating

I'm trying to read an xml file and data isn't getting inserted into their variables from one section of the xml.

The Inbound Message Trees shows
CustomerInformation
FinalReport
variant-report
ReportPDF

I can read variables and messages from FinalReport without any issues, but variables associated with variant-report are not mapped. I can drag the mapping over from the Message Tree and a step is created:

variantreport_attDisease
msg['variant-report']['@disease'].toString()

generated script for the variable is:

var mapping;

try {
mapping = msg['variant-report']['@disease'].toString();
} catch (e) {
logger.error(e);
mapping = '';
}

channelMap.put('variantreport_attDisease', validate( mapping , '', new Array()));



FMI2.xml.zip

TRF038585.xml

mc_screenshot.png
Reply With Quote
  #2  
Old 02-04-2016, 07:47 AM
mcalKno mcalKno is offline
 
Join Date: Apr 2015
Location: Pennsylvania
Posts: 247
mcalKno is on a distinguished road
Default

PHP Code:
var disXML = new XML(msg);
var 
result disXML.*::['variant-report']['@disease'].toString();
channelMap.put('disease'result); 
Reply With Quote
  #3  
Old 02-04-2016, 10:05 AM
jreber jreber is offline
What's HL7?
 
Join Date: Jan 2016
Posts: 2
jreber is on a distinguished road
Default

Thank you mcalKno, that is exactly what I needed.
Reply With Quote
Reply

Tags
mappings, variables, xml segments

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:49 AM.


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