web stats
Assigning Arbitrary Empty XML Node - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-18-2019, 09:07 AM
ace ace is offline
Mirth Newb
 
Join Date: May 2016
Location: Austin, TX, USA
Posts: 9
ace is on a distinguished road
Default Assigning Arbitrary Empty XML Node

Is it possible to create an arbitrary empty/blank XML node to assign to the arrays that Connect uses to represent HL7?

For example, I can hardcode a statement like this which replaces the MSH:

var msgXML = new XML(SerializerFactory.getSerializer('HL7V2').toXML (inStr));
msgXML['PID']['PID.5'] = <PID.5/>;

But, the <PID.5/> seems like it is a special variable or constant in Connect, not a String, so is there a way to have a variable that contains the
name of an HL7 field, like the String, 'MSH.10', or in the case above, 'PID.5', and by using that String variable, dynamically assign
an empty node, as I have done in the hardcoded version? Perhaps something like this:

var hl7FieldName = 'PID.5';
var emptyXmlNode = magicMysteryFunction(hl7FieldName);
msgXML['PID']['PID.5'] = emptyXmlNode;
Reply With Quote
 

Tags
empty, 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 03:24 AM.


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