Data types in FHIR resources

There are 58 distinct data types in FHIR.

Each FHIR resource is made up of a combination of these data types.

They fall into three categories: primitive, general purpose and special purpose. Let’s look at these more closely and use the Patient resource as an example.

1. Primitive Data Types

    These are simple values such as dates, numbers, strings and codes. A code is a fixed value drawn from a list.

    Examples from the Patient resource:

    • gender (code)
    • birthDate (date)
    • active (boolean)
    • multipleBirth (boolean or integer)

    Screenshot: https://vanyalabs.com/files/patient-primtives.png

    2. General Purpose Data Types

      Think of these as small objects that themselves are made up of the other data types. HumanName, Address, Identifier and CodeableConcept are all general purpose data types.

      Examples from the Patient resource:

      • address (Address)
      • photo (Attachment)
      • identifier (Identifier)
      • maritalStatus (CodeableConcept)

      Screenshot: https://vanyalabs.com/files/patient-general.png

      3. Special Purpose Data Types

        Similar to general purpose, these are also small objects. But they play a significant role in how FHIR resources are constructed and interact. Examples are Reference, BackboneElement, Extension and the Meta element that holds key information for every FHIR resource.

        Examples from the Patient resource:

        • organization (Reference)
        • generalPractitoner (Reference)
        • contact (BackboneElement)
        • meta (Meta)

        Screenshot: https://vanyalabs.com/files/patient-special.png

        Understanding the different data types and how they relate to each other is more important than understanding FHIR resources themselves.

        All FHIR data sits inside the elements that make up a resource. And each element is composed of one or more of these 58 data types.

        Once you understand these, you understand how data is stored and shared in FHIR.

        More about data types: https://www.hl7.org/fhir/R4/datatypes.html

        ---

        Ways to Work With Me

        Discover more from Darren Devitt

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

        Continue reading