HLLoop for X12 856

Hi ,

I wanted to create a EDI document for X12 856 shipping notification as shown below . My concern is about creating the multiple HLLoop's in the below format . I tried creating HLLoops as below and renamed them as HLLoop2 and HLLoop3 . But I am getting serialization errors . I want the HLLoops at shipping level , Order Level and OrderItem level . I can use the default one for shipping level but not sure on how to create the other 2 loops . I get error when I add HLLoop2 to the XSD schema . Please help .

ST*856*1234~BSN*00*200803280036*20080408*1305~

HL*1**S~

TD3*RR**CSXT1*G*113575*LB~

REF*BM*200803280036~

REF*LA*00119~DTM*011*20080408~

N1*SF*XXXXXXXXXXXXXXXXXXXXXX~

N1*ST*ZZZZZZZ*6*000~

HL*1*1*O~

PRF segment

HL*1*1*I~

LIN segment

PO4 segment

MEA segment

MEA segment

REF segment

HL*2*1*O~

PRF segment

HL*1*2*I~

LIN segment

PO4 segment

MEA segment

MEA segment

REF segment

SE*14*1234~

May 13th, 2008 7:06pm

Precis,

ASN mapping, especially when the source data structure is mulitiple loops, is very advance mapping. Explaining how to do this map would require seeing the input data as well to see what the structure looked like. Even then, explaining the techniques clearly enough for you to do it without examples would be difficult. Some folks will tell you to modify the 856 schema, but that is not really necessary.

From a high level, here are the two methods we often use when faced with a difficult 856:

1. Gather the sourcedata early in the map. There are number of ways to do this, but most of the time we create one or more arrays and pull the data through a Scripting functoid that fills the arrays.We use the Cumulative Concatenate functoid to pull the entire source through the Scripting functoids. Once the data is in the arrays, we use Scripting functids to extract the data and put it into the output nodes as needed. Obviously, there are a number of counters and flags that must be used to determine when to output a segment and which data to output.

2. Do the map entirely in XSLT. This entails using XPATH queries to extract data from the source and to generate output nodes.

In our early days doing an 856 in BizTalk might take a week or more; today we can do most of them in about four hours. Normally when clients pose a question such as this direct to us, we tell them that the most effective way is to pay us to do the first 856 and then study the method to see how to do future ones.

Good luck on this, contact me at jim@sspsi.com if you want. Also, take a look at http://sspsi.com/blog/index.html. There are some tidbits on there that might help.
Free Windows Admin Tool Kit Click here and download it now
May 13th, 2008 8:04pm

Does the schema validate? What serialization errors are you seeing?

You can look at the HIPAA schemas(837s) to see how to create multiple HL loops in a schema. (<bts>\XSD_Schema\EDI\HIPAA\00401A1\Claim-Professional_837P\single)

Have you reviewed the XML the assembler is receiving to make sure the map is generating the data properly?

Feel free to email me your schema if you can't get it to validate.
May 14th, 2008 5:52pm

I've managed to create a solution to this problem using a combination of two scripting functoids along with a set of logical functoids to control the looping behavior. The full explanation is on my blog at http://rogue-technology.com/blog/?p=370.
Free Windows Admin Tool Kit Click here and download it now
May 15th, 2008 11:48pm

Scott

Can you share your code?

Now I have a problem that map EDI_X12_856 to custom xml.

November 14th, 2008 11:06am

Scott,

Can you please share your code ?

Free Windows Admin Tool Kit Click here and download it now
July 13th, 2013 7:51pm

A sample of HL counters can be found here:

http://msdn.microsoft.com/en-us/magazine/gg650658.aspx

However, you may need a second variable to store the current parent instead of simple decrementing HL01.  All you'd do is set the current parent when incrementing HL01 and return it instead of HL01 - 1;

July 14th, 2013 8:06am

The std 856 schema has only one HL loop. How can we do it using one HL loop ?

How can we use the logical functoids to control occurance of S, O, P,I loops with different segments under each loop. 

Can you please share any code if you have for reference.

Free Windows Admin Tool Kit Click here and download it now
July 14th, 2013 12:11pm

You have to add the additional HL Loops.

So, basically, Create HLLoop2, HLLoop3 at the correct position, HLLoop3 being a child of HLLoop2. and move the child segments under them.  Also, create the HL segment as the first child of course.

Sorry, I thought you had done that.

I'd suggest you look at the HIPAA schemas but they can be overwhelming at first if you haven't already worked with them.

July 15th, 2013 9:48am

Yes. I created HL loops like below

HLLoop_Shipment (1-1)
HL_Shipment
TD1
Order-Loops(1-1)
      HLLoop_Order(1-unbounded)
HL_Order(1-1)
PRF
Pack-Loops (1-1)
HLLoop_Pack(1-unbounded)
HL_Pack(1-1)
MAN
HL_Item(1-1)
LIN
SN1


Now the issue is when I run the file with multiple orders the map is creating output correctly in xml
with 
HL - O
HL -P
HL-I
HL- O
HL- P
HL-I

But it is throwing error while validating againest the new 856 schema.It is not able to regnize the segment PRF.It is expecting the segment MAN. This is because of  HL (segment with same tag identifier)coming 
in Order loop and Pack loop. while validaing the HL for order , It thinks it is the HL under PAck loop.

can we put some restriction in xsd,so that it can match the HL segments correctly ?

Free Windows Admin Tool Kit Click here and download it now
July 15th, 2013 10:39am

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

Other recent topics Other recent topics