Skip to main content
v2026.11,986 entries · CC-BY 4.0

FHIR StructureDefinition: Profiling, Slicing, and Extensions

How HL7 FHIR StructureDefinition resources define base resources, profiles, extensions, differential and snapshot element trees, slicing, and MustSupport.

Written and maintained by CASRAI Editorial Board

Published

On this page

A FHIR StructureDefinition is the foundational conformance and schema metadata resource in HL7 Fast Healthcare Interoperability Resources (FHIR). Every base data type (such as Coding or Quantity), every core clinical or administrative resource (such as Patient or Observation), every profile constraint in a FHIR Implementation Guide, and every custom extension is formally specified and machine-validated using a StructureDefinition instance.

Because the base FHIR R4 specification is intentionally designed as an 80% global baseline with permissive cardinalities (often 0..1 or 0..*), national standards bodies, clinical trial networks, and health systems use StructureDefinition profiles to constrain optionality, bind elements to domain-specific terminology value sets, slice repeating arrays, and register computable extensions.

What Is a FHIR StructureDefinition and What Can It Define?

A StructureDefinition resource identifies itself globally via its canonical url and classifies its structural role using two core metadata attributes: kind and derivation.

  • kind: Indicates the structural category being defined: primitive-type (such as string, boolean, dateTime), complex-type (such as CodeableConcept, Identifier, Period), resource (such as Patient, Condition, or Observation), or logical (an abstract logical data model not directly serialized as a standard FHIR resource).
  • derivation: Distinguishes between specialization (which defines a brand-new base resource or data type in the core specification) and constraint (which profiles an existing base resource or parent profile identified in baseDefinition without adding arbitrary undeclared root elements).
  • Extensions: In FHIR, an extension is itself defined by a StructureDefinition where type = "Extension" and derivation = "constraint", accompanied by a context array specifying which resource paths are permitted to host the extension.

How Do Differential and Snapshot Views Work in FHIR Profiling?

Inside a StructureDefinition, the element hierarchy is represented as an ordered list of ElementDefinition objects contained in either or both of two structural views:

View StructureDefinition Path Contents & Authoring Role Validation & Runtime Role
Differential StructureDefinition.differential.element Contains only the elements modified, constrained, sliced, or bound relative to the parent baseDefinition. Sparse delta authored via FHIR Shorthand (FSH) or Forge; cannot validate an instance alone without resolving parent profiles.
Snapshot StructureDefinition.snapshot.element Contains the complete flattened tree of every inherited and constrained ElementDefinition down from the base resource. Generated by the HL7 IG Publisher or a FHIR server; used directly by runtime schema and profile validators.

Monotonic Constraint Rules in Profile Inheritance

When a profile sets derivation = "constraint" against a baseDefinition (including multi-level inheritance chains such as a clinical study profile derived from US Core, which is itself derived from base FHIR R4), every constraint must narrow or maintain the rules of its parent—never widen them:

  • Cardinality tightening: Minimum cardinality (min) can be increased (for example, 0 to 1) and maximum cardinality (max) can be decreased (for example, * to 1 or 0 to forbid an element), but a 0..1 element in the base resource can never be widened to 0..* in a profile.
  • Type restriction: Choice data types (such as Observation.value[x]) can be restricted to a subset of allowed types (for example, permitting only valueQuantity and valueCodeableConcept).
  • Terminology binding strength: A profile can replace an example, preferred, or extensible value set binding with a stronger binding (up to required), or narrow a value set, but cannot weaken a parent’s required binding.
  • FHIRPath invariants: Custom co-occurrence and cross-element validation expressions declared in ElementDefinition.constraint.expression are evaluated alongside all inherited base invariants.

What Is MustSupport and Slicing in HL7 FHIR Implementation Guides?

Two of the most frequently misunderstood mechanisms in ElementDefinition are slicing and MustSupport.

Slicing Repeating Elements and Discriminators

Many FHIR elements repeat (0..*)—such as Patient.identifier, Observation.component, or Observation.category. When a profile requires that at least one entry in Observation.component represent systolic blood pressure (LOINC 8480-6) and another represent diastolic blood pressure (LOINC 8462-4), a simple cardinality constraint on Observation.component is insufficient. Slicing splits a single repeating list into named sub-constraints (slices):

  1. Slicing root (ElementDefinition.slicing): Declares how validators distinguish which slice an incoming array item belongs to using one or more discriminator definitions (type of value, pattern, type, profile, or exists paired with a relative path) and whether additional unsliced array items are allowed (rules = "open" | "closed" | "openAtEnd").
  2. Named slices (ElementDefinition.sliceName): Each slice specifies its own minimum/maximum cardinality, fixed value or patternCodeableConcept, and terminology binding. In blood pressure profiles, slicing.rules is typically open so that additional components (such as mean arterial pressure) can still be transmitted without failing validation.

MustSupport (ElementDefinition.mustSupport = true)

Unlike setting minimum cardinality to 1 (which causes every resource instance missing that element to fail validation even when the clinical datum is genuinely unknown), setting mustSupport: true on a 0..1 or 0..* element is a functional conformance requirement directed at implementing systems rather than individual payload instances. Its exact operational obligations are defined by each Implementation Guide’s conformance section: typically, a Data Sender (Server) must be capable of populating the element whenever the data exists in its underlying database, and a Data Consumer (Client) must be capable of parsing, processing, displaying, or storing the element without throwing errors or silently discarding it.

Frequently Asked Questions

What is the difference between fixed[x] and pattern[x] in an ElementDefinition?

In a FHIR StructureDefinition, fixed[x] requires the instance element to match the specified structure exactly, prohibiting any additional properties, extra coding translations, or human-readable text elements inside a CodeableConcept. By contrast, pattern[x] requires only that the specified sub-properties be present (for example, at least one coding with a required system and code) while allowing additional codings, display strings, and extensions. For complex types like CodeableConcept, HL7 profiling best practices strongly prefer pattern[x] over fixed[x].

How does FHIR Shorthand (FSH) relate to StructureDefinition?

FHIR Shorthand (FSH) is a domain-specific language standardized by HL7 that allows authors to write concise text definitions for profiles, extensions, value sets, and examples. The SUSHI compiler translates FSH source files into standard JSON StructureDefinition resources containing differential element trees, which the HL7 IG Publisher then expands into full snapshots.

How can a profile prohibit an element or require a Data Absent Reason?

To prohibit an element entirely (for example, stripping direct identifiers in a de-identified research profile), the profile constrains its maximum cardinality to max: "0". When a required element (min: 1) is temporarily unknown or masked in a real-world clinical record, profiles bind the HL7 data-absent-reason extension together with a FHIRPath invariant requiring either a populated value or a valid data-absent-reason code.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · full access

Ask about FHIR StructureDefinition: Profiling, Slicing, and Extensions

Full access: large monthly usage, up to 10 source passages behind each answer, and MCP and API access for Claude Code, Codex and other CLIs. Cancel any time.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →