none
Parent node showing in schema when child nodes not present RRS feed

  • Question

  • I had several folks answer my questions on mapping from a flat file to an EDI 835 schema and I am down to just a couple of issues before I finish up. I have a conditional mapping issue that I have to solve before I can map the rest of the document. I am mapping three fields in a single non-repeating line in the flat file to a repeating segment in the 835. Basically I need to create a separate AMT_ClaimSupplementalInformation segment for each field in the flat file line. As you can see in the picture below I want to create a AMT_ClaimSupplementalInformation segment for CDISCOUNT, CINELIGIBLE and CALLOWED.

    You can see I have quite a bit of conditional logic attached to the three fields, but I have all three connected via a loop to the AMT_ClaimSupplementalInformation parent. I cannot attach the loop to the parent of the three fields because it only appears once in the file. And if I leave the loop out the AMT segments get stacked funny, like this:
    <AMT_ClaimSupplementalInformation>
    AMT1
    AMT1
    AMT2
    AMT2
    </AMT_ClaimSupplementalInformation>
    You can see how they should be stacked in the next pic.
    In some cases however, one of those fields may be blank so I will not need to create a AMT_ClaimSupplementalInformation segment for it. I was able to use some conditional mapping ideas you guys gave me using the Not-Equal and Value Mapping functoids, and that works great to keep blank child nodes from being created. However, Since I have a loop attached to the AMT_ClaimSupplementalInformation parent node it still creates an empty parent node even when the child nodes are not created. See the empty parent node in the pic below.

    Since looping functoids can only be attached to links I don't know how to make the parent node conditional.
    Any suggestions?

    Thanks.


    • Edited by gcooper Sunday, January 19, 2014 4:10 AM
    Sunday, January 19, 2014 4:08 AM

Answers

  • Well, that's not really what I meant.

    I use a Call Template in a Functoid to create only those elements that are tricky to get with links alone.  You can leave all the other links alone and have just 1 or 3 Functoids to create the AMT segments.

    In that case, each Script Functoid would be linked to AMT_ClaimSupplimentalInformation.

    • Marked as answer by Pengzhen Song Wednesday, February 5, 2014 2:38 AM
    Sunday, January 19, 2014 8:05 PM

All replies

  • There's a couple of these that can be a bit tricky, like CAS in the 837.

    I usually use an Xslt Call Template, or Templates, one for each.  That would be my first suggestion.

    Another option, if the number of AMT types (AMT02) is manageable (3 is manageable) would be to customize the schema to include an individual AMT for each code.  Then, you could apply the 'should exist' check to the AMT itself.

    Sunday, January 19, 2014 1:22 PM
  • Boatseller, thanks for the tip. I did end up going the XSLT direction. It's a bit of a hack, but I'm using the following XSLT to eliminate empty nodes :
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:template match="@*|node()">
            <xsl:if test=". != ''">
                <xsl:copy>
                    <xsl:apply-templates select="@*|node()"/>
                </xsl:copy>
            </xsl:if>
        </xsl:template>
    </xsl:stylesheet>

    I created a new map with the 835 schema on each side. I then created an XSLT file and pointed to it in the Custom XSLT Path property. It seems to work well. I call this map right after my FlatFile_To_835 map.

    I was hoping to use the scripting functoid with inline XSLT in the map so that I didn't have to worry about deploying the XSLT file(just another thing to keep up with in the future), but when I compile it I get the following error:
    The "Scripting" functoid has 1 input parameter(s), but 2 parameter(s) are expected.
    I'm wondering if I'm connecting the schemas incorrectly in the map:


    In any case, I'm past the empty nodes issue for now, which was a big roadblock. Now I have to deal with the CAS segments which are, as you said, a real pain. 
    Thanks for all of your input.

    Sunday, January 19, 2014 7:30 PM
  • Well, that's not really what I meant.

    I use a Call Template in a Functoid to create only those elements that are tricky to get with links alone.  You can leave all the other links alone and have just 1 or 3 Functoids to create the AMT segments.

    In that case, each Script Functoid would be linked to AMT_ClaimSupplimentalInformation.

    • Marked as answer by Pengzhen Song Wednesday, February 5, 2014 2:38 AM
    Sunday, January 19, 2014 8:05 PM
  • When you use custom Xslt you do not need to deploy the Xslt file to the BizTalk server.

    When not using a custom Xslt, the BizTalk mapper compiles the graphical map into Xslt which is stored in a constant string in the BizTalk assembly. You can see this Xslt by validating the map in Visual Studio. A link to the generated Xslt file is available in the output window. 

    If you specify a custom Xslt, the this file is inserted into the BizTalk assembly instead.

    At runtime, BizTalk compiles and caches the Xslt and uses this to perform the mapping.

    Tuesday, February 4, 2014 2:29 PM