NOTE that this implementation guide is under construction.

Introduction

FHIR is to a large extent based on coded values published as terminologies, later referred to as code systems and value sets. Code systems and value sets are used within elements of the type code. Coded values are used in many FHIR resources to structure the information and make it system readable. The content of code systems and value sets define a set of values in a specific context. The expression code is commonly also called concept and is a structured and often standardized way of expressing a value.

A code system/value set can represent codes from a wellknown terminology e.g. Snomed CT, or locally defined codes.

The picture below shows how the binding to code systems or value sets can be seen in a FHIR profile. In this case, the profile has an element with a binding (1) to a value set shc-allowed-question-types (2) which defines all valid codes for the element.

binding-example

Value sets and code systems defined by other organizations are usually not republished by the Swedish eHealth Agency. The identity of a value set or code system can take many forms, e.g. OID, URI etc. A URI identity may in some cases be used as a URL as well, and make it possible to look up and view the concepts by a browser.

CodeableConcept, Coding and code

The way FHIR usually uses codes in resources is by defining a CodableConcept. One single concept can be described in CodableConcept by specifing one or more Codings (with a code and potentially a textual description). In some cases the use of codes in the resource is very strict, e.g. in the "status" element that is available in many resources. In those cases a plain code is used.

Resource types and relations

The figure below shows how the terminology resources relate to each other.

terminology-resources

Code System

A code system is a set of concepts where each concept has a unique code and a display name and possibly a definition of the concept. Each code system also has a globally unique identifier, sometimes in the form of an URI or OID. When exchanging a coded element in FHIR, the elements used for this information is Coding.code, Coding.display and Coding.system respectively.

No code systems are published in this guide but each value set refers to the code system of each code in the value set.

Value Set

A value set is a subset of codes from one or more code systems. A code is understood in a value set only in combination with what code system it is from, hence this information always has to be present when passing around coded values. In actual implementations you can often see value sets and code systems being mixed up. While FHIR elements are bound to value sets to show which subset of codes are valid for those elements, it is always the code system that is specified in the Coding.system element. If you can not read which code system the code comes from, you do not know what code it is - in theory, one code can by chance be the same in multiple code systems.