none
REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA Looping issue in EDI 837 RRS feed

  • Question

  • Could some one please help me to resolve one strange issue I been facing in my EDI 837 map.
    I have to map REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA_Loop based on REF01__ReferenceIdentificationQualifier values. I do need to map REF02__BillingProviderAdditionalIdentifier value only if REF01__ReferenceIdentificationQualifier is SY or EI. But there are many other valid values in this segment and I am receiving many REF segments in my input data. But my map is looking the very first REF segment and skipping rest of the data. Here is an example; here I have to map REF*EI value; but my map is taking only the very first REF segment and ignoring rest of the REF's. How to fix this.

    NM1*85*2*AAAAAAAAAAAAAA*****XX*1111111111~
    N3*Address1~
    N4*City name*OH*12345~
    REF*G2*111122224003~
    REF*G5*0000~
    REF*EI*123456789~
    Sunday, March 29, 2009 5:01 PM

Answers

All replies

  • I believe your requirement is to map REF02 to target when REF01 is SY or EI. Please try the following.

    1. Use looping functoid with REF segment as source and Target record 'X' as destination.
    2. Have a scripting functoid, which takes REF01 as input parameter, and returns bool
    3. Implement the logic in scripting functoid to check if REF01 = SY | REF01 = E1 and return true
    4. Add a value mapping functoid which takes output from scripting functoid as 1st parameter and REF02 as second.. map value mapping functoid to the target node
    5. Add a logical existance functoid which takes output from scripting functoid and map it to target record 'X'. this is to make sure that empty 'X' records will not be created for other qualifiers..

    Same can be achieved using the combination of logical equal, value mapping and cumulative maximum functoid based on the assumption that REF segment usualy don't repeat with same qualifier...

    Monday, March 30, 2009 8:20 AM
  • Thank you so much. But I do have issues too. It is not working for all the records. It worked for some records and then after a while it stopped working. I mean if I drop a file it worked for say first half and rest of the records won’t get data mapped to this field. Is there any system limitation or some kind of setup I need to change? I am new to BT and really appreciate your help.

     

    Monday, March 30, 2009 4:28 PM
  • Welcome to XSLT!
    I have posted the solution (actually two different solutions) on how to do this here:
    http://blog.biztalk-info.com/archive/2008/09/12/Extracting_data_from_a_sub_loop__two_ways_to.aspx
    Monday, March 30, 2009 8:45 PM
  • Eric, I am not able to go to that URL; getting server error.
    Tuesday, March 31, 2009 5:50 PM
  • Sorry, I am upgrading my blog, I just rolled it back...


    Tuesday, March 31, 2009 5:55 PM
  • My personal preference is XSLT. If you are using custom XSLT in your map, you could try this.  Say this is your Billing Provider data

    - <ns0:TS837Q1_2010AA_Loop>
    
    - <ns0:NM1_BillingProviderName_TS837Q1_2010AA>
    
      <NM101__EntityIdentifierCode>85</NM101__EntityIdentifierCode> 
    
      <NM102__EntityTypeQualifier>1</NM102__EntityTypeQualifier> 
    
      <NM103__BillingProviderLastOrOrganizationalName>JOHN DOE</NM103__BillingProviderLastOrOrganizationalName> 
    
      <NM108__IdentificationCodeQualifier>XX</NM108__IdentificationCodeQualifier> 
    
      <NM109__BillingProviderIdentifier>0000000000</NM109__BillingProviderIdentifier> 
    
      </ns0:NM1_BillingProviderName_TS837Q1_2010AA>
    
    - <ns0:N3_BillingProviderAddress_TS837Q1_2010AA>
    
      <N301__BillingProviderAddressLine>1234 STREET AVE</N301__BillingProviderAddressLine> 
    
      </ns0:N3_BillingProviderAddress_TS837Q1_2010AA>
    
    - <ns0:N4_BillingProviderCityStateZIPCode_TS837Q1_2010AA>
    
      <N401__BillingProviderCityName>CITY</N401__BillingProviderCityName> 
    
      <N402__BillingProviderStateOrProvinceCode>ST</N402__BillingProviderStateOrProvinceCode> 
    
      <N403__BillingProviderPostalZoneOrZIPCode>11111</N403__BillingProviderPostalZoneOrZIPCode> 
    
      </ns0:N4_BillingProviderCityStateZIPCode_TS837Q1_2010AA>
    
    - <ns0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA>
    
      <REF01__ReferenceIdentificationQualifier>EI</REF01__ReferenceIdentificationQualifier> 
    
      <REF02__BillingProviderAdditionalIdentifier>803520359</REF02__BillingProviderAdditionalIdentifier> 
    
      </ns0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA>
    
      </ns0:TS837Q1_2010AA_Loop>
    
    
    
    

    You could use something like this to pull the REF02 when REF01 = EI or SY
    <xsl:variable name="billProviderInfo" 	select="/s0:X12_00401_837_P/s0:TS837Q1_2000A_Loop/s0:TS837Q1_2010AA_Loop"/>
    
    <xsl:variable name="billingProviderID">
    	<xsl:choose>
    		<xsl:when test="$billProviderInfo/s0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA[REF01__ReferenceIdentificationQualifier='EI']">
    			<xsl:value-of select="$billProviderInfo/s0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA[REF01__ReferenceIdentificationQualifier = 'EI']/REF02__BillingProviderAdditionalIdentifier/text()"/>
    		</xsl:when>
    		<xsl:when test="$billProviderInfo/s0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA[REF01__ReferenceIdentificationQualifier='SY']">
    			<xsl:value-of select="$billProviderInfo/s0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA[REF01__ReferenceIdentificationQualifier = 'SY']/REF02__BillingProviderAdditionalIdentifier/text()"/>
    		</xsl:when>
    	</xsl:choose>
    </xsl:variable>


    s0 is the namespace defined in the <xsl:stylesheet section> of the map

    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    
                    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    
                    xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" 
    
                    xmlns:s0="http://schemas.microsoft.com/BizTalk/EDI/X12/2006"
    
                                   exclude-result-prefixes="msxsl var s0" version="1.0">
    
    
    • Edited by G.Joseph Tuesday, March 31, 2009 10:23 PM formatting issue
    Tuesday, March 31, 2009 10:18 PM
  • Eric,
        yes i can access your post now. Thank you so much. I will try your solution as well. My issue is very starnge;part of the records are working fine, even working for multiple REF segments,but some records are not working even it had only one REF segement. It is very strange.

    Wednesday, April 1, 2009 12:44 AM
  • Thanks; I know nothing about XSLTs :(
    I am little bit confused with "Inline XSLT call template" and "Inline XSLT".

    I tried bellow scrpit as "Inline XSLT" but not even a single output record had data in my target field;

    When I tried with "Inline XSLT Call template" an error showed up in "Validate map"

    Error 7 The Script functoid, that connects to target node 'Provider_Ref_Number', has an error in its 'Xslt Call-Template' definition: 'There is not an xsl:template node at the root of the xslt.' 

    Here is what I used in the both "Inline XSLT template" and "Inline XSLT"

    <xsl:variable name="billProviderInfo"  select="/s0:X12_00401_837_P/s0:TS837Q1_2000A_Loop/s0:TS837Q1_2010A_SubLoop/s0:TS837Q1_2010AA_Loop/s0:REF_TS837Q1_2010AA_SubLoop/s0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA_Loop"/>

    <xsl:variable name="Provider_Ref_Number">
     <xsl:choose>
      <xsl:when test="$billProviderInfo/s0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA[REF01__ReferenceIdentificationQualifier='EI']">
       <xsl:value-of select="$billProviderInfo/s0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA[REF01__ReferenceIdentificationQualifier = 'EI']/REF02__BillingProviderAdditionalIdentifier/text()"/>
      </xsl:when>
      <xsl:when test="$billProviderInfo/s0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA[REF01__ReferenceIdentificationQualifier='SY']">
       <xsl:value-of select="$billProviderInfo/s0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA[REF01__ReferenceIdentificationQualifier = 'SY']/REF02__BillingProviderAdditionalIdentifier/text()"/>
      </xsl:when>
     </xsl:choose>
    </xsl:variable>



    Here is my XML input data
    </ns0:HL_BillingPaytoProviderHierarchicalLevel_TS837Q1_2000A><ns0:TS837Q1_2010A_SubLoop xmlns:ns0="http://schemas.microsoft.com/BizTalk/EDI/X12/2006">
      <ns0:TS837Q1_2010AA_Loop>
        <ns0:NM1_BillingProviderName_TS837Q1_2010AA>
          <NM101__EntityIdentifierCode>85</NM101__EntityIdentifierCode>
          <NM102__EntityTypeQualifier>2</NM102__EntityTypeQualifier>
          <NM103__BillingProviderLastOrOrganizationalName>Name</NM103__BillingProviderLastOrOrganizationalName>
          <NM108__IdentificationCodeQualifier>XX</NM108__IdentificationCodeQualifier>
          <NM109__BillingProviderIdentifier>11111111</NM109__BillingProviderIdentifier>
        </ns0:NM1_BillingProviderName_TS837Q1_2010AA>
        <ns0:N3_BillingProviderAddress_TS837Q1_2010AA>
          <N301__BillingProviderAddressLine>address</N301__BillingProviderAddressLine>
        </ns0:N3_BillingProviderAddress_TS837Q1_2010AA>
        <ns0:N4_BillingProviderCityStateZIPCode_TS837Q1_2010AA>
          <N401__BillingProviderCityName>city</N401__BillingProviderCityName>
          <N402__BillingProviderStateOrProvinceCode>ST</N402__BillingProviderStateOrProvinceCode>
          <N403__BillingProviderPostalZoneOrZIPCode>1111</N403__BillingProviderPostalZoneOrZIPCode>
        </ns0:N4_BillingProviderCityStateZIPCode_TS837Q1_2010AA>
        <ns0:REF_TS837Q1_2010AA_SubLoop>
          <ns0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA_Loop>
            <ns0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA>
              <REF01__ReferenceIdentificationQualifier>EI</REF01__ReferenceIdentificationQualifier>
              <REF02__BillingProviderAdditionalIdentifier>111111</REF02__BillingProviderAdditionalIdentifier>
            </ns0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA>
            <ns0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA>
              <REF01__ReferenceIdentificationQualifier>G5</REF01__ReferenceIdentificationQualifier>
              <REF02__BillingProviderAdditionalIdentifier>001000</REF02__BillingProviderAdditionalIdentifier>
            </ns0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA>
          </ns0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA_Loop>
        </ns0:REF_TS837Q1_2010AA_SubLoop>
        <ns0:PER_BillingProviderContactInformation_TS837Q1_2010AA>
          <PER01__ContactFunctionCode>IC</PER01__ContactFunctionCode>
          <PER02__BillingProviderContactName>name</PER02__BillingProviderContactName>
          <PER03__CommunicationNumberQualifier>TE</PER03__CommunicationNumberQualifier>
          <PER04__CommunicationNumber>11111111</PER04__CommunicationNumber>
        </ns0:PER_BillingProviderContactInformation_TS837Q1_2010AA>
      </ns0:TS837Q1_2010AA_Loop>

    Wednesday, April 1, 2009 3:46 PM
  • The inline xslt should work that I posted, you should be able to debug the xslt if it it not...
    Wednesday, April 1, 2009 5:07 PM
  • Hello Eric,
         I tried with an "Inline XSLT Template" like below; but it is failing at run time; not able to get the schema referance. Could you please let me know how to define element name from HIPPA schema?

    <xsl:template name="SubLoopExtract_REF_BillProv">
     <xsl:param name="REF02" />
     <xsl:element name="/s0:X12_00401_837_P/s0:TS837Q1_2000A_Loop/s0:TS837Q1_2010A_SubLoop/s0:TS837Q1_2010AA_Loop/s0:REF_TS837Q1_2010AA_SubLoop/s0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA_Loop/s0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA/REF02__BillingProviderAdditionalIdentifier">
      <xsl:value-of select="REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA[@REF01__ReferenceIdentificationQualifier = $REF02]/REF02__BillingProviderAdditionalIdentifier/text()" />
     </xsl:element>
    </xsl:template>

    Here is the error

    '/s0:X12_00401_837_P/s0:TS837Q1_2000A_Loop/s0:TS837Q1_2010A_SubLoop/s0:TS837Q1_2010AA_Loop/s0:REF_TS837Q1_2010AA_SubLoop/s0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA_Loop/s0:REF_BillingProviderSecondaryIdentification_TS837Q1_2010AA/REF02__BillingProviderAdditionalIdentifier' is an invalid QName.

     

    Wednesday, April 1, 2009 5:25 PM
  • I would debug the XSLT to find out what it looks like, validate the map and make sure that it (the xslt) looks correct, and the xpath is correct.
    Wednesday, April 1, 2009 6:24 PM
  • Thank you so much Eric. I am able to make it work as you suggested. Once again many thanks.
    Friday, April 24, 2009 6:06 PM