The ANSI ASC X12 document structure is a well-defined format used for Electronic Data Interchange (EDI) in North America. It allows businesses to exchange standard documents electronically, ensuring that the data is structured in a consistent and machine-readable format. The structure of an ANSI ASC X12 document is hierarchical, consisting of envelopes, segments, and data elements. Below is a detailed breakdown of each component:
1. Interchange Envelope
The highest level of the structure, the interchange envelope, wraps around the entire EDI document. It consists of the ISA and IEA segments.
a. ISA Segment (Interchange Control Header)
- Purpose: Identifies the sender, receiver, and control information for the entire interchange.
- Key Data Elements:
- Authorization Information Qualifier (ISA01)
- Authorization Information (ISA02)
- Security Information Qualifier (ISA03)
- Security Information (ISA04)
- Interchange ID Qualifier (ISA05): Identifies the type of sender ID.
- Interchange Sender ID (ISA06)
- Interchange ID Qualifier (ISA07): Identifies the type of receiver ID.
- Interchange Receiver ID (ISA08)
- Interchange Date (ISA09)
- Interchange Time (ISA10)
- Interchange Control Standards Identifier (ISA11)
- Interchange Control Version Number (ISA12)
- Interchange Control Number (ISA13)
- Acknowledgment Requested (ISA14)
- Usage Indicator (ISA15): Indicates whether the data is test or production.
- Component Element Separator (ISA16): Specifies the delimiter for sub-elements.
Example:
ISA*00* *00* *ZZ*SENDERID *ZZ*RECEIVERID *240814*1530*U*00401*000000001*0*T*:~
b. IEA Segment (Interchange Control Trailer)
- Purpose: Marks the end of the interchange and provides control totals.
- Key Data Elements:
- Number of Included Functional Groups (IEA01)
- Interchange Control Number (IEA02): Matches the control number in the ISA segment.
Example:
IEA*1*000000001~
2. Functional Group
The functional group encloses a group of related transaction sets. It consists of the GS and GE segments.
a. GS Segment (Functional Group Header)
- Purpose: Groups related transactions, such as all purchase orders or invoices, under a single functional group.
- Key Data Elements:
- Functional Identifier Code (GS01): Identifies the type of transactions (e.g.,
PO
for Purchase Order). - Application Sender's Code (GS02)
- Application Receiver's Code (GS03)
- Date (GS04)
- Time (GS05)
- Group Control Number (GS06)
- Responsible Agency Code (GS07)
- Version/Release/Industry Identifier Code (GS08)
- Functional Identifier Code (GS01): Identifies the type of transactions (e.g.,
Example:
GS*PO*SENDERID*RECEIVERID*20240814*1530*1*X*004010~
b. GE Segment (Functional Group Trailer)
- Purpose: Marks the end of a functional group and provides control totals.
- Key Data Elements:
- Number of Transaction Sets Included (GE01)
- Group Control Number (GE02): Matches the control number in the GS segment.
Example:
GE*1*1~
3. Transaction Set
Each functional group contains one or more transaction sets, each representing a specific business document, such as a purchase order or invoice. It consists of the ST and SE segments.
a. ST Segment (Transaction Set Header)
- Purpose: Identifies the beginning of a transaction set.
- Key Data Elements:
- Transaction Set Identifier Code (ST01): Identifies the type of transaction (e.g.,
850
for Purchase Order). - Transaction Set Control Number (ST02): Unique number for tracking the transaction set.
- Transaction Set Identifier Code (ST01): Identifies the type of transaction (e.g.,
Example:
ST*850*0001~
b. SE Segment (Transaction Set Trailer)
- Purpose: Marks the end of a transaction set and provides control totals.
- Key Data Elements:
- Number of Included Segments (SE01)
- Transaction Set Control Number (SE02): Matches the control number in the ST segment.
Example:
SE*15*0001~
4. Segments
Segments are the building blocks of the transaction set, each containing related data elements. Segments begin with a two- or three-character identifier.
a. Example Segments in an 850 Purchase Order:
BEG Segment (Beginning Segment for Purchase Order)
- Purpose: Indicates the start of the purchase order.
- Key Data Elements:
- Transaction Set Purpose Code (BEG01)
- Purchase Order Type Code (BEG02)
- Purchase Order Number (BEG03)
- Date (BEG05)
Example:
BEG*00*SA*123456789**20240814~REF Segment (Reference Identification)
- Purpose: Provides additional identifying information.
- Key Data Elements:
- Reference Identification Qualifier (REF01)
- Reference Identification (REF02)
Example:
REF*DP*1234~N1 Segment (Name)
- Purpose: Identifies a party involved in the transaction.
- Key Data Elements:
- Entity Identifier Code (N101)
- Name (N102)
- Identification Code Qualifier (N103)
- Identification Code (N104)
Example:
N1*BY*BUYER NAME*92*12345~PO1 Segment (Purchase Order Line Item)
- Purpose: Provides details about individual items being ordered.
- Key Data Elements:
- Assigned Identification (PO101)
- Quantity Ordered (PO102)
- Unit of Measure (PO103)
- Unit Price (PO104)
- Product/Service ID Qualifier (PO106)
- Product/Service ID (PO107)
Example:
PO1*1*10*EA*25.00*PE*BP*1001*VP*5678~PID Segment (Product/Item Description)
- Purpose: Provides a description of the item.
- Key Data Elements:
- Item Description Type (PID01)
- Description (PID05)
Example:
PID*F****BLUE WIDGET~
5. Data Elements
Data elements are the smallest units of information in an EDI document. Each data element is defined by its data element number and can contain alphanumeric, numeric, or date values.
a. Types of Data Elements:
- Simple Data Element: Contains a single piece of data, such as a number or text.
- Composite Data Element: Contains multiple components, which are further broken down into simple data elements.
6. Delimiters
Delimiters are special characters used to separate different parts of the document:
- Data Element Separator: Typically an asterisk (
*
), used to separate individual data elements within a segment. - Sub-element Separator: Often a colon (
:
), used within composite data elements to separate individual components. - Segment Terminator: Typically a tilde (
~
), used to indicate the end of a segment.
Example: Full Structure
Here’s a summarized view of a simple ANSI ASC X12 850 Purchase Order document:
ISA*00* *00* *ZZ*SENDERID *ZZ*RECEIVERID *240814*1530*U*00401*000000001*0*T*:~GS*PO*SENDERID*RECEIVERID*20240814*1530*1*X*004010~
ST*850*0001~
BEG*00*SA*123456789**20240814~
REF*DP*1234~
N1*BY*BUYER NAME*92*12345~
N3*123 BUYER STREET~
N4*BUYER CITY*STATE*ZIP~
N1*ST*SHIP TO NAME*92*54321~
N3*456 SHIPPER AVENUE~
N4*SHIPPER CITY*STATE*ZIP~
PO1*1*10*EA*25.00*PE*BP*1001*VP*5678~
PID*F****BLUE WIDGET~
SCH*10*20240820*010*AL~
CTT*1~
SE*15*0001~
GE*1*1~
IEA*1*000000001~
No comments:
Post a Comment