Spec reference: https://hl7.org/fhir/structuredefinition.html
StructureDefinition
resource that constrains a base resource or datatype.
What a profile can constrain
Common profile constraints include:- Cardinality: required vs optional fields (e.g.
1..1instead of0..1) - Fixed values / patterns: e.g.
Observation.statusmust befinal - Terminology bindings: allowed codes for
CodeableConceptandCoding - Reference targets: allowed resource types / target profiles
- Slicing: “this repeating element has named slices with different rules”
- Invariants: FHIRPath rules that must hold
How to spot profiles on an instance
Instances can declare conformance viameta.profile[]:
Differential vs snapshot
StructureDefinitions often come in two views:- Differential: only “what changed” from the base definition
- Snapshot: the fully expanded structure after applying base + constraints
Where profiles come from
Profiles are almost always distributed via FHIR packages (IG packages). When you install an IG, you install its StructureDefinitions.TLQ links
- Learn FHIR: Packages
- Learn FHIR: Extensions
- Learn FHIR: Validation
- Snapshot mechanics: FHIR Core: Snapshot Generation
- TLQ package management: Server guide: Packages
Next
- Add new fields safely: Extensions
- Check conformance: Validation