Understanding X12 EDI Structure


Before Jumping to EDI Structure, let us understand what is a Page in a book or word document?

Structure of the Page
Word 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 see an example of two addresses using the above structure. Assume that we need a subscriber(insurer) address and Company address in the document.

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
Separators
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
Let us rewrite our examples in EDI Structure.

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