Reference·HL7 v2·NTE
HL7 v2 Reference

Testing HL7 v2 NTE: The Fields Your System Actually Needs to Handle

Jul 28, 2026 · 6 min read

NTE is the segment that shows up almost everywhere and gets tested almost nowhere. It can trail a PID, an OBX, an ORC, an OBR, or a dozen other segments to carry a free-text note, and because it never anchors a message on its own, most test suites only exercise it in the one or two spots someone happened to remember.

Quick answer

NTE (Notes and Comments) is a general-purpose HL7 v2 segment that attaches free-text commentary to whatever segment came before it. It has no fixed home in the message structure — it can follow PID, OBX, ORC, OBR, and many others, repeating as many times as needed. Its three core fields are a sequence number, a coded source for who or what generated the note, and the comment text itself.

The fields that actually matter in practice

NTE-1 →
Set ID — sequence number for repeating NTE segments attached to the same parent segment
NTE-2 →
Source of Comment — coded value identifying who or what generated the note — patient, ancillary department, or the ordering provider, among others
NTE-3 →
Comment — the free-text content of the note itself, which can repeat and can run considerably longer than most other fields in the message
NTE-4
Comment Type — an optional coded qualifier describing the category of the comment, distinct from its source

Example

Synthetic example Generated by Synthibase
OBX|1|NM|2345-7^GLUCOSE^LN||118|mg/dL|70-105|H|||F
NTE|1|L|Specimen slightly hemolyzed; result reported per lab policy.
NTE|2|L|Patient reports fasting status was not confirmed prior to draw.

Two synthetic NTE segments following an OBX result, both from a lab (L) source. The identifiers, values, and text are fabricated for this example.

Where this trips people up

Because NTE can legally follow almost any segment, test generators tend to hardcode it into just one or two familiar spots — usually trailing OBX — and never exercise it after PID, ORC, or OBR, where receiving systems often have completely separate parsing paths for the same segment type. Teams also frequently build test messages with a single short NTE-3 value and never check what happens when the comment repeats several times or runs past a few hundred characters, which is exactly the scenario that exposes truncation bugs, delimiter-escaping mistakes, and off-by-one errors in how a system reassembles multi-segment notes into one field.

How to Write EDI Test Cases
HL7 ADT Messages: A01 through A08 Explained
Generate realistic NTE coverage across every segment it can follow
Synthibase produces fully synthetic HL7 v2 messages with NTE segments attached wherever they legally belong — after PID, OBX, ORC, OBR, and more — with varied sources and comment lengths, so your parsing logic gets tested everywhere it actually runs, not just the one spot someone remembered.
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.