X12 EDI Examples
Understanding X12 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:
- Segment Name - Identifies the type of data.
- 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.
Before Jumping to EDI Structure, let us understand what is a Page in a book or word document?
Structure of the PageWord | A word is a single unit of language that can be represented in writing or speech and each word is separated by space. |
Sentence | A combination of a group of words that gives a complete meaning and each sentence separated by a line |
Paragraph | A combination of a group of sentences that gives a complete meaning |
Let us name the below paragraph as Paragraph 1 and contains Subscriber information.
Carrie J. Brown, DOB 01/13/1953, Male
3360 Lynn Street
Woburn, MA 01801
Let us name the above paragraph as Paragraph 2 and contains Company information with a tax id.
Healthservices LLC, Tax ID: xx1234512
2550 Adamsville Road
Harlingen, TX 78550
Page Vs EDI
Page in a Book | Message in an EDI |
Word | Elements |
Sentence | Segments |
Paragraph | Loop |
Page in a Book | Message in an EDI |
Words are separated by space | Elements as separated by a delimiter. Any Character can be a delimiter, but most used is Asterisk * |
Sentence are separated by Line | Segments as separated by the terminator. Any character can be terminator, but most used is ~ |
Paragraph are separated by one or more lines | There are no separators for Loop |
Carrie*J*Brown*01/13/1953*Male~
3360*Lynn Street~
Woburn*MA*01801~
Healthservices LLC*xx1234512~
2550*Adamsville Road~
Harlingen*TX*78550~
Just for better understanding, the above information is separated with a newline character, but in real-time, it will look as follows
Carrie*J*Brown*01/13/1953*Male~3360*Lynn Street~Woburn*MA*01801~Healthservices LLC*xx1234512~2550*Adamsville Road~Harlingen*TX*78550~
Now let us get into more detail by looking at the above message. There are some issues for the computer to understand as follows.
1) Very first, the computer does not know what we are talking about, but we know that the above is two address representations where one is for the subscriber and one is for the company.
2) So, it is time to give information in a more structured way to the computer about this data.
X12 EDI expects before you start giving information, it needs a segment Name and segment type. Whenever we need to provide information about an entity or person, then the segment name is NM1. Second, we need to inform what is that entity or person, are its Patient details or is it Company Name, etc. That is called type qualifier, for example, for the subscriber, the type qualifier is IL and for Company, the type qualifier is 85, etc
Segments should start with Segment Name, optionally there should be segment type or type qualifier.
Let us rewrite our examples in EDI Structure
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~
As you can see, every segment starts with segment names such as NM1, N3, N4, etc and optionally it also contains type in the second position. An important point to note that is, for address segments, there is no need to provide type.
Other important notes on EDI Message
1) If you want to send any number such as NPI or tax ID or SSN, then before that number we need to tell what that number is. For example, the provider contains NPI number, so before we put the actual NPI number, it should be prefixed by XX as follows1) If you want to send any number such as NPI or tax ID or SSN, then before that number we need to tell what that number is. For example, provider contains NPI number, so before we put the actual NPI number, it should be prefixed by XX as followsNM1*85*2*Demo Clinic*XX*1215099528
Subscribe to:
Posts (Atom)