Understanding FHIR Cardinality

When constructing a Postman request or writing code using your FHIR SDK, do you refer to the documentation regularly, or depend on trial, error and IntelliSense?

It may seem obvious, but being able to read and understand the FHIR documentation at a glance makes development faster and easier.

The Cardinality column is particularly useful, as it tells you whether an element is mandatory and how many of them there are allowed to be.

A simple structure: a number followed by two dots followed by another number.

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 and there can be any number (a list)

1 .. * => There MUST be one and there can be any number (a list)

Knowing whether or not an element is mandatory and whether it’s stored as a list or a single object is essential when constructing requests and writing code. In the Consent resource shown above there can any number of Identifiers, one and only one Status, and none or one Patient.

And just in case you thought it was that simple, Profiles can and often do alter the cardinality of elements.

Discussion

---

Ways to Work With Me

Discover more from Darren Devitt

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

Continue reading