Mohsin Kalam’s Blog

January 2, 2008

RSS Feed link

Filed under: R2 EDI — Mohsin Kalam @ 12:50 pm

It was requested by a few users :)

http://mohsink.com/rss

Happy new year :)

Mohsin Kalam

December 18, 2007

HIPAA QFE for R2

Filed under: R2 EDI — Mohsin Kalam @ 2:08 pm

For HIPAA documents with equivalent subloops and/or equivalent segments (such as 837 claim documents) the EDI engine in BizTalk Server 2006 R2 would incorrectly generate validation errors when these loops and/or segments were not in the same order as they were in the schema. The HIPAA standard allows equivalent subloops and segments to appear in any order and therefore errors should not be generated in these situations. This fix provides updated HIPAA schemas and modifications to the EDI engine to address this issue.

The QFE can be found at the following link

http://www.microsoft.com/downloads/details.aspx?FamilyId=ED9C18F8-9842-4CBB-BD34-1FCD7D196900&displaylang=en

Thanks

Mohsin Kalam

December 10, 2007

Site Map

Filed under: R2 EDI — Mohsin Kalam @ 1:36 pm

This blog site is divided into 2 sections. Posts and Pages. I recently discovered that the rss feed does not include pages. So to help resolve that issue and to provide better navigation, I have highlighted the sitemap.

Post – available in heirarchal order

HIPAA QFE for R2
XML Tools
Batching
PAM
R2 Engine Send
R2 Engine Receive
Introduction to Microsoft BizTalk Server 2006 R2 EDI
Welcome to MohsinKalam’s Blog

Pages – These are links you will find on the right of the page

Delimiters
EDI Global Properties

EDIFACT Party Properties
Encoding
Envelope Application
Party Resolution
Schema Discovery
X12 Party Properties

Thanks for stopping by!

Mohsin Kalam

November 14, 2007

XML Tools

Filed under: R2 EDI — Mohsin Kalam @ 3:25 pm

Goal:

To describe the design time experience in BizTalk R2 EDI.

Overview:

XML Tools extension hosted in Visual Studio is used to provide design time support to users to improve usability of EDI Schemas and also assist in the validation and generation of BTS EDI artifacts. The 3 main functions are “Validate Schema“, “Validate Instance” and “Generate Instance“.

To perform these 3 functions, a user needs to follow series of steps as follows:

  1. Set up Visual Studio with an EDI schema
  2. Set input/output properties on the schema (if applicable)
  3. Execute the operation (set delimiters if applicable)
  4. Observe the result

Let’s explain these plumbing steps in some details before going into the meat of this feature

Visual Studio Setup:

For all 3 operations, you would need to add an EDI schema in a BizTalk project in Visual Studio. This is what I refer to as the Base Schema as this would be used to set input/output properties and to execute the 3 operations. Here’s how you would do it:

  1. Open Visual Studio from the start menu. You can also type devenv at the run command box
  2. Go to File -> New -> Project
  3. In the dialog box that appears select “BizTalk Project” under project types and “Empty BizTalk Server Project” under Templates and click OK.
  4. You should now have a blank BizTalk project. Right click on the project and select Add -> Existing Item. Browse to the path where you have the EDI schema stored and add that!

Input/Output Properties: 

With the schema added you would have to set some properties on it for instance validation and generation. Right clicking on the schema and selecting “Properties” brings up the properties window where the users can select the following options:

Output Instance Filename:

Used to specify the path to where the output instance will be saved will respect to the “Generate Instance” property

Input Instance Filename:

Used to specify the path to where the input instance used with respect to the “Validate Instance” is located

Generate Instance Output Type:

A drop down used to specify the type of file to be generated. Two options are Native (EDI) and XML

Validate Instance Input Type:

A drop down used to specify the type of file to be validated. Two options are Native (EDI) and XML

Note: R2 ships with 8K+ schemas and any of these schemas can be used out of box within Visual Studio!

Delimiter Dialog Box:

During Validate Instance and Generate Instance, the users are presented with a dialog box to input the delimiters used for the respective operation. The dialog box for X12 is as follows (EDIFACT has a similar dialog box):

X12 Delimiter Dialog Box

This dialog box lets the user choose all the applicable separators along with the segment separator suffix, the encoding information and trailing delimiters option. The box also has a Error/Information section that is used to show validation errors to the user.

Now that we have touched on the back ground information for the core operations, lets dive into the core operations which as previously mentioned are Validate Schema, Validate Instance and Generate Instance. These operations are available by right clicking the schema added in a BizTalk Project.

Validate Schema:

This verifies that the schema is syntactically correct and it conforms to the EDI parsing rules and it can be used with the EDI pipeline components without parsing errors. Validate Schema requires no input and output parameters and does not require any delimiter dialog box.

Validate Instance:

This is used to validate an existing EDI instance with an EDI schema. Validate instance supports 2 modes of operation, namely Trasaction Set mode (TS) or Interchange mode.

TS mode:

In this mode, the input file is just a transaction set without the Interchange and group headers and trailer. For X12 this is a document with just ST and SE and for EDIFACT it is with just UNH and UNT. The base schema is the transaction set schema itself. Since the instance does not have the information for delimiters, the dialog box is popped for the user to input his selection. Once the user has input his selection, that setting is used to validate the input file against the base schema. Any validation error results in an error being logged in the output window. If there are no errors then a success message is logged in the output window. 

Both Native and XML formats are supported for TS mode.

Interchange mode:

In this mode, the input file is an Interchange containing one or more transaction sets in one or more groups. For X12 this is a document with ISA and IEA and for EDIFACT it is with UNB and UNZ. The base schemas for X12 and EDIFACT are X12_BatchSchema.xsd and Edifact_BatchSchema.xsd respectively. This is under {Microsoft BizTalk Server 2006}\X12_Schema\EDI. The user needs to add all the additional schemas that correspond to the transaction sets in the input file. For example if the input file has 810 and 850 transaction sets, the user needs to add X12_BatchSchema.xsd (the base schema) and 810 and 850 in the same project.

For X12, the delimiter information is already present in the file so that information is blanked out in the dialog box that pops up during interchange mode instance validation. For EDIFACT, if the optional UNA segment is present in the instance, then all the delimiter information is already present and that information is blanked out. Once the user has input his selection, that setting is used to validate the input file against the base schema and all the additional schemas. Any validation error results in an error being logged in the output window. If there are no errors then a success message is logged in the output window.

Only the Native format is supported for Interchange mode.

Generate Instance:

This is used to generate an EDI instance against an EDI schema. Like Validate Instance, Generate Instance also supports the 2 modes of operation.

TS mode:

In this mode, the output file is just a transaction set without the Interchange and group headers and trailer. For X12 this is a document with just ST and SE and for EDIFACT it is with just UNH and UNT. The base schema is the transaction set schema itself. During Generate Instance, the dialog box is popped for the user to input his selection. Once the user has input his selection, that setting is used to generate the utput file against the base schema. Any validation error results in an error being logged in the output window. If there are no errors then a success message is logged in the output window. 

Both Native and XML formats are supported for TS mode.

Interchange mode:

In this mode, the output file is an Interchange containing one or more transaction sets in one of more groups. For X12 this is document with ISA and IEA and for EDIFACT it is with UNB and UNZ. The base schemas for X12 and EDIFACT are X12_BatchSchema.xsd and Edifact_BatchSchema.xsd respectively. For every additional schema added in the BizTalk project, the output file will contain 3 transaction sets. For example if the BizTalk project contains the base schema and 810 and 850 schema, the output file will contain 2 groups each with 3 810 and 850s. For EDIFACT since the group is optional, the output file will not contain a group.

For both X12 and EDIFACT, the delimiter information is required to generate the instance. Once the user has input his selection in the delimiter box, that set of delimiter and the additional settings are used to generate the instance. Any validation error results in an error being logged in the output window. If there are no errors then a success message is logged in the output window.

Only the Native format is supported for Interchange mode.

Custom Schema View:

To make the XSD schema more readable and user friendly, XML Tools introduce the EDI schema view. This view highlights information like min length, max length, min occurs, max occurs etc about the individual nodes in the schema.

End Note:

I hope this post has been useful in understanding the Design Time Experience in BizTalk R2 EDI. Your comments/questions are always welcome.

Thanks

Mohsin Kalam

November 7, 2007

Batching

Filed under: R2 EDI — Mohsin Kalam @ 8:11 pm

Goal:

To provide an in depth analysis of how R2 Batching subsystem is designed to provide out of box batching capability of EDI documents.

Overview:

Batching subsystem is implemented as a combination of BizTalk pipeline component Batch Marker in the Resolve Party stage in the EDI Receive pipeline out of box and a couple of orchestrations namely the Batching Orchestration (Batching ODX) and the Routing Orchestration (Routing ODX). Together these 3 components provide the ability to batch EDI documents out of box.

Batch Marker:

The Batch Marker component is responsible for stamping a message to be included in the Batching process. More specifically it checks the filter criteria (explained later on) on parties with active batching to see if a match has happened. 

If the filter criteria match happens for a single party with active batching, it stamps the following to the context of that message:

  • ToBeBatched = True
  • DestinationPartyID (same as BizTalk Server Party ID and is unique among all parties)
  • EncodingType (if known)

If the filter criteria match happens for more than one party with active batching, it stamps the following to the context of that message:

  • ToBeRouted = True
  • DestinationParties (comma separated values of the DestinationPartyIDs)
  • EncodingType (if known)

If the filter criteria match happens and the encoding type is not known, it stamps the following to the context of that message:

  • ToBeRouted = True
  • DestinationParties (in case of a single match, this field contains only one value)

Batching ODX:

Everytime batching is activated on a party, an instance of the batching orchestration is instantiated. When batching is stopped this instance is taken away. Batching orchestration subscribes to the following three properties:

  • ToBeBatched = True
  • DestinationPartyID
  • EncodingType

Everytime a document matches this subscription, it gets picked up by the Batching ODX and added to the active batch. Once a release criteria on a batch is met, that batch is released in the MessageBox. This batch can then be subscribed by a send port by using the expression (which is set by the Batching ODX)

DestinationPartyName = “PartyName” And
ToBeBatched = “False”

As you can see, the Batch Marker stamps any document meeting the filter criteria with the properties that a Batching ODX subscribes to for this magic to happen. 

Routing ODX:

The Routing ODX subscribes to the following property

  • ToBeRouted = True

Everytime a document matches this subscription, it gets picked up by the Routing ODX. Routing ODX then makes N number of copies of the original message depending on the list of DestinationParties and stamps each message with the properties that the Batching ODX subscribes to (namely ToBeBatched = True, DestinationPartyID and EncodingType).

In the case where the encoding type is not known, the Batch Marker stamps just the ToBeRouted and DestinationParties property on a message. By the time the message arrives at the Routing ODX, the encoding type has to be set. It then follows the similar strategy of making N number of copies and stamping each message with the properties that the Batching ODX will subscribe to. If the encoding type can not be determined at that point, the message gets suspended.

Summary: 

If the encoding type is known:

1. If filter criteria matches for one party, the batch marker will stamp the properties that the Batching ODX subscribes to

2. If match happens for more than one party, the batch marker will stamp the properties that the Routing ODX subscribes to. The Routing ODX will make N number of copies and stamp each message with properties that the Batching ODX subscribes to.

If the encoding type is not known:

1. The batch marker will stamp the properties that the Routing ODX subscribes to. By the time the document hits the Routing ODX, the encoding type should be set. The Routing ODX then makes N copies and stamp each message with the properties that the Batching ODX will subscribe to.

Batching Configuration:

Batching is available only at the party level and is configurable through PAM under EDI properties. For each party, there is a node for both X12 and EDIFACT standards labelled “Interchange Batch Creation Settings” that controls all the settings related to batching. The following snapshot shows this view

Batching Screen Shot 

Filter Criteria:

Batching follows the exact same Pub-Sub model inherent to BizTalk Server. So naturally the filter criteria is similar to the send port subscription model and works in the exact same way as a send port subscription would work. For example users can filter based on the DocType or the ReceivePort etc.

Release Criteria:

The release criteria is compared against the active set of batches to determine the release of a batch. R2 supports the following release criterias

  • Time Based
    • Hourly
    •  Daily
    • Weekly
  • Number Based
    • Max number of transaction sets in a group
    • Max number of transaction sets in an interchange
    • Max number of characters in an interchange
  • External release trigger

Activation Range:

Users can select the start date and end date of a batch. Once a batch is started, users have the option of specifying no end date, end after a number of occurrences or end by a certain date. The batch is forced released if the end date or the number of occurrence option is met before the release criteria is met. For example if a user has set a release criteria to have 3 transaction sets in a group and currently the batch holds only 2, that incomplete batch will be released when the activation range is over.  

Control Buttons:

These constiture the Start, Override and Stop buttons. Start is used to start an instance of the Batching ODX. Once a batch is started, the Batching ODX id appears in the read only box and the screen indicates at the bottom that batching is activated if the refresh button is pressed or the window is closed and reopened.

The override and stop button are inactive while a batch is in the stopped state. Starting the batch disables the start button and enables the override and stop button. Override button lets you release the batch without stopping the Batching ODX. The stop button releases the batch (even if incomplete) and kills the Batching ODX instance. 

End Note: 

I hope this post has been useful in understanding Batching components in R2 EDI used during baching of an EDI document. Your comments/questions are always welcome.

Thanks

Mohsin Kalam

Next Page »

The Rubric Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.