Skip to content
  • Thursday, 16 July 2026
  • 3:37 am
  • Follow Us
Wattman
  • Intake form
  • Master patient index
  • Dermatology
  • Services
  • EHR software
  • Home
  • Reading a FHIR Resource Definition the Way Developers Read a Class
Reference corner

Reference corner

Whenever a colleague asks which fields a Practitioner resource actually needs, I point them at the R4 resource atlas I maintain here.

FHIR Server & API Solutions
  • Reading a FHIR Resource Definition the Way Developers Read a Class
  • R4 vs R5: The Resources That Changed Enough to Notice
  • Must-Support Elements and What Implementers Actually Do
  • The Extension Model: When a FHIR Resource Is Silent on Your Data
  • Profiles and Slicing at a Glance
R4 Resource Atlas

Reading a FHIR Resource Definition the Way Developers Read a Class

Jasmine Ward Jul 15, 2026 0
Editorial illustration in cyberpunk-neon style depicting a cyberpunk-neon FHIR resource definition rendered as a class layout with identity, domain, extension, and reference sections

Editorial illustration in cyberpunk-neon style depicting a cyberpunk-neon FHIR resource definition rendered as a class layout with identity, domain, extension, and reference sections

A FHIR resource definition is not that different from a class definition in a strongly typed language. The names differ, the columns differ, but the pattern is the same: identity fields, then structural fields, then domain-specific fields, each with a type and a cardinality. Once that mapping is in place, reading an unfamiliar resource takes minutes instead of a session. The site's R4 resource atlas surfaces each resource in that shape. For the wider FHIR framing, the FHIR architecture archive collects supporting material.

The Read Order

Every FHIR resource definition has a table with these columns: element, cardinality, type, description. Read them in this order:

  1. Skim the element list top to bottom for shape
  2. Note which elements have cardinality lower bound = 1 (required)
  3. Note which elements have cardinality upper bound = * (repeating)
  4. Read the type of every reference-shaped element (which resources it points at)
  5. Read the binding strength on coded elements (required, extensible, preferred, example)

That five-step pass produces enough knowledge to write a valid payload against the resource.

Identity Elements Come First

Every DomainResource carries id, meta, implicitRules, language, text, contained, extension, modifierExtension. These are inherited from the base and behave the same across all resource types. Read them once for the whole spec, not per resource type. For the base pattern, navigating FHIR R4 resources when you know DomainResource but not much else covers them.

Domain Elements Come Next

The elements specific to the resource type are where the meaning lives. Patient has name, identifier, gender, birthDate. Observation has code, subject, value[x], effective[x]. Read the type of each domain element — CodeableConcept, Reference, dateTime, quantity — and the type answers most questions about what the element carries.

The `[x]` Suffix Is a Polymorphism Flag

Elements with [x] in their name accept one of several types at runtime. Observation.value[x] can be Quantity, CodeableConcept, string, boolean, integer, Range, Ratio, SampledData, time, dateTime, Period. The payload uses valueQuantity, valueCodeableConcept, etc., depending on which type was chosen.

Understanding polymorphism is the difference between reading a payload and being surprised by it. Every [x] in the definition is a decision the sender makes.

The Reference Types Are the Foreign Keys

Every Reference element carries a target-type declaration. Those declarations are the equivalent of typed foreign keys in a relational schema. Ignoring them produces payloads that violate the reference contract. For the deeper split of when to reference vs when to contain, reference vs contained: when to embed and when to link is the entry.

Binding Strength Is the Constraint on Coded Values

Coded elements have a binding to a value set with a strength. Required binding means the value has to come from the set. Extensible means it should, but implementers can extend. Preferred and example are advisory. Reading binding strength is what tells you whether a coded value is a hard constraint or a soft suggestion.

Extensions Sit at the End

Every resource can carry extensions. Reading the extensions section tells you which extensions this resource supports and which are common. Profiles add more. For the profile mechanic, profiles and slicing at a glance covers it.

The Short Version

Read cardinality, read type, read binding, note polymorphism, note reference targets. Extensions sit last. That five-check pass turns a FHIR resource definition into something you can code against without guessing. The atlas is the fast lookup; this is the reading pattern.

Cyberpunk-neon diagram of a FHIR resource definition rendered as a class-like layout with identity elements at the top, domain elements in the middle, and extensions and references marked at the sides, drawn with neon cyan accents on a dark grid

Sources

  • HL7 canonical R4 StructureDefinition resource specification - HL7 canonical R4 StructureDefinition resource specification
FHIR Validator & Compliance
Editorial illustration in cyberpunk-neon style depicting a cyberpunk-neon R4 vs R5 version comparison strip with Subscription, MedicationRequest, and Bundle highlighted
R4 Resource Atlas
R4 vs R5: The Resources That Changed Enough to Notice
Jasmine Ward Jul 15, 2026
Editorial illustration in cyberpunk-neon style depicting a cyberpunk-neon Must-Support flag routing to a sender (populate) and receiver (must handle)
R4 Resource Atlas
Must-Support Elements and What Implementers Actually Do
Jasmine Ward Jul 14, 2026
Editorial illustration in cyberpunk-neon style depicting a cyberpunk-neon FHIR resource with regular and modifier extensions tagged by canonical URL
R4 Resource Atlas
The Extension Model: When a FHIR Resource Is Silent on Your Data
Jasmine Ward Jul 14, 2026
Editorial illustration in cyberpunk-neon style depicting a cyberpunk-neon base Patient resource with US Core profile applied and sliced identifiers
R4 Resource Atlas
Profiles and Slicing at a Glance
Jasmine Ward Jul 13, 2026
Editorial illustration in cyberpunk-neon style depicting a cyberpunk-neon side-by-side of Reference between resources vs a contained child resource
R4 Resource Atlas
Reference vs Contained: When to Embed and When to Link
Jasmine Ward Jul 13, 2026
Editorial illustration in cyberpunk-neon style depicting a cyberpunk-neon ten-tile grid of the most common R4 resource types with cyan neon strokes
R4 Resource Atlas
The Ten FHIR Resources You Should Learn First
Jasmine Ward Jul 12, 2026
Editorial illustration in cyberpunk-neon style depicting a cyberpunk-neon FHIR R4 inheritance tree fanning from Resource and DomainResource into module-scoped resources
R4 Resource Atlas
Navigating FHIR R4 Resources When You Know DomainResource But Not Much Else
Jasmine Ward Jul 12, 2026
Medical Forms & FHIR SDC
Editorial illustration in cyberpunk-neon style depicting a cyberpunk-neon FHIR resource definition rendered as a class layout with identity, domain, extension, and reference sections
R4 Resource Atlas
Reading a FHIR Resource Definition the Way Developers Read a Class
Jasmine Ward Jul 15, 2026
Editorial illustration in cyberpunk-neon style depicting a cyberpunk-neon R4 vs R5 version comparison strip with Subscription, MedicationRequest, and Bundle highlighted
R4 Resource Atlas
R4 vs R5: The Resources That Changed Enough to Notice
Jasmine Ward Jul 15, 2026
Editorial illustration in cyberpunk-neon style depicting a cyberpunk-neon Must-Support flag routing to a sender (populate) and receiver (must handle)
R4 Resource Atlas
Must-Support Elements and What Implementers Actually Do
Jasmine Ward Jul 14, 2026
Editorial illustration in cyberpunk-neon style depicting a cyberpunk-neon FHIR resource with regular and modifier extensions tagged by canonical URL
R4 Resource Atlas
The Extension Model: When a FHIR Resource Is Silent on Your Data
Jasmine Ward Jul 14, 2026