web stats
Mirth Community - View Single Post - File Writer - Dynamically Build Outbound Template
View Single Post
  #1  
Old 05-07-2019, 07:55 AM
jcurry5 jcurry5 is offline
OBX.2 Kenobi
 
Join Date: May 2013
Posts: 57
jcurry5 is on a distinguished road
Question 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.
Reply With Quote