Inferensys

Glossary

StructureDefinition

A FHIR resource that defines the rules and constraints for how a base FHIR resource is used in a specific context, forming the basis for profiling and validation.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
FHIR PROFILING & VALIDATION

What is StructureDefinition?

A StructureDefinition is the foundational FHIR resource for defining constraints, extensions, and usage rules on a base FHIR resource, creating a reusable profile for a specific clinical or administrative context.

A StructureDefinition is a FHIR resource that defines the rules and constraints for how a base FHIR resource is used in a specific context, forming the basis for profiling and validation. It specifies which elements are mandatory, which are prohibited, and what coded values are allowed, transforming a generic Patient or Observation resource into a precisely tailored data structure for a use case like a US Core Patient profile.

Every StructureDefinition declares a derivation method—either constraint for profiling an existing resource or specialization for defining a new logical model. It works in concert with ValueSet and CodeSystem resources to bind coded elements to specific terminologies, enabling the FHIR Validator to programmatically verify that a resource instance conforms to the defined rules before exchange.

FHIR PROFILING

Core Characteristics of a StructureDefinition

A StructureDefinition is the foundational building block for FHIR interoperability, defining the rules, constraints, and extensions that transform a generic base resource into a precise, context-specific data contract.

01

Constraining the Base Resource

The primary function is to impose cardinality constraints on elements. A base resource like Observation might have an optional valueQuantity, but a specific Blood Pressure Profile can make it mandatory (1..1). This process also involves slicing discriminators to define complex rules for repeating elements, ensuring data consistency across disparate systems.

0..0
Forbidden Cardinality
1..1
Required Cardinality
03

Binding to Terminology

A profile binds generic CodeableConcept elements to specific ValueSets. Instead of allowing any LOINC code for an observation, a profile binds the element to a curated list. The binding strength (required, extensible, preferred, example) dictates how strictly a system must adhere to the specified codes during validation.

Required
Strictest Binding
04

Differential vs. Snapshot Views

A StructureDefinition contains two critical views:

  • Differential: A sparse representation showing only the changes and constraints applied relative to the base resource.
  • Snapshot: A fully calculated, complete picture of the resource with all constraints applied, used by validators to check conformance. The snapshot is computationally generated from the differential.
05

Canonical URL Identity

Every StructureDefinition is globally uniquely identified by a canonical URL (e.g., http://hl7.org/fhir/StructureDefinition/bp). This URL serves as the permanent, version-independent identifier for the profile. It is distinct from the resource's physical server ID and is used by other resources to reference the profile they claim conformance to.

06

Validation Engine

The StructureDefinition serves as the input to the FHIR Validator. The validator engine parses the snapshot, checks element cardinalities, verifies terminology bindings, validates invariant rules (expressed in FHIRPath), and confirms extension contexts. A resource instance is only considered conformant if it passes all constraints defined in the profile.

FHIR PROFILING

Frequently Asked Questions

Clear answers to common questions about the StructureDefinition resource, the foundational mechanism for constraining and validating FHIR data in healthcare interoperability.

A StructureDefinition is a FHIR resource that defines the rules, constraints, and extensions for how a base FHIR resource (like Patient or Observation) is used in a specific context. It forms the core of FHIR's profiling and validation architecture. A StructureDefinition answers three fundamental questions: what elements are present, what data types and cardinalities apply, and what terminology bindings are required. For example, a US Core Patient Profile StructureDefinition constrains the base Patient resource to mandate specific identifier systems, require race and ethnicity extensions, and bind the communication.language element to a specific ValueSet. Every ImplementationGuide packages a set of StructureDefinitions that collectively define conformance rules for a use case. The resource itself is a computable artifact—tools like the FHIR Validator use it to check instance data for compliance, ensuring semantic and structural interoperability across healthcare systems.

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.