Reference·AL1 Segment·AL1-1
HL7 v2 Reference

What Is HL7 v2 AL1-1? Set ID, Explained for Testers

Jul 27, 2026 · 4 min read
AL1-2 →

AL1-1 looks like the most boring field in the entire segment, a plain incrementing number. It is also the field most likely to be silently wrong, because nobody double-checks it until two allergy records get merged into one on screen.

Quick answer

AL1-1 is a sequential integer, starting at 1, that numbers each AL1 segment within a message when a patient has more than one recorded allergy. It exists purely to keep repeated segments distinguishable and ordered; it carries no clinical meaning on its own.

What this field contains

Format
Numeric string — typically "1", "2", "3"... with no leading zeros or decimals
Scope
Message-level, per segment — resets with each new message; not a persistent patient-level identifier
Cardinality
One per AL1 segment — every repeated AL1 in the message should carry a distinct, increasing value

Example

Synthetic example Generated by Synthibase
AL1|1|DA|PENICILLIN^PENICILLIN^L|SV|HIVES^ANAPHYLAXIS|20250314

AL1-1 is the leading "1", marking this as the first allergy record in the message.

Where this trips people up

Test data generators that hardcode AL1-1 to "1" on every segment are the number one cause of downstream bugs never getting caught. If your synthetic patients only ever have a single allergy, your integration engine or interface layer never has to prove it can correctly sequence and store two, three, or ten AL1 segments in one message. Also watch for gaps: some source systems skip numbers after a deletion or edit, and a parser that assumes strictly consecutive values with no gaps will fail against real production traffic even though it passes every test you wrote.

HL7 v2 AL1 Segment Guide: Fields, Format, and Testing Gotchas
HL7 ADT Messages: A01 through A08 Explained
Regression Testing for EHR Upgrades: A Complete Guide
Stop testing with single-allergy patients
Synthibase generates patients with realistic, multi-allergy histories and correctly sequenced AL1-1 values so your parsing and display logic actually gets exercised.
Start free trial →
This page is written independently by Synthibase for testing and informational purposes. It is not an official publication of HL7 International or X12/Washington Publishing Company, and is not a substitute for reviewing the official standard or your trading partner's companion guide. See our Terms of Service for full legal terms.