PackagesCanonicalsLogsProblems
    Packages
    nostalgic-ie.fhir.core@0.2.0
    https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-medicationrequest-eprescription
{
  "description": "One prescription item of an Irish electronic prescription (HIQA EP Section 3), derived from the HL7 Europe MPD MedicationRequest. A multi-item prescription is a set of MedicationRequests sharing groupIdentifier, exchanged in an IECoreBundleEPrescription together with the patient, prescriber and the allergy statement.",
  "_filename": "StructureDefinition-ie-core-medicationrequest-eprescription.json",
  "package_name": "nostalgic-ie.fhir.core",
  "date": null,
  "derivation": "constraint",
  "publisher": null,
  "fhirVersion": "4.0.1",
  "name": "IECoreMedicationRequestEPrescription",
  "abstract": false,
  "type": "MedicationRequest",
  "experimental": null,
  "resourceType": "StructureDefinition",
  "title": "IE Core MedicationRequest (ePrescription)",
  "package_version": "0.2.0",
  "status": "draft",
  "id": "27b4fe69-dec5-44b7-ab1f-9ee1970a9713",
  "kind": "resource",
  "url": "https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-medicationrequest-eprescription",
  "version": "0.2.0",
  "differential": {
    "element": [ {
      "id": "MedicationRequest",
      "path": "MedicationRequest",
      "constraint": [ {
        "key": "ie-rx-status-1",
        "human": "A status reason SHALL be given unless the prescription item is active, completed or draft (HIQA EP 3.5.2.2 / 3.5.2.3)",
        "source": "https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-medicationrequest-eprescription",
        "severity": "error",
        "expression": "(status = 'active' or status = 'completed' or status = 'draft') or statusReason.exists()"
      }, {
        "key": "ie-rx-age-1",
        "human": "If the patient is under 12 years old at the date of prescribing, or the date of birth is not a full date, the patient's age SHALL be recorded on the prescription (HIQA EP 1.4.2; a legal requirement in Ireland)",
        "source": "https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-medicationrequest-eprescription",
        "severity": "error",
        "expression": "subject.resolve().ofType(Patient).birthDate.empty() or authoredOn.empty() or ((subject.resolve().ofType(Patient).birthDate.toString().length() = 10) and ((subject.resolve().ofType(Patient).birthDate + 12 years).toString() <= authoredOn.toString().substring(0,10))) or extension('https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-patient-age-at-prescribing').exists()"
      }, {
        "key": "ie-rx-cd-1",
        "human": "A prescription for a controlled drug (any schedule of the Misuse of Drugs Regulations 2017) SHALL state the quantity in words and figures (HIQA EP 3.5.7.2)",
        "source": "https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-medicationrequest-eprescription",
        "severity": "error",
        "expression": "(medication.ofType(Reference).resolve().extension('https://profiles.ihe.net/PHARM/MPD/StructureDefinition/ihe-ext-medication-classification').value.ofType(CodeableConcept).coding.where(system = 'https://hl7-ie.github.io/ie-core/fhir/ie/core/CodeSystem/ie-core-mda-schedule').exists()) implies extension('https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-quantity-in-words-and-figures').exists()"
      }, {
        "key": "ie-rx-cd-2",
        "human": "A prescription for a Schedule 2 or 3 controlled drug SHALL have a validity period ending no later than 14 days after the date of issue, or, for an instalment prescription, no later than two months after (the final instalment) (HIQA EP 3.5.9.1; Misuse of Drugs Regulations 2017)",
        "source": "https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-medicationrequest-eprescription",
        "severity": "error",
        "expression": "(medication.ofType(Reference).resolve().extension('https://profiles.ihe.net/PHARM/MPD/StructureDefinition/ihe-ext-medication-classification').value.ofType(CodeableConcept).coding.where(system = 'https://hl7-ie.github.io/ie-core/fhir/ie/core/CodeSystem/ie-core-mda-schedule' and (code = 'schedule-2' or code = 'schedule-3')).exists()) implies (dispenseRequest.validityPeriod.end.exists() and ((dispenseRequest.extension('https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-number-of-instalments').exists() and dispenseRequest.validityPeriod.end.toString().substring(0,10) <= (authoredOn + 2 months).toString().substring(0,10)) or (dispenseRequest.validityPeriod.end.toString().substring(0,10) <= (authoredOn + 14 days).toString().substring(0,10))))"
      }, {
        "key": "ie-rx-cd-3",
        "human": "A prescription for a Schedule 2, 3 or 4 Part 1 controlled drug SHALL state the number of instalments and, when there is more than one, the interval between them (HIQA EP 3.5.12, 3.5.13; Misuse of Drugs Regulations 2017)",
        "source": "https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-medicationrequest-eprescription",
        "severity": "error",
        "expression": "(medication.ofType(Reference).resolve().extension('https://profiles.ihe.net/PHARM/MPD/StructureDefinition/ihe-ext-medication-classification').value.ofType(CodeableConcept).coding.where(system = 'https://hl7-ie.github.io/ie-core/fhir/ie/core/CodeSystem/ie-core-mda-schedule' and (code = 'schedule-2' or code = 'schedule-3' or code = 'schedule-4-part-1')).exists()) implies (dispenseRequest.extension('https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-number-of-instalments').exists() and ((dispenseRequest.extension('https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-number-of-instalments').value.ofType(positiveInt) > 1) implies dispenseRequest.dispenseInterval.exists()))"
      }, {
        "key": "ie-rx-subst-1",
        "human": "When substitution is not allowed ('Do Not Substitute'), a reason SHALL be given (HIQA EP 3.5.10.3)",
        "source": "https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-medicationrequest-eprescription",
        "severity": "error",
        "expression": "substitution.allowed.ofType(boolean).where($this = false).exists() implies substitution.reason.exists()"
      } ]
    }, {
      "id": "MedicationRequest.extension:offLabelUse",
      "path": "MedicationRequest.extension",
      "comment": "HIQA EP 3.5.14 Off label (Required): 3.5.14.1 off-label use (Mandatory within the cluster) and 3.5.14.2 reason (coded or free text). IHE ihe-ext-offLabel, inherited from HL7 Europe MPD; replaces the retired IECoreOffLabelUse.",
      "sliceName": "offLabelUse",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.extension:effectiveDosePeriod",
      "path": "MedicationRequest.extension",
      "comment": "HIQA EP 3.5.6 Period of use (Required 0..1): overall period of all dosage schemes.",
      "sliceName": "effectiveDosePeriod",
      "mustSupport": true
    }, {
      "path": "MedicationRequest.extension",
      "min": 0,
      "short": "Patient age at prescribing (a legal requirement if under 12)",
      "type": [ {
        "code": "Extension",
        "profile": [ "https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-patient-age-at-prescribing" ]
      } ],
      "mustSupport": true,
      "sliceName": "ageAtPrescribing",
      "max": "1",
      "id": "MedicationRequest.extension:ageAtPrescribing",
      "comment": "HIQA EP 1.4.2 Age (Required 0..1; 1.4.2.1 value and 1.4.2.2 type Mandatory within the cluster). Required when the patient is under 12 at authoredOn (invariants ie-rx-age-1, ie-bnd-rx-3)."
    }, {
      "id": "MedicationRequest.extension:quantityInWordsAndFigures",
      "max": "1",
      "min": 0,
      "path": "MedicationRequest.extension",
      "type": [ {
        "code": "Extension",
        "profile": [ "https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-quantity-in-words-and-figures" ]
      } ],
      "comment": "HIQA EP 3.5.7.2 Quantity prescribed (free text, words and figures): must be recorded for any medication listed as a controlled drug under the Misuse of Drugs Regulations 2017 (invariant ie-rx-cd-1).",
      "sliceName": "quantityInWordsAndFigures",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.identifier",
      "min": 1,
      "path": "MedicationRequest.identifier",
      "comment": "HIQA EP 3.5.1 Prescription item identifier (Mandatory 1..*). For a single-item prescription this is typically the same as the electronic prescription identifier (EP 3.1).",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.status",
      "path": "MedicationRequest.status",
      "comment": "HIQA EP 3.5.2.1 Prescription item status (Mandatory 1..1): e.g. active, on-hold (inactive) or completed (dispensed). The status of the whole prescription (EP 3.3) is derived from its items: all completed = complete; any active = active; otherwise inactive.",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.statusReason",
      "path": "MedicationRequest.statusReason",
      "comment": "HIQA EP 3.5.2.2 (Required) and 3.5.2.3 (free text, in statusReason.text). Must be given unless the status is active or completed (invariant ie-rx-status-1).",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.intent",
      "path": "MedicationRequest.intent",
      "patternCode": "order"
    }, {
      "id": "MedicationRequest.category",
      "path": "MedicationRequest.category",
      "comment": "HIQA EP 3.5.5 Intended use of prescription item (Optional), e.g. prophylaxis, therapeutic or diagnostic.",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.medication[x]",
      "path": "MedicationRequest.medication[x]",
      "type": [ {
        "code": "Reference",
        "targetProfile": [ "https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-medication-eprescription" ]
      } ],
      "comment": "HIQA EP 3.5.3 Prescribed medication item (Mandatory 1..1); see Section 4 (IECoreMedicationEPrescription). A reference is required (not an inline CodeableConcept): HIQA EP 4.7.2 makes the ingredient Mandatory, and the controlled-drug rules (ie-rx-cd-1/2/3) read the MDA schedule from the Medication (independent review R-01). SNOMED CT Irish Edition / NMPC coding in Medication.code.",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.subject",
      "path": "MedicationRequest.subject",
      "type": [ {
        "code": "Reference",
        "targetProfile": [ "https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-patient-eprescription" ]
      } ],
      "comment": "HIQA EP Section 1 Patient Details. The patient profile carries only the HIQA EP dataset (ADR-002).",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.supportingInformation",
      "path": "MedicationRequest.supportingInformation",
      "comment": "HIQA EP 1.6 Clinical information: SHALL reference the allergy statement (IECoreListAllergiesAtPrescribing; EP 1.6.1/1.6.2, invariant ie-bnd-rx-2) and MAY reference weight (IECoreBodyWeight, EP 1.6.3) and height (IECoreBodyHeight, EP 1.6.4).",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.authoredOn",
      "path": "MedicationRequest.authoredOn",
      "comment": "HIQA EP 3.2 Date and time of issuing the prescription (Mandatory 1..1).",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.requester",
      "path": "MedicationRequest.requester",
      "type": [ {
        "code": "Reference",
        "targetProfile": [ "https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-practitionerrole", "https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-practitioner" ]
      } ],
      "comment": "HIQA EP Section 2 Health Practitioner Details. The prescriber must be a registered health practitioner (EP 2.6, Mandatory), so an Organization is not allowed. Prefer PractitionerRole, which carries the role (2.5), facility (2.7–2.12) and contact details (2.10).",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.reasonCode",
      "path": "MedicationRequest.reasonCode",
      "comment": "HIQA EP 3.5.4.1 Indication (coded, Optional) and 3.5.4.2 (free text, in reasonCode.text).",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.groupIdentifier",
      "path": "MedicationRequest.groupIdentifier",
      "comment": "HIQA EP 3.1 Electronic prescription (group) identifier (Mandatory 1..*): the NePS identifier used throughout the prescription and dispensation life cycle. Required when the prescription has more than one item (Bundle invariant ie-bnd-rx-1).",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.courseOfTherapyType",
      "path": "MedicationRequest.courseOfTherapyType",
      "comment": "Acute or continuous (repeat) prescribing. Not a HIQA element; supports EP 3.5.11.",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.note",
      "path": "MedicationRequest.note",
      "comment": "HIQA EP 3.6.1 Note (Optional) and 1.6.5 Additional clinical notes (Optional): for the patient or the pharmacist.",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.dosageInstruction",
      "min": 1,
      "path": "MedicationRequest.dosageInstruction",
      "comment": "HIQA EP 3.5.8 Dosage instructions (Mandatory 1..1) and Section 5 Dosaging.",
      "constraint": [ {
        "key": "ie-rx-dosage-1",
        "human": "A structured dosage SHALL be accompanied by a human-readable dosage text (safety fallback; HIQA EP 5.1 / 5.2)",
        "source": "https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-medicationrequest-eprescription",
        "severity": "error",
        "expression": "(timing.exists() or doseAndRate.exists()) implies text.exists()"
      } ],
      "mustSupport": true
    }, {
      "id": "MedicationRequest.dosageInstruction.sequence",
      "path": "MedicationRequest.dosageInstruction.sequence",
      "comment": "HIQA EP 5.2.1 Sequence (Optional)."
    }, {
      "id": "MedicationRequest.dosageInstruction.text",
      "min": 1,
      "path": "MedicationRequest.dosageInstruction.text",
      "comment": "HIQA EP 5.1 Rendered dosage instruction (Optional). IE Core requires it (stricter than HIQA, OI-012) as a human-readable safety fallback for the structured dosage.",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.dosageInstruction.additionalInstruction",
      "path": "MedicationRequest.dosageInstruction.additionalInstruction",
      "comment": "Additional instructions (e.g. 'with food'); complements HIQA EP 5.2.2.",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.dosageInstruction.patientInstruction",
      "path": "MedicationRequest.dosageInstruction.patientInstruction",
      "comment": "HIQA EP 5.2.2 Note for patient (Required).",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.dosageInstruction.timing",
      "path": "MedicationRequest.dosageInstruction.timing",
      "comment": "HIQA EP 5.2.4 Repeat administration (Required): bounds (5.2.4.1), duration (5.2.4.2), frequency and period (5.2.4.3), day of week (5.2.4.4), time of day (5.2.4.5), event (5.2.4.6).",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.dosageInstruction.timing.repeat.frequency",
      "path": "MedicationRequest.dosageInstruction.timing.repeat.frequency",
      "comment": "HIQA EP 5.2.4.3.1 Frequency of administration (Mandatory within the frequency cluster).",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.dosageInstruction.timing.repeat.period",
      "path": "MedicationRequest.dosageInstruction.timing.repeat.period",
      "comment": "HIQA EP 5.2.4.3.2 Period (Mandatory within the frequency cluster), with periodUnit.",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.dosageInstruction.timing.repeat.periodUnit",
      "path": "MedicationRequest.dosageInstruction.timing.repeat.periodUnit",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.dosageInstruction.asNeeded[x]",
      "path": "MedicationRequest.dosageInstruction.asNeeded[x]",
      "comment": "HIQA EP 5.2.5 Administer as needed (Optional)."
    }, {
      "id": "MedicationRequest.dosageInstruction.site",
      "path": "MedicationRequest.dosageInstruction.site",
      "comment": "HIQA EP 5.2.6 Body site (Optional): morphology, location, qualifier and laterality post-coordinated in SNOMED CT, or described in site.text (5.2.6.5)."
    }, {
      "id": "MedicationRequest.dosageInstruction.route",
      "path": "MedicationRequest.dosageInstruction.route",
      "comment": "HIQA EP 5.2.7 Route of administration (Required); EDQM Standard Terms preferred.",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.dosageInstruction.doseAndRate",
      "path": "MedicationRequest.dosageInstruction.doseAndRate",
      "comment": "HIQA EP 5.2.3 Dose and rate (Required): dose quantity or range (5.2.3.1), rate (5.2.3.2).",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.dosageInstruction.doseAndRate.dose[x]",
      "path": "MedicationRequest.dosageInstruction.doseAndRate.dose[x]",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.dosageInstruction.maxDosePerPeriod",
      "path": "MedicationRequest.dosageInstruction.maxDosePerPeriod",
      "comment": "Maximum dose per period (not a distinct HIQA element; supports safe 'as needed' dosing).",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.dispenseRequest",
      "min": 1,
      "path": "MedicationRequest.dispenseRequest",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.dispenseRequest.extension:prescribedQuantity",
      "path": "MedicationRequest.dispenseRequest.extension",
      "comment": "HIQA EP 3.5.7.1 Quantity prescribed (Required): overall quantity, independent of repeats (IHE extension via HL7 Europe MPD).",
      "sliceName": "prescribedQuantity",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.dispenseRequest.extension:numberOfInstalments",
      "max": "1",
      "min": 0,
      "path": "MedicationRequest.dispenseRequest.extension",
      "type": [ {
        "code": "Extension",
        "profile": [ "https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-number-of-instalments" ]
      } ],
      "comment": "HIQA EP 3.5.12 Number of instalments (Required): a legal requirement for Schedule 2, 3 and 4 Part 1 controlled drugs (invariant ie-rx-cd-3).",
      "sliceName": "numberOfInstalments",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.dispenseRequest.extension:doNotExtend",
      "max": "1",
      "min": 0,
      "path": "MedicationRequest.dispenseRequest.extension",
      "type": [ {
        "code": "Extension",
        "profile": [ "https://hl7-ie.github.io/ie-core/fhir/ie/core/StructureDefinition/ie-core-do-not-extend" ]
      } ],
      "comment": "HIQA EP 3.5.9.2 'Do Not Extend' (Optional).",
      "sliceName": "doNotExtend"
    }, {
      "id": "MedicationRequest.dispenseRequest.dispenseInterval",
      "path": "MedicationRequest.dispenseRequest.dispenseInterval",
      "comment": "HIQA EP 3.5.13 Minimum dispense interval (Required); also the instalment interval, which must be specified for Schedule 2, 3 and 4 Part 1 instalment prescriptions (invariant ie-rx-cd-3).",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.dispenseRequest.validityPeriod",
      "path": "MedicationRequest.dispenseRequest.validityPeriod",
      "comment": "HIQA EP 3.5.9.1 Validity period (Required). If no start is given, it is the date of issue. Up to 12 months for non-controlled drugs. Schedule 2 and 3 controlled drugs: 14 days, or for instalment prescriptions the final instalment within two months (the first instalment within 14 days is checked at dispensing, OI-027) (invariant ie-rx-cd-2).",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.dispenseRequest.numberOfRepeatsAllowed",
      "path": "MedicationRequest.dispenseRequest.numberOfRepeatsAllowed",
      "comment": "HIQA EP 3.5.11 Repeats of prescription item allowed (Optional); default 0. Repeats already dispensed are DERIVED from the completed MedicationDispense records that reference this request, not stored (ADR-003).",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.dispenseRequest.quantity",
      "min": 1,
      "path": "MedicationRequest.dispenseRequest.quantity",
      "comment": "Quantity to supply per dispense. IE Core requires it (1..1, stricter than HIQA EP 3.5.7 Required 0..1; OI-012).",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.substitution",
      "path": "MedicationRequest.substitution",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.substitution.allowed[x]",
      "path": "MedicationRequest.substitution.allowed[x]",
      "comment": "HIQA EP 3.5.10.2 'Do Not Substitute' (Optional): allowedBoolean = false means 'Do Not Substitute'. A legal requirement to endorse the item if the prescriber invokes it.",
      "mustSupport": true
    }, {
      "id": "MedicationRequest.substitution.reason",
      "path": "MedicationRequest.substitution.reason",
      "comment": "HIQA EP 3.5.10.3 Reason for not allowing substitution (Required when 'Do Not Substitute'; free text in reason.text; invariant ie-rx-subst-1).",
      "mustSupport": true
    } ]
  },
  "baseDefinition": "http://hl7.eu/fhir/mpd/StructureDefinition/MedicationRequest-eu-mpd"
}