<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="HdBe-MedicationUse2" />
  <url value="https://fhir.healthdata.be/StructureDefinition/HdBe-MedicationUse2" />
  <name value="HdBeMedicationUse2" />
  <title value="HdBe MedicationUse2" />
  <status value="draft" />
  <date value="2022-10-17T09:09:13.9562003+00:00" />
  <publisher value="Healthdata.be (Sciensano)" />
  <contact>
    <name value="Service portal – healthdata.be" />
    <telecom>
      <system value="url" />
      <value value="https://sciensano.service-now.com/sp" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="MedicationUse2 is a statement on the historic, current or intended use of a certain medicine." />
  <copyright value="Copyright and related rights waived via CC0, https://creativecommons.org/publicdomain/zero/1.0/. This does not apply to information from third parties, for example a medical terminology system. The implementer alone is responsible for identifying and obtaining any necessary licenses or authorizations to utilize third party IP in connection with the specification or otherwise." />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="zib-medicationuse2-v1.1.1-2020EN" />
    <uri value="https://zibs.nl/wiki/MedicationUse2-v1.1.1(2020EN)" />
    <name value="zib MedicationUse2-v1.1.1(2020EN)" />
  </mapping>
  <mapping>
    <identity value="HdBe-MedicationUse2" />
    <uri value="https://fhir.healthdata.be/StructureDefinition/LogicalModel/HdBe-MedicationUse2" />
    <name value="HdBe logical model MedicationUse2" />
  </mapping>
  <mapping>
    <identity value="HdBe-InstructionsForUse" />
    <uri value="https://fhir.healthdata.be/StructureDefinition/LogicalModel/HdBe-InstructionsForUse" />
    <name value="HdBe logical model InstructionsForUse" />
  </mapping>
  <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" />
      <short value="MedicationUse" />
      <comment value="When interpreting a medicationStatement, the value of the status and NotTaken needed to be considered:&#xD;MedicationStatement.status + MedicationStatement.wasNotTaken&#xD;* Status=Active + NotTaken=T = Not currently taking&#xD;* Status=Completed + NotTaken=T = Not taken in the past&#xD;* Status=Intended + NotTaken=T = No intention of taking&#xD;* Status=Active + NotTaken=F = Taking, but not as prescribed&#xD;* Status=Active + NotTaken=F = Taking&#xD;* Status=Intended +NotTaken= F = Will be taking (not started)&#xD;* Status=Completed + NotTaken=F = Taken in past&#xD;* Status=In Error + NotTaken=N/A = In Error." />
      <alias value="MedicatieGebruik" />
      <mapping>
        <identity value="zib-medicationuse2-v1.1.1-2020EN" />
        <map value="NL-CM:9.11.21338" />
        <comment value="MedicationUse" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationUse2" />
        <map value="MedicationUse2" />
      </mapping>
    </element>
    <element id="MedicationStatement.extension">
      <path value="MedicationStatement.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="MedicationStatement.extension:renderedDosageInstruction">
      <path value="MedicationStatement.extension" />
      <sliceName value="renderedDosageInstruction" />
      <min value="0" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.healthdata.be/StructureDefinition/ext-RenderedDosageInstruction" />
      </type>
    </element>
    <element id="MedicationStatement.extension:renderedDosageInstruction.value[x]">
      <path value="MedicationStatement.extension.value[x]" />
      <mapping>
        <identity value="HdBe-InstructionsForUse" />
        <map value="InstructionsForUse.Description" />
      </mapping>
    </element>
    <element id="MedicationStatement.extension:prescriber">
      <path value="MedicationStatement.extension" />
      <sliceName value="prescriber" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.healthdata.be/StructureDefinition/ext-MedicationUse2.Prescriber" />
      </type>
    </element>
    <element id="MedicationStatement.extension:prescriber.value[x]">
      <path value="MedicationStatement.extension.value[x]" />
      <mapping>
        <identity value="HdBe-MedicationUse2" />
        <map value="MedicationUse2.Prescriber" />
      </mapping>
    </element>
    <element id="MedicationStatement.extension:asAgreedIndicator">
      <path value="MedicationStatement.extension" />
      <sliceName value="asAgreedIndicator" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.healthdata.be/StructureDefinition/ext-MedicationUse2.AsAgreedIndicator" />
      </type>
    </element>
    <element id="MedicationStatement.extension:asAgreedIndicator.value[x]">
      <path value="MedicationStatement.extension.value[x]" />
      <mapping>
        <identity value="HdBe-MedicationUse2" />
        <map value="MedicationUse2.AsAgreedIndicator" />
      </mapping>
    </element>
    <element id="MedicationStatement.modifierExtension">
      <path value="MedicationStatement.modifierExtension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="MedicationStatement.modifierExtension:stopType">
      <path value="MedicationStatement.modifierExtension" />
      <sliceName value="stopType" />
      <min value="0" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.healthdata.be/StructureDefinition/ext-StopType" />
      </type>
    </element>
    <element id="MedicationStatement.modifierExtension:stopType.value[x]">
      <path value="MedicationStatement.modifierExtension.value[x]" />
      <short value="MedicationUseStopType" />
      <alias value="MedicatieGebruikStopType" />
      <mapping>
        <identity value="zib-medicationuse2-v1.1.1-2020EN" />
        <map value="NL-CM:9.11.23132" />
        <comment value="MedicationUseStopType" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationUse2" />
        <map value="MedicationUse2.MedicationUseStopType" />
      </mapping>
    </element>
    <element id="MedicationStatement.modifierExtension:repeatPeriodCyclicalSchedule">
      <path value="MedicationStatement.modifierExtension" />
      <sliceName value="repeatPeriodCyclicalSchedule" />
      <min value="0" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.healthdata.be/StructureDefinition/ext-InstructionsForUse.RepeatPeriodCyclicalSchedule" />
      </type>
    </element>
    <element id="MedicationStatement.modifierExtension:repeatPeriodCyclicalSchedule.value[x]">
      <path value="MedicationStatement.modifierExtension.value[x]" />
      <mapping>
        <identity value="HdBe-InstructionsForUse" />
        <map value="InstructionsForUse.RepeatPeriodCyclicalSchedule" />
      </mapping>
    </element>
    <element id="MedicationStatement.status">
      <path value="MedicationStatement.status" />
      <short value="UseIndicator / MedicationUseStopType / PeriodOfUse" />
      <definition value="Status may contain information on the stop type, the manner in which this medication is discontinued (temporary or definitive) and if the medicine is used or not." />
      <comment value="This element is mapped to the CBB concept UseIndicator and implicitly to MedicationUseStopType and PeriodOfUse. Unless a more appropriate status is recorded, the following guidance applies:&#xD;&#xA;&#xD;&#xA;* When MedicationUseStopType has no value and UseIndicator is _true_, `.status` will usually be set to _active_.&#xD;&#xA;* When UseIndicator is _false_, `.status` will be set to _not-taken_.&#xD;&#xA;* When MedicationUseStopType is _14803004_, `.status` will usually be set to _on-hold_.&#xD;&#xA;* When MedicationUseStopType is _255545003_, `.status` will usually be set to _stopped_.&#xD;&#xA;* When PeriodOfUse start date is in the past and PeriodOfUse end date is present and in the future, `.status` will usually be set to _active_.&#xD;&#xA;* When PeriodOfUse end date has a value and in the past, `.status` will usually be set to _completed_.&#xD;&#xA;* When PeriodOfUse duration and start date are known, the end date can be deducted and the previous rules apply. &#xD;&#xA;* When a system is unable to infer the status, `.status` will be set to _unknown_. The _unknown_ code is not to be used to convey other statuses. The _unknown_ code should be used when one of the statuses applies, but the authoring system doesn't know the current state of the MedicationStatement." />
      <alias value="MedicatieGebruikStopType" />
      <alias value="GebruikIndicator" />
      <alias value="Gebruiksperiode" />
      <binding>
        <strength value="required" />
        <description value="Use ConceptMap 'MedicationStopType-to-MedicationStatementStatus' to translate CBB terminology to profile terminology in ValueSet 'Medication Status Codes'." />
        <valueSet value="http://hl7.org/fhir/ValueSet/medication-statement-status|4.0.1">
          <extension url="http://hl7.org/fhir/StructureDefinition/11179-permitted-value-conceptmap">
            <valueCanonical value="https://fhir.healthdata.be/ConceptMap/MedicationStopType-to-MedicationStatementStatus" />
          </extension>
        </valueSet>
      </binding>
      <mapping>
        <identity value="zib-medicationuse2-v1.1.1-2020EN" />
        <map value="NL-CM:9.11.22399" />
        <comment value="UseIndicator" />
      </mapping>
      <mapping>
        <identity value="zib-medicationuse2-v1.1.1-2020EN" />
        <map value="NL-CM:9.11.23132" />
        <comment value="MedicationUseStopType (implicit, main mapping is on the modifier extension ext-StopType)" />
      </mapping>
      <mapping>
        <identity value="zib-medicationuse2-v1.1.1-2020EN" />
        <map value="NL-CM:9.11.22663" />
        <comment value="PeriodOfUse (implicit, main mapping is on `.effective[x]:effectivePeriod` and extension ext-TimeInterval.Duration)" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationUse2" />
        <map value="MedicationUse2.UseIndicator" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationUse2" />
        <map value="MedicationUse2.MedicationUseStopType" />
        <comment value="implicit, main mapping is on the modifier extension ext-StopType" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationUse2" />
        <map value="MedicationUse2.PeriodOfUse" />
        <comment value="implicit, main mapping is on `.effective[x]:effectivePeriod` and extension ext-TimeInterval.Duration" />
      </mapping>
    </element>
    <element id="MedicationStatement.statusReason">
      <path value="MedicationStatement.statusReason" />
      <short value="ReasonForChangeOrDiscontinuationOfUse" />
      <definition value="Reason for changing or discontinuing use of medication." />
      <alias value="RedenWijzigenOfStoppenGebruik" />
      <binding>
        <strength value="required" />
        <valueSet value="https://fhir.healthdata.be/ValueSet/MedicationReason" />
      </binding>
      <mapping>
        <identity value="zib-medicationuse2-v1.1.1-2020EN" />
        <map value="NL-CM:9.11.22493" />
        <comment value="ReasonForChangeOrDiscontinuationOfUse" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationUse2" />
        <map value="MedicationUse2.ReasonForChangeOrDiscontinuationOfUse" />
      </mapping>
    </element>
    <element id="MedicationStatement.category">
      <path value="MedicationStatement.category" />
      <min value="1" />
      <patternCodeableConcept>
        <coding>
          <system value="http://snomed.info/sct" />
          <code value="422979000" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="MedicationStatement.medication[x]">
      <path value="MedicationStatement.medication[x]" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="MedicationStatement.medication[x]:medicationReference">
      <path value="MedicationStatement.medication[x]" />
      <sliceName value="medicationReference" />
      <short value="ProductUsed" />
      <definition value="The product used. This is usually medication. Food, blood products, aids and bandages do not strictly fall under the category of medication, but can be recorded as well.&#xD;&#xA;In principle, this will be the prescribed product, but the product used may differ from the prescribed product." />
      <alias value="Gebruiksproduct" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Medication" />
        <targetProfile value="https://fhir.healthdata.be/StructureDefinition/HdBe-PharmaceuticalProduct" />
      </type>
      <mapping>
        <identity value="zib-medicationuse2-v1.1.1-2020EN" />
        <map value="NL-CM:9.11.21339" />
        <comment value="ProductUsed" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationUse2" />
        <map value="MedicationUse2.ProductUsed" />
      </mapping>
    </element>
    <element id="MedicationStatement.subject">
      <path value="MedicationStatement.subject" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Group" />
        <targetProfile value="https://fhir.healthdata.be/StructureDefinition/HdBe-Patient" />
      </type>
    </element>
    <element id="MedicationStatement.effective[x]">
      <path value="MedicationStatement.effective[x]" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="MedicationStatement.effective[x]:effectivePeriod">
      <path value="MedicationStatement.effective[x]" />
      <sliceName value="effectivePeriod" />
      <short value="PeriodOfUse" />
      <definition value="Medication use can be recorded for a certain moment or over a certain period. Thus, medication use can be recorded multiple times during the use of medication. The usage period is the period or moment over which the data is recorded.&#xA;**Start date:** This is the time at which the agreement was to take effect (or took effect or will take effect). &#xA;**End date:** The time at which the period of use ends (or ended or will end). To avoid confusion between 'to' and 'up to', the submission of time is always mandatory for the end date." />
      <alias value="Gebruiksperiode" />
      <type>
        <code value="Period" />
        <profile value="https://fhir.healthdata.be/StructureDefinition/HdBe-TimeInterval" />
      </type>
      <mapping>
        <identity value="zib-medicationuse2-v1.1.1-2020EN" />
        <map value="NL-CM:9.11.22663" />
        <comment value="PeriodOfUse" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationUse2" />
        <map value="MedicationUse2.PeriodOfUse" />
      </mapping>
    </element>
    <element id="MedicationStatement.dateAsserted">
      <path value="MedicationStatement.dateAsserted" />
      <short value="MedicationUseDateTime" />
      <definition value="Date on which this use is entered." />
      <alias value="MedicatieGebruikDatumTijd" />
      <mapping>
        <identity value="zib-medicationuse2-v1.1.1-2020EN" />
        <map value="NL-CM:9.11.22398" />
        <comment value="MedicationUseDateTime" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationUse2" />
        <map value="MedicationUse2.MedicationUseDateTime" />
      </mapping>
    </element>
    <element id="MedicationStatement.reasonCode">
      <path value="MedicationStatement.reasonCode" />
      <slicing>
        <discriminator>
          <type value="exists" />
          <path value="text" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="MedicationStatement.reasonCode:reasonForUse">
      <path value="MedicationStatement.reasonCode" />
      <sliceName value="reasonForUse" />
      <max value="1" />
    </element>
    <element id="MedicationStatement.reasonCode:reasonForUse.text">
      <path value="MedicationStatement.reasonCode.text" />
      <short value="ReasonForUse" />
      <definition value="The reason for using the medication, particularly in self-care medicine purchased by the patient themselves." />
      <alias value="RedenGebruik" />
      <min value="1" />
      <mapping>
        <identity value="zib-medicationuse2-v1.1.1-2020EN" />
        <map value="NL-CM:9.11.22491" />
        <comment value="ReasonForUse" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationUse2" />
        <map value="MedicationUse2.ReasonForUse" />
      </mapping>
    </element>
    <element id="MedicationStatement.note">
      <path value="MedicationStatement.note" />
      <max value="1" />
    </element>
    <element id="MedicationStatement.note.text">
      <path value="MedicationStatement.note.text" />
      <short value="Comment" />
      <definition value="Comments on the medication use." />
      <alias value="Toelichting" />
      <mapping>
        <identity value="zib-medicationuse2-v1.1.1-2020EN" />
        <map value="NL-CM:9.11.21624" />
        <comment value="Comment" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationUse2" />
        <map value="MedicationUse2.Comment" />
      </mapping>
    </element>
    <element id="MedicationStatement.dosage">
      <path value="MedicationStatement.dosage" />
      <short value="DosingInstructions / InstructionsForUse" />
      <definition value="Instructions for the use of the medication, e.g. dose and route of administration. In the event of medication use, this is the pattern of use established by the patient or which the patient followed." />
      <alias value="Gebruiksinstructie" />
      <type>
        <code value="Dosage" />
        <profile value="https://fhir.healthdata.be/StructureDefinition/HdBe-InstructionsForUse.DosageInstructions" />
      </type>
      <mapping>
        <identity value="zib-medicationuse2-v1.1.1-2020EN" />
        <map value="NL-CM:9.11.22504" />
        <comment value="InstructionsForUse" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationUse2" />
        <map value="MedicationUse2.InstructionsForUse" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>