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: binding: {strength: required, valueSet: 'https://fhir.nhs.uk/ValueSet/DM-medicationrequest-category'} index: 19 required: [coding] eventHistory: type: Reference refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-Provenance'] index: 74 substitution: mustSupport: true index: 70 elements: allowed: choices: [allowedBoolean] index: 72 allowedBoolean: {type: boolean, choiceOf: allowed, index: 73} encounter: type: Reference refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-Encounter'] index: 27 dispenseRequest: mustSupport: true index: 52 elements: id: {index: 53} extension: index: 54 slicing: slices: performerSiteType: match: {} schema: {type: Extension, short: type of dispensing organisation, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PerformerSiteType', index: 55} min: 1 validityPeriod: mustSupport: true index: 56 elements: start: {index: 57} required: [start] numberOfRepeatsAllowed: {mustSupport: true, index: 58} quantity: mustSupport: true index: 59 elements: value: {index: 60} unit: {index: 61} code: {index: 62} required: [value, unit, code] expectedSupplyDuration: short: Days Supply mustSupport: true index: 63 elements: value: {index: 64} code: pattern: {type: Code, value: d} index: 65 required: [value, code] performer: type: Reference mustSupport: true refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-Organization'] index: 66 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: 67} elements: extension: type: Extension short: practitioner who released(/downloaded) the prescription mustSupport: true url: https://fhir.nhs.uk/StructureDefinition/Extension-DM-DispensingPerformer index: 67 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: 67} max: 1 identifier: elements: system: pattern: {type: Uri, value: 'https://fhir.nhs.uk/Id/ods-organization-code'} index: 68 value: {index: 69} 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: 55} required: [extension, quantity] reasonCode: {index: 33} medicationCodeableConcept: {type: CodeableConcept, mustSupport: true, choiceOf: medication, index: 22} 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: 28} note: {short: Dispensing Note, mustSupport: true, index: 48} 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} NHSBSAprescriptionType: match: {} schema: {type: Extension, short: NHS BSA Prescription Type, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionType', index: 3} controlledDrug: match: {} schema: {type: Extension, short: Optional Controlled Drug Extensions, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-ControlledDrug', index: 4} max: 1 dispensingInformation: match: {} schema: {type: Extension, short: For EPS use only, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-DispensingInformation', index: 5} max: 1 prescriptionStatusHistory: match: {} schema: {type: Extension, isModifier: false, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionStatusHistory', index: 6} 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: 29 elements: reference: {index: 30} required: [reference] status: {short: active | cancelled | stopped, mustSupport: true, index: 11} dosageInstruction: type: Dosage mustSupport: true index: 49 elements: additionalInstruction: {index: 50} patientInstruction: {index: 51} groupIdentifier: short: groupIdentifier (Short Form Prescription ID) mustSupport: true index: 37 extensions: PrescriptionOrderUUID: url: https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionId type: Extension short: UUID order number for grouped MedciationRequests index: 39 elements: value[x]: elements: system: {index: 40} value: {index: 41} required: [value, system] elements: extension: index: 38 slicing: slices: PrescriptionOrderUUID: match: {} schema: type: Extension short: UUID order number for grouped MedciationRequests url: https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionId index: 39 elements: value[x]: elements: system: {index: 40} value: {index: 41} required: [value, system] system: pattern: {type: Uri, value: 'https://fhir.nhs.uk/Id/prescription-order-number'} index: 42 value: {index: 43} 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: 32 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: 35 extensions: repeatInformation: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-RepeatInformation', max: 1, type: Extension, short: Additional repeatInformation, mustSupport: true, index: 36} elements: extension: type: Extension short: Additional repeatInformation mustSupport: true url: https://fhir.nhs.uk/StructureDefinition/Extension-EPS-RepeatInformation index: 36 slicing: slices: repeatInformation: match: {} schema: {type: Extension, short: Additional repeatInformation, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-RepeatInformation', index: 36} max: 1 medicationReference: type: Reference mustSupport: true choiceOf: medication refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationRequest-Medication'] index: 23 courseOfTherapyType: binding: {strength: required, valueSet: 'https://fhir.nhs.uk/ValueSet/DM-medicationrequest-course-of-therapy'} mustSupport: true index: 44 elements: coding: index: 45 elements: system: {index: 46} code: {index: 47} 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: 24 elements: identifier: elements: system: pattern: {type: Uri, value: 'https://fhir.nhs.uk/Id/nhs-number'} index: 25 value: {index: 26} 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: 31 medication: mustSupport: true choices: [medicationCodeableConcept, medicationReference] index: 21 reasonReference: {index: 34} package_version: 2.18.2-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} NHSBSAprescriptionType: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionType', type: Extension, short: NHS BSA Prescription Type, mustSupport: true, index: 3} controlledDrug: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-ControlledDrug', max: 1, type: Extension, short: Optional Controlled Drug Extensions, mustSupport: true, index: 4} dispensingInformation: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-DispensingInformation', max: 1, type: Extension, short: For EPS use only, mustSupport: true, index: 5} prescriptionStatusHistory: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionStatusHistory', type: Extension, isModifier: false, 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.1.0 required: [dosageInstruction, groupIdentifier, identifier, courseOfTherapyType, dispenseRequest]