Naming Conventions

Naming conventions are applicable to FHIR conformance resources published as part of this Implementation guide. The approach taken is covered by the sections below:

  • Standard Resource Definitions: This section covers the standardised approach used for the key “identity” metadata such as filenames, id and name elements, and their consistent application across different resource types. It covers tailoring and examples for its application to Profile, Extension, Message Definition, Code System and Value Set.​
  • Additional Conventions: These conventions supplement the standard, and apply to specific asset types beyond those addressed in the first section. They cover the following: Concept Map, Naming System, External Terminology, Example, Element (including slice, extension and backport) and Message Event.​
  • Character Restrictions: This section considers the implications of character limits and other restrictions on filepath and id. It offers guidelines for complying with the constraints.​
  • Glossary: Defines the naming components that contribute to name construction as described on this page.

Standard Resource Definitions

See the Glossary section below for definitions of the components used throughout the naming standards.

The naming conventions for resource definitions in the Wales FHIR Implementation Guide are drawn up to be consistent across resource types. The foundation of the naming convention is the filename, which is transformed to provide the related elements in the resource definition and the page filename. In order to closely follow existing practice in UK and international implementation guides, there is some conditional treatment of the discriminator component.

Element Construction Transformation rules
Asset filename [Discriminator]-DataStandardsWales-[BusinessName].xml None.
Page filename {[Discriminator]-}DataStandardsWales-[BusinessName].page.md Same as xml asset filename, but discriminator omitted if it is “Profile”.
id {[Discriminator]-}DataStandardsWales-[BusinessName] Same as filename, but discriminator omitted if it is “Profile”, or if it is the same as the HL7 level 2 resource type as in “CodeSystem”.
name {[Discriminator]}DataStandardsWales[BusinessName] Based on id, with all hyphens removed.
title {[Discriminator]} Data Standards Wales [Business Name] Based on id, with spaces between all words.
url [baseUrl]/[L2ResourceType]/[id] The id is referenced without amendment.
reference [L2ResourceType]/[id] The resource definition can be uniquely referenced within the implementation guide omitting the base url.

The specific application of this standard approach to resource definitions for each asset type is elaborated, with examples, in the tabs below. In each case Discriminator and BusinessName are specialised as applicable to the asset type.​

The conventions for asset types that diverge from this approach are described in the Additional Conventions section below.

Filename structure: Profile-DataStandardsWales-[L3L4ResourceType]{-[Qualifier]}{-[Qualifier]}​
id structure: DataStandardsWales-[L3L4ResourceType]{-[Qualifier]}{-[Qualifier]}​
​ Note that in line with UK and international practice the “Profile” discriminator is omitted from id and name and from uses derived from those elements. It is also omitted from the page filename in the implementation guide.​

​ Worked example 1 (profile)​
A profile to apply Wales-specific standards to the UKCore-Observation profile. The optional qualifier component is not applicable in this case.

Asset filename Profile-DataStandardsWales-Observation.xml
Page filename DataStandardsWales-Observation.page.md
id DataStandardsWales-Observation
name DataStandardsWalesObservation
title Data Standards Wales Observation
url https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Observation
reference StructureDefinition/DataStandardsWales-Observation

Worked example 2 (sub-profile)​
A profile to specialise the DataStandardsWales-Observation profile for the capture of vital signs observations.

Asset filename Profile-DataStandardsWales-Observation-VitalSigns.xml
Page filename DataStandardsWales-Observation-VitalSigns.page.md
id DataStandardsWales-Observation-VitalSigns
name DataStandardsWalesObservationVitalSigns
title Data Standards Wales Observation Vital Signs
url https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Observation-VitalSigns
reference StructureDefinition/DataStandardsWales-Observation-VitalSigns

Worked example 3 (sub-profile)​
A profile to specialise the DataStandardsWales-Observation-VitalSigns profile for the capture of BMI.

Asset filename Profile-DataStandardsWales-Observation-VitalSigns-BMI.xml
Page filename DataStandardsWales-Observation-VitalSigns-BMI.page.md
id DataStandardsWales-Observation-VitalSigns-BMI
name DataStandardsWalesObservationVitalSignsBMI
title Data Standards Wales Observation Vital Signs BMI
url https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Observation-VitalSigns-BMI
reference StructureDefinition/DataStandardsWales-Observation-VitalSigns-BMI

Filename structure: Extension-DataStandardsWales-[Descriptor]
id structure: Extension-DataStandardsWales-[Descriptor]

​ Worked example​
An extension to capture the digital status of a document in the DocumentReference resource.

Asset filename Extension-DataStandardsWales-DocumentDigitalStatus.xml
Page filename Extension-DataStandardsWales-DocumentDigitalStatus.page.md
id Extension-DataStandardsWales-DocumentDigitalStatus
name ExtensionDataStandardsWalesDocumentDigitalStatus
title Extension Data Standards Wales Document Digital Status
url https://fhir.nhs.wales/StructureDefinition/Extension-DataStandardsWales-DocumentDigitalStatus
reference StructureDefinition/Extension-DataStandardsWales-DocumentDigitalStatus

Filename structure: MessageDefinition-DataStandardsWales-[MessageEvent]{-[Qualifier]}
id structure: DataStandardsWales-[MessageEvent]{-[Qualifier]}
Note that typically each message event would have one corresponding message definition. However, the FHIR standard does allow for multiple MessageDefinition resources with the same message event code. In this case a qualifier should be used.​

​ Worked example​
A message definition to submit a care document to a FHIR repository. The event code quoted will have been defined as part of a code system that is included in the bound DataStandardsWales-MessageEvent value set.

event.code care-document-submit
Asset filename MessageDefinition-DataStandardsWales-CareDocumentSubmit.xml
Page filename MessageDefinition-DataStandardsWales-CareDocumentSubmit.page.md
id DataStandardsWales-CareDocumentSubmit
name DataStandardsWalesCareDocumentSubmit
title Data Standards Wales Care Document Submit
url https://fhir.nhs.wales/MessageDefinition/DataStandardsWales-CareDocumentSubmit
reference MessageDefinition/DataStandardsWales-CareDocumentSubmit

Filename structure: CodeSystem-DataStandardsWales-[Descriptor]
id structure: DataStandardsWales-[Descriptor]
Note that in line with UK and international practice the “CodeSystem” discriminator is omitted from id and name and from uses derived from those elements.​

​ Worked example​
A code system to define a set of concepts that describe the digital status of a document in the DocumentReference resource.

Asset filename CodeSystem-DataStandardsWales-DocumentDigitalStatus.xml
Page filename CodeSystem-DataStandardsWales-DocumentDigitalStatus.page.md
id DataStandardsWales-DocumentDigitalStatus
name DataStandardsWalesDocumentDigitalStatus
title Data Standards Wales Document Digital Status
url https://fhir.nhs.wales/CodeSystem/DataStandardsWales-DocumentDigitalStatus
reference CodeSystem/DataStandardsWales-DocumentDigitalStatus

Filename structure: ValueSet-DataStandardsWales-[Descriptor]
id structure: DataStandardsWales-[Descriptor]
Note that in line with UK and international practice the “ValueSet” discriminator is omitted from id and name and from uses derived from those elements.​

​ Worked example​
A value set to specify the code systems that can be used to describe the digital status of a document in the DocumentReference resource.

Asset filename ValueSet-DataStandardsWales-DocumentDigitalStatus.xml
Page filename ValueSet-DataStandardsWales-DocumentDigitalStatus.page.md
id DataStandardsWales-DocumentDigitalStatus
name DataStandardsWalesDocumentDigitalStatus
title Data Standards Wales Document Digital Status
url https://fhir.nhs.wales/ValueSet/DataStandardsWales-DocumentDigitalStatus
reference ValueSet/DataStandardsWales-DocumentDigitalStatus

Additional Conventions

See the Glossary section below for definitions of the components used throughout the naming standards.

The conventions in the tabs below supplement the standard conventions described above. Resource definitions in the Wales FHIR Implementation Guide are drawn up to be consistent across resource types as far as possible, but with pragmatic allowance for special circumstances.

Filename structure: ConceptMap-DataStandardsWales-[SourceDescriptor]-[TargetDescriptor]
id structure: DataStandardsWales-[SourceDescriptor]-[TargetDescriptor]

For concept maps, both the name and title are adapted for clarity of meaning
name structure: DataStandardsWalesConceptMap[SourceDescriptor]To[TargetDescriptor]
title structure: Data Standards Wales Concept Map from [Source Descriptor] to [Target Descriptor]

​ Worked example​
A concept map to specify mapping of Data Standards Wales Sex codes to UK Core Birth Sex codes.

Asset filename ConceptMap-DataStandardsWales-Sex-UKCoreBirthSex.xml
Page filename ConceptMap-DataStandardsWales-Sex-UKCoreBirthSex.page.md
id DataStandardsWales-Sex-UKCoreBirthSex
name DataStandardsWalesConceptMapSexToUKCoreBirthSex
title Data Standards Wales Concept Map from Sex to UK Core Birth Sex
url https://fhir.nhs.wales/ConceptMap/DataStandardsWales-Sex-UKCoreBirthSex
reference ConceptMap/DataStandardsWales-Sex-UKCoreBirthSex

Filename structure: NamingSystem-{[Organisation]}-{[System]}-[descriptor]
id structure: DataStandardsWales-{[Organisation]}-{[System]}-[Descriptor]
name structure: {[Organisation]}{[System]}[Descriptor]
uniqueId value structure:https://fhir.[ownerdomain]/Id/[Descriptor]

The formal convention is for Descriptor to be consistent between id, name and uniqueId, but the influence of external owners means this is not always the case. There is variability by owning system and organisation, as illustrated by the examples below.​

​ Worked example 1 - All Wales identifiers​
WRTS organization identifiers

Asset filename NamingSystem-WRTS-organization-identifier.xml
id DataStandardsWales-WRTS-OrganizationIdentifier
name WRTSOrganizationIdentifier
uniqueId https://fhir.nhs.wales/Id/wrts-organization-identifier

LIMS TCLe report identifiers

Asset filename NamingSystem-LIMS-TCLe-report-identifier.xml
id NHSWales-LIMS-TCLe-Report-Code
name TCLeReportCodeIdentifier
uniqueId https://fhir.nhs.wales/Id/lims-tcle-report-code

Worked example 2 - Identifiers issued by local PAS​
PAS Practitioner Identifier (CAVUHB)

Asset filename NamingSystem-CAVUHB-pas-practitioner-identifier.xml
id DataStandardsWales-CAVUHB-PAS-PractitionerIdentifier
name CAVUHBPASPractitionerIdentifier
uniqueId https://fhir.cavuhb.nhs.wales/Id/pas-practitioner-identifier

PAS Location Identifier (BCUHB)

Asset filename NamingSystem-BCUHB-pas-location-identifier.xml
id DataStandardsWales-BCUHB-PAS-LocationIdentifier
name BCUHBPASLocationIdentifier
uniqueId https://fhir.bcuhb.nhs.wales/Id/pas-location-identifier

Filename structure: Differentiator-[Owner][Descriptor]
id structure: [Owner][Descriptor]

​ Worked example​
A code system owned by the WPAS system classifiying source of admission.

Asset filename CodeSystem-WPASSourceAdmission.xml
Page filename CodeSystem-WPASSourceAdmission.page.md
id WPASSourceAdmission
name WPASSourceAdmission
title WPAS Source Admission
url https://fhir.nhs.wales/CodeSystem/WPASSourceAdmission
reference CodeSystem/WPASSourceAdmission

Filename structure: [Example]-DataStandardsWales-[L3L4ResourceType]-[Descriptor]{-[Qualifier]}
id structure: [Example]-DataStandardsWales-[L3L4ResourceType]-[Descriptor]{-[Qualifier]}
reduced length id*: [Example]-DSW-[L3L4ResourceType]-[Descriptor]{-[Qualifier]}

*See the Character Restrictions section

​ Worked example 1​
An example Organization resource for Neath Port Talbot Hospital.

Asset filename Example-DataStandardsWales-Organization-NPT.xml
Page filename Example-DataStandardsWales-Organization-NPT.page.md
id Example-DataStandardsWales-Organization-NPT
reference Organization/Example-DataStandardsWales-Organization-NPT

Worked example 2​
An example MedicationStatement resource for Bendroflumethiazide issued at the point of discharge.

Asset filename Example-DataStandardsWales-MedicationStatement-Bendroflumethiazide-Discharge.xml
Page filename Example-DataStandardsWales-MedicationStatement-Bendroflumethiazide-Discharge.page.md
id Example-DSW-MedicationStatement-Bendroflumethiazide-Discharge
reference MedicationStatement/Example-DSW-MedicationStatement-Bendroflumethiazide-Discharge

The fields within a profile that store information are called elements. Any core element name is unchangeable and is dictated by HL7 and UK Core depending on who created the element. We can however create our own elements as extensions and slices. In all cases elements use the lowerCamelCase naming convention. e.g. DocumentReference.extension:digitalStatus

In the special case where a backport extension is used from a later FHIR release, the slice name for the extension is suffixed by the release number e.g. DocumentReference.extension:versionR5​

The following naming convention applies to the message event code as used by MessageDefinition.eventCoding and MessageHeader.eventCoding.

The event code should be lower case and follow the kebab-case naming convention e.g.

✅ patient-admission-submit  
❌ patientAdmission-submit  
❌ PatientAdmissionSubmit  

Event codes should be short and descriptive in the form [primary-content]-[qualifier]-[verb]

  • primary-content → a high level description of the content in plain English and hyphenated (e.g. care-document, allergy-list, clinician)
  • qualifier → optional detail (e.g. initial, amendment, discharge, lab)
  • verb → action. Common verbs:
    • -submit: request to update if found, else create new.
    • -notify: informational event (server processes but does not persist resources).
    • -cancel: request to revoke/withdraw a prior submission.
    • -update: explicit update only (do not create if missing).
Avoid acronyms or local system jargon in the event code. Use standard healthcare terms wherever possible.

Examples WITHOUT qualifiers

  • observation-submit
  • allergy-list-update
  • lab-result-notify

Examples WITH qualifiers

  • observation-lab-submit
  • observation-vitalsigns-update

Representation in event coding element:

"eventCoding": { 
"system": "https://fhir.nhs.wales/CodeSystem/DataStandardsWales-MessageEvent", 
"code": "care-document-submit",
"display": "Care Document Submit"
} 


Character Restrictions

Some filenames may become very long depending on the information they are trying to convey. Example filenames tend to be more affected by this. Asset identifiers generally inherit these names and may become invalid if they are over 64 characters, are not alpha numeric, or contain disallowed special characters.

File paths over 260 characters for certain windows systems will also cause problems due to operating system limits. Consequently, the filename and identifiers may have to diverge.

When creating content, we should be mindful of these restrictions and apply the following guidance:

  • Do not nest folders beyond a reasonable amount
  • Ensure nested folder names use minimal characters
  • Keep full file paths well below 260 characters
  • Try to keep the filename to the lowest number of characters while maintaining context
  • Only alphanumeric characters and hyphens should be used in identifiers
  • Only alphanumeric characters, hyphens and periods should be used in filenames, with the use of periods restricted to identification of the file type (.xml, .page.md)
  • The filename may be longer and provide more context than the identifier.
  • If the name/identifier can be conveyed in under 64 characters, do not use any abbreviation
  • If the name/identifier would be over 64 characters, then:
    • Use NHS Wales standard abbreviations where possible (e.g. ABUHB or PAS)
    • Abbreviate DataStandardsWales to DSW to maintain context in the full name
    • Abbreviate some of the terms in the end of the file using standard abbreviations wherever possible (e.g. full blood count becomes FBC)

If this does not resolve the issue, the name/identifier should be reconsidered.

Glossary

Component Definition
baseUrl A fixed value of https://fhir.nhs.wales applies to all resource definitions in the Wales FHIR Implementation Guide.
BusinessName The business name of the resource. Constructed according to rules specific to the resource type. UpperCamelCase used for each contributing element.
DataStandardsWales This fixed value indicates that this is a Wales-wide standard, equally applicable to exchange or storage of FHIR data in any system in Wales.
Descriptor A simple descriptor for the subject of the resource definition. For CodeSystem and ValueSet, where applicable, this shall reflect the name given to the data set as published in the relevant Data Standards Change Notice (DSCN). For ConceptMap resources, this shall reflect the name given to the value set that is being mapped to or from.
Discriminator This is used to distinguish one FHIR asset type from another. It is typically the Level 2 HL7 resource type such as CodeSystem, but it is also used to distinguish Profile from Extension as both are instances of the StructureDefinition resource type.
L2ResourceType The Level 2 FHIR resource type. The resource definitions covered by this section are of the following types: StructureDefinition, MessageDefinition, CodeSystem and ValueSet. ConceptMap and NamingSystem definitions are covered separately in the “Additional naming conventions” section below.
L3L4ResourceType The Level 3 or Level 4 resource type e.g.‘Patient’, ‘Organization’, ‘Observation’, ‘Medication’.
MessageEvent The code for the message event, converted from kebab-case to UpperCamelCase.
Organization A recognised abbreviation for the organisation that owns the namespace.
Owner A recognised abbreviation for the system or organisation that owns the terminology asset.
Qualifier Used as an additional descriptor when existing resources are specialised for a specific use case.
System A recognised abbreviation for the system that owns the namespace.
.xml Resources are defined using xml to ensure that the correct element order is made explicit for resource instances created using xml. The json equivalent is published via conversion from xml in the implementation guide.