EDI X12 Message Typical Structure in Brief
In the previous posts in our blog we have already written about EDI X12 standard in general. Today we will try to explain typical structure of the EDI X12 message and we take 837 Healthcare Claim (HIPAA) release version 4010 document as an example.
General notes about EDI X12 file structure
- Each segment is displayed on the separate line and ends with ~ (tilde) (in this example) – segment separator (delimiter).
- Each segment starts with 2-3 letter code that identifies it (ISA, GS, ST, BHT…) – these are segment identifiers.
- Elements in each segment are separated by element separator * (star) (in this example).
- Separators in our case are printable characters – ~ (tilde) and * (star), however, they can be represented by pipe sign or non-printable characters.
- Segments like ISA, GS, ST, SE, GE, IEA form envelope and represent important information about parties. Also envelope contains interchange, transaction group and transaction control numbers, counts, transmission dates and times etc.
- Enveloping segments are in pairs. ISA-IEA represents an interchange, GS-GE is a group inside of interchange and ST-SE is a transaction inside the group.
- Some of the segments may repeat more than once – in this case they will have different qualifiers for identification.
Layers in the envelope contain their specific control numbers that serve for identification of successful and failed interchanges, groups and transactions. The thing is that control numbers at the end of the document must match control numbers at the beginning of it. Control numbers have definite format and length requirements and therefore they are unique.
Transaction number (message numeric name) takes the first element place in ST segment. It indicates transactions presented in the EDI file (there may be some EDI documents sent at one time, in one EDI file). In such cases EDI messages are hard to process.