XSLT for Loop 2110

Jul 6, 2011 at 5:11 AM
Edited Jul 6, 2011 at 11:36 AM

Hello Dstrubhar,

 Good Morning.

Thanks for quick reply. I am presently working with .835 Parser which uses to parse ERA for my own software using your frame work. I am confused how to add a loop in .XSLT file.

ERA files can be having more then one Date of services. Means In the Loop of 2110 for Segments SVC, DTM, QTY we cannot define how many lines we have.

So, how we add this in XSLT template???



Thanks

Ram.

Coordinator
Jul 10, 2011 at 7:55 PM

I'm not quite sure I understand your question.  Loop 2110 can accept any number of the 3 segments you specified.

If you want to add an xpath query to the multiple dates in your 2110 loop it might look like any of the following assuming you are doing something like the example here:

Received Date:

<xsl:value-of select="$payment/Loop[LoopId="2000"]/Loop[LoopId="2100"]/Loop[LoopId="2110"]/DTM[DTM01="050"]/DTM02"/>
Claim Statement Period Start:
<xsl:value-of select="$payment/Loop[LoopId="2000"]/Loop[LoopId="2100"]/Loop[LoopId="2110"]/DTM[DTM01="232"]/DTM02"/>
Claim Statement Period End:
<xsl:value-of select="$payment/Loop[LoopId="2000"]/Loop[LoopId="2100"]/Loop[LoopId="2110"]/DTM[DTM01="233"]/DTM02"/>
Service Date:
<xsl:value-of select="$payment/Loop[LoopId="2000"]/Loop[LoopId="2100"]/Loop[LoopId="2110"]/DTM[DTM01="472"]/DTM02"/>
Service Period Start:
<xsl:value-of select="$payment/Loop[LoopId="2000"]/Loop[LoopId="2100"]/Loop[LoopId="2110"]/DTM[DTM01="150"]/DTM02"/>
Service Period End:
<xsl:value-of select="$payment/Loop[LoopId="2000"]/Loop[LoopId="2100"]/Loop[LoopId="2110"]/DTM[DTM01="151"]/DTM02"/>

Jul 11, 2011 at 7:00 AM

I am trying to write all the fileds in a single flat text file. I need Check Number, Date, Payer, Payeee, Membername, Date of service, Service, units etc in as ingle falt file.

 

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
  <xsl:output method="text" indent="yes"/>

  <xsl:template match="Interchange">
    <xsl:apply-templates select="FunctionGroup/Transaction/Loop[@LoopId='2000']/Loop[@LoopId='2100']"/>
  </xsl:template>

  <xsl:template match="Loop[@LoopId='2100']" >
    <xsl:variable name="trans" select="../../."/>
    <xsl:variable name="payer" select="../../Loop[@LoopId='1000A']"/>
    <xsl:variable name="payee" select="../../Loop[@LoopId='1000B']"/>
    <xsl:variable name="payment" select="."/>
    <xsl:value-of select="$trans/BPR/BPR16"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="$payer/N1/N102"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="$payee/N1/N102"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="$payee/N1/N104"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="$payment/CLP/CLP01"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="$payment/CLP/CLP02"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="$payment/CLP/CLP03"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="$payment/NM1[NM101='QC']/NM103"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="$payment/NM1[NM101='QC']/NM104"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="$payment/CAS[CAS01='CO']/CAS02"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="$payment/CAS[CAS01='CR']/CAS02"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="$payment/CAS[CAS01='OA']/CAS02"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="$payment/CAS[CAS01='PI']/CAS02"/>
    <xsl:value-of select="','"/>
    <xsl:value-of select="$payment/CAS[CAS01='PR']/CAS02"/>
    <xsl:value-of select="','"/>

    <xsl:value-of select="$payment/Loop[LoopId='2110']/DTM[DTM01='472']/DTM02"/>
    <xsl:value-of select="','"/>
    <xsl:text>&#x0A;</xsl:text>
  </xsl:template>
</xsl:stylesheet>