none
Having trouble getting value to repeat from a proprietary schema to an X12 945 map RRS feed

  • Question

  • I have an EDI map which has two elements in the same loop. The elements are:

    Reference2

    Serial

    The nodes their data targets in this map are the N901 & N902 nodes of a 4010 (yes 4010!) X12 945 map. The logic for this mapping is supposed to be as follows: 

    “If Reference2 exists, put “LI” in the N901 and the value from the Reference2 element in the N902”
    “If Serial exists, out “SE” in the N901 and put the value from the Reference2 element in the N902”

    The desired output would be, when both elements have data, would be (if the Reference2 value = 1 and there is any data in the serial element):

    N9*SE*1~

    N9*LI*1~

    The problem I have is I can get the output like this:

    N9*SE*1~

    N9*LI~

    For whatever reason the Reference2 value won't carry to the 2nd instance of the N9 segment created within the loop. The parts of the maps that are pertinent to this are (the constants push the values "SE" and "LI", but otherwise the rest is straightforward mapping:


    I am hopeful this can be resolved within the map, as XSLT is something with which I am only vaguely familiar. 

    Thanks in advance--

    Tom

    Thursday, August 20, 2015 5:07 PM

Answers

  • The easiest way to handle this is by creating custom N9 segments, then you don't have to worry about looping or anything like that.  Each us just a direct Map.

    You can follow the steps for Creating Custom Fields in this Wiki Article: http://social.technet.microsoft.com/wiki/contents/articles/27099.biztalk-edi-features-not-just-for-hipaa.aspx

    • Proposed as answer by Angie Xu Friday, August 28, 2015 2:59 AM
    • Marked as answer by Angie Xu Monday, August 31, 2015 1:55 AM
    Friday, August 21, 2015 11:32 AM
  • Hi Tom,

    Please use scripting functoid with value mapping functoid to achieve your scenario.

    With scripting functoid check the value exist in Reference2 then map N901 to 'LI' and Value of Reference2 in N902. Please use below script to check input script and please refer below mapping for reference.

    public bool CheckBlankString(string input)
    {
        return !string.IsNullOrEmpty(input) && input.Trim() != string.Empty;
    }


    Thanks, If my reply is helpful please mark as answer or vote as helpful.

    • Proposed as answer by [Kamlesh Kumar] Sunday, August 23, 2015 6:29 PM
    • Marked as answer by Angie Xu Monday, August 31, 2015 1:55 AM
    Friday, August 21, 2015 4:51 AM

All replies

  • Hi Tom,

    Please use scripting functoid with value mapping functoid to achieve your scenario.

    With scripting functoid check the value exist in Reference2 then map N901 to 'LI' and Value of Reference2 in N902. Please use below script to check input script and please refer below mapping for reference.

    public bool CheckBlankString(string input)
    {
        return !string.IsNullOrEmpty(input) && input.Trim() != string.Empty;
    }


    Thanks, If my reply is helpful please mark as answer or vote as helpful.

    • Proposed as answer by [Kamlesh Kumar] Sunday, August 23, 2015 6:29 PM
    • Marked as answer by Angie Xu Monday, August 31, 2015 1:55 AM
    Friday, August 21, 2015 4:51 AM
  • The easiest way to handle this is by creating custom N9 segments, then you don't have to worry about looping or anything like that.  Each us just a direct Map.

    You can follow the steps for Creating Custom Fields in this Wiki Article: http://social.technet.microsoft.com/wiki/contents/articles/27099.biztalk-edi-features-not-just-for-hipaa.aspx

    • Proposed as answer by Angie Xu Friday, August 28, 2015 2:59 AM
    • Marked as answer by Angie Xu Monday, August 31, 2015 1:55 AM
    Friday, August 21, 2015 11:32 AM
  • Will this pass EDI validation if I start dinking with the X12 schema? Or do you mean a canonical? Also I don't know if I can get away with editing this schema as it is used in existing processes---I need to know there aren't other processes in this application using it! If this is the end schema I may get away with changing it...

    (Good to see you again Boat---you answered my questions under "N0F3AR" before!)


    • Edited by N0F3AR Friday, August 21, 2015 7:01 PM more info
    Friday, August 21, 2015 6:50 PM
  • KK007:  How is the inside of the Equals functoid configured? Also, am I correct in assuming your script is C#? Plus your map looks like it is using a different source schema, which is fine, but I need to know for sure what the origins are. 

    Thanks for your answer--hope I am closer to solving this!

    Tom

    Friday, August 21, 2015 6:57 PM
  • Yes, it will pass validation.  Just be sure to use a custom copy of the Microsoft Schema with a namespace you own.

    Yes, I remember, no fears....

    Friday, August 21, 2015 10:55 PM
  • KK007:  How is the inside of the Equals functoid configured? Also, am I correct in assuming your script is C#? Plus your map looks like it is using a different source schema, which is fine, but I need to know for sure what the origins are. 

    Thanks for your answer--hope I am closer to solving this!

    Tom

    Equal functoid accept two inputs and it is coming in logical functoids category, one input is passing with scripting functoide and another is mapped with value value true

    If value is true then map the N901 to 'LI' and N902 equal to value of Reference2. Please find the configuration on Equal functoid in below snap shot.

    While connecting the output of a logical functoid to a destination node, the result determines whether or not we can output that node, depending on the value's being true or false.

    Yes, you are correct script is written in C#.

    My source schema has been created with SQL Stored procedure and we have mapped our source schema to EDI 850 schema.


    Thanks, If my reply is helpful please mark as answer or vote as helpful.

    Saturday, August 22, 2015 5:07 AM