<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="HdBe-MedicationAgreement" />
  <url value="https://fhir.healthdata.be/StructureDefinition/HdBe-MedicationAgreement" />
  <name value="HdBeMedicationAgreement" />
  <title value="HdBe MedicationAgreement" />
  <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="A medication agreement is a prescriber’s proposal for a patient to use medication. An agreement to discontinue the use of medication is also a medication agreement." />
  <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-medicationagreement-v1.2-2020EN" />
    <uri value="https://zibs.nl/wiki/MedicationAgreement-v1.2(2020EN)" />
    <name value="zib MedicationAgreement-v1.2(2020EN)" />
  </mapping>
  <mapping>
    <identity value="zib-instructionsforuse-v1.2.1-2020EN" />
    <uri value="https://zibs.nl/wiki/InstructionsForUse-v1.2.1(2020EN)" />
    <name value="zib InstructionsForUse-v1.2.1(2020EN)" />
  </mapping>
  <mapping>
    <identity value="HdBe-MedicationAgreement" />
    <uri value="https://fhir.healthdata.be/StructureDefinition/LogicalModel/HdBe-MedicationAgreement" />
    <name value="HdBe logical model MedicationAgreement" />
  </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="MedicationRequest" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/MedicationRequest" />
  <derivation value="constraint" />
  <differential>
    <element id="MedicationRequest">
      <path value="MedicationRequest" />
      <short value="MedicationAgreement" />
      <alias value="Medicatieafspraak" />
      <mapping>
        <identity value="zib-medicationagreement-v1.2-2020EN" />
        <map value="NL-CM:9.6.9580" />
        <comment value="MedicationAgreement" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationAgreement" />
        <map value="MedicationAgreement" />
      </mapping>
    </element>
    <element id="MedicationRequest.extension">
      <path value="MedicationRequest.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="MedicationRequest.extension:medicationAgreementAdditionalInformation">
      <path value="MedicationRequest.extension" />
      <sliceName value="medicationAgreementAdditionalInformation" />
      <min value="0" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.healthdata.be/StructureDefinition/ext-MedicationAgreement.MedicationAgreementAdditionalInformation" />
      </type>
    </element>
    <element id="MedicationRequest.extension:medicationAgreementAdditionalInformation.value[x]">
      <path value="MedicationRequest.extension.value[x]" />
      <mapping>
        <identity value="HdBe-MedicationAgreement" />
        <map value="MedicationAgreement.MedicationAgreementAdditionalInformation" />
      </mapping>
    </element>
    <element id="MedicationRequest.extension:renderedDosageInstruction">
      <path value="MedicationRequest.extension" />
      <sliceName value="renderedDosageInstruction" />
      <min value="0" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.healthdata.be/StructureDefinition/ext-RenderedDosageInstruction" />
      </type>
      <mapping>
        <identity value="HdBe-InstructionsForUse" />
        <map value="InstructionsForUse.Description" />
      </mapping>
    </element>
    <element id="MedicationRequest.extension:renderedDosageInstruction.value[x]">
      <path value="MedicationRequest.extension.value[x]" />
      <short value="Description" />
      <definition value="Textual description of the complete instructions for use including the period of use." />
      <alias value="Omschrijving" />
      <mapping>
        <identity value="zib-instructionsforuse-v1.2.1-2020EN" />
        <map value="NL-CM:9.12.9581" />
        <comment value="Description" />
      </mapping>
    </element>
    <element id="MedicationRequest.extension:periodOfUse">
      <path value="MedicationRequest.extension" />
      <sliceName value="periodOfUse" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.healthdata.be/StructureDefinition/ext-TimeInterval.Period" />
      </type>
    </element>
    <element id="MedicationRequest.extension:periodOfUse.value[x]">
      <path value="MedicationRequest.extension.value[x]" />
      <short value="PeriodOfUse" />
      <definition value="**Start date**: This is the time at which the agreement was to take effect (or took effect or will take effect). This is the time at which the instructions for use in this agreement start. In the case of an agreement to discontinue use, this is the start date of the original medication agreement. The end date indicates from when the medication is to be discontinued.&#xD;&#xA;&#xD;&#xA;**Duration**: The intended duration of use. E.g. 5 days or 8 weeks. It is not allowed to indicate the duration in months, because different months have a variable duration in days.&#xD;&#xA;&#xD;&#xA;**End date**: The time at which the period of use ends (or ended or will end). In the case of an agreement to discontinue use, this is the time at which the medication is to be discontinued. To avoid confusion between 'to' and 'up to', the submission of time is always mandatory for the end date.&#xD;&#xA;&#xD;&#xA;With medication for an indefinite period only a start date is indicated." />
      <alias value="Gebruiksperiode" />
      <mapping>
        <identity value="zib-medicationagreement-v1.2-2020EN" />
        <map value="NL-CM:9.6.19936" />
        <comment value="PeriodOfUse" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationAgreement" />
        <map value="MedicationAgreement.PeriodOfUse" />
      </mapping>
    </element>
    <element id="MedicationRequest.modifierExtension">
      <path value="MedicationRequest.modifierExtension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="MedicationRequest.modifierExtension:stopType">
      <path value="MedicationRequest.modifierExtension" />
      <sliceName value="stopType" />
      <min value="0" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.healthdata.be/StructureDefinition/ext-StopType" />
      </type>
    </element>
    <element id="MedicationRequest.modifierExtension:stopType.value[x]">
      <path value="MedicationRequest.modifierExtension.value[x]" />
      <short value="MedicationAgreementStopType" />
      <alias value="MedicatieafspraakStopType" />
      <mapping>
        <identity value="zib-medicationagreement-v1.2-2020EN" />
        <map value="NL-CM:9.6.19954" />
        <comment value="MedicationAgreementStopType" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationAgreement" />
        <map value="MedicationAgreement.MedicationAgreementStopType" />
      </mapping>
    </element>
    <element id="MedicationRequest.modifierExtension:repeatPeriodCyclicalSchedule">
      <path value="MedicationRequest.modifierExtension" />
      <sliceName value="repeatPeriodCyclicalSchedule" />
      <min value="0" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.healthdata.be/StructureDefinition/ext-InstructionsForUse.RepeatPeriodCyclicalSchedule" />
      </type>
      <mapping>
        <identity value="HdBe-InstructionsForUse" />
        <map value="InstructionsForUse.RepeatPeriodCyclicalSchedule" />
      </mapping>
    </element>
    <element id="MedicationRequest.modifierExtension:repeatPeriodCyclicalSchedule.value[x]">
      <path value="MedicationRequest.modifierExtension.value[x]" />
      <mapping>
        <identity value="HdBe-InstructionsForUse" />
        <map value="InstructionsForUse.RepeatPeriodCyclicalSchedule" />
      </mapping>
    </element>
    <element id="MedicationRequest.status">
      <path value="MedicationRequest.status" />
      <comment value="This element is implictly mapped to the CBB concepts period_of_use medication_agreement_stop_type.&#xD;&#xA;Unless the status is explicitly recorded, the following guidance applies:&#xD;&#xA;&#xD;&#xA;* When MedicationAgreementStopType is _14803004_, `.status` will usually be set to _on-hold_.&#xD;&#xA;* When MedicationAgreementStopType is _255545003_, `.status` will usually be set to _stopped_.&#xD;&#xA;* When the PeriodOfUse start date is in the future, `.status` will usually be set to _active_.&#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 is present 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 from the Start and End, `.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 MedicationAgreement." />
      <mapping>
        <identity value="zib-medicationagreement-v1.2-2020EN" />
        <map value="NL-CM:9.6.19936" />
        <comment value="PeriodOfUse (implicit, main mapping is on the extensions ext-TimeInterval.Period and ext-TimeInterval.Duration)" />
      </mapping>
      <mapping>
        <identity value="zib-medicationagreement-v1.2-2020EN" />
        <map value="NL-CM:9.6.19954" />
        <comment value="MedicationAgreementStopType (implicit, main mapping is on StopType extension)" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationAgreement" />
        <map value="MedicationAgreement.PeriodOfUse" />
        <comment value="implicit, main mapping is on the extensions ext-TimeInterval.Period and ext-TimeInterval.Duration" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationAgreement" />
        <map value="MedicationAgreement.MedicationAgreementStopType" />
        <comment value="implicit, main mapping is on StopType extension" />
      </mapping>
    </element>
    <element id="MedicationRequest.intent">
      <path value="MedicationRequest.intent" />
      <definition value="Unless `intent` is explicitly recorded and a more appropriate code is known, the value can be set to _order_ because a MedicationAgreement should authorize an action for a patient, pharmacist, professional administrator et cetera." />
    </element>
    <element id="MedicationRequest.category">
      <path value="MedicationRequest.category" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="MedicationRequest.category:medicationAgreementCode">
      <path value="MedicationRequest.category" />
      <sliceName value="medicationAgreementCode" />
      <min value="1" />
      <max value="1" />
      <patternCodeableConcept>
        <coding>
          <system value="http://snomed.info/sct" />
          <code value="16076005" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="MedicationRequest.medication[x]">
      <path value="MedicationRequest.medication[x]" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="MedicationRequest.medication[x]:medicationReference">
      <path value="MedicationRequest.medication[x]" />
      <sliceName value="medicationReference" />
      <short value="AgreedMedicine" />
      <definition value="The medicine agreed upon to be used." />
      <alias value="Afgesprokengeneesmiddel" />
      <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-medicationagreement-v1.2-2020EN" />
        <map value="NL-CM:9.6.19925" />
        <comment value="AgreedMedicine" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationAgreement" />
        <map value="MedicationAgreement.AgreedMedicine" />
      </mapping>
    </element>
    <element id="MedicationRequest.subject">
      <path value="MedicationRequest.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="MedicationRequest.authoredOn">
      <path value="MedicationRequest.authoredOn" />
      <short value="MedicationAgreementDateTime" />
      <definition value="The time at which the agreement was made. Appointment date + time are required (order of the appointments must be clear in cases with multiple appointments on one day)." />
      <alias value="MedicatieafspraakDatumTijd" />
      <mapping>
        <identity value="zib-medicationagreement-v1.2-2020EN" />
        <map value="NL-CM:9.6.19757" />
        <comment value="MedicationAgreementDateTime" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationAgreement" />
        <map value="MedicationAgreement.MedicationAgreementDateTime" />
      </mapping>
    </element>
    <element id="MedicationRequest.requester">
      <path value="MedicationRequest.requester" />
      <short value="Prescriber" />
      <definition value="The health professional that entered the medication agreement with the patient." />
      <alias value="Voorschrijver" />
      <type>
        <code value="Reference" />
        <profile value="https://fhir.healthdata.be/StructureDefinition/pattern-HealthProfessionalReference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Device" />
        <targetProfile value="https://fhir.healthdata.be/StructureDefinition/HdBe-HealthProfessional-PractitionerRole" />
      </type>
      <mapping>
        <identity value="zib-medicationagreement-v1.2-2020EN" />
        <map value="NL-CM:9.6.1030" />
        <comment value="Prescriber" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationAgreement" />
        <map value="MedicationAgreement.Prescriber" />
      </mapping>
    </element>
    <element id="MedicationRequest.reasonCode">
      <path value="MedicationRequest.reasonCode" />
      <short value="ReasonMedicationAgreement" />
      <definition value="Reason for this agreement. This can be the reason to start, change or stop the medication treatment." />
      <alias value="RedenMedicatieafspraak" />
      <max value="1" />
      <binding>
        <strength value="required" />
        <valueSet value="https://fhir.healthdata.be/ValueSet/MedicationReason" />
      </binding>
      <mapping>
        <identity value="zib-medicationagreement-v1.2-2020EN" />
        <map value="NL-CM:9.6.22094" />
        <comment value="ReasonMedicationAgreement" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationAgreement" />
        <map value="MedicationAgreement.ReasonMedicationAgreement" />
      </mapping>
    </element>
    <element id="MedicationRequest.reasonReference">
      <path value="MedicationRequest.reasonReference" />
      <short value="PrescriptionReason" />
      <definition value="The medical reason for the prescription or for use of the medication. This can be used to enter a medical indication which was the direct cause for prescription or for use of the medication in question. &#xD;&#xA;It can concern every type of problem (or condition) of the patient, almost all diagnoses, complaints or symptoms." />
      <alias value="RedenVanVoorschrijven" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Condition" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Observation" />
        <targetProfile value="https://fhir.healthdata.be/StructureDefinition/HdBe-Problem" />
      </type>
      <mapping>
        <identity value="zib-medicationagreement-v1.2-2020EN" />
        <map value="NL-CM:9.6.23133" />
        <comment value="PrescriptionReason" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationAgreement" />
        <map value="MedicationAgreement.PrescriptionReason" />
      </mapping>
    </element>
    <element id="MedicationRequest.note">
      <path value="MedicationRequest.note" />
      <max value="1" />
    </element>
    <element id="MedicationRequest.note.text">
      <path value="MedicationRequest.note.text" />
      <short value="Comment" />
      <definition value="Comments regarding to the medication agreement. For example: in consultation with the medical specialist." />
      <alias value="Toelichting" />
      <mapping>
        <identity value="zib-medicationagreement-v1.2-2020EN" />
        <map value="NL-CM:9.6.22273" />
        <comment value="Comment" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationAgreement" />
        <map value="MedicationAgreement.Comment" />
      </mapping>
    </element>
    <element id="MedicationRequest.dosageInstruction">
      <path value="MedicationRequest.dosageInstruction" />
      <short value="DosingInstructions / InstructionsForUse" />
      <definition value="Instructions for the use of the medication, e.g. dose and route of administration." />
      <alias value="Gebruiksinstructie" />
      <type>
        <code value="Dosage" />
        <profile value="https://fhir.healthdata.be/StructureDefinition/HdBe-InstructionsForUse.DosageInstructions" />
      </type>
      <mapping>
        <identity value="zib-medicationagreement-v1.2-2020EN" />
        <map value="NL-CM:9.6.23240" />
        <comment value="InstructionsForUse" />
      </mapping>
      <mapping>
        <identity value="HdBe-MedicationAgreement" />
        <map value="MedicationAgreement.InstructionsForUse" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>