The 4 columns that help define a FHIR resource

I was working with FHIR for months before I had a handle on the basics. A typical dev, I didn’t read the manual.

The screenshot below is from the Observation page of the FHIR documentation. Let’s take a closer look at those 4 columns.

Card. Column

Cardinality — tells us how many of an element there can be.

– 0 .. 1 => There can be none and there is a maximum of one.
– 1 .. 1 => There MUST be one and there can be ONLY one.
– 0 .. * => There can be none or many (a list)
– 1 .. * => There MUST be one or more (a list)

Profiles can change the cardinality of an element, often by making a non-mandatory element mandatory.

Name Column

– The red arrow points to effective[x].
– The [x] is significant as it tells us that this element can be one of multiple different data types.
– The Type column tells us what those types are.
– This is difficult for devs new to FHIR to understand, often causing problems when an unexpected data type arrives.

Flags Column

– ?! : Signifies a modifier element. These cannot safely be ignored. Example: status=entered-in-error.
– Σ : Tells us that the element will be returned when a query requests a summary of the resource.
– N in a box: Identifies the resource as Normative, which means the resource is fixed and unlikely to introduce breaking changes in a future FHIR version.
– TU in a box: Trial Use — means the element is not in widespread use and may change. Which contradicts the Normative state of the Observation resource. Welcome to FHIR!

Type Column

– Identifies the data type of an element: CodeableConcept, string, etc.
– For resource references, it also tells us which resource types the element can reference.
– Example: Observation.subject can be one of only Patient, Group, Device or Location.

Every developer working with FHIR should learn the basics — if only to make their own lives easier.

---

Ways to Work With Me

Discover more from Darren Devitt

Subscribe now to keep reading and get access to the full archive.

Continue reading