StructureDefinition — FHIR meta-model
The grammar of FHIR. Every resource, primitive type, complex type, extension and national profile is defined by a StructureDefinition. The engine behind everything that is semantically typed in FHIR.
Purpose of the resource
StructureDefinition defines the shape of every typed thing in FHIR: the resources published by HL7 (Patient, Observation, Bundle…), the primitive types (string, date), the complex types (HumanName, Address, Identifier), custom extensions and national profiles (US Core, FR Core, NL Core…).
A StructureDefinition is composed of elements describing each path
(Patient.name.given) with its cardinality, type, terminology binding, FHIRPath
constraints, slicing and examples.
Key fields
| Field | Type | Cardinality | Role |
|---|---|---|---|
url | uri | 1..1 | Canonical URL. |
identifier | Identifier[] | 0..* | Business identifiers. |
version | string | 0..1 | Version. |
name | string | 1..1 | Technical name. |
title | string | 0..1 | Human-readable title. |
status | code | 1..1 | draft | active | retired | unknown. |
fhirVersion | code | 0..1 | Target FHIR version. |
kind | code | 1..1 | primitive-type | complex-type | resource | logical. |
abstract | boolean | 1..1 | Abstract or instantiable type. |
type | uri | 1..1 | Underlying FHIR type (Patient, Observation…). |
baseDefinition | canonical | 0..1 | Parent StructureDefinition. |
derivation | code | 0..1 | specialization | constraint. |
snapshot | BackboneElement | 0..1 | Full resolved view. |
differential | BackboneElement | 0..1 | Diff against the parent (used by profiles). |
JSON example
{
"resourceType": "StructureDefinition",
"id": "us-core-patient",
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient",
"version": "7.0.0",
"name": "USCorePatientProfile",
"title": "US Core Patient Profile",
"status": "active",
"publisher": "HL7 International — US Realm",
"fhirVersion": "5.0.0",
"kind": "resource",
"abstract": false,
"type": "Patient",
"baseDefinition": "http://hl7.org/fhir/StructureDefinition/Patient",
"derivation": "constraint",
"differential": {
"element": [{
"id": "Patient.identifier",
"path": "Patient.identifier",
"min": 1
}, {
"id": "Patient.name",
"path": "Patient.name",
"min": 1
}]
}
} Profiles and extensions
- Profile —
derivation=constraintrestricts a resource (US Core Patient = Patient + identifier 1..*). - Extension —
kind=complex-type+type=Extensionadds an ad-hoc field to a resource. - Logical model —
kind=logicaldefines a conceptual model (FHIR Shorthand, ABMD). - Slicing — splits a multi-valued field into sub-types (e.g. identifier.use=usual vs official).
Common pitfalls
- No
baseDefinitionfor a profile — the validator does not know what to validate against. - Snapshot not synchronised — always regenerate the snapshot when the differential changes.
- Poorly discriminated slicing — without a clear
discriminator, tools cannot sort.
Related resources
- ImplementationGuide — packages StructureDefinitions.
- StructureMap — transformation.
- ValueSet, CodeSystem.
- CapabilityStatement.
- FHIR R5 hub.