none
Conditional Mapping to 835 schema RRS feed

  • Question

  • I am interrogating a value in the incoming flat file schema and if the value is greater than '0' I am supposed to set some values in the CLP segment. However, if the value in the incoming schema is '0', I should not create the CLP segment. I'm not quite sure how to accomplish this. I am using inline c# in the scripting functoid to evaluate the incoming value and then set the value for the CLP01, CLP02, etc. The best I know how to do is....if the incoming value is '0', just return an empty string, but that creates a CLP segment with blank values in the CLP segment fields which is not allowed. How do I tell the map to not create the segment at all if the incoming value is '0'?

    Thanks.

    Thursday, January 9, 2014 9:37 PM

Answers

  • You don't need inline C#

    Just use functoids, Greater than functoid, value in second filed = '0' first filed is source element.

    Value Mapping, first filed = output of Greater Than, Second fiield = Source element

    • Marked as answer by gcooper Friday, January 10, 2014 4:02 PM
    Thursday, January 9, 2014 10:22 PM

All replies

  • You can do the followings:

      • Add equal functoid  and coonect source value to it and add zero to the second parameter of equal functoid
      • Add not functoid and coonect equal to it
      • Add value mapping functoid and connect not functoid to it
      • Connect source value to value mapping functoid
      • Connect not functoid to CLP segment(record)
      • Connect value mapping functoid to CLP field (element)

      I hope this will help you


    Thursday, January 9, 2014 10:19 PM
  • You don't need inline C#

    Just use functoids, Greater than functoid, value in second filed = '0' first filed is source element.

    Value Mapping, first filed = output of Greater Than, Second fiield = Source element

    • Marked as answer by gcooper Friday, January 10, 2014 4:02 PM
    Thursday, January 9, 2014 10:22 PM
  • Prabhdeep,

    Your suggestion worked well. I actually mis-spoke as it is the AMT segment I'm working with. Anyway, your suggestion helped eliminate empty sub-elements in the AMT segment. However, since I am looping through three different fields in the incoming schema, I am still getting one empty top level AMT node, like this:
    <ns0:AMT_ClaimSupplementalInformation/>

    Whereas before your help I was getting this:
    <ns0:AMT_ClaimSupplementalInformation>
    <AMT01_AmountQualifierCode/>
    <AMT02_ClaimSupplementalInformationAmount>
    </ns0:AMT_ClaimSupplementalInformation>

    The other two fields I'm looping through have good data and the AMT segments for them get created correctly.
    Is there any way to tell the looping functoid NOT to loop for the field if the field contains certain data?

    Below is my map. You can see where I fixed the input for the CINELIGIBLE field based on your input. I still have to fix the CALLOWED and CBALANCE fields. You can see where I have to use a looping functoid because I have multiple fields to check on the left  which are mapped to a single node tree(the AMT) on the right, that can repeat per the schema rules for the 835 schema.

    Thanks for your help!


    • Edited by gcooper Friday, January 10, 2014 4:25 PM
    Friday, January 10, 2014 4:15 PM
  • I see what you are saying,

    I would check looping condition at higher level (Totals in your case) because all elements below will repeat only if Total repeats multiple time (whole segement not just few elements).

    Having done that your looping is checked at higher level.

    Part2: Creating segment only when - certain data condition.

    Ans: Here again use the similar logic that we tried earlier, check for value for Callowed etc using ">" or  "=" functoids and then after doing value mapping , map the output of value mapping to AMT_ClaimSupplementInformation node ( parent level of AMT01 etc). This way, parent level node will only be created if condition is true. So you can have false for first two repetitions and third time during true, your target will created.

    Always remember to think about from target side perspective.

    Here when you reach AMT(parent) level, think about when you want this to be created and apply conditions from sourrce side. Once created, does it loop? Yes when.., when Totals appear multiple times.

    Then we go AMT01, when do we want to create it, if value is gerater than '0'. Ok create condition. Like that...

    Please let me know if it doesn't help or you have more questions.

    Thanks


    Sunday, January 12, 2014 8:10 AM
  • I was finally able to eliminate the empty top level AMT segment. Now I just need to figure out the looping. You can see I have a loop connecting all three fields on the left side to the AMT parent on the right. This is not necessarily working correctly. I need an AMT segment on the right for each of the fields on the left. If I remove the loop they get stacked like this:
    <AMT_ClaimSupplementalInformation>
    AMT01
    AMT01
    AMT01
    AMT02
    AMT02
    AMT02
    AMT03
    AMT03
    AMT03
    </AMT_ClaimSupplementalInformation>

    It should look like this:
    <AMT_ClaimSupplementalInformation> ---- for CDISCOUNT
    AMT01
    AMT02
    </AMT_ClaimSupplementalInformation>
    <AMT_ClaimSupplementalInformation> ---- for CELIGIBLE
    AMT01
    AMT02
    </AMT_ClaimSupplementalInformation>
    <AMT_ClaimSupplementalInformation> ---- for CALLOWED
    AMT01
    AMT02
    </AMT_ClaimSupplementalInformation>

    I can't set the loop at the TOTAL level on the left side because the TOTAL line only occurs once. There has to be an easy remedy to this, but it certainly is eluding me

    [EDIT] I was just taking a look at the Table looping and table extractor functoids. I wonder if they could be used for something like this? I've never used them before.

    • Edited by gcooper Tuesday, January 21, 2014 3:40 AM
    Tuesday, January 21, 2014 2:41 AM