web stats
Generate repeating XML in Mirth - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 09-13-2016, 09:08 AM
vibinChander vibinChander is offline
OBX.2 Kenobi
 
Join Date: Jul 2015
Location: Chennai
Posts: 74
vibinChander is on a distinguished road
Send a message via Skype™ to vibinChander
Default Generate repeating XML in Mirth

Hi Guys,

I was just developing CCDA xml, where I have to generate multiple template ID tags, I don't like to go by the way of defining structure in the outbound templates, so I decided to go by this method.

Code:
function data()
{
var clinicalDocument = new XML ("<clinicalDocument></clinicalDocument>");
clinicalDocument['realmCode']['@code']="US";
clinicalDocument['typeId']['@extension']="POCD_HD000040";
clinicalDocument['typeId']['@root']="2.16.840.1.113883.1.3";
clinicalDocument['templateId'][0]['@root']="2.16.840.1.113883.10.20.22.1.1";
clinicalDocument['templateId'][1]['@root']="2.16.840.1.113883.10.20.24.1.1";
clinicalDocument['templateId'][2]['@root']="2.16.840.1.113883.10.20.24.1.2";
clinicalDocument['documentationOf']['serviceEvent']['performer']['assignedEntity']['code']['@codeSystemName']="Healthcare Provider Taxonomy";
clinicalDocument['documentationOf']['serviceEvent']['performer']['assignedEntity']['code']['@displayName']="Adult Medicine";
logger.info("Data : "+clinicalDocument);
}
data();
I cannot develop template id with referring indexes. It says it is undefined. Obviously i cannot loop too, cannot use counter also. for developing output. I expect output in this format.

Code:
<templateId root="2.16.840.1.113883.10.20.22.1.1"/>	
    <templateId root="2.16.840.1.113883.10.20.24.1.1"/>
    <templateId root="2.16.840.1.113883.10.20.24.1.2"/>
kindly help
__________________

Mirth Interface Engineer
AWS DevOps
Reply With Quote
Reply

Tags
ccd, ccda, mirth 3.3.2

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 11:56 AM.


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