<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="medicationrequest-ca-core" />
  <extension url="http://hl7.org/fhir/StructureDefinition/obligation">
    <extension url="code">
      <valueCode value="SHALL:able-to-populate" />
    </extension>
    <extension url="elementId">
      <valueString value="status" />
    </extension>
    <extension url="elementId">
      <valueString value="priority" />
    </extension>
    <extension url="elementId">
      <valueString value="medicationReference" />
    </extension>
    <extension url="elementId">
      <valueString value="medicationCodeableConcept" />
    </extension>
    <extension url="elementId">
      <valueString value="authoredOn" />
    </extension>
    <extension url="elementId">
      <valueString value="requester" />
    </extension>
    <extension url="elementId">
      <valueString value="dosageInstruction" />
    </extension>
    <extension url="elementId">
      <valueString value="dosageInstruction.text" />
    </extension>
    <extension url="elementId">
      <valueString value="dosageInstruction.timing" />
    </extension>
    <extension url="elementId">
      <valueString value="dosageInstruction.timing.repeat" />
    </extension>
    <extension url="elementId">
      <valueString value="dosageInstruction.timing.repeat.frequency" />
    </extension>
    <extension url="elementId">
      <valueString value="dosageInstruction.timing.repeat.period" />
    </extension>
    <extension url="elementId">
      <valueString value="dosageInstruction.route" />
    </extension>
    <extension url="elementId">
      <valueString value="dosageInstruction.doseAndRate" />
    </extension>
    <extension url="elementId">
      <valueString value="dosageInstruction.doseAndRate.dose[x]" />
    </extension>
    <extension url="elementId">
      <valueString value="dispenseRequest.numberOfRepeatsAllowed" />
    </extension>
    <extension url="actor">
      <valueCanonical value="http://fhir.infoway-inforoute.ca/ca-core/ActorDefinition/server" />
    </extension>
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/obligation">
    <extension url="code">
      <valueCode value="SHALL:no-error" />
    </extension>
    <extension url="elementId">
      <valueString value="status" />
    </extension>
    <extension url="elementId">
      <valueString value="priority" />
    </extension>
    <extension url="elementId">
      <valueString value="medicationReference" />
    </extension>
    <extension url="elementId">
      <valueString value="medicationCodeableConcept" />
    </extension>
    <extension url="elementId">
      <valueString value="authoredOn" />
    </extension>
    <extension url="elementId">
      <valueString value="requester" />
    </extension>
    <extension url="elementId">
      <valueString value="dosageInstruction" />
    </extension>
    <extension url="elementId">
      <valueString value="dosageInstruction.timing" />
    </extension>
    <extension url="elementId">
      <valueString value="dosageInstruction.timing.repeat" />
    </extension>
    <extension url="elementId">
      <valueString value="dosageInstruction.timing.repeat.frequency" />
    </extension>
    <extension url="elementId">
      <valueString value="dosageInstruction.timing.repeat.period" />
    </extension>
    <extension url="elementId">
      <valueString value="dosageInstruction.route" />
    </extension>
    <extension url="elementId">
      <valueString value="dosageInstruction.doseAndRate" />
    </extension>
    <extension url="elementId">
      <valueString value="dosageInstruction.doseAndRate.dose[x]" />
    </extension>
    <extension url="elementId">
      <valueString value="dispenseRequest.numberOfRepeatsAllowed" />
    </extension>
    <extension url="actor">
      <valueCanonical value="http://fhir.infoway-inforoute.ca/ca-core/ActorDefinition/client" />
    </extension>
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-imposeProfile">
    <valueCanonical value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-medicationRequest" />
  </extension>
  <url value="http://fhir.infoway-inforoute.ca/ca-core/StructureDefinition/medicationrequest-ca-core" />
  <name value="MedicationRequestCACore" />
  <title value="Medication Request (CA-Core)" />
  <status value="draft" />
  <experimental value="false" />
  <description value="This profile represents the constraints applied to the MedicationRequest resource by the CA Core+ project to represent the minimum expectations for the MedicationRequest resource when used to promote capacity building for functionality found across Canadian FHIR implementations. It is informed by the constraints of shared across CIHI pCHDCF data sets and has also undergone analysis to assert alignment with the [Canadian Baseline MedicationRequest Profile v1.1.0](http://build.fhir.org/ig/HL7-Canada/ca-baseline/branches/master/StructureDefinition-profile-medicationrequest.html)" />
  <copyright value="Copyright © 2024 Canada Health Infoway. All rights reserved. [Terms of Use and License Agreements](https://ic.infoway-inforoute.ca/en/about/tou). [Privacy Policy](https://www.infoway-inforoute.ca/en/legal/privacy-policy)." />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="pCHDCF" />
    <name value="Pan-Canadian Health Data Content Framework" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="MedicationRequest" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/MedicationRequest" />
  <derivation value="constraint" />
  <differential>
    <element id="MedicationRequest.status">
      <path value="MedicationRequest.status" />
      <mapping>
        <identity value="pCHDCF" />
        <map value="Medication Request Status" />
      </mapping>
    </element>
    <element id="MedicationRequest.priority">
      <path value="MedicationRequest.priority" />
      <mapping>
        <identity value="pCHDCF" />
        <map value="Medication Request Priority" />
      </mapping>
    </element>
    <element id="MedicationRequest.intent">
      <path value="MedicationRequest.intent" />
      <comment value="This element is considered mandatory in the Base FHIR R4 Specification. &#xD;&#xA;&#xD;&#xA;Base R4 Note: It is expected that the type of requester will be restricted for different stages of a MedicationRequest. For example, Proposals can be created by a patient, relatedPerson, Practitioner or Device. Plans can be created by Practitioners, Patients, RelatedPersons and Devices. Original orders can be created by a Practitioner only. An instance-order is an instantiation of a request or order and may be used to populate Medication Administration Record. This element is labeled as a modifier because the intent alters when and how the resource is actually applicable." />
    </element>
    <element id="MedicationRequest.medication[x]">
      <path value="MedicationRequest.medication[x]" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <comment value="Currently, this profile allows pCHDCF medication code and name concepts to be met through either medicationReference or medicationCodeableConcept. Future expectations to support one data type over another will become clearer as pCHDCF modelling evolves and expressed the minimum set of information that needs to be demonstrable for a medicationRequest. For example, if details only expressed on the medication resource (e.g., the amount of drug in the packaged product, form details separate from the form expressed on the CCDD code) needs to be exchanged in relation to a medicationRequest then support of medicationReference may be required to meet the full breadth of expectation." />
      <mapping>
        <identity value="pCHDCF" />
        <map value="Medication Code" />
        <comment value="Mapping of this concept applies to both medicationReference or medicationCodeableConcept data types" />
      </mapping>
      <mapping>
        <identity value="pCHDCF" />
        <map value="Medication Brand Name" />
        <comment value="Mapping of this concept applies to both medicationReference or medicationCodeableConcept data types" />
      </mapping>
      <mapping>
        <identity value="pCHDCF" />
        <map value="Medication Generic Name" />
        <comment value="Mapping of this concept applies to both medicationReference or medicationCodeableConcept data types" />
      </mapping>
    </element>
    <element id="MedicationRequest.medication[x]:medicationReference">
      <path value="MedicationRequest.medication[x]" />
      <sliceName value="medicationReference" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/ca-core/StructureDefinition/medication-ca-core" />
      </type>
      <mapping>
        <identity value="pCHDCF" />
        <map value="Medication Details*" />
        <comment value="*The reference that is the target of this element conveys additional details about the Medication (e.g., Code, Brand Name, Generic Name) as indicated in the pCHDCF artefacts. Readers should review the profile to understand the pCHDCF mapping against its elements" />
      </mapping>
    </element>
    <element id="MedicationRequest.medication[x]:medicationCodeableConcept">
      <path value="MedicationRequest.medication[x]" />
      <sliceName value="medicationCodeableConcept" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/tools/StructureDefinition/additional-binding">
          <extension url="purpose">
            <valueCode value="candidate" />
          </extension>
          <extension url="valueSet">
            <valueCanonical value="https://fhir.infoway-inforoute.ca/ValueSet/manufacturedproductmp" />
          </extension>
          <extension url="documentation">
            <valueMarkdown value="ValueSet used to convey Medication Brand Name for Manufactured Products" />
          </extension>
        </extension>
        <extension url="http://hl7.org/fhir/tools/StructureDefinition/additional-binding">
          <extension url="purpose">
            <valueCode value="candidate" />
          </extension>
          <extension url="valueSet">
            <valueCanonical value="https://fhir.infoway-inforoute.ca/ValueSet/non-proprietarytherapeuticproductntp" />
          </extension>
          <extension url="documentation">
            <valueMarkdown value="ValueSet used to convey Medication Generic Name for Non-Proprietary Therapeutic Products" />
          </extension>
        </extension>
        <extension url="http://hl7.org/fhir/tools/StructureDefinition/additional-binding">
          <extension url="purpose">
            <valueCode value="candidate" />
          </extension>
          <extension url="valueSet">
            <valueCanonical value="https://fhir.infoway-inforoute.ca/ValueSet/devicenon-proprietarytherapeuticproductdevicentp" />
          </extension>
          <extension url="documentation">
            <valueMarkdown value="ValueSet used to convey Medication Generic Name for Device Non-Proprietary Therapeutic Products" />
          </extension>
        </extension>
        <strength value="preferred" />
        <valueSet value="http://fhir.infoway-inforoute.ca/ValueSet/hc-CCDD" />
      </binding>
      <mapping>
        <identity value="pCHDCF" />
        <map value="Medication Code*" />
        <comment value="*medicationCodeableConcept may convey both coded (e.g., code, system, display) as well as text details for this concept" />
      </mapping>
      <mapping>
        <identity value="pCHDCF" />
        <map value="Medication Brand Name*" />
        <comment value="*medicationCodeableConcept may convey both coded (e.g., code, system, display) as well as text details for this concept" />
      </mapping>
      <mapping>
        <identity value="pCHDCF" />
        <map value="Medication Generic Name*" />
        <comment value="*medicationCodeableConcept may convey both coded (e.g., code, system, display) as well as text details for this concept" />
      </mapping>
    </element>
    <element id="MedicationRequest.subject">
      <path value="MedicationRequest.subject" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/ca-core/StructureDefinition/patient-ca-core" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Group" />
      </type>
    </element>
    <element id="MedicationRequest.authoredOn">
      <path value="MedicationRequest.authoredOn" />
      <mapping>
        <identity value="pCHDCF" />
        <map value="Medication Request Date" />
      </mapping>
    </element>
    <element id="MedicationRequest.requester">
      <path value="MedicationRequest.requester" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/ca-core/StructureDefinition/practitioner-ca-core" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/ca-core/StructureDefinition/practitionerRole-ca-core" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Device" />
      </type>
      <mapping>
        <identity value="pCHDCF" />
        <map value="Medication Prescriber*" />
        <comment value="*The reference that is the target of this element conveys additional details about the Medication Prescriber (e.g. first name, last name, ID) as indicated in the pCHDCF artefacts" />
      </mapping>
    </element>
    <element id="MedicationRequest.dosageInstruction">
      <path value="MedicationRequest.dosageInstruction" />
    </element>
    <element id="MedicationRequest.dosageInstruction.text">
      <path value="MedicationRequest.dosageInstruction.text" />
      <comment value="Implementers are encouraged to provide feedback on the impact of expectating systems demonstrate they support the text element without further expectations to demonstrate they can populate or receive the sequence element (which can be used when dosageInstructions have more than one line that should be treated sequentially)" />
      <mapping>
        <identity value="pCHDCF" />
        <map value="Medication Administration Instruction" />
      </mapping>
    </element>
    <element id="MedicationRequest.dosageInstruction.timing">
      <path value="MedicationRequest.dosageInstruction.timing" />
      <mapping>
        <identity value="pCHDCF" />
        <map value="Medication Administration Instruction Time" />
        <comment value="The current definition for this concept implies a separation of generic instructions from the instructions of when the medication should be administered. While dosageInstruction.timing provides these details, the current mapping is to a backbone element where individual structured components are expressed together to provide meaning (e.g., frequency + period + bounds instead of a instruction text string for timing). Implementers are encouraged to provide feedback on the frrquency that these separated timing instructions are captured in string form in child fields (e.g., dosageInstruction.additionalInstruction, dosageInstruction.code.text) to more specific targets in future releases" />
      </mapping>
    </element>
    <element id="MedicationRequest.dosageInstruction.timing.repeat.frequency">
      <path value="MedicationRequest.dosageInstruction.timing.repeat.frequency" />
      <mapping>
        <identity value="pCHDCF" />
        <map value="Medication Frequency" />
        <comment value="The current definition for this concept implies that the frequency is understood within a given time period. To fully provide meaning to frequency under this definition, the MedicationRequest.dosageInstruction.timing.repeat.period element must also be used." />
      </mapping>
    </element>
    <element id="MedicationRequest.dosageInstruction.timing.repeat.period">
      <path value="MedicationRequest.dosageInstruction.timing.repeat.period" />
      <mapping>
        <identity value="pCHDCF" />
        <map value="Medication Frequency*" />
        <comment value="*The current definition for this concept implies that the frequency is understood within a given time period. To fully provide meaning to frequency under this definition, the MedicationRequest.dosageInstruction.timing.repeat.period element must also be used." />
      </mapping>
    </element>
    <element id="MedicationRequest.dosageInstruction.route">
      <path value="MedicationRequest.dosageInstruction.route" />
      <binding>
        <extension url="http://hl7.org/fhir/tools/StructureDefinition/additional-binding">
          <extension url="purpose">
            <valueCode value="candidate" />
          </extension>
          <extension url="valueSet">
            <valueCanonical value="https://fhir.infoway-inforoute.ca/ValueSet/routeofadministration" />
          </extension>
          <extension url="documentation">
            <valueMarkdown value="SCTCA Route of Administration" />
          </extension>
        </extension>
        <strength value="preferred" />
        <description value="Route of admnistration for the prescription from the PrescribeIT value set" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/prescriptionrouteofadministration" />
      </binding>
      <mapping>
        <identity value="pCHDCF" />
        <map value="Medication Route of Administration" />
      </mapping>
    </element>
    <element id="MedicationRequest.dosageInstruction.doseAndRate.dose[x]">
      <path value="MedicationRequest.dosageInstruction.doseAndRate.dose[x]" />
      <mapping>
        <identity value="pCHDCF" />
        <map value="Medication Prescribed Dose" />
      </mapping>
    </element>
    <element id="MedicationRequest.dispenseRequest">
      <path value="MedicationRequest.dispenseRequest" />
    </element>
    <element id="MedicationRequest.dispenseRequest.numberOfRepeatsAllowed">
      <path value="MedicationRequest.dispenseRequest.numberOfRepeatsAllowed" />
      <mapping>
        <identity value="pCHDCF" />
        <map value="Medication Refills" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>