X12 documentation uses envelope for the header-and-trailer pairs that delimit parts of a message. An interchange contains functional groups, and each group contains transaction sets.
Interchange: ISA and IEA
ISA starts the interchange, and IEA ends it. This pair comes from the single-benefit response:
ISA*00* *00* *ZZ*CEDARVALLEYHP *ZZ*OAKSTMEDGROUP *990101*1201*^*00501*000000101*0*T*:~
...
IEA*1*000000101~ISA01throughISA04show that the example does not supply authorization or security information. The spaces still fill fixed-width positions.ISA05/ISA06identify the sender, andISA07/ISA08identify the receiver. Both useZZ, the mutually defined qualifier.ISA09andISA10contain the interchange date and time.ISA11,ISA12, andISA16establish the repetition separator, control version, and component separator.ISA15=Tmarks the interchange as test data.ISA13is the interchange control number. The same value appears inIEA02.IEA01=1reports one functional group in this interchange.
For field details, see the ISA field table and the IEA field table.
Functional group: GS and GE
GS and GE surround a functional group:
GS*HB*CEDARVALLEYHP*OAKSTMEDGROUP*20990101*1201*101*X*005010X279A1~
...
GE*1*101~GS01=HBidentifies the functional group as eligibility, coverage, or benefit information.GS02andGS03contain the application sender and receiver codes.GS04andGS05contain the group date and time.GS06=101is the group control number. It matchesGE02.GS07=Xidentifies X12 as the responsible agency.GS08=005010X279A1identifies the implementation convention used here.GE01=1reports one transaction set in the group.
For field details, see the GS field table and the GE field table.
Transaction set: ST and SE
ST and SE surround one business transaction:
ST*271*0101*005010X279A1~
...
SE*10*0101~ST01=271identifies an eligibility, coverage, or benefit response.ST02=0101is the transaction control number. It matchesSE02.ST03=005010X279A1identifies the implementation convention used by the transaction.SE01=10counts every segment fromSTthroughSE, including both.
For field details, see the ST field table and the SE field table.
These pairs close in reverse order: ST/SE, then GS/GE, then ISA/IEA. A file can contain more than one interchange, as shown by X12 Request for Interpretation (RFI) 1585. Each route can set its own file and batching rules.