EDI batch for X12

An X12 Batch is the interchange of one or more encoded business transactions including the EDI (electronic data interchange) encoded transactions of Accredited Standards Committee (ASC) X12. The batch message provides the interchange envelope of a header and trailer for the electronic interchange through a data transmission.

A batch message is defined in $HCIROOT/formats/x12/<version>/batch.

The basic batch message hierarchy is similar to:

ISA
[ISB]
[ISE]
[{TA1}]
{
 GS
 [S1S]
 ... (Transaction set Message)
 [{
 S1A
 SVA
 }]
 [S1E]
 GE
}
IEA

Header and trailer definitions:

Segment Definition
GS Functional Group Header. This starts a group of related transaction sets.
ST Transaction Set Header. This starts a transaction set.
LS Loop Header. This starts a bounded loop of data segments but is not part of the loop.
LE Loop Trailer. This ends a bounded loop of data segments but is not part of the loop.
SE Transaction Set Trailer. This ends a transaction set.
GE Functional Group Trailer. This ends a group of related transaction sets.

More than one ST/SE pair, each representing a transaction set, can be used within one functional group. More than one LS/LE pair, each representing a bounded loop, can be used within one transaction set.

According to this structure, you can define to split to groups/transaction sets during the handling of an Inbound Batch message.

Cloverleaf splits the batch message by searching GS/ST segment, then puts the whole group/transaction set content as a single X12 message.

On the outbound side, the engine puts several single X12 messages together by adding the envelope header, ISA – Interchange Control Header, and trailer, IEA - Interchange Control Trailer. The user must set the values for these segments.

Examples

A dialog box opens when you click Edit for EDI Batch on the Outbound tab.

On the Inbound side, set the Inbound EDI Batch to X12, and Trx ID Determination Format to X12. When a batch message is received, the Cloverleaf engine splits the batch message according to the setting (Split to Transaction Sets/Groups) to several single messages. Then, Cloverleaf gets the TRXID from these messages, and routes them to the destinations.

On the Outbound side, set the Inbound EDI Batch to X12 with the default values for the ISA segment and the message count/interval for the batch message. When there are enough messages to be sent out, or the time interval passes, the engine puts these messages to be a batch message by adding ISA and IEA segments.