Skip to content

Segment Reference

EDI transactions are built from segments — single lines of data that each serve a specific purpose. Understanding segment structure is essential for reading and troubleshooting EDI files.


What Are Segments?

A segment is a single line in an EDI file, starting with a 2-3 character segment ID and ending with a segment terminator (usually ~). Each segment represents a specific type of information.

Basic Structure

NM1*IL*1*SMITH*JOHN*A***MI*ABC123456~
│    │  │   │     │   │ │ │  │        │
│    └──┴───┴─────┴───┴─┴─┴──┴────────┴── Elements (separated by *)
└── Segment ID                         └── Segment Terminator

Key Concepts

TermDefinition
Segment ID2-3 character identifier (e.g., NM1, CLM, SVC)
ElementIndividual data field within a segment
Element SeparatorCharacter separating elements (usually *)
CompositeElement containing sub-elements (separated by :)
Segment TerminatorCharacter ending the segment (usually ~)
Required ElementMust be present for the segment to be valid
Situational ElementRequired only in certain circumstances

Understanding Elements

Elements are numbered starting from 01 after the segment ID. Empty elements still need their separators:

DMG*D8*19800515*M**~
    │    │       │  ││
    01   02      03 0405 (empty)
  • DMG01: D8 — Date format qualifier
  • DMG02: 19800515 — Date of birth
  • DMG03: M — Gender
  • DMG04: Empty
  • DMG05: Empty (trailing empties can be omitted)

How EDI Paisan Displays Elements

In the segment detail panel, EDI Paisan shows:

DMG - Demographic Information
├── DMG01: D8 (Date Format: CCYYMMDD)
├── DMG02: 19800515 (Date of Birth)
├── DMG03: M (Gender: Male)

Each element is labeled with its position and meaning based on the transaction type context.


Composite Elements

Some elements contain sub-elements separated by colons (:). These are called composite elements.

Example: Healthcare Service Code

SV1*HC:99213:25*125*UN*1~
     │   │    │
     │   │    └── Modifier
     │   └── CPT Code
     └── Code Type (HC = HCPCS)

This SV1-01 composite contains:

  • SV1-01-1: HC — Procedure code qualifier
  • SV1-01-2: 99213 — CPT/HCPCS code
  • SV1-01-3: 25 — Modifier

Common Composite Patterns

ElementComponentsExample
Procedure CodeType:Code:Mod1:Mod2:Mod3:Mod4HC:99213:25
Diagnosis CodeType:CodeABK:J0690
AmountQualifier:AmountB6:1500.00
Provider IDType:IDXX:1234567890

Envelope Segments

Every EDI file is wrapped in envelope segments that identify the transmission:

ISA — Interchange Control Header

The ISA segment starts every EDI file and has fixed-length elements:

ISA*00*          *00*          *ZZ*SENDER         *ZZ*RECEIVER       *240115*1200*^*00501*000000001*0*P*:~
ElementLengthDescription
ISA012Authorization Info Qualifier
ISA0210Authorization Information
ISA032Security Info Qualifier
ISA0410Security Information
ISA052Interchange Sender ID Qualifier
ISA0615Interchange Sender ID
ISA072Interchange Receiver ID Qualifier
ISA0815Interchange Receiver ID
ISA096Interchange Date (YYMMDD)
ISA104Interchange Time (HHMM)
ISA111Repetition Separator
ISA125Interchange Control Version
ISA139Interchange Control Number
ISA141Acknowledgment Requested
ISA151Usage Indicator (P=Production, T=Test)
ISA161Component Element Separator

ISA Fixed-Width

Unlike other segments, ISA elements have fixed widths. That's why you see padding spaces. EDI Paisan handles this automatically.

IEA — Interchange Control Trailer

Closes the interchange:

IEA*1*000000001~
  • IEA01: Number of included functional groups
  • IEA02: Interchange control number (must match ISA13)

GS — Functional Group Header

Groups related transactions:

GS*HC*SENDER*RECEIVER*20240115*1200*1*X*005010X222A1~
ElementDescription
GS01Functional ID Code (HC=Healthcare Claim)
GS02Application Sender's Code
GS03Application Receiver's Code
GS04Date (CCYYMMDD)
GS05Time (HHMM)
GS06Group Control Number
GS07Responsible Agency Code (X=X12)
GS08Implementation Version

GE — Functional Group Trailer

GE*1*1~
  • GE01: Number of transaction sets in group
  • GE02: Group control number (must match GS06)

ST — Transaction Set Header

Starts each transaction:

ST*837*0001*005010X222A1~
  • ST01: Transaction Set ID (837, 835, 270, 271)
  • ST02: Transaction Set Control Number
  • ST03: Implementation Convention Reference

SE — Transaction Set Trailer

SE*42*0001~
  • SE01: Number of segments in transaction (including ST and SE)
  • SE02: Transaction Set Control Number (must match ST02)

Key Segments by Transaction Type

837 — Claims

SegmentNamePurposeLoop
BHTBeginning of Hierarchical TransactionTransaction info, purposeHeader
HLHierarchical LevelEstablishes parent-child structure2000*
NM1Individual or Organizational NameIdentifies entities2010*
N3Address InformationStreet address2010*
N4Geographic LocationCity, state, ZIP2010*
REFReference IdentificationIDs, account numbersVarious
DMGDemographic InformationDOB, gender2010*
CLMClaim InformationClaim details, charges2300
DTPDate/Time ReferenceService dates, admissionVarious
HIHealth Care Information CodesDiagnosis codes2300
SBRSubscriber InformationCoverage details2000B
SV1Professional ServiceLine item (837P)2400
SV2Institutional ServiceLine item (837I)2400
LXTransaction Set Line NumberLine counter2400

CLM — Claim Information

The heart of an 837 transaction:

CLM*PATIENT-ACCT-123*500***11:B:1*Y*A*Y*Y~
ElementDescription
CLM01Patient Account Number
CLM02Total Claim Charge Amount
CLM03Not used
CLM04Not used
CLM05Place of Service:Facility Code:Frequency Code
CLM06Provider Signature on File (Y/N)
CLM07Assignment or Plan Participation Code
CLM08Benefits Assignment Certification
CLM09Release of Information Code

SV1 — Professional Service (837P)

SV1*HC:99213:25*125*UN*1***1:2:3~
ElementDescription
SV101Composite - Procedure Code (HC:CPT:Modifiers)
SV102Line Item Charge Amount
SV103Unit Basis (UN=Unit)
SV104Service Unit Count
SV105Place of Service
SV106Not used
SV107Composite - Diagnosis Code Pointers

HI — Health Care Information Codes (Diagnosis)

HI*ABK:J0690*ABF:E119*ABF:I10~
QualifierDescription
ABKICD-10 Principal Diagnosis
ABFICD-10 Diagnosis
BKICD-9 Principal Diagnosis
BFICD-9 Diagnosis

835 — Remittance

SegmentNamePurposeLoop
BPRFinancial InformationPayment method, amountHeader
TRNReassociation Trace NumberCheck/EFT numberHeader
DTMDate/Time ReferenceProduction dateHeader
N1NamePayer/Payee identification1000*
LXTransaction Set Line NumberHeader grouping2000
CLPClaim Level PaymentClaim adjudication2100
CASClaim Adjustment SegmentAdjustments, denials2100/2110
NM1Individual or Organizational NamePatient, provider2100
SVCService Payment InformationLine-level payment2110
AMTMonetary AmountVarious amounts2100/2110
PLBProvider Level BalanceProvider adjustmentsTrailer

BPR — Financial Information

BPR*I*1500.00*C*ACH*CTX*01*999999999*DA*1234567890**01*999999999*DA*9876543210*20240120~
ElementDescription
BPR01Transaction Handling Code (I=Remittance Info Only, C=Payment)
BPR02Total Actual Provider Payment Amount
BPR03Credit/Debit Flag
BPR04Payment Method (ACH, CHK, NON)
BPR16Check Issue/EFT Date

CLP — Claim Payment

CLP*PATIENT123*1*500.00*400.00*50.00*MA*CLAIM123*11~
ElementDescription
CLP01Patient's Claim Number
CLP02Claim Status Code
CLP03Total Claim Charge Amount
CLP04Total Claim Payment Amount
CLP05Patient Responsibility Amount
CLP06Claim Filing Indicator Code
CLP07Payer's Claim Control Number
CLP08Facility Code Value

Claim Status Codes (CLP02):

CodeMeaning
1Processed as Primary
2Processed as Secondary
3Processed as Tertiary
4Denied
19Processed as Primary, Forwarded
20Processed as Secondary, Forwarded
22Reversal of Previous Payment

CAS — Claim Adjustment Segment

CAS*CO*45*100.00**42*50.00~
ElementDescription
CAS01Claim Adjustment Group Code
CAS02Adjustment Reason Code
CAS03Adjustment Amount
CAS04Adjustment Quantity
(Repeats)Up to 6 adjustments per CAS segment

Adjustment Group Codes (CAS01):

CodeMeaningPatient Responsibility?
COContractual ObligationNo — write-off
CRCorrections and ReversalsVaries
OAOther AdjustmentsVaries
PIPayer Initiated ReductionNo
PRPatient ResponsibilityYes

270 — Eligibility Inquiry

SegmentNamePurposeLoop
BHTBeginning of Hierarchical TransactionTransaction purposeHeader
HLHierarchical LevelStructure2000*
NM1Individual or Organizational NameEntity identification2100*
REFReference IdentificationIDs, group numbers2100*
DMGDemographic InformationDOB, gender2100C
DTPDate/Time ReferenceDate of service2100C
EQEligibility or Benefit InquiryWhat's being asked2100C

EQ — Eligibility Inquiry

EQ*30~
  • EQ01: Service Type Code (see Qualifier Codes for full list)
  • EQ02: Composite Medical Procedure (optional)

Common Service Type Codes:

CodeDescription
30Health Benefit Plan Coverage
1Medical Care
33Chiropractic
47Hospital
86Emergency Services

271 — Eligibility Response

SegmentNamePurposeLoop
BHTBeginning of Hierarchical TransactionTransaction infoHeader
HLHierarchical LevelStructure2000*
NM1Individual or Organizational NameEntities2100*
REFReference IdentificationIDs2100*
EBEligibility or Benefit InformationCoverage details2110*
HSDHealth Care Services DeliveryQuantity limits2110*
DTPDate/Time ReferenceEffective dates2110*
MSGMessage TextFree-form notes2110*

EB — Eligibility/Benefit Information

The key segment in 271 responses:

EB*1*IND*30*HM*GOLD PLAN~
ElementDescription
EB01Eligibility/Benefit Information Code
EB02Coverage Level Code (IND, FAM, etc.)
EB03Service Type Code
EB04Insurance Type Code
EB05Plan Coverage Description
EB06Time Period Qualifier
EB07Monetary Amount
EB08Percent

EB01 Information Codes:

CodeMeaning
1Active Coverage
6Inactive
INon-Covered
ACo-Insurance
BCo-Payment
CDeductible
FLimitations
GOut of Pocket Maximum
ROther or Additional Payor

Name Segments (NM1)

The NM1 segment identifies entities and appears throughout EDI transactions:

NM1*IL*1*SMITH*JOHN*A***MI*ABC123456~
ElementDescription
NM101Entity Identifier Code (who this is)
NM102Entity Type Qualifier (1=Person, 2=Organization)
NM103Last Name or Organization Name
NM104First Name (persons only)
NM105Middle Name (persons only)
NM106Name Prefix
NM107Name Suffix
NM108Identification Code Qualifier
NM109Identification Code

See Qualifier Codes for complete lists of entity identifiers and ID qualifiers.


Address Segments (N3/N4)

Addresses are split across two segments:

N3 — Street Address

N3*123 MAIN STREET*SUITE 100~
  • N301: Address Line 1
  • N302: Address Line 2

N4 — Geographic Location

N4*ANYTOWN*SC*29601*US~
  • N401: City Name
  • N402: State/Province Code
  • N403: Postal Code
  • N404: Country Code

Date Segments (DTP)

Date/time information uses consistent qualifiers:

DTP*472*D8*20240115~
ElementDescription
DTP01Date/Time Qualifier
DTP02Date/Time Format (D8=Date, RD8=Date Range)
DTP03Date/Time Value

Common Date Qualifiers (DTP01)

CodeDescription
096Discharge Date
232Claim Statement Period Start
233Claim Statement Period End
291Plan Begin
292Plan End
304Latest Visit/Consultation
314Disability Begin
360Initial Treatment
435Admission
472Service
573Date Claim Paid

Date Formats (DTP02)

CodeFormatExample
D8CCYYMMDD20240115
RD8CCYYMMDD-CCYYMMDD20240115-20240131

Reading Segments in EDI Paisan

Using the Tree View

  1. Expand loops to see contained segments
  2. Click a segment to see element breakdown
  3. Element tooltips show qualifier meanings

Search by segment ID to find all occurrences:

  • NM1 — Find all name segments
  • CAS — Find all adjustments
  • EB*1 — Find active coverage responses

Segment Colors

EDI Paisan color-codes segments by category:

ColorCategoryExamples
BlueIdentificationNM1, N1, REF
GreenFinancialCLM, SVC, CLP, AMT
OrangeDatesDTP, DTM
PurpleCodesHI, SV1, EB
GrayEnvelopeISA, GS, ST, SE

Common Issues

Missing Required Elements

If a required element is missing:

NM1*IL*1*SMITH****MI*~   ← Missing first name (NM104)

EDI Paisan will show a validation warning.

Invalid Qualifier Codes

Unrecognized qualifiers display with a warning badge. Check Qualifier Codes for valid values.

Trailing Delimiters

Extra delimiters at segment end are allowed but unnecessary:

DTP*472*D8*20240115~     ← Clean
DTP*472*D8*20240115***~  ← Works but wasteful

Your Friend in EDI