HL7 FHIR® UK Core Design and Development Approach

Extension Design

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. Further information about extensibility is available.

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[x] element, which may have many datatypes associated with it. See Extension Element for more details.
  • Complex extensions: A complex extension has a single Extension.urlelement and a single Extension.extension element. The latter contains a nested structure and are used for one of two reason:
    • The extension has complex content, which is presented as a nested tree of values and defined locally within the extension.
    • The extension is extended with an additional extension defined separately.

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.

Each Extension SHALL have an associated example to describe its usage, and the example SHALL be added to the example tab within the relevant profile and the extension page.

Any binding in an Extension SHALL only be done to CodeableConcept value's - cvode and coding values SHALL NOT be used.

Referencing to resources SHOULD be to the base resource rather than a UK Core Profile, unless agreed.


Metadata Usage

Metadata Usage

The list below contains the element differences between the UKCore and HL7.

Base Resource Definitions

View further information about FHIR base resource definitions.

Element name Base Cardinality UK Core Cardinality Type Definition, Constraints and Notes
id 0..1 1..1 id In the UK Core the format in the following, with the FHIRAssetName and Specialism in PascalCase:

UKCore-[FHIRAssetName][Specialism].

StructureDefinition Content

View further information about FHIR Resource StructureDefinition - Content.

Element name Base Cardinality UK Core Cardinality Type Definition, Constraints and Notes
url 0..1 1..1 uri In the UK Core the format is the following, with the FHIRAssetName and Specialism in PascalCase:

https://fhir.hl7.org.uk/StructureDefinition/UKCore-[FHIRAssetName][Specialism].
identifier 0..* 0..0 Identifier identifier SHALL NOT be used within the UKCore
version 0..1 1..1 string This will follow the Semantic Versioning standard [major.minor.patch].
Further details about internal versioning for UK Core assets are available.
name 0..1 1..1 string In the UK Core the format is PascalCase:

UKCore[FHIRAssetName][Specialism] .
title 0..1 1..1 string In the UK Core the format is Proper Case:

UK Core [FHIRAssetName] [Specialism].
status 1..1 1..1 code See NamingSystem.status for more information.
date 0..1 1..1 dateTime Only the date, without time, is populated in the UK Core.
publisher 0..1 1..1 string For all UK Core Profiles, where the base URL is https://fhir.hl7.org.uk, the name of the publisher will be HL7 UK.
contact 0..* 1..* ContactDetail See Publisher, Contact & Copyright for details of how this SHALL be populated for all UK Core Profiles, where the base URL is https://fhir.hl7.org.uk/.
description 0..1 1..1 markdown This SHALL be in the following format:

This profile defines the UK constraints and extensions on the International FHIR resource [FHIRAssetName]([link to HL7 Resource]).
copyright 0..1 1..1 markdown All UK Core Profiles SHALL contain the the copyright as listed in Publisher, Contact & Copyright
fhirVersion 0..1 1..1 code The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor].

The UKCore mandates the use of this element.
purpose 0..1 1..1 markdown This provides traceability of ''why'' the resource is either needed or ''why'' it is defined as it is. This SHOULD contain the correct usage of the profile, for instance when it is similar to another profile examples of the expected use cases and examples which would be a misuse of the profile. The purpose is not to record the scope if these are subject to change, these SHALL be entered into the IG 'example use cases' section instead.
baseDefinition 0..1 1..1 canonical(StructureDefinition) The baseDefinition SHALL be a complete URI referencing the relevant HL7 FHIR resource for UK Core base profiles, and the relevant UK Core base profile for any UK Core derived profiles.
snapshot 0..1 1..1 BackboneElement Snapshots SHALL be present within the UK Core package and only rendered when creation of the package. Snapshots SHALL NOT be present within the UKCore GitHub Repo.
differential
.element
1..* 1..* ElementDefinition When used for extensions, the element ID SHALL be [Profile].extension:[Extension name without the ExtensionUKCore prefix, in camelCase]. E.g, for ExtensionUKCoreBirthSex this will be Patient.extension:birthSex
differential
.element
.sliceName
0..1 0..1 string When used for extensions, the element ID SHALL be [Extension name without the ExtensionUKCore prefix, in camelCase]. E.g, for ExtensionUKCoreBirthSex this will be birthSex
differential
.element
.defaultValue[x]
0..1 0..0 * Defining default values creates many difficulties in implementation (e.g. when is a value missing?). For these reasons, default values SHALL NOT be used within the UKCore.



The Extension Root Element

Extensions are optional within the UK Core (minimum cardinality of 0), but certain use cases may mandate their use. Currently, 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.

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 SHALL be bound to a ValueSet.

Further information about FHIR datatypes is available.

Cardinality of a value[x] element

Simple extension - The UK Core mandates the use of Extension.value[x] for a simple extension, that is, a cardinality of 1..1.

Complex extension - The UK Core mandates the use of Extension.extension:[Element].value[x] for a complex extension, that is, a cardinality of 1..1.


Extension Examples

Simple Extension Illustration

Snapshot View

id0..1string
extensionI0..*Extension
url1..1uriFixed Value
valueCodeableConceptCodeableConcept

Differential View

id0..1string
extensionI0..*Extension
url1..1uriFixed Value
valueCodeableConceptCodeableConcept

Hybrid View

id0..1string
extensionI0..*Extension
url1..1uriFixed Value
valueCodeableConceptCodeableConcept

Table View

Extension..
Extension.url..
Extension.value[x]CodeableConcept1..

XML View

<StructureDefinition xmlns="http://hl7.org/fhir">
    <id value="Extension-UKCore-EthnicCategory" />
    <url value="https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory" />
    <version value="2.3.0" />
    <name value="ExtensionUKCoreEthnicCategory" />
    <title value="Extension UK Core Ethnic Category" />
    <status value="active" />
    <date value="2023-12-12" />
    <publisher value="HL7 UK" />
    <contact>
        <name value="HL7 UK" />
        <telecom>
            <system value="email" />
            <value value="ukcore@hl7.org.uk" />
            <use value="work" />
            <rank value="1" />
        </telecom>
    </contact>
    <description value="Information that describes the patient&#39;s ethnic category." />
    <purpose value="This extension extends the Patient resource to support the exchange of ethnic category information, as a Codeable Concept." />
    <copyright value="Copyright &#169; 2021+ 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." />
    <fhirVersion value="4.0.1" />
    <mapping>
        <identity value="rim" />
        <uri value="http://hl7.org/v3" />
        <name value="RIM Mapping" />
    </mapping>
    <kind value="complex-type" />
    <abstract value="false" />
    <context>
        <type value="element" />
        <expression value="Patient" />
    </context>
    <type value="Extension" />
    <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Extension" />
    <derivation value="constraint" />
    <differential>
        <element id="Extension">
            <path value="Extension" />
            <short value="Ethnic category" />
            <definition value="The ethnicity of the subject." />
        </element>
        <element id="Extension.url">
            <path value="Extension.url" />
            <fixedUri value="https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory" />
        </element>
        <element id="Extension.value[x]">
            <path value="Extension.value[x]" />
            <short value="A code classifying the person&#39;s ethnicity" />
            <definition value="A code classifying the person&#39;s ethnicity." />
            <min value="1" />
            <type>
                <code value="CodeableConcept" />
            </type>
            <binding>
                <strength value="extensible" />
                <description value="A set of codes that define the ethnicity of a person, as specified by the person." />
                <valueSet value="https://fhir.hl7.org.uk/ValueSet/UKCore-EthnicCategory" />
            </binding>
        </element>
    </differential>
</StructureDefinition>

JSON View

{
    "resourceType": "StructureDefinition",
    "id": "Extension-UKCore-EthnicCategory",
    "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory",
    "version": "2.3.0",
    "name": "ExtensionUKCoreEthnicCategory",
    "title": "Extension UK Core Ethnic Category",
    "status": "active",
    "date": "2023-12-12",
    "publisher": "HL7 UK",
    "contact":  [
        {
            "name": "HL7 UK",
            "telecom":  [
                {
                    "system": "email",
                    "value": "ukcore@hl7.org.uk",
                    "use": "work",
                    "rank": 1
                }
            ]
        }
    ],
    "description": "Information that describes the patient's ethnic category.",
    "purpose": "This extension extends the Patient resource to support the exchange of ethnic category information, as a Codeable Concept.",
    "copyright": "Copyright © 2021+ 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.",
    "fhirVersion": "4.0.1",
    "mapping":  [
        {
            "identity": "rim",
            "uri": "http://hl7.org/v3",
            "name": "RIM Mapping"
        }
    ],
    "kind": "complex-type",
    "abstract": false,
    "context":  [
        {
            "type": "element",
            "expression": "Patient"
        }
    ],
    "type": "Extension",
    "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Extension",
    "derivation": "constraint",
    "differential": {
        "element":  [
            {
                "id": "Extension",
                "path": "Extension",
                "short": "Ethnic category",
                "definition": "The ethnicity of the subject."
            },
            {
                "id": "Extension.url",
                "path": "Extension.url",
                "fixedUri": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory"
            },
            {
                "id": "Extension.value[x]",
                "path": "Extension.value[x]",
                "short": "A code classifying the person's ethnicity",
                "definition": "A code classifying the person's ethnicity.",
                "min": 1,
                "type":  [
                    {
                        "code": "CodeableConcept"
                    }
                ],
                "binding": {
                    "strength": "extensible",
                    "description": "A set of codes that define the ethnicity of a person, as specified by the person.",
                    "valueSet": "https://fhir.hl7.org.uk/ValueSet/UKCore-EthnicCategory"
                }
            }
        ]
    }
}

Complex Extension Illustration

Snapshot View

id0..1string
id0..1string
extensionI0..*Extension
url1..1uriFixed Value
valueCodeableConceptCodeableConcept
id0..1string
extensionI0..*Extension
url1..1uriFixed Value
valueDateTimedateTime
url1..1uriFixed Value

Differential View

id0..1string
id0..1string
extensionI0..*Extension
url1..1uriFixed Value
valueCodeableConceptCodeableConcept
id0..1string
extensionI0..*Extension
url1..1uriFixed Value
valueDateTimedateTime
url1..1uriFixed Value

Hybrid View

id0..1string
id0..1string
extensionI0..*Extension
url1..1uriFixed Value
valueCodeableConceptCodeableConcept
id0..1string
extensionI0..*Extension
url1..1uriFixed Value
valueDateTimedateTime
url1..1uriFixed Value

Table View

Extension..1
Extension.extension1..
Extension.extension1..1
Extension.extension.url..
Extension.extension.value[x]CodeableConcept1..
Extension.extension..1
Extension.extension.url..
Extension.extension.value[x]dateTime1..
Extension.url..
Extension.value[x]..0

XML View

<StructureDefinition xmlns="http://hl7.org/fhir">
    <id value="Extension-UKCore-DeathNotificationStatus" />
    <url value="https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeathNotificationStatus" />
    <version value="2.2.0" />
    <name value="ExtensionUKCoreDeathNotificationStatus" />
    <title value="Extension UK Core Death Notification Status" />
    <status value="active" />
    <date value="2023-12-07" />
    <publisher value="HL7 UK" />
    <contact>
        <name value="HL7 UK" />
        <telecom>
            <system value="email" />
            <value value="ukcore@hl7.org.uk" />
            <use value="work" />
            <rank value="1" />
        </telecom>
    </contact>
    <description value="The patient&#39;s death notification status." />
    <purpose value="This extension extends the Patient resource to support the exchange of the patient&#39;s death notification status." />
    <copyright value="Copyright &#169; 2021+ 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." />
    <fhirVersion value="4.0.1" />
    <mapping>
        <identity value="rim" />
        <uri value="http://hl7.org/v3" />
        <name value="RIM Mapping" />
    </mapping>
    <kind value="complex-type" />
    <abstract value="false" />
    <context>
        <type value="element" />
        <expression value="Patient" />
    </context>
    <type value="Extension" />
    <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Extension" />
    <derivation value="constraint" />
    <differential>
        <element id="Extension">
            <path value="Extension" />
            <short value="The patient&#39;s death notification status." />
            <definition value="The patient&#39;s death notification status." />
            <max value="1" />
        </element>
        <element id="Extension.extension">
            <path value="Extension.extension" />
            <min value="1" />
        </element>
        <element id="Extension.extension:deathNotificationStatus">
            <path value="Extension.extension" />
            <sliceName value="deathNotificationStatus" />
            <short value="The patient&#39;s death notification status." />
            <definition value="The patient&#39;s death notification status." />
            <min value="1" />
            <max value="1" />
        </element>
        <element id="Extension.extension:deathNotificationStatus.url">
            <path value="Extension.extension.url" />
            <fixedUri value="deathNotificationStatus" />
        </element>
        <element id="Extension.extension:deathNotificationStatus.value[x]">
            <path value="Extension.extension.value[x]" />
            <short value="The patient&#39;s death notification status." />
            <definition value="The patient&#39;s death notification status." />
            <min value="1" />
            <type>
                <code value="CodeableConcept" />
            </type>
            <binding>
                <strength value="extensible" />
                <valueSet value="https://fhir.hl7.org.uk/ValueSet/UKCore-DeathNotificationStatus" />
            </binding>
        </element>
        <element id="Extension.extension:systemEffectiveDate">
            <path value="Extension.extension" />
            <sliceName value="systemEffectiveDate" />
            <short value="System effective date for patient&#39;s death notification status." />
            <definition value="System effective date for patient&#39;s death notification status." />
            <max value="1" />
        </element>
        <element id="Extension.extension:systemEffectiveDate.url">
            <path value="Extension.extension.url" />
            <fixedUri value="systemEffectiveDate" />
        </element>
        <element id="Extension.extension:systemEffectiveDate.value[x]">
            <path value="Extension.extension.value[x]" />
            <short value="System effective date for patient&#39;s death notification status." />
            <definition value="System effective date for patient&#39;s death notification status." />
            <min value="1" />
            <type>
                <code value="dateTime" />
            </type>
        </element>
        <element id="Extension.url">
            <path value="Extension.url" />
            <fixedUri value="https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeathNotificationStatus" />
        </element>
        <element id="Extension.value[x]">
            <path value="Extension.value[x]" />
            <max value="0" />
        </element>
    </differential>
</StructureDefinition>

JSON View

{
    "resourceType": "StructureDefinition",
    "id": "Extension-UKCore-DeathNotificationStatus",
    "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeathNotificationStatus",
    "version": "2.2.0",
    "name": "ExtensionUKCoreDeathNotificationStatus",
    "title": "Extension UK Core Death Notification Status",
    "status": "active",
    "date": "2023-12-07",
    "publisher": "HL7 UK",
    "contact":  [
        {
            "name": "HL7 UK",
            "telecom":  [
                {
                    "system": "email",
                    "value": "ukcore@hl7.org.uk",
                    "use": "work",
                    "rank": 1
                }
            ]
        }
    ],
    "description": "The patient's death notification status.",
    "purpose": "This extension extends the Patient resource to support the exchange of the patient's death notification status.",
    "copyright": "Copyright © 2021+ 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.",
    "fhirVersion": "4.0.1",
    "mapping":  [
        {
            "identity": "rim",
            "uri": "http://hl7.org/v3",
            "name": "RIM Mapping"
        }
    ],
    "kind": "complex-type",
    "abstract": false,
    "context":  [
        {
            "type": "element",
            "expression": "Patient"
        }
    ],
    "type": "Extension",
    "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Extension",
    "derivation": "constraint",
    "differential": {
        "element":  [
            {
                "id": "Extension",
                "path": "Extension",
                "short": "The patient's death notification status.",
                "definition": "The patient's death notification status.",
                "max": "1"
            },
            {
                "id": "Extension.extension",
                "path": "Extension.extension",
                "min": 1
            },
            {
                "id": "Extension.extension:deathNotificationStatus",
                "path": "Extension.extension",
                "sliceName": "deathNotificationStatus",
                "short": "The patient's death notification status.",
                "definition": "The patient's death notification status.",
                "min": 1,
                "max": "1"
            },
            {
                "id": "Extension.extension:deathNotificationStatus.url",
                "path": "Extension.extension.url",
                "fixedUri": "deathNotificationStatus"
            },
            {
                "id": "Extension.extension:deathNotificationStatus.value[x]",
                "path": "Extension.extension.value[x]",
                "short": "The patient's death notification status.",
                "definition": "The patient's death notification status.",
                "min": 1,
                "type":  [
                    {
                        "code": "CodeableConcept"
                    }
                ],
                "binding": {
                    "strength": "extensible",
                    "valueSet": "https://fhir.hl7.org.uk/ValueSet/UKCore-DeathNotificationStatus"
                }
            },
            {
                "id": "Extension.extension:systemEffectiveDate",
                "path": "Extension.extension",
                "sliceName": "systemEffectiveDate",
                "short": "System effective date for patient's death notification status.",
                "definition": "System effective date for patient's death notification status.",
                "max": "1"
            },
            {
                "id": "Extension.extension:systemEffectiveDate.url",
                "path": "Extension.extension.url",
                "fixedUri": "systemEffectiveDate"
            },
            {
                "id": "Extension.extension:systemEffectiveDate.value[x]",
                "path": "Extension.extension.value[x]",
                "short": "System effective date for patient's death notification status.",
                "definition": "System effective date for patient's death notification status.",
                "min": 1,
                "type":  [
                    {
                        "code": "dateTime"
                    }
                ]
            },
            {
                "id": "Extension.url",
                "path": "Extension.url",
                "fixedUri": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeathNotificationStatus"
            },
            {
                "id": "Extension.value[x]",
                "path": "Extension.value[x]",
                "max": "0"
            }
        ]
    }
}

back to top