Understanding X12 EDI Structure

Understanding EDI Structure

Understanding EDI Structure

Introduction

Before diving into the EDI (Electronic Data Interchange) structure, let's first understand how data is typically structured in a book or a Word document.

Structure of a Page

  • Word: A single unit of language separated by space.
  • Sentence: A group of words forming a meaningful statement.
  • Paragraph: A collection of sentences expressing a complete idea.

Example of Address Representation

Subscriber Information

Carrie J. Brown, DOB 01/13/1953, Male
3360 Lynn Street
Woburn, MA 01801

Company Information

Healthservices LLC, Tax ID: xx1234512
2550 Adamsville Road
Harlingen, TX 78550

Page vs. EDI Structure

Traditional Document EDI Structure
Words are separated by spaces Elements are separated by a delimiter (usually *)
Sentences are separated by lines Segments are separated by a terminator (usually ~)
Paragraphs are separated by line breaks Loops do not have defined separators

Converting Data to EDI Format

Using EDI formatting, the above address example is converted into:

Carrie*J*Brown*01/13/1953*Male~
3360*Lynn Street~
Woburn*MA*01801~

Healthservices LLC*xx1234512~
2550*Adamsville Road~
Harlingen*TX*78550~

Note: In real-world EDI, this appears as:

Carrie*J*Brown*01/13/1953*Male~3360*Lynn Street~Woburn*MA*01801~Healthservices LLC*xx1234512~2550*Adamsville Road~Harlingen*TX*78550~

How Computers Process EDI Data

Computers do not inherently understand the meaning of raw EDI data. To structure it properly, we use:

  1. Segment Name - Identifies the type of data.
  2. Type Qualifier (Optional) - Specifies what the segment represents.

Rewriting the Example with Proper EDI Segments

NM1*IL*Carrie*J*Brown*01/13/1953*Male~
N3*3360*Lynn Street~
N4*Woburn*MA*01801~

NM1*85*Healthservices LLC*xx1234512~
N3*2550*Adamsville Road~
N4*Harlingen*TX*78550~

Key Points

  • ✅ Each segment starts with a segment name (e.g., NM1, N3, N4).
  • Type qualifiers (e.g., IL, 85) differentiate data types.
  • Address segments (N3, N4) do not require a type qualifier.

Additional Notes on EDI Messages

  • If you need to send a number (NPI, Tax ID, SSN), it must be prefixed with an identifier.
NM1*85*2*Demo Clinic*XX*1215099528

Since segments are groups of elements, some elements may be optional.

  • With a middle name:
NM1*IL*Carrie*J*Brown
  • Without a middle name:
NM1*IL*Carrie**Brown

Conclusion

EDI structures transform unstructured text into computer-readable formats. By using segments, delimiters, and type qualifiers, we create a standardized way to exchange data efficiently.