<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="profile-medication" />
  <url value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-medication" />
  <version value="1.0.2" />
  <name value="MedicationProfile" />
  <title value="Medication Profile" />
  <status value="draft" />
  <date value="2026-01-09" />
  <publisher value="HL7 Canada - FHIR Implementation Work Group" />
  <contact>
    <telecom>
      <system value="url" />
      <value value="https://infocentral.infoway-inforoute.ca/en/collaboration/wg/fhir-implementations" />
    </telecom>
  </contact>
  <description value="Proposed constraints and extensions on the Medication resource.  Generated as a first step toward creating a set of Canadian Baseline FHIR profiles." />
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166" />
      <code value="CA" />
    </coding>
  </jurisdiction>
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="script10.6" />
    <uri value="http://ncpdp.org/SCRIPT10_6" />
    <name value="Mapping to NCPDP SCRIPT 10.6" />
  </mapping>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Medication" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Medication" />
  <derivation value="constraint" />
  <differential>
    <element id="Medication">
      <path value="Medication" />
      <short value="Medication Profile" />
      <definition value="The Medication Profile is based upon the core FHIR Medication Resource" />
    </element>
    <element id="Medication.extension">
      <path value="Medication.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Medication.extension:medicationstrength">
      <path value="Medication.extension" />
      <sliceName value="medicationstrength" />
      <short value="Socialized Optional Extension: Medication Strength" />
      <definition value="Provides a textual description of the strength of the active ingredient(s) in the medication" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://prescribeit.ca/fhir/StructureDefinition/ext-medication-strength-description" />
      </type>
    </element>
    <element id="Medication.code">
      <path value="Medication.code" />
      <comment value="Given the lack of an existing superset of Canadian codes and the complexity and variation in code systems used by of prescription ordering and medication &amp; natural product dispensing systems - The Canadian Baseline has chosen to model the variety of coding systems expected in existing systems through an open slice on code.coding. When a super value set is developed, the CA Baseline will update the preferred binding strength that currently points to a placeholder to align to the new value set." />
      <min value="1" />
      <example>
        <label value="DIN" />
        <valueCodeableConcept>
          <coding>
            <system value="http://hl7.org/fhir/NamingSystem/ca-hc-din" />
          </coding>
        </valueCodeableConcept>
      </example>
      <example>
        <label value="NPN" />
        <valueCodeableConcept>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/v3-hc-npn" />
          </coding>
        </valueCodeableConcept>
      </example>
      <example>
        <label value="CCDD" />
        <valueCodeableConcept>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/hc-CCDD" />
          </coding>
        </valueCodeableConcept>
      </example>
      <example>
        <label value="SNOMED CT (Medications) - IPS" />
        <valueCodeableConcept>
          <coding>
            <system value="http://snomed.info/sct" />
          </coding>
        </valueCodeableConcept>
      </example>
      <example>
        <label value="WHO ATC IPS" />
        <valueCodeableConcept>
          <coding>
            <system value="http://www.whocc.no/atc" />
          </coding>
        </valueCodeableConcept>
      </example>
      <binding>
        <strength value="preferred" />
        <description value="TBD. This is a placeholder for a comprehensive valueset, consisting of all Manufactured Product (MP), Non-proprietary Therapeutic Product (NTP) and Therapeutic Moiety (TM) codes, which would be created and maintained by Canada Health Infoway. Medicinal products for prescribing and dispensing in Canada. The content of this subset only contains commonly used medicinal products that are available for prescribing and dispensing in Canada. This content will expand to include all human medicinal products over time." />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/prescriptionmedicinalproduct" />
      </binding>
    </element>
    <element id="Medication.code.extension">
      <path value="Medication.code.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Medication.code.coding">
      <path value="Medication.code.coding" />
      <comment value="CA Baseline Usage Notes: either text or at least one coding or both have to be present" />
    </element>
    <element id="Medication.code.coding.extension:isRepresentative">
      <path value="Medication.code.coding.extension" />
      <sliceName value="isRepresentative" />
      <short value="Socialized Optional Extension: Code is Representative" />
      <definition value="If set to true, indicates that the medication code sent was chosen as a representative code of a drug picked at a more general level. I.e. The user didn't actually choose this specific code. The intended constraints around what drug should be supplied are conveyed by the request's substitution rules." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://prescribeit.ca/fhir/StructureDefinition/ext-medication-code-representative" />
      </type>
    </element>
    <element id="Medication.code.coding.system">
      <path value="Medication.code.coding.system" />
      <min value="1" />
    </element>
    <element id="Medication.code.coding.code">
      <path value="Medication.code.coding.code" />
      <min value="1" />
    </element>
    <element id="Medication.code.text">
      <path value="Medication.code.text" />
      <comment value="CA Baseline Usage Notes: either text or at least one coding or both have to be present" />
    </element>
    <element id="Medication.manufacturer">
      <path value="Medication.manufacturer" />
      <comment value="CA Baseline Usage Notes: This is a reference to an organization that manufactures the medication. TBD: if there is a need to reference a 'DPD Company', a new extension should be created and used. A 'DPD Company' name, as used in the Health Canada DPF, indicates the organisation (company) that holds the authorization to place the product on the market in Canada. This may not be the company that has manufactured the product, but it is the company that holds the legal responsibility for the use of the product in Canada and should be the same as the company named on the product label/packaging." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-organization" />
      </type>
    </element>
    <element id="Medication.form">
      <path value="Medication.form" />
      <comment value="CA Core Usage Notes: The prescription drug form is required in some provinces in order to meet the prescribing standards set out by the College of Physicians and Surgeons." />
      <binding>
        <strength value="example" />
        <description value="TBD. This is a placeholder for a comprehensive valueset, which would be created and maintained by Canada Health Infoway. Currently seeking implementer feedback and input from pan-Canadian profiles to support updates to the nominated valueSet." />
        <valueSet value="https://fhir.infoway-inforoute.ca/ValueSet/dispensabledrugform" />
      </binding>
    </element>
  </differential>
</StructureDefinition>