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 follows

NM1*85*2*Demo Clinic*XX*1215099528

2) As we known that segments are group of elements. In some cases, your claim may not have data for some elements. For example, some patients may have middle name, or some may not have.
Patients having middle Name representation.

NM1*IL*Carrie*J*Brown
Here is J is middle Name

Patients without middle Name representation.
NM1*IL*Carrie**Brown

Summary

Loops

A block or section of an EDI file is called a Loop. Each loop contains several different Segments, which are comprised of Elements and Sub-Elements. They will typically begin with an HL or NM1 Segment.
Please follow the below link to see the Loops defined in EDI 837 Professional Message. Normally, they begin with an NM or HL segment.
EDI 837 Professional Loops
   There are multiple types of loops, but they are all broken into five primary sections:
  • 2000A- Billing Provider
  • 2000B- Subscriber
  • 2000C- Client, though this is only on the form if it’s different than the subscriber.
  • 2300- Claim Information
  • 2400- Service Line Information

Segments
Each Loop contains one or more segments to represent the data. Each segment will contain a character to identify that is the end of the segment. The most common used character is tilde (~).
Every segment begins with a Segment Identifier Code.  The tilde is known as the Segment Separator. A Segment Identifier Code is located before each segment. Here are some common codes that you may see:
Common codes that you will see throughout the file include:
  • PRV = Provider
  • SBR = Subscriber
  • HL = Hierarchy
  • NM1 = Name
  • N3 = Street Address
  • N4 = City, State, and ZIP
  • DTP = Date
  • DMG = Demographic
  • REF = Reference
  • CLM = Claim
  • LX = Line
  • SV1 = Service
Elements
Each Segment contains one or more elements. Each element is separated by a character . The most common used character is asterisks (*). These are called Element Separators.Additionally, Sub-Elements are separated using a colon (:). If you see multiple asterisks or colons side-by-side, that means that the Element or Sub-Element is empty. Data elements have the same claim information that prints on the paper forms.

As with Segments, there are also several Element Identifier Codes that you will see throughout the file, such as:

  • 41 = Claim Creator (Hardcoded to EI Assistant)
  • 40 = Claim Receiver
  • 85 = Billing Provider
  • 82 = Rendering Provider
  • DN = Referring Provider
  • IC = Information Contact
  • 77 = Service Location
  • 472 = Date of Service
  • SY = Social Security Number
  • EI = Tax ID (EIN)
  • XX = NPI
  • Y4 = Claim Casualty Number
  • HC = Standard CPT Code
  • ABK = Principal Diagnosis
  • ABF = Diagnosis