The rules for X12 envelope structure ensure the integrity of the data and the efficiency of the information exchange. The actual X12 message structure has primary levels that are hierarchical. From highest to the lowest, they are:
Interchange Envelope
Functional Group
Transaction Set
A schematic structure of X12 envelopes is shown in Figure 2–1. Each of these levels is explained in more detail in the remainder of this section.
Figure 2–2 shows the standard segment table for an X12 997 (Functional Acknowledgment) as it appears in the X12 standard and in most industry-specific implementation guides.
Functional Groups, often referred to as the “inner envelope,” are made up of one or more Transaction Sets, all of the same type, which can be batched together into one transmission. The Functional Group is defined by the header and trailer segments.
The Functional Group Header (designated GS) segment appears at the beginning, and the Functional Group Trailer (designated GE) segment appears at the end. Many Transaction Sets can be included in the Functional Group, but all local transactions must be of the same type.
Within the Functional Group, each Transaction Set is assigned a functional identifier code, which is the first data element of the header segment. The Transaction Sets that constitute a specific Functional Group are identified by this functional ID code.
The GS segment contains:
Functional ID code (the two-letter transaction code; for example, PO for an 850 Purchase Order, HS for a 270 Eligibility, Coverage, or Benefit Inquiry) to indicate the type of transaction in the Functional Group
Identification of sender and receiver
Control information (the Functional Group control numbers in the header and trailer segments must be identical)
Date and time
The GE segment contains:
Number of Transaction Sets included
Group control number (originated and maintained by the sender)
See Figure 2–3 and Figure 2–4.
The Interchange Envelope, often referred to as the “outer envelope,” is the wrapper for all the data to be sent in one transmission. It can contain multiple Functional Groups. This characteristic means that transactions of different types can be included in the Interchange Envelope, with each type of transaction stored in a separate Functional Group.
The Interchange Envelope is defined by the header and trailer; the Interchange Control Header (designated ISA) appears at the beginning, and the Interchange Control Trailer (designated IEA) appears at the end.
As well as enveloping one or more Functional Groups, the ISA and IEA segments include:
Data element separators and data segment terminator
Identification of sender and receiver
Control information (used to verify message was correctly received)
Authorization and security information, if applicable
The sequence of information transmitted is:
ISA
Optional interchange-related control segments
Actual message information, grouped by transaction type into Functional Groups
IEA
See Figure 2–5 and Figure 2–6.
The following list describes the ISA segments shown in Figure 2–5:
Authorization Information Qualifier
Security Information Qualifier
Interchange ID Qualifier
Interchange Sender ID
Interchange ID Qualifier
Interchange Receiver ID
Date
Time
Repetition Separator
Interchange Control Version Number
Interchange Control Number
Acknowledgment Requested
Usage Indicator
Each Transaction Set also known as a transaction contains:
Transaction Set header (designated ST)
Transaction Set trailer (designated SE)
Single message, enveloped within the header and footer
A Transaction Set has a three-digit code, a text title, and a two-letter code, for example, 997, Functional Acknowledgment (FA).
The Transaction Set is composed of logically related pieces of information grouped into units called segments. For example, one segment used in the Transaction Set might convey the address: city, state, postal code, and other geographical information. A Transaction Set may contain multiple segments. For example, the address segment might be used repeatedly to convey multiple sets of address information.
The X12 standard defines the sequence of segments in the Transaction Set and also the sequence of elements within each segment. The relationship between segments and elements can be compared to the relationship between records and fields in a database environment. See Figure 2–7 and Figure 2–8.