Examples help clarify the complexities of FHIR for the reader. For this reason, UKCore SHALL have at least one example for every Resource and Extension. Snippets of code may also be needed to convey certain information on specific elements which may be general to may Resources, or creating a full Resource would complicate the example. This section details how examples are constructed, named and referenced in the UK Core.
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.
When creating examples the filename SHALL adhere to the following convention:
Where the [FurtherDescription] is enough information for a reader to to able to understand what the example is representing. This description SHALL also be sufficient to make the example unique in the UK Core.
Each example SHOULD have the minimum amount of information necessary to convey the intended message whilst ensuring it is still a valid resource or extension. If there any agreed Clinical scenario(s), then these SHALL be represented examples.
Each Resource example SHALL include the following, along with any mandatory elements and any elements listed with the Profiles Minimum Viable Content (MVC) within the Implementation Guide:
<[Resource] xmlns="http://hl7.org/fhir"> <id value="[ResourceExampleName]" /> [Elements to convey resource example & any other elements to create a valid example] </[Resource]>
Each Extension Example SHALL have the following, along with any mandatory elements:
<[Resource] xmlns="http://hl7.org/fhir"> <id value="[ExtensionExampleName]" /> <extension url="[ExtensionUrl]"> [Elements to convey Extension example & any other elements to create a valid example] </[Resource]>
Each Snippet example SHALL have the following, along with any mandatory elements and comments describing the information:
<[Resource] xmlns="http://hl7.org/fhir"> <id value="[SnippetExampleName]" /> <!-- **************Snippet start************** --> [Elements to convey the snippet information] <!-- **************Snippet end************** --> [Necessary elements to create a valid snippet example] </[Resource]>
The Resource.meta
element SHALL NOT be used for Examples.
Patient.id[0] | UKCore-Patient-RichardSmith-Example |
Patient.extension[0].url[0] | https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory |
Patient.extension[0].value[0].coding[0].system[0] | https://fhir.hl7.org.uk/CodeSystem/UKCore-EthnicCategoryEngland |
Patient.extension[0].value[0].coding[0].code[0] | G |
Patient.extension[0].value[0].coding[0].display[0] | Mixed - Any other mixed background |
Patient.extension[1].extension[0].url[0] | PreferredContactMethod |
Patient.extension[1].extension[0].value[0].coding[0].system[0] | https://fhir.hl7.org.uk/CodeSystem/UKCore-PreferredContactMethod |
Patient.extension[1].extension[0].value[0].coding[0].code[0] | 3 |
Patient.extension[1].extension[0].value[0].coding[0].display[0] | Telephone |
Patient.extension[1].extension[1].url[0] | PreferredContactTimes |
Patient.extension[1].extension[1].value[0].repeat[0].frequency[0] | 1 |
Patient.extension[1].extension[1].value[0].repeat[0].period[0] | 1 |
Patient.extension[1].extension[1].value[0].repeat[0].periodUnit[0] | d |
Patient.extension[1].extension[1].value[0].repeat[0].dayOfWeek[0] | mon |
Patient.extension[1].extension[1].value[0].repeat[0].dayOfWeek[1] | wed |
Patient.extension[1].extension[1].value[0].repeat[0].dayOfWeek[2] | fri |
Patient.extension[1].extension[1].value[0].repeat[0].when[0] | MORN |
Patient.extension[1].extension[2].url[0] | PreferredWrittenCommunicationFormat |
Patient.extension[1].extension[2].value[0].coding[0].system[0] | https://fhir.hl7.org.uk/CodeSystem/UKCore-PreferredWrittenCommunicationFormat |
Patient.extension[1].extension[2].value[0].coding[0].code[0] | 11 |
Patient.extension[1].extension[2].value[0].coding[0].display[0] | Large print |
Patient.extension[1].url[0] | https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactPreference |
Patient.extension[2].extension[0].url[0] | deathNotificationStatus |
Patient.extension[2].extension[0].value[0].coding[0].system[0] | https://fhir.hl7.org.uk/CodeSystem/UKCore-DeathNotificationStatus |
Patient.extension[2].extension[0].value[0].coding[0].code[0] | U |
Patient.extension[2].extension[0].value[0].coding[0].display[0] | Removed |
Patient.extension[2].extension[1].url[0] | systemEffectiveDate |
Patient.extension[2].extension[1].value[0] | 2019-08-01T00:00:00.000Z |
Patient.extension[2].url[0] | https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeathNotificationStatus |
Patient.extension[3].url[0] | https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ResidentialStatus |
Patient.extension[3].value[0].coding[0].system[0] | https://fhir.hl7.org.uk/CodeSystem/UKCore-ResidentialStatus |
Patient.extension[3].value[0].coding[0].code[0] | H |
Patient.extension[3].value[0].coding[0].display[0] | UK Resident |
Patient.identifier[0].extension[0].url[0] | https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus |
Patient.identifier[0].extension[0].value[0].coding[0].system[0] | https://fhir.hl7.org.uk/CodeSystem/UKCore-NHSNumberVerificationStatusEngland |
Patient.identifier[0].extension[0].value[0].coding[0].code[0] | 01 |
Patient.identifier[0].extension[0].value[0].coding[0].display[0] | Number present and verified |
Patient.identifier[0].system[0] | https://fhir.nhs.uk/Id/nhs-number |
Patient.identifier[0].value[0] | 9912003888 |
Patient.name[0].use[0] | official |
Patient.name[0].family[0] | SMITH |
Patient.name[0].given[0] | Richard |
Patient.telecom[0].system[0] | phone |
Patient.telecom[0].value[0] | 01131231234 |
Patient.gender[0] | male |
Patient.birthDate[0] | 1970-09-11 |
Patient.address[0].line[0] | 4 Sandmoor Drive |
Patient.address[0].city[0] | LEEDS |
Patient.address[0].postalCode[0] | LS17 7DF |
Patient.contact[0].extension[0].url[0] | https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactRank |
Patient.contact[0].extension[0].value[0] | 1 |
Patient.contact[0].extension[1].url[0] | https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-CopyCorrespondenceIndicator |
Patient.contact[0].extension[1].value[0] | True |
Patient.contact[0].relationship[0].coding[0].system[0] | https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole |
Patient.contact[0].relationship[0].coding[0].code[0] | Personal |
Patient.contact[0].relationship[0].coding[0].display[0] | Personal relationship with the patient |
Patient.contact[0].name[0].use[0] | official |
Patient.contact[0].name[0].text[0] | JACKSON Jane (Miss) |
Patient.contact[0].name[0].family[0] | Jackson |
Patient.contact[0].name[0].given[0] | Jane |
Patient.contact[0].name[0].prefix[0] | Miss |
Patient.contact[0].telecom[0].system[0] | phone |
Patient.contact[0].telecom[0].value[0] | 07777123123 |
Patient.contact[0].telecom[0].use[0] | mobile |
Patient.contact[0].address[0].use[0] | home |
Patient.contact[0].address[0].type[0] | physical |
Patient.contact[0].address[0].line[0] | 5 Alwoodley Road |
Patient.contact[0].address[0].city[0] | LEEDS |
Patient.contact[0].address[0].postalCode[0] | LS17 6EH |
Patient.contact[0].gender[0] | female |
Patient.communication[0].language[0].coding[0].system[0] | urn:ietf:bcp:47 |
Patient.communication[0].language[0].coding[0].code[0] | bfi |
Patient.communication[0].language[0].coding[0].display[0] | British Sign Language |
Patient.communication[0].language[0].coding[1].system[0] | http://snomed.info/sct |
Patient.communication[0].language[0].coding[1].code[0] | 703963007 |
Patient.communication[0].language[0].coding[1].display[0] | Makaton vocabulary |
<Patient xmlns="http://hl7.org/fhir"> <id value="UKCore-Patient-RichardSmith-Example" /> <extension url="https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory"> <valueCodeableConcept> <coding> <system value="https://fhir.hl7.org.uk/CodeSystem/UKCore-EthnicCategoryEngland" /> <code value="G" /> <display value="Mixed - Any other mixed background" /> </coding> </valueCodeableConcept> </extension> <extension url="https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactPreference"> <extension url="PreferredContactMethod"> <valueCodeableConcept> <coding> <system value="https://fhir.hl7.org.uk/CodeSystem/UKCore-PreferredContactMethod" /> <code value="3" /> <display value="Telephone" /> </coding> </valueCodeableConcept> </extension> <extension url="PreferredContactTimes"> <valueTiming> <repeat> <frequency value="1" /> <period value="1" /> <periodUnit value="d" /> <dayOfWeek value="mon" /> <dayOfWeek value="wed" /> <dayOfWeek value="fri" /> <when value="MORN" /> </repeat> </valueTiming> </extension> <extension url="PreferredWrittenCommunicationFormat"> <valueCodeableConcept> <coding> <system value="https://fhir.hl7.org.uk/CodeSystem/UKCore-PreferredWrittenCommunicationFormat" /> <code value="11" /> <display value="Large print" /> </coding> </valueCodeableConcept> </extension> </extension> <extension url="https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeathNotificationStatus"> <extension url="deathNotificationStatus"> <valueCodeableConcept> <coding> <system value="https://fhir.hl7.org.uk/CodeSystem/UKCore-DeathNotificationStatus" /> <code value="U" /> <display value="Removed" /> </coding> </valueCodeableConcept> </extension> <extension url="systemEffectiveDate"> <valueDateTime value="2019-08-01T00:00:00.000Z" /> </extension> </extension> <extension url="https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ResidentialStatus"> <valueCodeableConcept> <coding> <system value="https://fhir.hl7.org.uk/CodeSystem/UKCore-ResidentialStatus" /> <code value="H" /> <display value="UK Resident" /> </coding> </valueCodeableConcept> </extension> <identifier> <extension url="https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus"> <valueCodeableConcept> <coding> <system value="https://fhir.hl7.org.uk/CodeSystem/UKCore-NHSNumberVerificationStatusEngland" /> <code value="01" /> <display value="Number present and verified" /> </coding> </valueCodeableConcept> </extension> <system value="https://fhir.nhs.uk/Id/nhs-number" /> <value value="9912003888" /> </identifier> <name> <use value="official" /> <family value="SMITH" /> <given value="Richard" /> </name> <telecom> <system value="phone" /> <value value="01131231234" /> </telecom> <gender value="male" /> <birthDate value="1970-09-11" /> <address> <line value="4 Sandmoor Drive" /> <city value="LEEDS" /> <postalCode value="LS17 7DF" /> </address> <contact> <extension url="https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactRank"> <valuePositiveInt value="1" /> </extension> <extension url="https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-CopyCorrespondenceIndicator"> <valueBoolean value="true" /> </extension> <relationship> <coding> <system value="https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole" /> <code value="Personal" /> <display value="Personal relationship with the patient" /> </coding> </relationship> <name> <use value="official" /> <text value="JACKSON Jane (Miss)" /> <family value="Jackson" /> <given value="Jane" /> <prefix value="Miss" /> </name> <telecom> <system value="phone" /> <value value="07777123123" /> <use value="mobile" /> </telecom> <address> <use value="home" /> <type value="physical" /> <line value="5 Alwoodley Road" /> <city value="LEEDS" /> <postalCode value="LS17 6EH" /> </address> <gender value="female" /> </contact> <communication> <language> <coding> <system value="urn:ietf:bcp:47" /> <code value="bfi" /> <display value="British Sign Language" /> </coding> <coding> <system value="http://snomed.info/sct" /> <code value="703963007" /> <display value="Makaton vocabulary" /> </coding> </language> </communication> </Patient>
{ "resourceType": "Patient", "id": "UKCore-Patient-RichardSmith-Example", "extension": [ { "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-EthnicCategory", "valueCodeableConcept": { "coding": [ { "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-EthnicCategoryEngland", "code": "G", "display": "Mixed - Any other mixed background" } ] } }, { "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactPreference", "extension": [ { "url": "PreferredContactMethod", "valueCodeableConcept": { "coding": [ { "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-PreferredContactMethod", "code": "3", "display": "Telephone" } ] } }, { "url": "PreferredContactTimes", "valueTiming": { "repeat": { "frequency": 1, "period": 1, "periodUnit": "d", "dayOfWeek": [ "mon", "wed", "fri" ], "when": [ "MORN" ] } } }, { "url": "PreferredWrittenCommunicationFormat", "valueCodeableConcept": { "coding": [ { "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-PreferredWrittenCommunicationFormat", "code": "11", "display": "Large print" } ] } } ] }, { "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-DeathNotificationStatus", "extension": [ { "url": "deathNotificationStatus", "valueCodeableConcept": { "coding": [ { "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-DeathNotificationStatus", "code": "U", "display": "Removed" } ] } }, { "url": "systemEffectiveDate", "valueDateTime": "2019-08-01T00:00:00.000Z" } ] }, { "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ResidentialStatus", "valueCodeableConcept": { "coding": [ { "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-ResidentialStatus", "code": "H", "display": "UK Resident" } ] } } ], "identifier": [ { "extension": [ { "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus", "valueCodeableConcept": { "coding": [ { "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-NHSNumberVerificationStatusEngland", "code": "01", "display": "Number present and verified" } ] } } ], "system": "https://fhir.nhs.uk/Id/nhs-number", "value": "9912003888" } ], "name": [ { "use": "official", "family": "SMITH", "given": [ "Richard" ] } ], "telecom": [ { "system": "phone", "value": "01131231234" } ], "gender": "male", "birthDate": "1970-09-11", "address": [ { "line": [ "4 Sandmoor Drive" ], "city": "LEEDS", "postalCode": "LS17 7DF" } ], "contact": [ { "extension": [ { "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-ContactRank", "valuePositiveInt": 1 }, { "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-CopyCorrespondenceIndicator", "valueBoolean": true } ], "relationship": [ { "coding": [ { "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-AdditionalPersonRelationshipRole", "code": "Personal", "display": "Personal relationship with the patient" } ] } ], "name": { "use": "official", "text": "JACKSON Jane (Miss)", "family": "Jackson", "given": [ "Jane" ], "prefix": [ "Miss" ] }, "telecom": [ { "system": "phone", "value": "07777123123", "use": "mobile" } ], "address": { "use": "home", "type": "physical", "line": [ "5 Alwoodley Road" ], "city": "LEEDS", "postalCode": "LS17 6EH" }, "gender": "female" } ], "communication": [ { "language": { "coding": [ { "system": "urn:ietf:bcp:47", "code": "bfi", "display": "British Sign Language" }, { "system": "http://snomed.info/sct", "code": "703963007", "display": "Makaton vocabulary" } ] } } ] }
Patient.id[0] | UKCore-Extension-AddressKey-Example |
Patient.address[0].extension[0].extension[0].url[0] | type |
Patient.address[0].extension[0].extension[0].value[0].coding[0].system[0] | https://fhir.hl7.org.uk/CodeSystem/UKCore-AddressKeyType |
Patient.address[0].extension[0].extension[0].value[0].coding[0].code[0] | PAF |
Patient.address[0].extension[0].extension[0].value[0].coding[0].display[0] | Postcode Address File |
Patient.address[0].extension[0].extension[1].url[0] | value |
Patient.address[0].extension[0].extension[1].value[0] | LS10ABC |
Patient.address[0].extension[0].url[0] | https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey |
Patient.address[0].line[0] | 4 Sandmoor Drive |
Patient.address[0].city[0] | LEEDS |
Patient.address[0].postalCode[0] | LS17 7DF |
<Patient xmlns="http://hl7.org/fhir"> <id value="UKCore-Extension-AddressKey-Example" /> <address> <!-- **************extension start************** --> <extension url="https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey"> <extension url="type"> <valueCodeableConcept> <coding> <system value="https://fhir.hl7.org.uk/CodeSystem/UKCore-AddressKeyType" /> <code value="PAF" /> <display value="Postcode Address File" /> </coding> </valueCodeableConcept> </extension> <extension url="value"> <valueString value="LS10ABC" /> </extension> </extension> <line value="4 Sandmoor Drive" /> <city value="LEEDS" /> <postalCode value="LS17 7DF" /> <!-- *************extension end ***************** --> </address> </Patient>
{ "resourceType": "Patient", "id": "UKCore-Extension-AddressKey-Example", "address": [ { "extension": [ { "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-AddressKey", "extension": [ { "url": "type", "valueCodeableConcept": { "coding": [ { "system": "https://fhir.hl7.org.uk/CodeSystem/UKCore-AddressKeyType", "code": "PAF", "display": "Postcode Address File" } ] } }, { "url": "value", "valueString": "LS10ABC" } ] } ], "line": [ "4 Sandmoor Drive" ], "city": "LEEDS", "postalCode": "LS17 7DF" } ] }
Condition.id[0] | UKCore-Extension-CodingSCT-MoleOfSkin-Example |
Condition.code[0].coding[0].system[0] | http://read.info/ctv3 |
Condition.code[0].coding[0].code[0] | X78Uv |
Condition.code[0].coding[0].display[0] | Benign melanocytic naevus skin |
Condition.code[0].coding[1].extension[0].url[0] | https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-CodingSCTDescDisplay |
Condition.code[0].coding[1].extension[0].value[0] | Mole of skin |
Condition.code[0].coding[1].extension[1].url[0] | http://hl7.org/fhir/StructureDefinition/coding-sctdescid |
Condition.code[0].coding[1].extension[1].value[0] | 1787065011 |
Condition.code[0].coding[1].system[0] | http://snomed.info/sct |
Condition.code[0].coding[1].code[0] | 400010006 |
Condition.code[0].coding[1].display[0] | Melanocytic naevus of skin |
Condition.code[0].text[0] | Moles |
Condition.subject[0].reference[0] | Patient/UKCore-Patient-RichardSmith-Example |
<Condition xmlns="http://hl7.org/fhir"> <id value="UKCore-Extension-CodingSCT-MoleOfSkin-Example" /> <!-- **************Snippet start************** --> <code> <coding> <system value="http://read.info/ctv3" /> <code value="X78Uv" /> <!-- no term code, so CTV3 PT is implied? --> <display value="Benign melanocytic naevus skin" /> <!-- text of V3 PT --> </coding> <coding> <extension url="https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-CodingSCTDescDisplay"> <valueString value="Mole of skin" /> <!-- text for id = 1787065011 --> </extension> <extension url="http://hl7.org/fhir/StructureDefinition/coding-sctdescid"> <valueId value="1787065011" /> <!-- not the SNOMED PT --> </extension> <system value="http://snomed.info/sct" /> <code value="400010006" /> <!-- SNOMED conceptId --> <display value="Melanocytic naevus of skin" /> <!-- text of SNOMED PT --> </coding> <text value="Moles" /> <!-- what user saw on screen, from data entry template --> </code> <!-- **************Snippet end************** --> <subject> <reference value="Patient/UKCore-Patient-RichardSmith-Example" /> </subject> </Condition>
{ "resourceType": "Condition", "id": "UKCore-Extension-CodingSCT-MoleOfSkin-Example", "code": { "coding": [ { "system": "http://read.info/ctv3", "code": "X78Uv", "display": "Benign melanocytic naevus skin" }, { "extension": [ { "url": "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-CodingSCTDescDisplay", "valueString": "Mole of skin" }, { "url": "http://hl7.org/fhir/StructureDefinition/coding-sctdescid", "valueId": "1787065011" } ], "system": "http://snomed.info/sct", "code": "400010006", "display": "Melanocytic naevus of skin" } ], "text": "Moles" }, "subject": { "reference": "Patient/UKCore-Patient-RichardSmith-Example" } }
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 Profile the metadata expression SHALL follow the following convention:
[FHIRAssetName].Title: ('[FHIRAssetName] example: ' + id)
[FHIRAssetName].Description: ('[FHIRAssetName] example: ' + id)
[FHIRAssetName].UrlKey: id
Important Note: the following properties of examples are automatically generated by Simplifier and SHALL NOT be manually changed or updated