HL7 FHIR® UK Core Design and Development Approach

FHIR Assets

This section documents the processes for creating, maintaining and reviewing the HL7 FHIR® UK Core assets.

Conformance

The UK Core conforms to the HL7 FHIR® specification (Release 4) and its assets are profiles of the corresponding base HL7 FHIR resources.

Further information about conformance in FHIR is available.


Design Principles

Background

During collaboration with stakeholders and development of UK Core FHIR assets, important design principles have been established. They are critical in ensuring a consistent approach to asset creation.

Key Principle:

  • "FHIR assets must not be England specific and must be capable of representing the requirements of each UK nation identified during collaboration."

Other Principles

Extensions

  • "Will be applied to profiles after agreement during Clinical and Technical assurance
  • "Will be added to an Extension Library within the UK Core."

Read more about FHIR Extensions and Extension design in the UK Core.

Cardinalities

  • "FHIR resource element cardinalities will only be amended, if clinical justifications are agreed during Clinical and Technical assurance."
  • "No elements will be removed unless deemed clinically unsafe following consultation and agreement during Clinical and Technical assurance."

Read more about FHIR resource cardinalities.

Slicing

  • "Must only be used where it enforces structure in a profile", for example
    • for a ValueSet binding
    • for the representation of an identifier in a list, such as a patient's NHS number
  • "Slicing must be Open e.g. one or more additional slices can be added."

Read more about Slicing in FHIR.

Must Support

  • "Will only be used when there is a requirement arising from a use case identified during Clinical and Technical assurance."

Read more about "Must Support" in FHIR.

ValueSets

  • "Binding strength should be set to 'extensible', where not defined as 'required' by the FHIR standard."
  • "'required' or 'preferred' binding strengths for ValueSets should only be used, if agreed during collaboration." The binding strength should be decided as part of the Clinical and Technical Assurance process.

Read more about ValueSets and ValueSet bindings in FHIR.


Profile Design

This approach is used by the UK Core Development team to produce the UK Core Implementation Guides and the UK Core FHIR assets. It will be updated and matured in line with decisions taken during the Clinical and Technical Assurance process. This documentation is aimed at the technical reader and is included as reference material. The approach is based on the design principles.

Background

The HL7 FHIR® standard

The HL7 FHIR® standard creates a common foundation on which a variety of different solutions are implemented. The resources contained in the specification usually require further adaptation to particular health or social care use cases; this adaptation is referred to as "profiling" and the resulting artefacts as "profiles".

CareConnect

Prior to the development of the UK Core, HL7 UK and INTEROPen collaborated with NHS Digital as a development partner to create a library of nationally defined HL7 FHIR assets in FHIR version STU3. This was called the CareConnect initiative and the assets were formally reviewed by different stakeholders to make them suitable for implementation.
However, issues were identified with the CareConnect landscape, for example the scope of CareConnect was England only rather than the whole of the UK. The UK Core initiative aimed to address these issues, but also to build on the useful work already done. Therefore, where they existed, CareConnect assets were used as input for initial UK Core development.

General profiling approach

The checklist below was adhered to when developing a draft UK Core profile suitable for progression to Clinical and Technical Assurance.

Use any corresponding CareConnect profile as a starting point

For each profile, where a CareConnect STU3 profile exists, refer to it as a starting point for the UK Core FHIR R4 profiling exercise

Consider the resource changes between FHIR STU3 and R4 versions

Analyse the changes in the FHIR standard between FHIR STU3 version and FHIR R4,for example the addition or deletion of any elements and the introduction of new or updated terminology assets in the R4 version.

Approach to StructureDefinition elements

Cardinality

FHIR R4 resource cardinalities remain unchanged in initial development

Element cardinalities should remain unchanged from the base FHIR R4 resource when a profile is initially developed and this will then be reviewed during the Clinical and Technical assurance process

Identifiers

Where existing CareConnect STU3 profiles have applied slicing and profiling to identifiers, this will be recreated in the UK Core profiles, then evaluated during Clinical and Technical assurance.

MustSupport labelling

The MustSupport property in StructureDefinitions will not be used for the UK Core profiles.

Removal of elements

No elements will be removed from the FHIR assets for the UK Core profiles during initial profiling prior to Clinical and Technical Assurance.

Experimental element

The FHIR specification defines the 'StructureDefinition.experimental' element as the following, when set to ‘true’: 'This structure was authored for testing purposes (or education/evaluation/marketing), and is not intended for genuine usage.' (Source: http://hl7.org/fhir/r4/structuredefinition.html). Currently there is no requirement in the UK Core to set the experimental element as ‘true’ or ‘false’, so this field should remain in the default view (undefined).

URL prefix for profiles

The URL prefix which SHALL be applied to all UK Core assets is https://fhir.hl7.org.uk/

Naming convention for profiles

The UK Core profile name SHALL follow an agreed format. The name of a profile consists of a number of name segments, and will be in the form:-

[Base][FHIRAssetName][Specialism]

The segments are defined as follows:-

  • Base: Mandatory The base for a profile this will always be UKCore.
  • FHIRAssetName: Mandatory The name of the base FHIR Resource.
  • Specialism: Required This is only used where there are multiple UK Core profiles for a given base resource type.

Note: "Mandatory" means that a segment SHALL be present. "Required" means that a segment SHOULD be present, in this case in the event of there being multiple profiles for one base resource.

This name SHALL be used in three places:

  • The profile's physical filename.
  • The name of the profile - carried in the StructureDefinition.name.value element
  • The profile's logical id. This is carried in the element StructureDefinition.id.value
    Read more about logical ids in FHIR.

Example of usage of the name element

    <StructureDefinition xmlns="http://hl7.org/fhir">
    <id value="UKCore-MedicationStatement" />
    <url value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationStatement" />
    <version value="1.0.0" />
    <name value="UKCoreMedicationStatement" />
    <title value="UK Core Medication Statement" />

Extensions

There is a UK Core requirement to develop extensions based on any equivalent CareConnect STU3 extensions. The exception to this is where an extension is no longer needed because either

  • the data can be carried in a new element for a relevant resource in FHIR R4
  • a corresponding common extension has been developed in FHIR R4

Extensions will be constrained (hard coded) into profiles.

The Implementation Guide for the UK Core will include an Extension Library page, which will list extensions and their corresponding UK Core profiles.

HL7 Extensions

There is no requirement to profile HL7 extensions locally. Where a HL7 extension is identified as in scope, a link to it will be added on the Extension Library page under HL7 Common Extensions.

View further information about Extension design.

Versioning

Internal versioning for UK Core assets will be entered in the StructureDefinition.version element.
Further details about internal versioning for UK Core assets are available.

Note: No version information is allowed in the R4 profile name.

ConceptMaps

To develop a ConceptMap:

  • Create a UK Core ValueSet
  • Create a ConceptMap which maps the UK Core ValueSet to the FHIR R4 ValueSet

Guidance for Creating new profile or new version

  • Refer to UK Core Design Principles and Profile Design guidance

  • Compare to any existing CareConnect profile as a baseline

  • Refer to any existing FHIR R4 Uplift impact assessment for the CareConnect profile. This will show any changes between FHIR versions which must be accounted for when upversioning the UK Core profile to FHIR R4.

  • (If required), create supporting UK Core FHIR assets:

    • Create Extensions
    • Create ValueSets
    • Create CodeSystems
    • Create ConceptMaps
    • Create Examples
    • Create Simplifier page
    • Import to Simplifier and provide relevant documentation pages in the Implementation Guidance.

Guidance for Reviewing new profile or new version

  • Review profile against UK Core Design Principles and Profile Design guidance

  • Review against any corresponding CareConnect profile

  • Review against any existing FHIR R4 Uplift impact assessment for the CareConnect profile

  • Identify which supporting FHIR assets terminology assets have been developed for this profile and review them

  • Review Extensions

  • Review ValueSets

  • Review CodeSystems

  • Review ConceptMaps

  • Review Examples

  • Review Simplifier page


Extension Design

Background

It is common for specific implementations to have valid requirements that are not part of the agreed common requirements modelled in the FHIR standard. Incorporating all specific use cases would make the standard too cumbersome. Therefore additional valid requirements can be implemented as extensions to the agreed common resources.

This section gives guidance on the correct modelling of extensions. There are two basic types of extensions used by UK Core:

  • Simple extensions
    A simple extension has a single extension.urlelement and a single extension.value element.
  • Complex extensions
    Complex extensions contain extensions to define a nested structure and are used to model more complex content.

Currently the UK Core does not use modifierExtensions, so no guidance is given here on this type. More information on modifierExtensions is available in the FHIR specification.

Extension Development Rules

General Rules for Extensions

These rules apply to simple and complex extensions.

Extension naming and url format

This section gives details on the format of:

  • the extension.id.value
  • the extension.url.value
  • the extension.name.value
  • the extension.title.value

extension.id.value

MUST conform to the format: Extension-UKCore-[extension name]
e.g. Extension-UKCore-AddressKey

extension.url.value

MUST conform to the format: https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-[extension name]
e.g. https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey

extension.name.value

MUST conform to the format:
Camelcase for each full word e.g. "AddressKey"
Note: only the characters [A-Z,a-z] can be used and full word means Careplan, not CarePlan.

extension.title.value

MUST conform to the format:
The full extension name with a space between each full word e.g. "Extension UK Core Address Key"

Example usage in a UK Core extension

   <StructureDefinition xmlns="http://hl7.org/fhir">
    <id value="Extension-UKCore-AddressKey" />
    <url value="https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey" />
    <version value="2.1.0" />
    <name value="ExtensionUKCoreAddressKey" />
    <title value="Extension UK Core Address Key" />
    <status value="active" />
    <date value="2021-09-10" />
    <publisher value="HL7 UK" />


The Extension Root Element

The cardinality of the extension root element MUST be 0..1 or 0..*.
This cardinality determines how many times the extension can occur in the profile or profile element.

Extensions are optional within the UK Core, but certain use cases may mandate their use. Therefore, all UK Core extensions are modelled as being optional at the extension root element.
Where the use case requires an extension to be mandated, the Implementation Guide for that use case will specify the requirements.

It is important that certain extensions are limited to one occurrence. For example, an extension for a date of death logically can only be populated once and therefore should have a cardinality 0..1 at the root level.

Rules for Modelling Simple Extensions

This section details the rules to follow when creating, updating or reviewing a simple extension.

Simple Extension Illustration

urlFixed Value
valueCodeableConceptCodeableConcept

The extension.url element rules

A simple extension has only one extension.url element and the rules for this element are:
The extension.url element MUST be a Fixed value. The fixed value of the extension.url element MUST comply with UK Core Extension URL formats.

The extension.value element rules

The extension.value element in an extension is normally constrained to one or a few datatypes. The rules in this section are applicable to the various datatypes used by the UK Core extensions. Where a value's datatype is not currently used in the UK Core, no specific rules may be given.

Further information about FHIR datatypes is available.

Extension Bindings When the Value is a Coded Type

If the extension.value is constrained to a coded type e.g. one of: Code, Coding, or CodeableConcept: The extension.value MUST be bound to a ValueSet.

Cardinality of an extension.value element

On a simple extension the extension.value must be mandated, so MUST have a cardinality of 1..1.

Rules for Modelling Complex Extensions

This section details the rules to follow when creating, updating or reviewing a complex extension. A complex extension has a multiple extension.url elements and multiple extension.value elements.

Complex Extension Illustration

urlFixed Value
valueCodingCoding
urlFixed Value
valueStringstring
urlFixed Value
value[x]..0

The extension.url element rules

A complex extension has multiple extension.url elements and the rules for the extension.url are:
All extension.url elements MUST be a Fixed value.
All the fixed values of the extension.url elements MUST comply with UK Core Extension URL formats.

Component extension rules

Component extensions may have a cardinality of 0..1, 0..* 1..1 or 1..* depending on the requirements.

The Extension.value element rules

The extension.value elements in a complex extension are normally constrained to one or a few types. The rules in this section are applicable to the various datatypes used by the UK Core extensions. Where a value's datatype is not currently used in the UK Core, no specific rules may be given.

Extension Bindings When the Value is a Coded type

If any of the extension.value elements is constrained to a coded type e.g. one of Code, Coding, or CodeableConcept:

The extension.value MUST be bound to a ValueSet.

Cardinality of an extension.value element

On a complex extension all the extension.value elements must be mandated. The extension.value MUST be mandated.

ValueSet Design

Background

Metadata used in UK Core Valuesets

This section provides background information on metadata used within ValueSet resources:

  • the metadata element name
  • the cardinality of the metadata in the HL7 FHIR standard
  • the cardinality of the metadata to be applied in the UK Core
  • the type (i.e. datatype) for the metadata, taken from the HL7 FHIR standard
  • a definition of the metadata, taken from the HL7 FHIR standard
  • any constraints that the HL7 FHIR standard applies to the metadata
  • any notes relating to the use of the metadata within the UK Core

Further information about the ValueSet resource is available.

Other Information about UK Core ValueSets

Further information in this section includes:

  • Lists of HL7 FHIR standard extensions that may be considered relevant to a UK Core ValueSet
  • An XML template for a new ValueSet including options for the Content Logical Definition
  • Links to example ValueSets already created for the UK Core
  • Information about expanding ValueSets

Metadata usage

The list below contains generic Resource elements, followed by generic DomainResource elements, followed by ValueSet resource elements.

View further information about FHIR base resource definitions and elements.

View further information about FHIR domain resources.

Element name Base Cardinality UK Core Cardinality Type Definition, Constraints and Notes
id 0..1 1..1 id Logical id of this artifact.

In the UK Core the format is:

"UKCore-[BusinessNames]" (initial letters in upper case, no spaces between words).
meta 0..1 0..1 Meta Metadata about the resource.

Not currently used in the UK Core.
- versionId 0..1 0..1 id Changes each time the content of the resource changes.

The version can be globally unique, or scoped by the Logical Id of the resource. Version identifiers are generally either a serially incrementing id scoped by the logical id, or a uuid, though neither of these approaches is required. There is no fixed order for version ids - clients cannot assume that a versionId that comes after another one either numerically or alphabetically represents a later version. The same versionId can never be used for more than one version of the same resource.

Not currently used in the UK Core.
- lastUpdated 0..1 0..1 instant If populated, this value changes each time the content of the resource changes. It can be used by a system or a human to judge the currency of the resource content.

Not currently used in the UK Core.
- source 0..1 0..1 uri A uri that identifies the source system of the resource.

Not currently used in the UK Core.
- profile 0..* 0..* canonical An assertion that the content conforms to a resource profile.

Not currently used in the UK Core.
- security 0..* 0..* Coding Security labels applied to this resource. These tags connect resources in specific ways to the overall security policy and infrastructure. Security tags can be updated when the resource changes, or whenever the security sub-system chooses to.

Not currently used in the UK Core.
- tag 0..* 0..* Coding Tags applied to this resource. Tags are used to relate resources to process and workflow. Applications are not required to consider the tags when interpreting the meaning of a resource.

Not currently used in the UK Core.
implicitRules 0..1 0..1 uri A set of rules under which this content was created.

Not currently used in the UK Core.
language 0..1 0..1 code Language of the resource content.

Not currently used in the UK Core.
text 0..1 0..1 Narrative Text summary of the resource, for human interpretation.

Not currently used in the UK Core.
contained 0..* 0..* Resource Contained, inline Resources.

Not currently used in the UK Core.
extension 0..* 0..* Extension Additional content defined by implementations.

See the ValueSetExtensions section for details of extensions that may be considered for use in UK Core value sets.
modifierExtension 0..* 0..* Extension Extensions that cannot be ignored.
url 0..1 1..1 uri Canonical identifier for this value set, represented as a URI (globally unique).

In the UK Core the format is:

"https://fhir.hl7.org.uk/ValueSet/UKCore-[BusinessNames]" (initial letters in upper case, no spaces between words).
identifier 0..* 0..* Identifier Additional identifier for the ValueSet, for example an OID.

If this is an OID, this should be in the following format:

    <identifier>
        <system value="urn:ietf:rfc:3986"/>
        <value value="urn:oid:2.16.840.1.113883.2.1.3.2.4.16.21"/>
    </identifier>


Further guidance may be needed in due course.
version 0..1 1..1 string Business version of the value set.

This will follow the Semantic Versioning standard [major.minor.patch].
name 0..1 1..1 string Computer readable name, this should reflect the name in the url element.

In the UK Core the format is:

"UKCore[BusinessNames]" (initial letters in upper case, no spaces between words).
title 0..1 1..1 string Human readable name, this should reflect the name in the url element.

In the UK Core the format is:

"UK Core [Business Names]" (initial letters in upper case, a space between each word).
status 1..1 1..1 code The publication status as defined in https://hl7.org/fhir/valueset-publication-status.html [draft | active | retired | unknown].

UK Core CodeSystems in development have a status of "draft".

UK Core CodeSystems that have been approved via Clinical and Technical Assurance have a status of "active".

UK Core CodeSystems that are no longer required in the UK Core have a status of "retired".
experimental 0..1 0..1 boolean Boolean value to indicate that this value set is authored for testing purposes and is not intended to be used for genuine usage.

Not currently used in the UK Core.
date 0..1 1..1 dateTime The date (and optionally time) when the value set was published or last changed. The date must change when the business version or status changes.

Just the date without time is populated in the UK Core.
publisher 0..1 1..1 string Name of the publisher (organization or individual).

For all UK Core value sets, where the base URL is https://fhir.hl7.org.uk, this will be "HL7 UK".
contact 0..* 1..* ContactDetail Contact details for the publisher.

See the template for details of how this must be populated for all UK Core value sets, where the base URL is https://fhir.hl7.org.uk/.
description 0..1 1..1 markdown A free text natural language description of the of the value set from a consumer's perspective. The textual description specifies the span of meanings for concepts to be included within the Value Set Expansion, and also may specify the intended use and limitations of the Value Set.

The general format should be as follows:

"A set of codes that define [description]".

In the UK Core there is a preference to use the words "define" or "describe" and more rarely, "identify".

For a value set containing a SNOMED CT Reference Set:

"A set of codes that describe [description]. Selected from the [RefSet display value] of the SNOMED CT UK coding system."

For a value set containing a SNOMED hierarchy:

"A set of codes that define [description]. Selected from the SNOMED CT UK coding system."

For a value set containing a complex set of SNOMED Reference Sets and/or hierarchies and/or individual concepts:

"A set of codes from the SNOMED CT UK coding system that: [description of RefSet/hierarchy1]; [description of RefSet/hierarchy2]; etc."

Where the value set includes nullFlavor(s) in addition to other sets of codes, for the nullFlavor section:

"Where no [MainCodeSystem(s)] coded information is available, a specific code from the nullFlavor CodeSystem can be used instead to indicate this."

For complicated descriptions, particularly where a complex set of SNOMED references is used, and where inclusion of a carriage return / line feed can make the content more presentable in Simplifier, the sequence can be inserted to start a new line and can be inserted to leave a line break before the next line starts.

See also the Example ValueSets from the UK Core section.
useContext 0..* 0..* UsageContext Context the content is intended to support. This is a code from extensible ValueSet https://hl7.org/fhir/valueset-usage-context-type.html, as well as a choice of CodeableConcept/Quantity/Range.

Not currently used in the UK Core.
jurisdiction 0..* 0..* CodeableConcept A legal or geographic region in which the code system is intended to be used (if applicable).

Not currently used in the UK Core but there may be a use case for derived assets.
immutable 0..1 0..1 boolean Indicates whether or not any change to the content logical definition may occur. If this is set to 'true', then no new versions of the content logical definition can be created. Normally immutability is set to 'false', which is the default assumption if it is not populated.

Not currently used in the UK Core.
purpose 0..1 0..1 markdown Explanation of why this value set is needed and why it has been designed as it has.

Not generally used in UK Core ValueSets but may have a use case in providing useful information not already evident from other content in a ValueSet.
copyright 0..1 1..1 markdown A copyright statement relating to the value set and/or its contents.

All UK Core ValueSets must contain the following:

"Copyright © [YYYY]+ HL7 UK Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. HL7® FHIR® standard Copyright © 2011+ HL7 The HL7® FHIR® standard is used under the FHIR license. You may obtain a copy of the FHIR license at https://www.hl7.org/fhir/license.html.", where [YYYY]=year of creation of the value set.

For UK Core ValueSets that contain SNOMED CT codes, the copyright statement must additionally include:

"This value set includes content from SNOMED CT, which is copyright © 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement.".

For UK Core ValueSets that contain dm+d codes, the copyright statement must additionally include:

"Copyright © NHS Digital"
compose 0..1 1..1 BackboneElement A set of criteria that define the contents of the value set by including or excluding codes selected from the specified code system(s) that the value set draws from. This is also known as the Content Logical Definition (CLD).

See the following sections for details on how to populate this:

- Content Logical Definition – ValueSets containing UK Core CodeSystems, and

- Content Logical Definition – ValueSets containing SNOMED concepts.
- lockedDate 0..1 0..1 date The Locked Date is the effective date that is used to determine the version of all referenced Code Systems and Value Set Definitions included in the compose that are not already tied to a specific version.

With a defined lockedDate the value set is considered "Locked". Otherwise, the value set may have different expansions as underlying code systems and/or value sets evolve. The interpretation of lockedDate is often dependent on the context - e.g. a SNOMED CT derived value set with a lockedDate will have a different expansion in USA than in UK. If a value set specifies a version for include and exclude statements, and also specifies a locked date, the specified versions need to be available that date, or the value set will not be usable.

Not currently used in the UK Core.
- inactive 0..1 0..1 boolean Whether inactive codes (codes that are not approved for current use) are in the value set.

If inactive = true, inactive codes are to be included in the expansion.

If inactive = false, the inactive codes will not be included in the expansion.

If absent, the behaviour is determined by the implementation, or by the applicable expansion parameters (but generally, inactive codes would be expected to be included).

Not currently used in the UK Core but a default value of "true" can be assumed.
- include 1..* 1..* BackboneElement Include one or more codes from a code system or other value set(s).

All the conditions in an include must be true. If a system is listed, all the codes from the system are listed. If one or more filters are listed, all of the filters must apply. If one or more value sets are listed, the codes must be in all the value sets. E.g. each include is 'include all the codes that meet all these conditions'.
- - system 0..1 0..1 uri A value set include/exclude SHALL have a value set or a system.

A value set with concepts or filters SHALL include a system.

Currently all UK Core ValueSets contain a system and none contain a ValueSet.
- - version 0..1 0..1 string Specific version of the code system referred to.

Do not include for value sets containing just SNOMED concepts as new versions are released bi-annually. This may be used for other value sets although not currently used in the UK Core.
- - concept 0..* 0..* BackboneElement Specifies a concept to be included or excluded.

A value set with concepts or filters SHALL include a system.

Cannot have both concept and filter.
- - - code 1..1 1..1 code Specifies a code for the concept to be included or excluded.
- - - display 0..1 1..1 string The text to display to the user for this concept in the context of this valueset.

For SNOMED concepts this will always be the preferred term.
- - - designation 0..* 0..* BackboneElement Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc.

Not currently used in the UK Core.
- - - - language 0..1 0..1 code
- - - - use 0..1 0..1 Coding
- - - - value 1..1 1..1 string
- - filter 0..* 0..* BackboneElement Select concepts by specify a matching criterion based on the properties (including relationships) defined by the system, or on filters defined by the system. If multiple filters are specified, they SHALL all be true.

A value set with concepts or filters SHALL include a system.

Cannot have both concept and filter.

For value sets containing SNOMED concepts, see the SNOMED Additional Guidance section.
- - - property 1..1 1..1 code A code that identifies a property or a filter defined in the code system.

For UK Core value sets containing SNOMED concepts encapsulated within an ECL expression, the "constraint" value is used.
- - - op 1..1 1..1 code The kind of operation to perform as a part of the filter criteria, as defined in https://hl7.org/fhir/valueset-filter-operator.html

[= | is-a | descendent-of | is-not-a | regex | in | not-in | generalizes | exists].

For UK Core value sets containing SNOMED concepts encapsulated within an ECL expression, the "=" value is used.
- - - value 1..1 1..1 string The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value (if the filter represents a property defined in CodeSystem) or of the system filter value (if the filter represents a filter defined in CodeSystem) when the operation is 'regex', or one of the values (true and false), when the operation is 'exists'.

For UK Core value sets containing SNOMED concepts encapsulated within an ECL expression, the ECL expression is contained in this element.
- - valueSet 0..* 0..* canonical(ValueSet) Selects the concepts found in this value set (based on its value set definition). This is an absolute URI that is a reference to ValueSet.url. If multiple value sets are specified this includes the union of the contents of all of the referenced value sets.

A value set include/exclude SHALL have a value set or a system.

Currently all UK Core ValueSets contain a system and none contain a ValueSet.
- exclude 0..* 0..* See include Explicitly exclude codes from a code system or other value sets.

An example of the use of exclude can be found in the Example ValueSets from the UK Core section.
expansion 0..1 0..1 BackboneElement A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.

See also the section on Expanding ValueSets for the UK Core.
- - identifier 0..1 0..1 uri An identifier that uniquely identifies this expansion of the valueset, based on a unique combination of the provided parameters, the system default parameters, and the underlying system code system versions etc. Systems may re-use the same identifier as long as those factors remain the same, and the expansion is the same, but are not required to do so. This is a business identifier.
- - timestamp 1..1 1..1 dateTime Time ValueSet expansion happened.
- - total 0..1 0..1 integer The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter.
- - offset 0..1 0..1 integer If paging is being used, the offset at which this resource starts. I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL NOT be present.
- - parameter 0..* 0..* BackboneElement A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.
- - name 1..1 1..1 string Name of the input parameter to the $expand operation; may be a server-assigned name for additional default or other server-supplied parameters used to control the expansion process.
- - value[x] 0..1 0..1 The value of the parameter.
- - - valueString string
- - - valueBoolean boolean
- - - valueInteger integer
- - - valueDecimal decimal
- - - valueUri uri
- - - valueCode code
- - - valueDateTime dateTime
- contains 0..* 0..* BackboneElement The codes that are contained in the value set expansion.
- - system 0..1 0..1 uri An absolute URI which is the code system in which the code for this item in the expansion is defined.

Must have a system if a code is present.
- - abstract 0..1 0..1 boolean If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.

Must have a code if not abstract.
- - inactive 0..1 0..1 boolean If the concept is inactive in the code system that defines it. Inactive codes are those that are no longer to be used, but are maintained by the code system for understanding legacy data. It might not be known or specified whether an concept is inactive (and it may depend on the context of use).
- - version 0..1 0..1 string The version of the code system from this code was taken. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.
- - code 0..1 0..1 code The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set.

SHALL have a code or a display.

Must have a code if not abstract.

Must have a system if a code is present.
- - display 0..1 0..1 string The recommended display for this item in the expansion.

SHALL have a code or a display.
- - designation 0..* 0..* See designation Additional representations for this item - other languages, aliases, specialized purposes, used for particular purposes, etc. These are relevant when the conditions of the expansion do not fix to a single correct representation.
- - contains 0..* 0..* See contains Other codes and entries contained under this entry in the hierarchy.

ValueSet Extensions

Currently there is no identified HL7 FHIR standard value set extension that has been recommended to be considered for use in UK Core value sets. The full list of FHIR Standard value set extensions available can be viewed online.

XML template for a new ValueSet

Main body of ValueSet

<ValueSet xmlns="http://hl7.org/fhir">
	<id value="UKCore-[ConcatenatedBusinessName(s)]" />
	<url value="https://fhir.hl7.org.uk/ValueSet/UKCore-[ConcatenatedBusinessName(s)]" />
	<version value="1.0.0" />
	<name value="UKCore[ConcatenatedBusinessName(s)]" />
	<title value="UK Core [SpaceSeparatedBusinessName(s)]" />
	<status value="draft" />
	<date value="2021-07-01" />
	<publisher value="HL7 UK" />
	<contact>
		<name value="HL7 UK" />
		<telecom>
			<system value="email" />
			<value value="secretariat@hl7.org.uk" />
			<use value="work" />
			<rank value="1" />
		</telecom>
	</contact>
	<contact>
		<name value="NHS Digital" />
		<telecom>
			<system value="email" />
			<value value="interoperabilityteam@nhs.net" />
			<use value="work" />
			<rank value="2" />
		</telecom>
	</contact>
	<description value="A set of codes that define ..." />
	<copyright value="Copyright &#169; [YYYY]+ HL7 UK Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at	http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. HL7&#174; FHIR&#174; standard Copyright &#169; 2011+ HL7	The HL7&#174; FHIR&#174; standard is used under the FHIR license. You may obtain a copy of the FHIR license at	https://www.hl7.org/fhir/license.html." />
	<!--Insert Content Logical Definition below here. See next two main sections for Content Logical Definition templates.-->
</ValueSet>

Content Logical Definition – ValueSets containing UK Core CodeSystems

Content Logical Definition - Single entire code system

  <compose>
		<include>
			<system value="https://fhir.hl7.org.uk/CodeSystem/UKCore-[ConcatenatedBusinessName(s)]" />
		</include>
  </compose>

Content Logical Definition – Selected included codes from a single code system

  <compose>
		<include>
			<system value="https://fhir.hl7.org.uk/CodeSystem/UKCore-[ConcatenatedBusinessName(s)]" />
			<concept>
				<code value="[conceptCode1]" />
				<display value="[conceptDisplay1]" />
			</concept>
			<concept>
				<code value="[conceptCode2]" />
				<display value="[conceptDisplay2]" />
			</concept>
		</include>
  </compose>

Content Logical Definition – Selected excluded codes from a single code system

  <compose>
		<include>
			<system value="https://fhir.hl7.org.uk/CodeSystem/UKCore-[ConcatenatedBusinessName(s)]" />
		</include>
		<exclude>
			<system value="https://fhir.hl7.org.uk/CodeSystem/UKCore-[ConcatenatedBusinessName(s)]" />
			<concept>
				<code value="[conceptCode1]" />
				<display value="[conceptDisplay2]" />
			</concept>
			<concept>
				<code value="[conceptCode2]" />
				<display value="[conceptDisplay2]" />
			</concept>
		</exclude>
  </compose>

Content Logical Definition – ValueSets containing SNOMED concepts

The UK Core approach is that all SNOMED is encapsulated within the Content Logical Definition using SNOMED Expression Constraint Language (ECL) in a single statement in the value element, together with a property element value of "constraint" and an op element value of "=".

More information about ECL is available online.

The ECL informative long syntax rather than the normative brief syntax is used to identify a hierarchy or reference set. As the brief and long syntaxes are logically equivalent, the long syntax is used in the UK Core to both provide greater clarity to a potentially wide audience and to simplify the process of creating, validating and using the ECL statement for a range of potential users as it avoids any need to encode and decode symbols otherwise used in the brief syntax.

Concept display values are not included in the ECL statement to avoid potential duplication with the value set description and to avoid any need to encode separator characters. The value set description field is used to provide hierarchy / reference set display name information, although display values for lists of individual codes will only be available via a value set expansion again to avoid duplication.

It is intended that at least a partial value set expansion be provided for all value sets containing SNOMED. Where the expansion would contain a very large number of concepts, a limit of 600 concepts will be listed. Note that expansions are only ever current at the time they are created. The date/time of expansion is currently only viewable from within the XML or JSON view of the ValueSet.

Example ValueSets from the UK Core

This section is intended to provide examples that illustrate the different ways in which the Content Logical Definition (i.e. the element and its children elements) might be constructed, depending on the required code system content of the value set.

Value set containing content from a single entire UK Core CodeSystem

https://simplifier.net/HL7FHIRUKCoreR4/UKCore-AddressKeyType/~xml

Value set containing selected content from a single FHIR standard CodeSystem and selected content from a single UK Core CodeSystem

https://simplifier.net/HL7FHIRUKCoreR4/UKCore-MedicationRequestCourseOfTherapy-duplicate-2/~xml

Value set containing content from a single entire UK Core CodeSystem and selected nullFlavors

https://simplifier.net/HL7FHIRUKCoreR4/UKCore-NHSNumberVerificationStatus-duplicate-2/~xml

Value set containing selected content from a single UK Core CodeSystem and multiple FHIR standard CodeSystems and also excluding specific concepts

https://simplifier.net/HL7FHIRUKCoreR4/UKCore-PersonRelationshipType-110/~xml

Value set containing selected individual codes from SNOMED

https://simplifier.net/HL7FHIRUKCoreR4/UKCore-ReasonImmunizationNotAdministered/~xml

Value set containing a single Reference Set from SNOMED

https://simplifier.net/HL7FHIRUKCoreR4/UKCore-MedicationForm/~xml

Value set containing a single hierarchy from SNOMED

https://simplifier.net/HL7FHIRUKCoreR4/UKCore-BodySite/~xml

Value set containing a multiple hierarchies from SNOMED

https://simplifier.net/HL7FHIRUKCoreR4/UKCore-VaccinationProcedure/~xml

Complex value set (SNOMED hierarchies and individual codes, and dm+d concept classes)

https://simplifier.net/HL7FHIRUKCoreR4/UKCore-AllergyCode/~xml

Expanding ValueSets for the UK Core

At the time of writing, a direct interface to a Terminology Server to enable automated expansion of a ValueSet content within Simplifier has not been implemented.

It is possible to manually obtain a ValueSet expansion from the NHS Digital Terminology Server (Ontoserver), and this expansion can be manually incorporated into an existing ValueSet. This approach was taken for the ValueSet examples above.

For some SNOMED ValueSets, the amount of content (e.g. 100,000s of concepts) is far too large to be incorporated into a ValueSet expansion or its display in Simplifier. For such ValueSets, a fragment of the ValueSet expansion can still be made available however.

CodeSystem Design

This section provides background information on metadata used within CodeSystem resources:

  • the metadata element name
  • the cardinality of the metadata in the HL7 FHIR standard
  • the cardinality of the metadata to be applied in the UK Core
  • the type (i.e. datatype) for the metadata, taken from the HL7 FHIR standard
  • a definition of the metadata, taken from the HL7 FHIR standard
  • any constraints that the HL7 FHIR standard applies to the metadata
  • any notes relating to the use of the metadata within the UK Core

Further information about the CodeSystem resource is available online.

This section also lists HL7 FHIR standard extensions that may be considered relevant to a UK Core CodeSystem, followed by an XML template for a new CodeSystem and links to example CodeSystems already created for the UK Core.

Metadata usage

The list below contains generic Resource elements, followed by generic DomainResource elements, followed by CodeSystem resource elements.

View further information about FHIR base resource definitions and elements.

View further information about FHIR domain resources.

Element name Base Cardinality UK Core Cardinality Type Definition, Constraints and Notes
id 0..1 1..1 id Logical id of this artifact.

In the UK Core the format is:

"UKCore-[BusinessNames]" (initial letters in upper case, no spaces between words).
meta 0..1 0..1 Meta Metadata about the resource.

Not currently used in the UK Core.
- versionId 0..1 0..1 id Changes each time the content of the resource changes.

The version can be globally unique, or scoped by the Logical Id of the resource. Version identifiers are generally either a serially incrementing id scoped by the logical id, or a uuid, though neither of these approaches is required. There is no fixed order for version ids - clients cannot assume that a versionId that comes after another one either numerically or alphabetically represents a later version. The same versionId can never be used for more than one version of the same resource.

Not currently used in the UK Core.
- lastUpdated 0..1 0..1 instant If populated, this value changes each time the content of the resource changes. It can be used by a system or a human to judge the currency of the resource content.

Not currently used in the UK Core.
- source 0..1 0..1 uri A uri that identifies the source system of the resource.

Not currently used in the UK Core but there may be a use case for establishing lineage and traceability with some code systems.
- profile 0..* 0..* canonical An assertion that the content conforms to a resource profile.

Not currently used in the UK Core.
- security 0..* 0..* Coding Security labels applied to this resource. These tags connect resources in specific ways to the overall security policy and infrastructure. Security tags can be updated when the resource changes, or whenever the security sub-system chooses to.

Not currently used in the UK Core.
- tag 0..* 0..* Coding Tags applied to this resource. Tags are used to relate resources to process and workflow. Applications are not required to consider the tags when interpreting the meaning of a resource.

Not currently used in the UK Core.
implicitRules 0..1 0..1 uri A set of rules under which this content was created.

Not currently used in the UK Core.
language 0..1 0..1 code Language of the resource content.

Not currently used in the UK Core.
text 0..1 0..1 Narrative Text summary of the resource, for human interpretation.

Not currently used in the UK Core.
contained 0..* 0..* Resource Contained, inline Resources.

Not currently used in the UK Core.
extension 0..* 0..* Extension Additional content defined by implementations.

See the CodeSystemExtensions section for details of extensions that may be considered for use in UK Core code systems.
modifier
Extension
0..* 0..* Extension Extensions that cannot be ignored.
url 0..1 1..1 uri Canonical identifier for this code system, represented as a URI (globally unique).

In the UK Core the format is:

"https://fhir.hl7.org.uk/CodeSystem/UKCore-[BusinessNames]" (initial letters in upper case, no spaces between words).
identifier 0..* 0..* Identifier Additional identifier for the code system, for example an OID.

If this is an OID, this should be in the following format:

    <identifier>
        <system value="urn:ietf:rfc:3986"/>
        <value value="urn:oid:2.16.840.1.113883.2.1.3.2.4.16.21"/>
    </identifier>


Further guidance may be needed in due course.
version 0..1 1..1 string Business version of the code system.

This will follow the Semantic Versioning standard [major.minor.patch].
name 0..1 1..1 string Computer readable name, this should reflect the name in the url element.

In the UK Core the format is:

"UKCore[BusinessNames]" (initial letters in upper case, no spaces between words).
title 0..1 1..1 string Human readable name, this should reflect the name in the url element.

In the UK Core the format is:

"UK Core [Business Names]" (initial letters in upper case, a space between each word).
status 1..1 1..1 code The publication status as defined in https://hl7.org/fhir/valueset-publication-status.html [draft | active | retired | unknown].

UK Core CodeSystems in development have a status of "draft".

UK Core CodeSystems that have been approved via Clinical and Technical Assurance have a status of "active".

UK Core CodeSystems that are no longer required in the UK Core have a status of "retired".
experimental 0..1 0..1 boolean Boolean value to indicate that this code system is authored for testing purposes and is not intended to be used for genuine usage.

Not currently used in the UK Core.
date 0..1 1..1 dateTime The date (and optionally time) when the code system was published or last changed. The date must change when the business version or status changes.

Just the date without time is populated in the UK Core.
publisher 0..1 1..1 string Name of the publisher (organization or individual).

For all UK Core code systems, where the base URL is https://fhir.hl7.org.uk/, this will be "HL7 UK".
contact 0..* 1..* ContactDetail Contact details for the publisher.

See the template for details of how this must be populated for all UK Core code systems, where the base URL is https://fhir.hl7.org.uk/.
description 0..1 1..1 markdown A free text natural language description of the of the code system from a consumer's perspective.

The format should be as follows:

"A set of codes that define [description]".
useContext 0..* 0..* UsageContext Context the content is intended to support. This is a code from extensible ValueSet https://hl7.org/fhir/valueset-usage-context-type.html, as well as a choice of CodeableConcept/Quantity/Range.

Not currently used in the UK Core.
jurisdiction 0..* 0..* Codeable
Concept
A legal or geographic region in which the code system is intended to be used (if applicable).

Not currently used in the UK Core but there may be a use case for derived assets.
purpose 0..1 0..1 markdown Explanation of why this code system is needed and why it has been designed as it has.

Not generally used in UK Core CodeSystems but may have a use case in providing useful information not already evident from other content in a CodeSystem.
copyright 0..1 1..1 markdown A copyright statement relating to the code system and/or its contents.

All UK Core CodeSystems must contain the following:

"Copyright © [YYYY]+ HL7 UK Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. HL7® FHIR® standard Copyright © 2011+ HL7 The HL7® FHIR® standard is used under the FHIR license. You may obtain a copy of the FHIR license at https://www.hl7.org/fhir/license.html.", where [YYYY]=year of creation of the code system.
caseSensitive 0..1 0..1 boolean A boolean to describe if code comparison is case sensitive. This element is primarily provided to support validation software.

For UK Core CodeSystems comprising codes which contain alphabetic characters, this MUST be set to "true".

For UK Core CodeSystems comprising codes which do not contain alphabetic characters, this SHOULD NOT be used.
valueSet 0..1 0..1 canonical
(ValueSet)
Canonical reference to the value set that contains the entire code system. The definition of the value set SHALL include all codes from this code system and only codes from this code system, and it SHALL be immutable. Immutable means no new versions of the content logical definition can be created, although metadata might still change.

Not currently used in the UK Core.
hierarchyMeaning 0..1 0..1 code The meaning of the hierarchy of concepts as represented in this resource. This is a code from required ValueSet https://hl7.org/fhir/valueset-codesystem-hierarchy-meaning.html [grouped-by | is-a | part-of | classified-with].

Not currently used in the UK Core.
compositional 0..1 0..1 boolean A boolean to indicate whether or not the code system defines a post-coordination grammar. Note that the code system resource does not define what the compositional grammar is, only whether or not there is one.
Not currently used in the UK Core.
versionNeeded 0..1 0..1 boolean This flag is used to signify that the code system does not commit to concept permanence across versions. If true, a version must be specified when referencing this code system.
Not currently used in the UK Core, with a default value of 'false' being assumed.
content 1..1 1..1 code A code from required ValueSet https://hl7.org/fhir/valueset-codesystem-content-mode.html to describe how much of the content of the code system - the concepts and codes it defines - are represented in this resource [not-present | example | fragment | complete | supplement].

This SHOULD normally be set to ‘complete’, i.e. all the concepts defined by the code system are included in the code system resource.
supplements 0..1 0..1 canonical
(CodeSystem)
The canonical URL of the code system that this code system supplement is adding designations and properties to. The most common use of a code system supplement is to add additional language support.

Not currently used in the UK Core.
count 0..1 0..1 unsignedInt The total number of concepts defined by the code system. Where the code system has a compositional grammar, the basis of this count is defined by the system steward. The count of concepts defined in this resource cannot be more than this value but may be less for several reasons - see the content element.

Not currently used in the UK Core.
filter 0..* 0..* Backbone
Element
A filter that can be used in a value set compose statement when selecting concepts using a filter.

Note that filters defined in code systems usually require custom code on the part of any terminology engine that will make them available for use in value set filters. For this reason, they are generally only seen in high value published terminologies.

This has only been used in the UK Core with CodeSystems that consist of a superset of concepts from more than one UK country (e.g. https://simplifier.net/hl7fhirukcorer4/ukcore-personmaritalstatus).
- code 1..1 1..1 code The code that identifies this filter when it is used as a filter in ValueSet.compose.include.filter.
- description 0..1 0..1 string A description of how or why the filter is used.
- operator 1..* 1..* code A list of operators that can be used with the filter from required ValueSet https://hl7.org/fhir/valueset-filter-operator.html [= | is-a | descendent-of | is-not-a | regex | in | not-in | generalizes | exists].
- value 1..1 1..1 string What to use for the value.
property 0..* 0..* Backbone
Element
A property defines an additional slot through which additional information can be provided about a concept.

This has only been used in the UK Core with CodeSystems that consist of a superset of concepts from more than one UK country (e.g. https://simplifier.net/hl7fhirukcorer4/ukcore-personmaritalstatus).
- code 1..1 1..1 code A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters.
- uri 0..1 0..1 uri Reference to the formal meaning of the property. One possible source of meaning is the Concept Properties code system (https://hl7.org/fhir/codesystem-concept-properties.html).
- description 0..1 0..1 string A description of the property- why it is defined, and how its value might be used.
- type 1..1 1..1 code The type of the property value. Properties of type "code" contain a code defined by the code system (e.g. a reference to another defined concept) from the concept property type value set (https://hl7.org/fhir/valueset-concept-property-type.html).
concept 0..* 0..* Backbone
Element
Concepts that are in the code system.

Cardinality would normally be 1..* but set to the standard 0..* to allow for a use case where the content element has a value of "not-present".
- code 1..1 1..1 code A code - a text symbol - that uniquely identifies the concept within the code system.
- display 0..1 1..1 uri A human readable string that is the recommended default way to present this concept to a user.
- definition 0..1 0..1 string The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.
- designation 0..* 0..* code Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.

Not currently used in the UK Core.
- - language 0..1 0..1 code
- - use 0..1 0..1 Coding
- - value 1..1 1..1 string
- property 0..* 0..* Backbone
Element
A property value for this concept.

This has only been used in the UK Core with CodeSystems that consist of a superset of concepts from more than one UK country (e.g. https://simplifier.net/hl7fhirukcorer4/ukcore-personmaritalstatus).
- - code 1..1 1..1 Coding
- - value[x] 1..1 1..1
- - - valueCode code
- - - valueCoding Coding
- - - valueString string
- - - valueInteger integer
- - - valueBoolean boolean
- - - valueDateTime dateTime
- - - valueDecimal decimal
- - concept 0..* 0..* See concept Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) - see hierarchyMeaning.

CodeSystem Extensions

This section lists HL7 FHIR standard code system extensions that could be considered for use in UK Core code systems.

The full list of FHIR standard code system extensions is available online.

codesystem-concept-comments

The FHIR Standard extension https://hl7.org/fhir/extension-codesystem-concept-comments.html could be considered where there is a need to include comments against individual code system concepts.

See the following example: https://hl7.org/fhir/codesystem-administrative-gender.xml.html

XML template for a new CodeSystem

<CodeSystem xmlns="http://hl7.org/fhir">
	<id value="UKCore-[ConcatenatedBusinessName(s)]" />
	<url value="https://fhir.hl7.org.uk/CodeSystem/UKCore-[ConcatenatedBusinessName(s)]" />
	<version value="1.0.0" />
	<name value="UKCore[ConcatenatedBusinessName(s)]" />
	<title value="UK Core [SpaceSeparatedBusinessName(s)]" />
	<status value="draft" />
	<date value="2021-07-01" />
	<publisher value="HL7 UK" />
	<contact>
		<name value="HL7 UK" />
		<telecom>
			<system value="email" />
			<value value="secretariat@hl7.org.uk" />
			<use value="work" />
			<rank value="1" />
		</telecom>
	</contact>
	<contact>
		<name value="NHS Digital" />
		<telecom>
			<system value="email" />
			<value value="interoperabilityteam@nhs.net" />
			<use value="work" />
			<rank value="2" />
		</telecom>
	</contact>
	<description value="A set of codes that define [business definition]." />
	<copyright value="Copyright &#169; [YYYY]+ HL7 UK Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at	http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. HL7&#174; FHIR&#174; standard Copyright &#169; 2011+ HL7	The HL7&#174; FHIR&#174; standard is used under the FHIR license. You may obtain a copy of the FHIR license at	https://www.hl7.org/fhir/license.html." />
<!--Only include the following caseSensitive element where the CodeSystem contains alpha/alphanumeric codes.-->	
	<caseSensitive value="true" />
	<content value="complete" />
	<!--The concept element below is repeated for each concept in the code system.-->
	<concept>
		<code value="[conceptCode]" />
		<display value="[conceptDisplay]" />
	</concept>
</CodeSystem>

Creating codes for a CodeSystem

Where they don't already exist, the UK Core approach to creating codes for concepts in a new CodeSystem is by placing a hyphen between each word of the display value (if they contain more than one word) and using solely lower case alphabetic characters.

An exception to this is where the CodeSystem is a copy of a Data Dictionary set of concepts from any of the UK nations, where the approach is to faithfully use both the code and its description within the CodeSystem as defined within the Data Dictionary source at the time of creation of the CodeSystem. Note that for some CodeSystems already in existence in the UK core, including content previously created for other projects, alternative code construction forms have also been used.

Example CodeSystems from the UK Core

Code system created for the UK Core

https://simplifier.net/HL7FHIRUKCoreR4/UKCore-MedicationPrescribingOrganization/~xml

Code system based on previously created content

https://simplifier.net/HL7FHIRUKCoreR4/UKCore-DeathNotificationStatus/~xml

Code system based on Data Dictionary content (to be provided once the resource has been incorporated into the UK Core).

ConceptMap Design

This section provides background information on metadata used within ConceptMap resources:

  • the metadata element name
  • the cardinality of the metadata in the HL7 FHIR standard
  • the cardinality of the metadata to be applied in the UK Core
  • the type (i.e. datatype) for the metadata, taken from the HL7 FHIR standard
  • a definition of the metadata, taken from the HL7 FHIR standard
  • any constraints that the HL7 FHIR standard applies to the metadata
  • any notes relating to the use of the metadata within the UK Core Further information about the ConceptMap resource is available online.

This section also lists HL7 FHIR standard extensions that may be considered relevant to a ConceptMap, followed by an XML template for a new ConceptMap and links to example ConceptMaps already created for the UK Core.

Metadata usage

The list below contains generic Resource elements, followed by generic DomainResource elements, followed by ConceptMap resource elements.

View further information about FHIR base resource definitions and elements.

View further information about FHIR domain resources.

Element name Base Cardinality UK Core Cardinality Type Definition, Constraints and Notes
id 0..1 1..1 Id Logical id of this artifact.

In the UK Core the format is:

"UKCore-[BusinessNames]" (initial letters in upper case, no spaces between words).
meta 0..1 0..1 Meta Metadata about the resource.

Not currently used in the UK Core.
- versionId 0..1 0..1 id Changes each time the content of the resource changes.

The version can be globally unique, or scoped by the Logical Id of the resource. Version identifiers are generally either a serially incrementing id scoped by the logical id, or a uuid, though neither of these approaches is required. There is no fixed order for version ids - clients cannot assume that a versionId that comes after another one either numerically or alphabetically represents a later version. The same versionId can never be used for more than one version of the same resource.

Not currently used in the UK Core.
- lastUpdated 0..1 0..1 instant If populated, this value changes each time the content of the resource changes. It can be used by a system or a human to judge the currency of the resource content.

Not currently used in the UK Core.
- source 0..1 0..1 uri A uri that identifies the source system of the resource.

Not currently used in the UK Core.
- profile 0..* 0..* canonical An assertion that the content conforms to a resource profile.

Not currently used in the UK Core.
- security 0..* 0..* Coding Security labels applied to this resource. These tags connect resources in specific ways to the overall security policy and infrastructure. Security tags can be updated when the resource changes, or whenever the security sub-system chooses to.

Not currently used in the UK Core.
- tag 0..* 0..* Coding Tags applied to this resource. Tags are used to relate resources to process and workflow. Applications are not required to consider the tags when interpreting the meaning of a resource.

Not currently used in the UK Core.
implicitRules 0..1 0..1 uri A set of rules under which this content was created.

Not currently used in the UK Core.
language 0..1 0..1 code Language of the resource content.

Not currently used in the UK Core.
text 0..1 0..1 Narrative Text summary of the resource, for human interpretation.

Not currently used in the UK Core.
contained 0..* 0..* Resource Contained, inline Resources.

Not currently used in the UK Core.
extension 0..* 0..* Extension Additional content defined by implementations.

See the ConceptMapExtensions section for details of extensions that may be considered for use in UK Core concept maps.
modifierExtension 0..* 0..* Extension Extensions that cannot be ignored.
url 0..1 1..1 uri Canonical identifier for this concept map, represented as a URI (globally unique).

In the UK Core the format is:

"https://fhir.hl7.org.uk/ConceptMap/UKCore-[BusinessNames]" (initial letters in upper case, no spaces between words).
identifier 0..* 0..* Identifier Additional identifier for the code system, for example an OID.

If this is an OID, this should be in the following format:

    <identifier>
        <system value="urn:ietf:rfc:3986"/>
        <value value="urn:oid:2.16.840.1.113883.2.1.3.2.4.16.21"/>
    </identifier>


Further guidance may be needed in due course.
version 0..1 1..1 string Business version of the concept map.

This will follow the Semantic Versioning standard Semantic Versioning standard [major.minor.patch].
name 0..1 1..1 string Computer readable name, this should reflect the name in the url element.

In the UK Core the format is:

"UKCore[BusinessNames]" (initial letters in upper case, no spaces between words).
title 0..1 1..1 string Human readable name, this should reflect the name in the url element.

In the UK Core the format is:

"UK Core [Business Names]" (initial letters in upper case, a space between each word).
status 1..1 1..1 code The publication status as defined in https://hl7.org/fhir/valueset-publication-status.html [draft | active | retired | unknown].
experimental 0..1 0..1 boolean Boolean value to indicate that this concept map is authored for testing purposes and is not intended to be used for genuine usage.

Not currently used in the UK Core.
date 0..1 1..1 dateTime The date (and optionally time) when the concept map was published or last changed. The date must change when the business version or status changes.

Just the date without time is populated in the UK Core.
publisher 0..1 1..1 string Name of the publisher (organization or individual).

For all UK Core concept maps, where the base URL is https://fhir.hl7.org.uk/, this will be "HL7 UK".
contact 0..* 1..* ContactDetail Contact details for the publisher.

See the template for details of how this must be populated for all UK Core concept maps, where the base URL is https://fhir.hl7.org.uk/
description 0..1 1..1 markdown A free text natural language description of the of the concept map from a consumer's perspective.

The format should be as follows:

"A mapping between codes from [sourceCodeSystem] and codes from [targetCodeSystem]".
useContext 0..* 0..* UsageContext Context the content is intended to support. This is a code from extensible ValueSet https://hl7.org/fhir/valueset-usage-context-type.html, as well as a choice of CodeableConcept/Quantity/Range.

Not currently used in the UK Core.
jurisdiction 0..* 0..* CodeableConcept A legal or geographic region in which the concept map is intended to be used (if applicable).

Not currently used in the UK Core but there may be a use case for derived assets.
purpose 0..1 0..1 markdown Explanation of why this concept map is needed and why it has been designed as it has.

Not generally used in UK Core ConceptMaps but may have a use case in providing useful information not already evident from other content in a ConceptMap.
copyright 0..1 1..1 markdown A copyright statement relating to the concept map and/or its contents.

All UK Core ConceptMaps must contain the following:

"Copyright © [YYYY]+ HL7 UK Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. HL7® FHIR® standard Copyright © 2011+ HL7 The HL7® FHIR® standard is used under the FHIR license. You may obtain a copy of the FHIR license at https://www.hl7.org/fhir/license.html.", where [YYYY]=year of creation of the concept map.
source[x] 0..1 1..1 Identifier for the source value set that contains the concepts that are being mapped and provides context for the mappings.

Should be a version specific reference. URIs SHOULD be absolute. If there is no source or target value set, there is no specified context for the map (not recommended). The source value set may select codes from either an explicit (standard or local) or implicit code system.
- sourceUri uri UK Core concept maps use this element of the choice.
- sourceCanonical canonical(ValueSet)
target[x] 0..1 1..1 The target value set provides context for the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.

Should be a version specific reference. URIs SHOULD be absolute. If there is no source or target value set, there is no specified context for the map.
- targetUri uri UK Core concept maps use this element of the choice.
- targetCanonical canonical(ValueSet)
group 0..* 0..* BackboneElement A group of mappings that all have the same source and target system.

A group element SHOULD normally be present.
- source 0..1 0..1 uri An absolute URI that identifies the source system where the concepts to be mapped are defined.

This is not needed if the source value set is specified and it contains concepts from only a single system.

Although this is not needed if the source value set is specified and contains concepts from a single code system, it SHOULD still be included in UK Core concept maps to avoid the need to find the source code system from the value set.
- sourceVersion 0..1 0..1 String The specific version of the code system, as determined by the code system authority.

The specification of a particular code system version may be required for code systems which lack concept permanence.

This SHOULD NOT normally be present in the UK Core.
- target 0..1 0..1 uri An absolute URI that identifies the target system that the concepts will be mapped to.

This is not needed if the target value set is specified and it contains concepts from only a single system. The group target may also be omitted if all of the target element equivalence values are 'unmatched'.

Although this is not needed if the target value set is specified and contains concepts from a single code system, it SHOULD still be included in UK Core concept maps to avoid the needing to find the target code system from the value set.
- targetVersion 0..1 0..1 string The specific version of the code system, as determined by the code system authority.

The specification of a particular code system version may be required for code systems which lack concept permanence.

This SHOULD NOT normally be present in the UK Core.
- element 1..* 1..* BackboneElement Mappings for an individual concept in the source to one or more concepts in the target.

Generally, the ideal is that there would only be one mapping for each concept in the source value set, but a given concept may be mapped multiple times with different comments or dependencies.
- - code 0..1 1..1 code Identity (code or path) or the element/item being mapped.
- - display 0..1 1..1 string The display for the code. The display is only provided to help editors when editing the concept map.

The display is ignored when processing the map.
- - target 0..* 0..* BackboneElement A concept from the target value set that this concept maps to.

Ideally there would only be one map, with equal or equivalent mapping. But multiple maps are allowed for several narrower options, or to assert that other concepts are unmatched.

If the map is narrower or inexact, there SHALL be some comments.

This SHOULD normally be present but MAY be absent where there is no mapping from a source concept.
- - - code 0..1 1..1 code Identity (code or path) or the element/item that the map refers to.
- - - display 0..1 1..1 string The display for the code. The display is only provided to help editors when editing the concept map.

The display is ignored when processing the map.
- - - equivalence 1..1 1..1 code The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source).

As defined in https://hl7.org/fhir/valueset-concept-map-equivalence.html [relatedto | equivalent | equal | wider | subsumes | narrower | specializes | inexact | unmatched | disjoint].

Is Modifier is true: Some of the values mean that there is no mapping from the source to the target, particularly 'disjoint', and the mapping cannot be interpreted without knowing this value as it could mean the elements are equivalent, totally mismatched or anything in between.
- - - comment 0..1 0..1 string A description of status/issues in mapping that conveys additional information not represented in the structured data.
- - - dependsOn 0..* 0..* BackboneElement A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.

Not currently used in the UK Core.
- - - - property 1..1 1..1 uri A reference to an element that holds a coded value that corresponds to a code system property. The idea is that the information model carries an element somewhere that is labelled to correspond with a code system property.
- - - - system 0..1 0..1 canonical(CodeSystem) An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems).
- - - - value 1..1 1..1 string Identity (code or path) or the element/item/ValueSet/text that the map depends on / refers to.
- - - - display 0..1 0..1 string The display for the code. The display is only provided to help editors when editing the concept map.
- - - product 0..* 0..* See dependsOn A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.

Not currently used in the UK Core.
- - unmapped 0..1 0..1 BackboneElement What to do when there is no mapping for the source concept. "Unmapped" does not include codes that are unmatched, and the unmapped element is ignored if a code is specified to have equivalence = unmatched.
- - - mode 1..1 1..1 code Defines which action to take if there is no match for the source concept in the target system designated for the group. One of 3 actions are possible: use the unmapped code (this is useful when doing a mapping between versions, and only a few codes have changed), use a fixed code (a default code), or alternatively, a reference to a different concept map can be provided (by canonical URL).

As defined in https://hl7.org/fhir/valueset-conceptmap-unmapped-mode.html [provided | fixed | other-map].

If the mode is 'fixed', a code must be provided.

If the mode is 'other-map', a url must be provided.
- - - code 0..1 0..1 code The fixed code to use when the mode = 'fixed' - all unmapped codes are mapped to a single fixed code.

If the mode is 'fixed', a code must be provided.
- - - display 0..1 0..1 string The display for the code. The display is only provided to help editors when editing the concept map.
- - - url 0..1 0..1 canonical(ConceptMap) The canonical reference to an additional ConceptMap resource instance to use for mapping if this ConceptMap resource contains no matching mapping for the source concept.

If the mode is 'other-map', a url must be provided.

ConceptMap Extensions

This section lists HL7 FHIR Standard concept map extensions that could be considered for use in UK Core concept maps.

The full list of HL7 FHIR Standard concept map extensions is available online.

Concept-bidirectional

The HL7 FHIR standard extension https://hl7.org/fhir/extension-concept-bidirectional.html MAY be used where the ConceptMap can be safely interpreted in reverse, in order to avoid needing to create an additional ConceptMap for the reverse mapping.

XML template for a new ConceptMap

<ConceptMap xmlns="http://hl7.org/fhir">
	<id value="UKCore-[ConcatenatedBusinessName(s)]" />
	<url value="https://fhir.hl7.org.uk/ConceptMap/ConceptMap-UKCore-[ConcatenatedBusinessName(s)]" />
	<version value="1.0.0" />
	<name value="ConceptMap[ConcatenatedBusinessName(s)]" />
	<title value="Concept Map - [SpaceSeparatedBusinessName(s)]" />
	<status value="draft" />
	<date value="2021-07-01" />
	<publisher value="HL7 UK" />
	<contact>
		<name value="HL7 UK" />
		<telecom>
			<system value="email" />
			<value value="secretariat@hl7.org.uk" />
			<use value="work" />
			<rank value="1" />
		</telecom>
	</contact>
	<contact>
		<name value="NHS Digital" />
		<telecom>
			<system value="email" />
			<value value="interoperabilityteam@nhs.net" />
			<use value="work" />
			<rank value="2" />
		</telecom>
	</contact>
	<description value="A mapping between codes from [sourceCodeSystem] and codes from [targetCodeSystem]." />
	<copyright value="Copyright &#169; [YYYY]+ HL7 UK Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at	http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. HL7&#174; FHIR&#174; standard Copyright &#169; 2011+ HL7	The HL7&#174; FHIR&#174; standard is used under the FHIR license. You may obtain a copy of the FHIR license at	https://www.hl7.org/fhir/license.html." />
	<sourceUri value="[sourceValueSetURI]" />
	<targetUri value="[targetValueSetURI]" />
	<!--The group element is repeated for each separate source code system within the concept map.-->
	<group>
		<source value="[sourceCodeSystemURI]" />
		<target value="[targetCodeSystemURI]" />
		<element>
			<code value="[sourceCode]" />
			<display value="[sourcedisplay]" />
			<target>
				<code value="[targetCode]" />
				<display value="[targetdisplay]" />
				<equivalence value="[equivalence]" />
			</target>
		</element>
	</group>
</ConceptMap>

Example Concept Maps from the UK Core

ConceptMap between an HL7UK code system and a code system of SNOMED concepts

https://simplifier.net/HL7FHIRUKCoreR4/UKCore-ConditionEpisodicity-duplicate-2/~xml

Terminology Metadata Design

This section describes the approach taken for metadata relating to (Terminology assets, ValueSet, CodeSystem and ConceptMap resources) used within the UK Core.

Properties for ValueSets, CodeSystems and ConceptMaps

Filename format The physical filename format to be used for these assets is as below:

  • ValueSets: ValueSet-UKCore-[Name]
  • CodeSystems: CodeSystem-UKCore-[Name]
  • ConceptMaps: ConceptMap-UKCore-[Name]

url property The url format to be used for these assets is as below:

  • ValueSets: https://fhir.hl7.org.uk/ValueSet/UKCore-[Name]
  • CodeSystems: https://fhir.hl7.org.uk/CodeSystem/UKCore-[Name]
  • ConceptMaps: https://fhir.hl7.org.uk/ConceptMap/UKCore-[Name]

Common properties

  • id: UKCore-[Name]
  • name: UKCore[Name]
  • title: UK Core [Name] – remember to use spaces between words
  • status: draft – unless stated otherwise

The copyright, publisher and contact information to be used for ValueSets and ConceptMaps is as below:

  • copyright: Copyright © 2020 HL7 UK Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. HL7® FHIR® standard Copyright © 2011+ HL7 The HL7® FHIR® standard is used under the FHIR license. You may obtain a copy of the FHIR license at https://www.hl7.org/fhir/license.html.
  • publisher: HL7 UK
  • contact information:
    • name: HL7 UK
    • system: email
    • value: secretariat@hl7.org.uk
    • use: work
    • rank: 1
  • contact information:
    • name: NHS Digital
    • system: email
    • value: interoperabilityteam@nhs.net
    • use: work
    • rank: 2

By default, all CodeSystems will use the following copyright, publisher and contact information:

  • copyright: Copyright © 2020 NHS Digital
  • publisher: NHS Digital
  • contact information:
    • name: NHS Digital
    • system: email
    • value: interoperabilityteam@nhs.net
    • use – work

This may change if a different copyright owner, publisher and contact is identified in CodeSystem requirements.


Instance Example Design

This section details how examples are constructed, named and referenced in the UK Core.

Simplifier Constraints and Configuration

Instance examples in Simplifier need to be correctly named and constructed to avoid duplicates being generated or other conflicts occurring. This guidance overrides the default Simplifier behaviour and has been developed following consultation with the Simplifier development team.

Configuration of Simplifier

Simplifier creates metadata around an instance when imported from GitHub. This metadata needs a custom configuration to allow the examples to be correctly imported. The url for updating the metadata expressions is accessible via:

"https://simplifier.net/ukcore/$editmetadataexpressions" which requires Admin access to update or configure.

For each FHIR resource type the following three lines need adding in the editor pane.

  • ResourceName.Title: ('ResourceName example: ' + id)
  • ResourceName.Description: ('ResourceName example: ' + id)
  • ResourceName.UrlKey: id

For example for Patient resource the following should be added:

  • Patient.Title: ('Patient example: ' + id)
  • Patient.Description: ('Patient example: ' + id)
  • Patient.UrlKey: id

Naming and Construction of Examples of Resources

This section details how the examples of a resource or group of resources are done. Examples always take on the name of the "root" resource. The root of the example is the first tag name in an example. This must always be a resource name. Extension examples are handled slightly differently and are documented in a separate sub-section below.

Within Simplifier, there are four metadata elements:

Title

This is auto-generated as shown in the example below:

  • AllergyIntolerance example:UKCore-AllergyIntolerance-EnteredInError-Example

Description

This is auto-generated as shown in the example below:

  • AllergyIntolerance example:UKCore-AllergyIntolerance-EnteredInError-Example

URL

This is auto-generated as shown in the example below:

  • UKCore-AllergyIntolerance-EnteredInError-Example

Filename

The filename is taken from the filename of the example in GitHub. The filename in GitHub MUST be in the following format:

  • UKCore-"ResourceName"-"FurtherDescription"-Example.xml, here the "FurtherDescription" is enough information for a reader to to able to understand what the example is representing. This description must also be sufficient to make the example unique in the UK Core. For example:

  • UKCore-AllergyIntolerance-EnteredInError-Example.xml

Naming and Construction of Examples of Extensions

This section details how the examples of an extension are done. All extension examples are inserted into resource tags for the context for the extension. For example, an extension for Patient will have an opening Patient tag, then an id element present before the extension elements, then a closing Patient tag.

For example:

<Patient>

<id value="UKCore-Patient-Extension-EthnicCategory-Example" />

<extension>

...... extension elements

</extension>

</Patient>|

Within simplifier there are four Simplifier metadata elements which are shown below.

Title

This is auto-generated as shown in the example below:

  • Patient example:UKCore-Patient-Extension-EthnicCategory-Example

Description

This is auto-generated as shown in the example below:

  • Patient example:UKCore-Patient-Extension-EthnicCategory-Example

URL

This is auto-generated as shown in the example below:

  • UKCore-Patient-Extension-EthnicCategory-Example

Filename

The filename is taken from the filename of the extension example in GitHub. The filename in GitHub MUST be in the following format:

  • UKCore-"ResourceName"-Extension-"ExtensionName"-Example.xml For example:

  • UKCore-Patient-Extension-EthnicCategory-Example.xml

Important Note: the properties of examples MUST not be manually changed or updated in Simplifier

An illustration of the properties of an example is shown below for information.


back to top