description: null package_name: uk.nhsdigital.r4.test derivation: constraint name: NHSDigitalMedicationRequest type: MedicationRequest elements: category: mustSupport: true index: 19 elements: coding: index: 20 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: 21 elements: system: pattern: {type: Uri, value: 'http://terminology.hl7.org/CodeSystem/medicationrequest-category'} index: 22 code: {index: 23} 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: 24 elements: system: pattern: {type: Uri, value: 'https://fhir.nhs.uk/CodeSystem/medicationrequest-category'} index: 25 code: {index: 26} required: [system, code] required: [coding] eventHistory: type: Reference refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-Provenance'] index: 82 substitution: mustSupport: true index: 78 elements: allowed: choices: [allowedBoolean] index: 80 allowedBoolean: {type: boolean, choiceOf: allowed, index: 81} encounter: type: Reference refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-Encounter'] index: 34 dispenseRequest: mustSupport: true index: 60 elements: id: {index: 61} extension: index: 62 slicing: slices: performerSiteType: match: {} schema: {type: Extension, short: type of dispensing organisation, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PerformerSiteType', index: 63} min: 1 validityPeriod: mustSupport: true index: 64 elements: start: {index: 65} required: [start] numberOfRepeatsAllowed: {mustSupport: true, index: 66} quantity: mustSupport: true index: 67 elements: value: {index: 68} unit: {index: 69} code: {index: 70} required: [value, unit, code] expectedSupplyDuration: short: Days Supply mustSupport: true index: 71 elements: value: {index: 72} code: pattern: {type: Code, value: d} index: 73 required: [value, code] performer: type: Reference mustSupport: true refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-Organization'] index: 74 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: 75} elements: extension: type: Extension short: practitioner who released(/downloaded) the prescription mustSupport: true url: https://fhir.nhs.uk/StructureDefinition/Extension-DM-DispensingPerformer index: 75 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: 75} max: 1 identifier: elements: system: pattern: {type: Uri, value: 'https://fhir.nhs.uk/Id/ods-organization-code'} index: 76 value: {index: 77} 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: 63} required: [extension, quantity] reasonCode: {index: 40} medicationCodeableConcept: {type: CodeableConcept, mustSupport: true, choiceOf: medication, index: 29} statusReason: binding: {strength: required, valueSet: 'https://fhir.nhs.uk/ValueSet/DM-medicationrequest-status-reason'} mustSupport: true index: 13 elements: coding: index: 14 elements: system: {index: 15} code: {index: 16} display: {index: 17} required: [display, system, code] required: [coding] authoredOn: {mustSupport: true, index: 35} note: {short: Dispensing Note, mustSupport: true, index: 56} 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 extensions: {} elements: extension: {index: 4} required: [extension] NHSBSAprescriptionType: match: {} schema: {type: Extension, short: NHS BSA Prescription Type, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionType', index: 5} controlledDrug: match: {} schema: {type: Extension, short: Optional Controlled Drug Extensions, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-ControlledDrug', index: 6} max: 1 dispensingInformation: match: {} schema: {type: Extension, short: For EPS use only, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-DispensingInformation', index: 7} 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: 36 elements: reference: {index: 37} required: [reference] status: {short: active | cancelled | stopped, mustSupport: true, index: 12} dosageInstruction: type: Dosage mustSupport: true index: 57 elements: additionalInstruction: {index: 58} patientInstruction: {index: 59} groupIdentifier: short: groupIdentifier (Short Form Prescription ID) mustSupport: true index: 45 extensions: PrescriptionOrderUUID: url: https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionId type: Extension short: UUID order number for grouped MedciationRequests index: 47 elements: value[x]: elements: system: {index: 48} value: {index: 49} required: [value, system] elements: extension: index: 46 slicing: slices: PrescriptionOrderUUID: match: {} schema: type: Extension short: UUID order number for grouped MedciationRequests url: https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionId index: 47 elements: value[x]: elements: system: {index: 48} value: {index: 49} required: [value, system] system: pattern: {type: Uri, value: 'https://fhir.nhs.uk/Id/prescription-order-number'} index: 50 value: {index: 51} 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: 39 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: 8 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: 9 elements: system: pattern: {type: Uri, value: 'https://fhir.nhs.uk/Id/prescription-order-item-number'} index: 10 value: {index: 11} required: [value, system] intent: {index: 18} basedOn: type: Reference mustSupport: true refers: ['http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation', 'https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationRequest'] index: 42 extensions: repeatInformation: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-RepeatInformation', max: 1, type: Extension, short: Additional repeatInformation, mustSupport: true, index: 43} orignalPrescriptionId: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionId', type: Extension, isModifier: false, index: 44} elements: extension: type: Extension short: Additional repeatInformation mustSupport: true url: https://fhir.nhs.uk/StructureDefinition/Extension-EPS-RepeatInformation index: 43 slicing: slices: repeatInformation: match: {} schema: {type: Extension, short: Additional repeatInformation, mustSupport: true, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-RepeatInformation', index: 43} max: 1 orignalPrescriptionId: match: {} schema: {type: Extension, isModifier: false, url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionId', index: 44} medicationReference: type: Reference mustSupport: true choiceOf: medication refers: ['https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationRequest-Medication'] index: 30 courseOfTherapyType: binding: {strength: required, valueSet: 'https://fhir.nhs.uk/ValueSet/DM-medicationrequest-course-of-therapy'} mustSupport: true index: 52 elements: coding: index: 53 elements: system: {index: 54} code: {index: 55} 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: 31 elements: identifier: elements: system: pattern: {type: Uri, value: 'https://fhir.nhs.uk/Id/nhs-number'} index: 32 value: {index: 33} 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: 38 medication: mustSupport: true choices: [medicationCodeableConcept, medicationReference] index: 28 reasonReference: {index: 41} package_version: 2.8.20-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 extensions: {} elements: extension: {index: 4} required: [extension] NHSBSAprescriptionType: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-PrescriptionType', type: Extension, short: NHS BSA Prescription Type, mustSupport: true, index: 5} controlledDrug: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-DM-ControlledDrug', max: 1, type: Extension, short: Optional Controlled Drug Extensions, mustSupport: true, index: 6} dispensingInformation: {url: 'https://fhir.nhs.uk/StructureDefinition/Extension-EPS-DispensingInformation', max: 1, type: Extension, short: For EPS use only, mustSupport: true, index: 7} class: profile kind: resource url: https://fhir.nhs.uk/StructureDefinition/NHSDigital-MedicationRequest base: https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationRequest version: 1.0.1 required: [dosageInstruction, requester, groupIdentifier, identifier, courseOfTherapyType, dispenseRequest]