<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="ca-on-ps-profile-medicationstatement" />
  <url value="http://ontariohealth.ca/fhir/StructureDefinition/ca-on-ps-profile-medicationstatement" />
  <version value="0.10.0" />
  <name value="MedicationStatementPSON" />
  <title value="Medication Statement (PS-ON)" />
  <status value="draft" />
  <date value="2024-02-01T19:39:15.322061+00:00" />
  <publisher value="Ontario Health" />
  <description value="This profile defines a set of constraints to the FHIR MedicationStatement resource for use in Ontario Patient Summaries (PS-ON).  It refines 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-UV-IPS 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." />
  <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 clinican." />
    </element>
    <element id="MedicationStatement.meta">
      <path value="MedicationStatement.meta" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.meta.profile">
      <path value="MedicationStatement.meta.profile" />
      <min value="1" />
      <mustSupport value="true" />
    </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="In the scope of the IPS the entered-in-error concept is not allowed. Implementors should be aware that the shift to R5 MedicationUsage will also involve a new value set for status that is constrained to: recorded, entered-in-error, and draft." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.medication[x]">
      <path value="MedicationStatement.medication[x]" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <rules value="closed" />
      </slicing>
      <definition value="Identifies the medication being administered or the reason for absent or unknown Medication. 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." />
      <comment value="Work is underway to define the pan-Canadian terminology that will be preferred and/or socialized for this element." />
      <mustSupport value="true" />
      <binding>
        <strength value="example" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/prescriptionmedicinalproduct" />
      </binding>
    </element>
    <element id="MedicationStatement.medication[x]:medicationReference">
      <path value="MedicationStatement.medication[x]" />
      <sliceName value="medicationReference" />
      <definition value="Identifies the medication being administered or the reason for absent or unknown Medication. 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." />
      <comment value="IPS-UV Note: If only a code is specified, then it needs to be a code for a specific product. If more information is required, then the use of the medication resource is recommended.  For example, if you require form or lot number, then you must reference the Medication resource." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://ontariohealth.ca/fhir/StructureDefinition/ca-on-ps-profile-medication" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.medication[x]:medicationCodeableConcept">
      <path value="MedicationStatement.medication[x]" />
      <sliceName value="medicationCodeableConcept" />
      <short value="Code for absent or unknown medication - or for supplying a codeableConcept when no information other than a simple code is available" />
      <definition value="Code for a negated/excluded medication statement.  This describes a categorical negated statement (e.g., &quot;No known medications&quot;) Because the IPS-UV value set on this slice is extensible, it can be used to supply other medication codes when only a simple code is available." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://ontariohealth.ca/fhir/StructureDefinition/ca-on-ps-profile-codeableconcept" />
      </type>
      <mustSupport value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="UnknownMedicationCode" />
        </extension>
        <strength value="extensible" />
        <description value="Representation of unknown or absent medications" />
        <valueSet value="http://hl7.org/fhir/uv/ips/ValueSet/absent-or-unknown-medications-uv-ips" />
      </binding>
    </element>
    <element id="MedicationStatement.subject">
      <path value="MedicationStatement.subject" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://ontariohealth.ca/fhir/StructureDefinition/ca-on-ps-profile-patient" />
      </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: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." />
      <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" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.dosage.route">
      <path value="MedicationStatement.dosage.route" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://ontariohealth.ca/fhir/StructureDefinition/ca-on-ps-profile-codeableconcept" />
      </type>
      <binding>
        <strength value="preferred" />
        <description value="SCTCA Route of Administration" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/routeofadministration" />
      </binding>
    </element>
    <element id="MedicationStatement.dosage.route.coding">
      <path value="MedicationStatement.dosage.route.coding" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <description value="Discriminated by value set" />
        <rules value="open" />
      </slicing>
      <type>
        <code value="Coding" />
        <profile value="http://ontariohealth.ca/fhir/StructureDefinition/ca-on-ps-profile-coding" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.dosage.route.coding:routeSCTCA">
      <path value="MedicationStatement.dosage.route.coding" />
      <sliceName value="routeSCTCA" />
      <short value="Optional slice for representing SNOMED CT Canadian edition routes of administration" />
      <definition value="SNOMED CT Canadian edition routes of administration" />
      <binding>
        <strength value="required" />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/routeofadministration" />
      </binding>
    </element>
  </differential>
</StructureDefinition>