Validation Guide

Understanding the three layers of HL7 message validation

HL7 Workbench validates messages using three complementary layers, each catching different categories of issues. All validation runs in real-time as you edit.

Schema Validation

Checks structure against the HL7 specification: segment order, field data types, lengths, table bindings, and optionality

Terminology Validation

Verifies coded values against 129 vocabularies: LOINC, SNOMED CT, ICD-10, RxNorm, and HL7 tables

Conformance Validation

Applies implementation guide-specific rules: required fields, cardinality constraints, and value restrictions

Enable auto-validation with the Validate button in the toolbar. Validation results appear in the Validation Panel with clickable links to each issue location.

Validation Options

OptionDefaultDescription
Required FieldsOnCheck that required (R) fields are populated
Data TypesOnValidate field values match their declared data type
RepetitionsOnCheck max repetition counts
Min CardinalityOffReport info-level notes for missing RE (required-but-may-be-empty) fields. Opt-in per HAPI design, enabled by the Strict layer; max repeats are covered by Repetitions
ComponentsOnCheck required components within composite data types
TablesOnValidate coded values against HL7 table definitions
Segment RulesOnCheck segment-specific rules (e.g., MSH encoding characters, OBX-2 determines OBX-5 type)
LengthOnValidate min/max field lengths
Choice GroupsOnValidate choice group constraints (one-of segments)
Message StructureOffCheck segment order and grouping against the declared message type. Opt-in (can be noisy on partial or edited messages) and enabled by the Strict layer

Severity Configuration

Three advanced severity settings let you control how specific violations are reported:

Min Length Severity

Report minimum length violations as info, warnings (default), or errors.

Table Display Mismatch Severity

Report display names that differ from the table definition as info (default), warnings, or errors. You can also turn the check off entirely.

Primitive Component Severity

Report component separators inside primitive types (ST, ID, IS) as info, warnings (default), or errors. The check can also be turned off.

Beyond the Basics

Several checks go further than structural conformance. These are the ones that tend to catch real interoperability defects rather than formatting slips:

UCUM as a grammar

Units are parsed against the UCUM grammar, not matched against a code list — so valid compositions are accepted and invented ones are not

Units vs. the LOINC property

A result coded as a mass concentration but reported in substance-concentration units is flagged — the US/SI mix-up no unit-level check can see

THO fallback across versions

A code absent from an older version’s table but valid in HL7 Terminology is reported as valid, with its provenance

Cross-version validation

Validate a message against any HL7 v2 version, not only the one it declares in MSH-12

LOINC axes on every match

Component, property, timing, system, scale and method — what the code actually means, not just its name

Unvalidatable is not invalid

Licence-restricted or unloaded code systems are reported as unjudgeable rather than wrong

Bulk Validation

Click Validate All to validate every imported message in the Messages Browser. Progress is tracked with a count indicator. Results are cached per message and shown as status icons in the sidebar.