{
  "resourceType": "StructureDefinition",
  "id": "medicationRequest-eu-core",
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
      "valueInteger": 2
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
      "valueCode": "trial-use"
    }
  ],
  "url": "http://hl7.eu/fhir/base/StructureDefinition/medicationRequest-eu-core",
  "name": "MedicationRequestEuCore",
  "title": "MedicationRequest (EU core)",
  "status": "active",
  "description": "This profile introduces essential constraints and extensions for the MedicationRequest resource that apply across multiple use cases.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "MedicationRequest",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/MedicationRequest",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "MedicationRequest.language",
        "path": "MedicationRequest.language",
        "short": "Language of the request"
      },
      {
        "id": "MedicationRequest.extension",
        "path": "MedicationRequest.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "MedicationRequest.extension:effectiveDosePeriod",
        "path": "MedicationRequest.extension",
        "sliceName": "effectiveDosePeriod",
        "short": "Period over which the medication should be taken.",
        "definition": "Period over which the medication should be taken. Where there are multiple dosageInstruction lines (for example, tapering doses), this is the earliest date and the latest end date of the dosageInstructions.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/5.0/StructureDefinition/extension-MedicationRequest.effectiveDosePeriod"
            ]
          }
        ]
      },
      {
        "id": "MedicationRequest.extension:renderedDosageInstruction",
        "path": "MedicationRequest.extension",
        "sliceName": "renderedDosageInstruction",
        "short": "Full representation of the dosage instructions",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/5.0/StructureDefinition/extension-MedicationRequest.renderedDosageInstruction"
            ]
          }
        ]
      },
      {
        "id": "MedicationRequest.identifier",
        "path": "MedicationRequest.identifier",
        "short": "Business identifier for this request"
      },
      {
        "id": "MedicationRequest.status",
        "path": "MedicationRequest.status",
        "short": "Current state of the order"
      },
      {
        "id": "MedicationRequest.statusReason",
        "path": "MedicationRequest.statusReason",
        "short": "Reason for current status of the order"
      },
      {
        "id": "MedicationRequest.intent",
        "path": "MedicationRequest.intent",
        "short": "Order, proposal or plan"
      },
      {
        "id": "MedicationRequest.category",
        "path": "MedicationRequest.category",
        "short": "Category of the medication request"
      },
      {
        "id": "MedicationRequest.medication[x]",
        "path": "MedicationRequest.medication[x]",
        "type": [
          {
            "code": "CodeableConcept"
          },
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.eu/fhir/base/StructureDefinition/medication-eu-core"
            ]
          }
        ]
      },
      {
        "id": "MedicationRequest.subject",
        "path": "MedicationRequest.subject",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.eu/fhir/base/StructureDefinition/patient-eu-core",
              "http://hl7.org/fhir/StructureDefinition/Group"
            ]
          }
        ]
      },
      {
        "id": "MedicationRequest.authoredOn",
        "path": "MedicationRequest.authoredOn",
        "short": "Date when the request was authored"
      },
      {
        "id": "MedicationRequest.requester",
        "path": "MedicationRequest.requester",
        "short": "The individual responsible for ordering the medication",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.eu/fhir/base/StructureDefinition/patient-eu-core",
              "http://hl7.eu/fhir/base/StructureDefinition/practitioner-eu-core",
              "http://hl7.eu/fhir/base/StructureDefinition/practitionerRole-eu-core",
              "http://hl7.eu/fhir/base/StructureDefinition/organization-eu-core",
              "http://hl7.org/fhir/StructureDefinition/RelatedPerson"
            ]
          }
        ]
      },
      {
        "id": "MedicationRequest.reasonCode",
        "path": "MedicationRequest.reasonCode",
        "short": "Reason or indication for this prescription",
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/tools/StructureDefinition/additional-binding",
              "valueString": "MedicationRequestReason",
              "extension": [
                {
                  "url": "purpose",
                  "valueCode": "preferred"
                },
                {
                  "url": "valueSet",
                  "valueCanonical": "http://terminology.ehdsi.eu/ValueSet/eHDSIIllnessandDisorder"
                },
                {
                  "url": "documentation",
                  "valueMarkdown": "MyHealth@EU crossborder value set for diagnoses. Based on WHO ICD 10."
                }
              ]
            }
          ],
          "strength": "example",
          "description": "A coded concept indicating why the medication was ordered.",
          "valueSet": "http://hl7.org/fhir/ValueSet/condition-code"
        }
      },
      {
        "id": "MedicationRequest.reasonReference",
        "path": "MedicationRequest.reasonReference",
        "short": "Condition or observation that supports this prescription"
      },
      {
        "id": "MedicationRequest.groupIdentifier",
        "path": "MedicationRequest.groupIdentifier",
        "short": "Group identifier"
      },
      {
        "id": "MedicationRequest.note.text",
        "path": "MedicationRequest.note.text",
        "short": "Textual note about the request"
      },
      {
        "id": "MedicationRequest.dosageInstruction",
        "path": "MedicationRequest.dosageInstruction",
        "short": "How the medication should be taken."
      },
      {
        "id": "MedicationRequest.dosageInstruction.text",
        "path": "MedicationRequest.dosageInstruction.text",
        "short": "Free text dosage instructions"
      },
      {
        "id": "MedicationRequest.dosageInstruction.timing",
        "path": "MedicationRequest.dosageInstruction.timing",
        "short": "Administration schedule"
      },
      {
        "id": "MedicationRequest.dosageInstruction.timing.repeat.duration",
        "path": "MedicationRequest.dosageInstruction.timing.repeat.duration",
        "short": "Duration of the treatment"
      },
      {
        "id": "MedicationRequest.dosageInstruction.timing.repeat.frequency",
        "path": "MedicationRequest.dosageInstruction.timing.repeat.frequency",
        "short": "Frequency times per period"
      },
      {
        "id": "MedicationRequest.dosageInstruction.timing.repeat.period",
        "path": "MedicationRequest.dosageInstruction.timing.repeat.period",
        "short": "Duration of time over which repetitions are to occur"
      },
      {
        "id": "MedicationRequest.dosageInstruction.timing.repeat.periodUnit",
        "path": "MedicationRequest.dosageInstruction.timing.repeat.periodUnit",
        "short": "Unit of the period (e.g. day)"
      },
      {
        "id": "MedicationRequest.dosageInstruction.timing.code",
        "path": "MedicationRequest.dosageInstruction.timing.code",
        "short": "A code for the timing schedule."
      },
      {
        "id": "MedicationRequest.dosageInstruction.route",
        "path": "MedicationRequest.dosageInstruction.route",
        "short": "Route of administration"
      },
      {
        "id": "MedicationRequest.dosageInstruction.doseAndRate.dose[x]",
        "path": "MedicationRequest.dosageInstruction.doseAndRate.dose[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "MedicationRequest.dosageInstruction.doseAndRate.dose[x]:doseQuantity",
        "path": "MedicationRequest.dosageInstruction.doseAndRate.dose[x]",
        "sliceName": "doseQuantity",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Quantity",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/SimpleQuantity"
            ]
          }
        ]
      },
      {
        "id": "MedicationRequest.dispenseRequest.extension",
        "path": "MedicationRequest.dispenseRequest.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "MedicationRequest.dispenseRequest.extension:prescribedQuantity",
        "path": "MedicationRequest.dispenseRequest.extension",
        "sliceName": "prescribedQuantity",
        "short": "Overall amount of product prescribed, independent from the number of repeats.",
        "definition": "When Medication resource implies a pack size, prescribedQuantity should convey number of packages. When the Medication does not imply an amount, overall amount could be in tablets or millilitres.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://profiles.ihe.net/PHARM/MPD/StructureDefinition/ihe-ext-medicationrequest-prescribedQuantity"
            ]
          }
        ]
      },
      {
        "id": "MedicationRequest.dispenseRequest.dispenseInterval",
        "path": "MedicationRequest.dispenseRequest.dispenseInterval",
        "short": "Interval between dispenses"
      },
      {
        "id": "MedicationRequest.dispenseRequest.validityPeriod",
        "path": "MedicationRequest.dispenseRequest.validityPeriod",
        "short": "Validity period of the dispense request"
      },
      {
        "id": "MedicationRequest.dispenseRequest.numberOfRepeatsAllowed",
        "path": "MedicationRequest.dispenseRequest.numberOfRepeatsAllowed",
        "short": "Number of repeats allowed"
      },
      {
        "id": "MedicationRequest.substitution",
        "path": "MedicationRequest.substitution",
        "short": "Whether substitution is allowed"
      }
    ]
  }
}
