{
"description": null,
"_filename": "NHSDigital-MedicationDispense.StructureDefinition.json",
"package_name": "uk.nhsdigital.medicines.r4",
"date": null,
"derivation": "constraint",
"publisher": null,
"fhirVersion": "4.0.1",
"name": "NHSDigitalMedicationDispense",
"mapping": [ {
"uri": "http://hl7.org/fhir/workflow",
"name": "Workflow Pattern",
"identity": "workflow"
}, {
"uri": "http://hl7.org/v3",
"name": "RIM Mapping",
"identity": "rim"
}, {
"uri": "http://hl7.org/fhir/fivews",
"name": "FiveWs Pattern Mapping",
"identity": "w5"
}, {
"uri": "http://www.hl7.org/v3/PORX_RM020070UV",
"name": "V3 Pharmacy Dispense RMIM",
"identity": "rx-dispense-rmim"
}, {
"uri": "http://hl7.org/v2",
"name": "HL7 v2 Mapping",
"identity": "v2"
} ],
"abstract": false,
"type": "MedicationDispense",
"experimental": null,
"resourceType": "StructureDefinition",
"title": null,
"package_version": "2.3.0",
"status": "draft",
"id": "7acaca20-319a-4a59-879a-50e4b8b6804e",
"kind": "resource",
"url": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationDispense",
"version": null,
"differential": {
"element": [ {
"id": "MedicationDispense.extension",
"min": 1,
"path": "MedicationDispense.extension",
"slicing": {
"rules": "open",
"discriminator": [ {
"path": "url",
"type": "value"
} ]
}
}, {
"id": "MedicationDispense.extension:prescriptionStatus",
"max": "1",
"min": 1,
"path": "MedicationDispense.extension",
"type": [ {
"code": "Extension",
"profile": [ "https://fhir.nhs.uk/StructureDefinition/Extension-EPS-TaskBusinessStatus" ]
} ],
"sliceName": "prescriptionStatus",
"mustSupport": true
}, {
"path": "MedicationDispense.extension",
"min": 0,
"definition": "Mandatory for Repeat Prescribing and Repeat Dispensing",
"short": "Repeat Prescribing and Dispensing",
"type": [ {
"code": "Extension",
"profile": [ "https://fhir.nhs.uk/StructureDefinition/Extension-EPS-RepeatInformation" ]
} ],
"mustSupport": true,
"sliceName": "repeatInformation",
"max": "1",
"id": "MedicationDispense.extension:repeatInformation"
}, {
"id": "MedicationDispense.identifier",
"path": "MedicationDispense.identifier",
"mustSupport": true
}, {
"id": "MedicationDispense.identifier.system",
"min": 1,
"path": "MedicationDispense.identifier.system"
}, {
"id": "MedicationDispense.identifier.value",
"min": 1,
"path": "MedicationDispense.identifier.value"
}, {
"id": "MedicationDispense.status",
"path": "MedicationDispense.status",
"mustSupport": true
}, {
"id": "MedicationDispense.statusReason[x]",
"path": "MedicationDispense.statusReason[x]",
"binding": {
"strength": "required",
"valueSet": "https://fhir.nhs.uk/ValueSet/DM-medicationdispense-status-reason"
}
}, {
"id": "MedicationDispense.category.coding.system",
"min": 1,
"path": "MedicationDispense.category.coding.system"
}, {
"id": "MedicationDispense.category.coding.code",
"min": 1,
"path": "MedicationDispense.category.coding.code"
}, {
"id": "MedicationDispense.medication[x]",
"path": "MedicationDispense.medication[x]",
"type": [ {
"code": "CodeableConcept",
"profile": [ "https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationDispense-CodeableConcept" ]
}, {
"code": "Reference",
"aggregation": [ "bundled" ],
"targetProfile": [ "https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationDispense-Medication" ]
} ],
"mustSupport": true
}, {
"id": "MedicationDispense.subject",
"min": 1,
"path": "MedicationDispense.subject",
"type": [ {
"code": "Reference",
"aggregation": [ "referenced", "bundled" ],
"targetProfile": [ "https://fhir.nhs.uk/StructureDefinition/NHSDigital-Patient" ]
} ],
"constraint": [ {
"key": "eps-2",
"human": "subject - An identifier reference plus a display name or resource reference must be provided",
"source": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationDispense",
"severity": "warning",
"expression": "(reference.exists() or (identifier.exists() and display.exists()))"
}, {
"key": "patient-nhs",
"human": "Supplied NHS Number is outside the English and Welsh NHS Number range or length of the number is wrong.",
"source": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-Claim",
"severity": "error",
"expression": "identifier.where(system='https://fhir.nhs.uk/Id/nhs-number').exists().not() or (identifier.where(system='https://fhir.nhs.uk/Id/nhs-number').exists() and identifier.where(system='https://fhir.nhs.uk/Id/nhs-number').value.matches('^([456789]{1}[0-9]{9})$'))"
} ],
"mustSupport": true
}, {
"id": "MedicationDispense.subject.identifier.system",
"min": 1,
"path": "MedicationDispense.subject.identifier.system",
"fixedUri": "https://fhir.nhs.uk/Id/nhs-number"
}, {
"id": "MedicationDispense.subject.identifier.value",
"min": 1,
"path": "MedicationDispense.subject.identifier.value"
}, {
"id": "MedicationDispense.context",
"path": "MedicationDispense.context",
"type": [ {
"code": "Reference",
"targetProfile": [ "http://hl7.org/fhir/StructureDefinition/EpisodeOfCare", "https://fhir.nhs.uk/StructureDefinition/NHSDigital-Encounter" ]
} ]
}, {
"id": "MedicationDispense.performer",
"path": "MedicationDispense.performer",
"mustSupport": true
}, {
"id": "MedicationDispense.performer.actor",
"path": "MedicationDispense.performer.actor",
"type": [ {
"code": "Reference",
"targetProfile": [ "https://fhir.nhs.uk/StructureDefinition/NHSDigital-Organization", "https://fhir.nhs.uk/StructureDefinition/NHSDigital-Practitioner" ]
} ],
"constraint": [ {
"key": "usercode-reference",
"human": "PractitionerRole.practitioner - An identifier reference plus a display name or resource reference must be provided",
"source": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationDispense",
"severity": "error",
"expression": "(reference.exists() or (identifier.exists() and display.exists()))"
}, {
"key": "usercode-nmc",
"human": "NMC must be of the format NNANNNNA",
"source": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationDispense",
"severity": "error",
"expression": "identifier.exists().not() or identifier.where(system='https://fhir.hl7.org.uk/Id/nmc-number').exists().not() or (identifier.where(system='https://fhir.hl7.org.uk/Id/nmc-number').exists() and identifier.where(system='https://fhir.hl7.org.uk/Id/nmc-number').value.matches('^[0-9]{2}[A-Z]{1}[0-9]{4}[A-Z]{1}$'))"
}, {
"key": "usercodee-gmp",
"human": "GMP must be of the format GNNNNNNN and not be a spurious code (starts with G6 or G7)",
"source": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationDispense",
"severity": "error",
"expression": "identifier.exists().not() or identifier.where(system='https://fhir.hl7.org.uk/Id/gmp-number').exists().not() or (identifier.where(system='https://fhir.hl7.org.uk/Id/gmp-number').exists() and identifier.where(system='https://fhir.hl7.org.uk/Id/gmp-number').value.matches('^[G]{1}[01234589]{1}[0-9]{6}$'))"
}, {
"key": "usercode-gmc",
"human": "GMC must be of the format CNNNNNNN",
"source": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationDispense",
"severity": "error",
"expression": "identifier.exists().not() or identifier.where(system='https://fhir.hl7.org.uk/Id/gmc-number').exists().not() or (identifier.where(system='https://fhir.hl7.org.uk/Id/gmc-number').exists() and identifier.where(system='https://fhir.hl7.org.uk/Id/gmc-number').value.matches('^[C]{1}[0-9]{7}$'))"
}, {
"key": "usercode-gphc",
"human": "GPHC must be of the format NNNNNNN",
"source": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationDispense",
"severity": "error",
"expression": "identifier.exists().not() or identifier.where(system='https://fhir.hl7.org.uk/Id/gphc-number').exists().not() or (identifier.where(system='https://fhir.hl7.org.uk/Id/gphc-number').exists() and identifier.where(system='https://fhir.hl7.org.uk/Id/gphc-number').value.matches('^[0-9]{7}$'))"
}, {
"key": "usercode-hcpc",
"human": "HCPC must be of the format AANNNNNN",
"source": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationDispense",
"severity": "error",
"expression": "identifier.exists().not() or identifier.where(system='https://fhir.hl7.org.uk/Id/hcpc-number').exists().not() or (identifier.where(system='https://fhir.hl7.org.uk/Id/hcpc-number').exists() and identifier.where(system='https://fhir.hl7.org.uk/Id/hcpc-number').value.matches('^[A-Z]{2}[0-9]{6}$'))"
}, {
"key": "usercode-din",
"human": "DIN format must be NNNNNN",
"source": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationDispense",
"severity": "error",
"expression": "identifier.exists().not() or identifier.where(system='https://fhir.hl7.org.uk/Id/din-number').exists().not() or (identifier.where(system='https://fhir.hl7.org.uk/Id/din-number').exists() and identifier.where(system='https://fhir.hl7.org.uk/Id/din-number').value.matches('^[0-9]{6}$'))"
} ]
}, {
"id": "MedicationDispense.performer.actor.identifier",
"min": 1,
"path": "MedicationDispense.performer.actor.identifier"
}, {
"id": "MedicationDispense.performer.actor.identifier.system",
"min": 1,
"path": "MedicationDispense.performer.actor.identifier.system"
}, {
"id": "MedicationDispense.performer.actor.identifier.value",
"min": 1,
"path": "MedicationDispense.performer.actor.identifier.value"
}, {
"id": "MedicationDispense.performer.actor.display",
"min": 1,
"path": "MedicationDispense.performer.actor.display"
}, {
"id": "MedicationDispense.location",
"path": "MedicationDispense.location",
"type": [ {
"code": "Reference",
"targetProfile": [ "https://fhir.nhs.uk/StructureDefinition/NHSDigital-Location" ]
} ]
}, {
"id": "MedicationDispense.location.identifier.system",
"min": 1,
"path": "MedicationDispense.location.identifier.system"
}, {
"id": "MedicationDispense.location.identifier.value",
"min": 1,
"path": "MedicationDispense.location.identifier.value"
}, {
"id": "MedicationDispense.location.display",
"min": 1,
"path": "MedicationDispense.location.display"
}, {
"id": "MedicationDispense.authorizingPrescription",
"min": 1,
"path": "MedicationDispense.authorizingPrescription",
"type": [ {
"code": "Reference",
"aggregation": [ "referenced" ],
"targetProfile": [ "https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationRequest" ]
} ],
"mustSupport": true
}, {
"id": "MedicationDispense.authorizingPrescription.extension",
"min": 1,
"path": "MedicationDispense.authorizingPrescription.extension",
"slicing": {
"rules": "open",
"discriminator": [ {
"path": "url",
"type": "value"
} ]
}
}, {
"id": "MedicationDispense.authorizingPrescription.extension:groupIdentifier",
"max": "1",
"min": 1,
"path": "MedicationDispense.authorizingPrescription.extension",
"type": [ {
"code": "Extension",
"profile": [ "https://fhir.nhs.uk/StructureDefinition/Extension-DM-GroupIdentifier" ]
} ],
"sliceName": "groupIdentifier"
}, {
"id": "MedicationDispense.authorizingPrescription.identifier",
"min": 1,
"path": "MedicationDispense.authorizingPrescription.identifier"
}, {
"id": "MedicationDispense.type",
"path": "MedicationDispense.type",
"binding": {
"strength": "required",
"valueSet": "https://fhir.nhs.uk/ValueSet/DM-medicationdispense-type",
"description": "A ValueSet to identify the type of medication item status."
},
"mustSupport": true
}, {
"id": "MedicationDispense.type.coding.system",
"min": 1,
"path": "MedicationDispense.type.coding.system"
}, {
"id": "MedicationDispense.type.coding.code",
"min": 1,
"path": "MedicationDispense.type.coding.code"
}, {
"id": "MedicationDispense.quantity",
"path": "MedicationDispense.quantity",
"mustSupport": true
}, {
"id": "MedicationDispense.quantity.extension",
"min": 0,
"path": "MedicationDispense.quantity.extension",
"slicing": {
"rules": "open",
"discriminator": [ {
"path": "url",
"type": "value"
} ]
}
}, {
"id": "MedicationDispense.quantity.extension:runningTotal",
"max": "1",
"min": 0,
"path": "MedicationDispense.quantity.extension",
"type": [ {
"code": "Extension",
"profile": [ "https://fhir.nhs.uk/StructureDefinition/Extension-DM-RunningTotal" ]
} ],
"sliceName": "runningTotal"
}, {
"id": "MedicationDispense.quantity.value",
"min": 1,
"path": "MedicationDispense.quantity.value"
}, {
"id": "MedicationDispense.quantity.unit",
"min": 1,
"path": "MedicationDispense.quantity.unit"
}, {
"id": "MedicationDispense.quantity.system",
"min": 1,
"path": "MedicationDispense.quantity.system"
}, {
"id": "MedicationDispense.quantity.code",
"min": 1,
"path": "MedicationDispense.quantity.code"
}, {
"id": "MedicationDispense.daysSupply",
"path": "MedicationDispense.daysSupply",
"mustSupport": true
}, {
"id": "MedicationDispense.whenHandedOver",
"path": "MedicationDispense.whenHandedOver",
"mustSupport": true
}, {
"id": "MedicationDispense.receiver",
"max": "1",
"path": "MedicationDispense.receiver"
}, {
"id": "MedicationDispense.dosageInstruction",
"path": "MedicationDispense.dosageInstruction",
"mustSupport": true
}, {
"id": "MedicationDispense.dosageInstruction.id",
"max": "0",
"path": "MedicationDispense.dosageInstruction.id"
}, {
"id": "MedicationDispense.dosageInstruction.text",
"min": 1,
"path": "MedicationDispense.dosageInstruction.text"
} ]
},
"baseDefinition": "https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationDispense"
}