<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="medicationstatement-ca-ps" />
  <url value="http://fhir.infoway-inforoute.ca/io/psca/StructureDefinition/medicationstatement-ca-ps" />
  <name value="MedicationStatementPSCA" />
  <title value="Medication Statement (PS-CA)" />
  <status value="draft" />
  <experimental value="false" />
  <date value="2024-04-09T00:00:00-08:00" />
  <description value="This profile represents the constraints applied to the MedicationStatement resource by the PS-CA project to represent a record of a medication statement in the patient summary. It is informed by the constraints of the [MedicationStatement IPS-UV profile](http://hl7.org/fhir/uv/ips/StructureDefinition-MedicationStatement-uv-ips.html) and the [Canadian Baseline Profile](http://build.fhir.org/ig/HL7-Canada/ca-baseline/branches/master/StructureDefinition-profile-medicationstatement.html) to allow for cross-border and cross-jurisdiction sharing of Medication Summary information." />
  <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" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="MedicationStatement" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/MedicationStatement" />
  <derivation value="constraint" />
  <differential>
    <element id="MedicationStatement">
      <path value="MedicationStatement" />
      <comment value="Jurisdictions mapping prescription data into FHIR profiles for the patient summary should use the MedicationRequest resource. Use of the MedicationStatement profile should be reserved for communicating a statement about the patient's usage of the medication that is ultimately provided by a patient, significant other, or a clinician." />
    </element>
    <element id="MedicationStatement.extension:RenderedDosageInstruction">
      <path value="MedicationStatement.extension" />
      <sliceName value="RenderedDosageInstruction" />
      <short value="Extension for representing rendered dosage instruction." />
      <definition value="A free form textual specification generated from the input specifications as created by the provider. This is made up of either an 'Ad-hoc instruction' or 'Textual rendition of the structured dosage lines', plus route, dosage unit, and other pertinent administration information specified by the provider." />
      <comment value="Use of structured fields for dosage instructions is heavily encouraged by this specification to promote interoperability of patient summaries. However, this extension is provided to make implementers aware that legacy medication data may come from some systems in this format. This extension is used by PrescribeIT implementations when the system has difficulty sending very complex dosage instructions in the form of structured data. Implementers are encouraged to read the PrescribeIT Specification (https://specs.prescribeit.ca/R5.0/erx/extension-ext-medication-rendered-dosage.html) to understand the context around its use." />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://prescribeit.ca/fhir/StructureDefinition/ext-rendered-dosage-instruction" />
      </type>
    </element>
    <element id="MedicationStatement.status">
      <path value="MedicationStatement.status" />
      <comment value="IPS Note: The entered-in-error concept is not permitted. Implementers should be aware that the shift to R5 MedicationUsage will also involve a new value set for status that is expected to be constrained to: recorded, entered-in-error, and draft." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.medication[x]">
      <path value="MedicationStatement.medication[x]" />
      <definition value="Identifies the medication being administered or the assertion of no known medications. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code. To improve global interoperability is strongly encouraged that the reference to a medication resource is used, limiting the usage of the medicationCodeableConcept only to the cases in which no other information than a simple code is available." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/psca/StructureDefinition/medication-ca-ps" />
      </type>
      <type>
        <code value="CodeableConcept" />
        <profile value="http://fhir.infoway-inforoute.ca/io/psca/StructureDefinition/CodeableConcept-medication-ca-ps" />
      </type>
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <valueSet value="http://fhir.infoway-inforoute.ca/io/psca/ValueSet/hc-CCDD" />
      </binding>
    </element>
    <element id="MedicationStatement.subject">
      <path value="MedicationStatement.subject" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/psca/StructureDefinition/patient-ca-ps" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.subject.reference">
      <path value="MedicationStatement.subject.reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.effective[x]">
      <path value="MedicationStatement.effective[x]" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.effective[x].extension">
      <path value="MedicationStatement.effective[x].extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="MedicationStatement.effective[x].extension:data-absent-reason">
      <path value="MedicationStatement.effective[x].extension" />
      <sliceName value="data-absent-reason" />
      <short value="effective[x] absence reason" />
      <definition value="Provides a reason why the effectiveTime is missing." />
      <comment value="While the IPS-UV specification considers this a Must Support element, many systems will not have a field within their data dictionaries that directly corresponds to dataAbsentReason, however it is recommended that systems be able to support the communication of this concept across a number of clinical profiles where population of the clinical element is crucial to clinical interpretation and use. Further feedback is required on whether these systems are still expected to be able to demonstrate they can construct this element when developing the patient summary instance" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/data-absent-reason" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.dosage">
      <path value="MedicationStatement.dosage" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.dosage.text">
      <path value="MedicationStatement.dosage.text" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.dosage.timing">
      <path value="MedicationStatement.dosage.timing" />
      <comment value="IPS-UV flags this as a Must Support element. It is not currently flagged as Must Support in PS-CA, as stakeholders have indicated the element may not be supported by the majority of systems today. Systems that do support the element are encouraged to include it in generated Patient Summary documents, and support it when received. Vendors should expect that some jurisdictions may add a Must Support requirement within the context of their own jurisdictional content." />
    </element>
    <element id="MedicationStatement.dosage.route">
      <path value="MedicationStatement.dosage.route" />
      <comment value="See additionalBinding extension." />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://fhir.infoway-inforoute.ca/io/psca/StructureDefinition/CodeableConcept-medication-ca-ps" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/tools/StructureDefinition/additional-binding">
          <extension url="purpose">
            <valueCode value="candidate" />
          </extension>
          <extension url="valueSet">
            <valueCanonical value="http://hl7.org/fhir/uv/ips/ValueSet/medicine-route-of-administration" />
          </extension>
          <extension url="documentation">
            <valueMarkdown value="EDQM Standards Terms for route." />
          </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/prescriptionrouteofadministration" />
          </extension>
          <extension url="documentation">
            <valueMarkdown value="Route of administration for the prescription from the PrescribeIT value set. Implementers should anticipate that data collected and or exchanged in the context of ePrescribing may contain concepts from this valueSet. While not the preferred terminology for broader pan-Canadian exchange use cases, this additional binding is surfaced to socialize the value sets that may be more commonly in use. Where multiple codings can be supplied, it is encouraged to supply the original coding alongside the pan-Canadian preferred terminology." />
          </extension>
        </extension>
        <strength value="preferred" />
        <description value="SCTCA Route of Administration" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/routeofadministration" />
      </binding>
    </element>
  </differential>
</StructureDefinition>