<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="MedicationPSAB" />
  <url value="https://www.alberta.ca/fhir/psab/StructureDefinition/MedicationPSAB" />
  <name value="MedicationPSAB" />
  <title value="Medication (PS-AB)" />
  <status value="draft" />
  <description value="This profile defines a set of constraints to the FHIR Medication resource for use in Alberta Patient Summaries (PS-AB). It includes constraints that represent the minimum expectations for the Medication resource when used in the PS-AB Composition profile or in one of the referred resources." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Medication" />
  <baseDefinition value="http://fhir.infoway-inforoute.ca/io/psca/StructureDefinition/medication-ca-ps" />
  <derivation value="constraint" />
  <differential>
    <element id="Medication.code.coding">
      <path value="Medication.code.coding" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Medication.code.coding:CCDD">
      <path value="Medication.code.coding" />
      <sliceName value="CCDD" />
      <comment value="Optional - submit if available [Note: Not always recorded in patient chart; and not always applicable - compound medications do not have a DIN number for example.] Reference: Health Canada Drug ID Number" />
      <min value="0" />
      <max value="*" />
      <mustSupport value="true" />
    </element>
    <element id="Medication.code.coding:CCDD.system">
      <path value="Medication.code.coding.system" />
      <min value="1" />
      <fixedUri value="http://terminology.hl7.org/CodeSystem/hc-CCDD" />
    </element>
    <element id="Medication.code.text">
      <path value="Medication.code.text" />
      <comment value="Mandatory if any prescribed medication data is present; otherwise must be blank/null. String: Max Character length (200)" />
      <min value="1" />
    </element>
    <element id="Medication.form.coding">
      <path value="Medication.form.coding" />
      <comment value="No terminology has been defined in AB for this element. Future releases may include defined terminology" />
    </element>
  </differential>
</StructureDefinition>