none
Help creating edi 837 REF*D9 segment RRS feed

  • Question

  • I need to create the REF*D9 segment for our trading partner. Our current edi process does not generate this segment.  The segment is basically a copy of the REF*F8 segment, except for the REF01 qualifier being different.  I have been able to generate the segment when the REF*F8 is in the subscriber loop, but the F8 segment can also be created in 2 other loops further down the schema (in the TS837_2330B loop). I have tried numerous solutions for this failing each time. I was told that XSLT would be best, but am not sure of the logic to use. I am new to BizTalk and XSLT, so I am not even sure of the syntax or how to reference the fields. This process is using 837P schema for source and destination. Could someone please help me out with how to populate this D9 segment, no matter what loop the F8 segment is created in? Thanks, I appreciate the help.
    Thursday, December 18, 2014 6:02 PM

Answers

  • First, make sure you have the requirement right because 2010BB and 2330B would be different payers.

    There's a few things that can influence this in the Map, but start here:

    1. Map REF02_PayerClaimControlNumber and REF02_OtherPayer_sClaimControlNumber (yes, there is a type in the Element name) to Index Functoids.
    2. Map the two Index Functoids to a Scripting Functoid.
    3. In the Scripting Functoid, have where decision logic you need.
    4. Map the Scripting Functoid to you destination node.

    If you Validate Map, you can see what the XSLT generated is to make adjustments.

    • Proposed as answer by Angie Xu Thursday, January 1, 2015 3:18 AM
    • Marked as answer by Angie Xu Wednesday, January 7, 2015 9:31 AM
    Thursday, December 18, 2014 10:58 PM
  • What you need can be done, but you have to keep checking the configuration of the Index Functoid against the generated xslt.

    In case it's not clear, the Index Functoid can take any number of additional 1 parameters so you may have 2, 3, 4 depending on the depth of the source field.

    You have to look for how each F8 is extracted, in for-each loops, then by direct xpath.

    if a for-each references a node that isn't there, none of the code may execute.


    • Edited by Johns-305MVP Tuesday, December 23, 2014 2:11 AM
    • Proposed as answer by Angie Xu Thursday, December 25, 2014 2:09 AM
    • Marked as answer by Angie Xu Wednesday, January 7, 2015 9:31 AM
    Tuesday, December 23, 2014 2:10 AM

All replies

  • First, make sure you have the requirement right because 2010BB and 2330B would be different payers.

    There's a few things that can influence this in the Map, but start here:

    1. Map REF02_PayerClaimControlNumber and REF02_OtherPayer_sClaimControlNumber (yes, there is a type in the Element name) to Index Functoids.
    2. Map the two Index Functoids to a Scripting Functoid.
    3. In the Scripting Functoid, have where decision logic you need.
    4. Map the Scripting Functoid to you destination node.

    If you Validate Map, you can see what the XSLT generated is to make adjustments.

    • Proposed as answer by Angie Xu Thursday, January 1, 2015 3:18 AM
    • Marked as answer by Angie Xu Wednesday, January 7, 2015 9:31 AM
    Thursday, December 18, 2014 10:58 PM
  • Thanks.  I have tried this, but not sure what you mean by see what XSLT generated is to make adjustments.  Like I said I am a newbie, and do not know xslt, so any help is appreciated.  Thanks again.
    Friday, December 19, 2014 4:08 PM
  • Did it work?
    Friday, December 19, 2014 6:35 PM
  • No.  The segment is not being created. 
    Saturday, December 20, 2014 6:31 PM
  • Right click on the Map and Choose Validate Map.

    In the Output windows, there will be a link to the xsl generated by the Map compiler.

    Because every situation is unique due to the custom source, this is how you figure out what's going on and make adjustment.  It's not really that hard to read.

    Most likely, you need to start adding parameters, value of 1, to the Index Functiod to break the looping.  Otherwise, if one of the source elements is not present, that map code will not be triggered.

    Monday, December 22, 2014 2:06 PM
  • Yes, that is the issue I believe.  The F8 segment is only created in one of three places.  So it will only be present in one loop.  Is that what you mean, if the F8 segment is in one of these loops, the code execute, or does it have to be in all of them for it to execute? 
    Monday, December 22, 2014 2:12 PM
  • Using this logic, it only creates the REF*D9 when the REF*F8 is coming from the REF_PayerClaimControlNumber Segment.  Otherwise I get nothing.  I tried adding an index for REF02_PayerClaimControlNumber, REF02_OtherPayerSecondaryIdentifier and REF02_OtherPayer_sClaimControlNumber.  I have these as inputs to a scripting functoid.  I then do a choose when the param is not = '', then use the param to populate the Ref02_ValueAddedNetworkTraceNumber.  I have tried mixing up the testing order, and I still get the same results.  Only get the D9 when REF02_PayerClaimControlNumber is populated, otherwise I get no REF*d9 segment.  Am I missing something else?  Thanks.
    Monday, December 22, 2014 6:20 PM
  • What you need can be done, but you have to keep checking the configuration of the Index Functoid against the generated xslt.

    In case it's not clear, the Index Functoid can take any number of additional 1 parameters so you may have 2, 3, 4 depending on the depth of the source field.

    You have to look for how each F8 is extracted, in for-each loops, then by direct xpath.

    if a for-each references a node that isn't there, none of the code may execute.


    • Edited by Johns-305MVP Tuesday, December 23, 2014 2:11 AM
    • Proposed as answer by Angie Xu Thursday, December 25, 2014 2:09 AM
    • Marked as answer by Angie Xu Wednesday, January 7, 2015 9:31 AM
    Tuesday, December 23, 2014 2:10 AM
  • I have been trying, but I guess I just don't get it. For the most part the mapping is a direct copy of the EDI 837. Main difference being that the trading partner needs the claims split into one claim per ST/SE segment (which I have working fine), and they require a REF*D9 segment. Our claims system does not generate the REF*D9 segment, but it is a copy of the REF*F8 segment. Problem there is that REF*F8 is generated in one of 3 spots. And two of those are deep in loops. I have tried the Index functoids. I have gone down to index level 9, still not getting info. I have looked at the code to see what is being selected. I have tried scripting functoids and selecting the element the same way. Doesn't work (don't know what I am doing wrong).  I have tried looping functoids.  Seems like no matter what I try I can only generate the REF*D9 when the REF*F8 segment is generated in the 2300 loop, under REF_SubLoop_5 in the REF_PayerClaimControlNumber.  If it is generated anywhere else, I can't seem to pick it up.  Again I am very new to BizTalk and XSLT, any other ideas for me to try?  Thanks.   
    Friday, December 26, 2014 6:21 PM
  • I know exactly your situation and I'm 99% sure the Index Functoid configuration is the solution, I've done similar many times.

    But of course, there's only 1 configuration, across all three sources, that will work, close doesn't count.

    Try with 1 and go from there,  checking the generated xslt each time.

    Wednesday, December 31, 2014 3:37 AM