Inferensys

Glossary

FHIR Validator

A software tool that checks FHIR resources and profiles against the specification's rules, constraints, and terminology bindings to ensure conformance.
Developer demonstrating multi-agent tool use, agent tool selection interface on laptop, casual tech demo moment.
CONFORMANCE TESTING

What is FHIR Validator?

A FHIR validator is a software tool that programmatically checks FHIR resources and profiles against the specification's structural rules, cardinality constraints, data type requirements, and terminology bindings to ensure strict conformance.

A FHIR Validator is a conformance testing engine that parses a StructureDefinition and verifies that a given resource instance satisfies all defined invariants. It operates by loading the base FHIR specification, any applicable Implementation Guides like US Core, and custom FHIR Profiles, then executing a multi-phase check that includes schema validation against the JSON or XML definition, cardinality and data type verification, and terminology binding validation against specified ValueSets.

The validation process generates an **OperationOutcome** resource detailing errors, warnings, and informational messages. Advanced validators support FHIRPath constraint evaluation, enabling complex cross-element rules beyond simple structural checks. This tool is a critical component of a FHIR Server's transaction processing and is essential for ensuring semantic interoperability before data exchange in production clinical workflows.

Conformance Engine

Core Validation Capabilities

A FHIR Validator is a conformance testing engine that verifies resources against the structural rules, terminology bindings, and business constraints defined by the base specification and implementation guides.

01

Structure Validation

Verifies that a resource's XML or JSON syntax is well-formed and that all mandatory elements are present. This includes checking cardinality (min/max occurrences), validating data types against the base FHIR schema, and ensuring that primitive values conform to their defined regular expressions. Structure validation catches missing required fields like Patient.name or Observation.status before more complex rules are evaluated.

02

Invariant Constraint Checking

Executes FHIRPath expressions embedded in profiles to enforce co-occurrence rules and conditional logic. Invariants are formal statements that must evaluate to true for a resource to be valid. Examples include:

  • obs-3: If Observation.value is absent, dataAbsentReason must be present
  • pat-1: Patient.name or Patient.deceased must be present
  • Custom profile invariants like 'if MedicationRequest.status is active, then intent must be order'
03

Terminology Binding Validation

Validates that coded elements use concepts from the correct ValueSet with the required binding strength. The validator checks:

  • required: The code must come from the specified ValueSet or the resource is invalid
  • extensible: The code must come from the ValueSet if a suitable concept exists, otherwise a local code is allowed
  • example/preferred: The code should come from the ValueSet but no enforcement occurs This ensures Observation.code uses LOINC and MedicationRequest.medication uses RxNorm where mandated.
04

Slicing Validation

Enforces discriminator-based rules that constrain repeated elements into distinct, named sub-groups called slices. Slicing is critical for profiles like US Core Blood Pressure, where the Observation.component array must contain exactly one systolic and one diastolic slice, each identified by a specific LOINC code. The validator checks that each slice meets its own cardinality, value constraints, and terminology bindings independently.

05

Profile Conformance

Asserts that a resource claiming conformance to a StructureDefinition (profile) satisfies all differential constraints layered on top of the base resource. This includes:

  • Verifying that all Must Support elements are populated
  • Checking that elements marked as fixed value or pattern match exactly
  • Ensuring that extension URLs are recognized and their nested constraints are validated recursively
  • Confirming that the meta.profile tag matches the profile being validated against
06

Implementation Guide Compliance

Validates a resource against the complete set of rules packaged in a FHIR Implementation Guide (IG). An IG bundles multiple profiles, extensions, ValueSets, and global invariants. The validator resolves all dependencies, loads the package manifest, and tests the resource against every applicable profile simultaneously. This is the definitive check for US Core, Da Vinci, or CARIN conformance, producing an aggregated OperationOutcome with issues, locations, and severity levels.

FHIR VALIDATION

Frequently Asked Questions

Clear, technical answers to the most common questions about FHIR validation, covering the mechanics, error interpretation, and architectural integration of conformance checking.

A FHIR Validator is a software engine that programmatically checks a FHIR resource instance against the formal constraints defined in the base FHIR specification, a specific Implementation Guide, and a set of FHIR Profiles. It works by parsing the resource's structure, verifying cardinality rules, checking data type conformance, and executing FHIRPath invariants. The validator does not just check syntax; it performs semantic validation by resolving Terminology Bindings to ensure that coded elements belong to the required ValueSet. The output is an OperationOutcome resource that categorizes issues by severity—fatal, error, warning, or information—providing a precise, machine-readable report on conformance.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.