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

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

August 20th, 2015 5:07pm

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;
}

Free Windows Admin Tool Kit Click here and download it now
August 21st, 2015 4:51am

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

August 21st, 2015 7:34am

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 12 hours 45 minutes ago more info
Free Windows Admin Tool Kit Click here and download it now
August 21st, 2015 2:51pm

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

August 21st, 2015 2:59pm

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....

Free Windows Admin Tool Kit Click here and download it now
August 21st, 2015 6:56pm

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.

August 22nd, 2015 1:09am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics