Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   General Discussion (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=7)
-   -   File Writer - Dynamically Build Outbound Template (http://www.mirthcorp.com/community/forums/showthread.php?t=219129)

jcurry5 05-07-2019 07:55 AM

File Writer - Dynamically Build Outbound Template
 
Is there a way to dynamically build a portion of the outbound template?

Say for example I have 5 dx segments but only 2 dx segments are populated, to only output 2 lines:

<Dx Code="${dx1}" Pos="1"/>
<Dx Code="${dx2}" Pos="2"/>

Rather than have the 5 dx lines and wastefully fill in blanks if nothing is sent.

Dx code is part of a larger template:
Code:

<NPI ID="${ID}"
MedRecNo="${mrn}"
AcctNo="${acctno}"
<Dx Code="${dx1}"  Pos="1"/>
<Dx Code="${dx2}"  Pos="2"/>
<Dx Code="${dx3}"  Pos="3"/>
<Dx Code="${dx4}"  Pos="4"/>
<Dx Code="${dx5}"  Pos="5"/>
</NPI>

What I'm trying to figure out is to accomplish this:
Code:

<NPI ID="1234}"
MedRecNo="abc123"
AcctNo="xyz789"
<Dx Code="val1"  Pos="1"/>
<Dx Code="val2"  Pos="2"/>
</NPI>

Rather than this:
Code:

<NPI ID="1234}"
MedRecNo="abc123"
AcctNo="xyz789"
<Dx Code="val1"  Pos="1"/>
<Dx Code="val2"  Pos="2"/>
<Dx Code=""  Pos="3"/>
<Dx Code=""  Pos="4"/>
<Dx Code=""  Pos="5"/>
</NPI>

Thanks.


All times are GMT -8. The time now is 06:45 AM.

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