description: This profile defines the NHS England constraints and extensions on the International FHIR resource [MedicationRequest](https://hl7.org/fhir/R4/medicationrequest.html). package_name: uk.nhsdigital.r4.test derivation: constraint name: NHSDigitalMedicationRequest type: MedicationRequest elements: category: mustSupport: true index: 18 elements: coding: index: 19 slicing: rules: open discriminator: - {path: system, type: value} min: 1 max: 1 slices: patientClassFHIR: match: {system: 'http://terminology.hl7.org/CodeSystem/medicationrequest-category'} schema: binding: {strength: required, valueSet: 'https://fhir.nhs.uk/ValueSet/DM-medicationrequest-category'} index: 20 elements: system: pattern: {type: Uri, value: 'http://terminology.hl7.org/CodeSystem/medicationrequest-category'} index: 21 code: {index: 22} required: [system, code] patientClassUK: match: {system: 'https://fhir.nhs.uk/CodeSystem/medicationrequest-category'} schema: binding: {strength: required, valueSet: 'https://fhir.nhs.uk/ValueSet/DM-medicationrequest-category'} index: 23 elements: system: pattern: {type: Uri, value: 'https://fhir.nhs.uk/CodeSystem/medicationrequest-category'} index: 24 code: {index: 25} required: [system, code] required: [coding] eventHistory: type: Reference refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-Provenance'] index: 81 substitution: mustSupport: true index: 77 elements: allowed: choices: [allowedBoolean] index: 79 allowedBoolean: {type: boolean, choiceOf: allowed, index: 80} encounter: type: Reference refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-Encounter'] index: 33 dispenseRequest: mustSupport: true index: 59 elements: id: {index: 60} extension: index: 61 slicing: slices: performerSiteType: match: {} schema: {type: Extension, short: type of dispensing organisation, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PerformerSiteType', index: 62} min: 1 validityPeriod: mustSupport: true index: 63 elements: start: {index: 64} required: [start] numberOfRepeatsAllowed: {mustSupport: true, index: 65} quantity: mustSupport: true index: 66 elements: value: {index: 67} unit: {index: 68} code: {index: 69} required: [value, unit, code] expectedSupplyDuration: short: Days Supply mustSupport: true index: 70 elements: value: {index: 71} code: pattern: {type: Code, value: d} index: 72 required: [value, code] performer: type: Reference mustSupport: true refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-Organization'] index: 73 extensions: dispensingPractitioner: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-DispensingPerformer', max: 1, type: Extension, short: practitioner who released(/downloaded) the prescription, mustSupport: true, index: 74} elements: extension: type: Extension short: practitioner who released(/downloaded) the prescription mustSupport: true url: https://fhir.nhs.uk/StructureDefinition/Extension-DM-DispensingPerformer index: 74 slicing: slices: dispensingPractitioner: match: {} schema: {type: Extension, short: practitioner who released(/downloaded) the prescription, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-DispensingPerformer', index: 74} max: 1 identifier: elements: system: pattern: {type: Uri, value: 'https://fhir.nhs.uk/Id/ods-organization-code'} index: 75 value: {index: 76} required: [value, system] extensions: performerSiteType: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PerformerSiteType', min: 1, type: Extension, short: type of dispensing organisation, mustSupport: true, index: 62} required: [extension, quantity] reasonCode: {index: 39} medicationCodeableConcept: {type: CodeableConcept, mustSupport: true, choiceOf: medication, index: 28} statusReason: binding: {strength: required, valueSet: 'https://fhir.nhs.uk/ValueSet/DM-medicationrequest-status-reason'} mustSupport: true index: 12 elements: coding: index: 13 elements: system: {index: 14} code: {index: 15} display: {index: 16} required: [display, system, code] required: [coding] authoredOn: {mustSupport: true, index: 34} note: {short: Dispensing Note, mustSupport: true, index: 55} extension: short: Continous and Continuous Repeat Dispensing mustSupport: true index: 0 slicing: slices: medicationRepeatInformation: match: {} schema: {short: Continous and Continuous Repeat Dispensing, mustSupport: true, index: 0} responsiblePractitioner: match: {} schema: {type: Extension, short: Responsible Practitioner for the prescription, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-ResponsiblePractitioner', index: 1} max: 1 prescriptionEndorsement: match: {} schema: {type: Extension, short: NHS BSA Prescription Endorsements, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionEndorsement', index: 2} prescriptionTaskStatusReason: match: {} schema: {type: Extension, short: Prescription task status reason, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionStatusHistory', index: 3} NHSBSAprescriptionType: match: {} schema: {type: Extension, short: NHS BSA Prescription Type, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionType', index: 4} controlledDrug: match: {} schema: {type: Extension, short: Optional Controlled Drug Extensions, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-ControlledDrug', index: 5} max: 1 dispensingInformation: match: {} schema: {type: Extension, short: For EPS use only, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-DispensingInformation', index: 6} max: 1 requester: type: Reference constraint: eps-3: {human: requester - An identifier reference or resource reference must be provided, severity: error, expression: (reference.exists() or (identifier.exists()))} mustSupport: true refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-PractitionerRole'] index: 35 elements: reference: {index: 36} required: [reference] status: {short: active | cancelled | stopped, mustSupport: true, index: 11} dosageInstruction: type: Dosage mustSupport: true index: 56 elements: additionalInstruction: {index: 57} patientInstruction: {index: 58} groupIdentifier: short: groupIdentifier (Short Form Prescription ID) mustSupport: true index: 44 extensions: PrescriptionOrderUUID: url: https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionId type: Extension short: UUID order number for grouped MedciationRequests index: 46 elements: value[x]: elements: system: {index: 47} value: {index: 48} required: [value, system] elements: extension: index: 45 slicing: slices: PrescriptionOrderUUID: match: {} schema: type: Extension short: UUID order number for grouped MedciationRequests url: https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionId index: 46 elements: value[x]: elements: system: {index: 47} value: {index: 48} required: [value, system] system: pattern: {type: Uri, value: 'https://fhir.nhs.uk/Id/prescription-order-number'} index: 49 value: {index: 50} required: [extension, value, system] recorder: type: Reference constraint: eps-4: {human: recorder - An identifier reference or resource reference must be provided, severity: error, expression: (reference.exists() or (identifier.exists()))} refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-Practitioner'] index: 38 identifier: short: Each MedicationRequest MUST be identified by an Universal Unique Identifiers (UUIDs) with a system of https://fhir.nhs.uk/Id/prescription-order-item-number mustSupport: true index: 7 slicing: rules: open discriminator: - {path: system, type: value} min: 1 slices: prescriptionOrderItem: match: {system: 'https://fhir.nhs.uk/Id/prescription-order-item-number'} schema: short: Prescription Order Item _required: true index: 8 elements: system: pattern: {type: Uri, value: 'https://fhir.nhs.uk/Id/prescription-order-item-number'} index: 9 value: {index: 10} required: [value, system] intent: {index: 17} basedOn: type: Reference mustSupport: true refers: ['http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation', 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationRequest'] index: 41 extensions: repeatInformation: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-RepeatInformation', max: 1, type: Extension, short: Additional repeatInformation, mustSupport: true, index: 42} orignalPrescriptionId: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionId', type: Extension, isModifier: false, index: 43} elements: extension: type: Extension short: Additional repeatInformation mustSupport: true url: https://fhir.nhs.uk/StructureDefinition/Extension-EPS-RepeatInformation index: 42 slicing: slices: repeatInformation: match: {} schema: {type: Extension, short: Additional repeatInformation, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-RepeatInformation', index: 42} max: 1 orignalPrescriptionId: match: {} schema: {type: Extension, isModifier: false, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionId', index: 43} medicationReference: type: Reference mustSupport: true choiceOf: medication refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationRequest-Medication'] index: 29 courseOfTherapyType: binding: {strength: required, valueSet: 'https://fhir.nhs.uk/ValueSet/DM-medicationrequest-course-of-therapy'} mustSupport: true index: 51 elements: coding: index: 52 elements: system: {index: 53} code: {index: 54} required: [system, code] required: [coding] subject: type: Reference constraint: patient-nhs: {human: Length of the supplied NHS Number is wrong., 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(''^([0-9]{10})$''))'} mustSupport: true refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-Patient-PDS'] index: 30 elements: identifier: elements: system: pattern: {type: Uri, value: 'https://fhir.nhs.uk/Id/nhs-number'} index: 31 value: {index: 32} required: [value, system] performer: type: Reference refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-Organization', 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-Practitioner', 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-PractitionerRole'] index: 37 medication: mustSupport: true choices: [medicationCodeableConcept, medicationReference] index: 27 reasonReference: {index: 40} package_version: 2.16.0-prerelease extensions: medicationRepeatInformation: {url: null, short: Continous and Continuous Repeat Dispensing, mustSupport: true, index: 0} responsiblePractitioner: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-ResponsiblePractitioner', max: 1, type: Extension, short: Responsible Practitioner for the prescription, mustSupport: true, index: 1} prescriptionEndorsement: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionEndorsement', type: Extension, short: NHS BSA Prescription Endorsements, mustSupport: true, index: 2} prescriptionTaskStatusReason: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionStatusHistory', type: Extension, short: Prescription task status reason, mustSupport: true, index: 3} NHSBSAprescriptionType: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionType', type: Extension, short: NHS BSA Prescription Type, mustSupport: true, index: 4} controlledDrug: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-ControlledDrug', max: 1, type: Extension, short: Optional Controlled Drug Extensions, mustSupport: true, index: 5} dispensingInformation: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-DispensingInformation', max: 1, type: Extension, short: For EPS use only, mustSupport: true, index: 6} class: profile kind: resource url: https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationRequest base: https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationRequest version: 1.0.2 required: [dosageInstruction, groupIdentifier, identifier, courseOfTherapyType, dispenseRequest]