<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="http://electronichealth.se/fhir/StructureDefinition/NLLMultiDoseDispConsent" />
  <version value="1.3.0" />
  <name value="NLLMultiDoseDispConsent" />
  <status value="active" />
  <date value="2024-08-28" />
  <publisher value="Swedish eHealth Agency" />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="EHM" />
    <uri value="http://ehalsomyndigheten.se" />
    <name value="E-hälsomyndigheten concept" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Consent" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Consent" />
  <derivation value="constraint" />
  <differential>
    <element id="Consent">
      <path value="Consent" />
      <short value="Consent for a patient receiving medications in multi dose dispense packaging" />
      <definition value="This consent represents the information needed when a patient starts (or stops) receiving medication in multi dose dispense bags (sv: blir dospatient)" />
      <comment value="_" />
      <mapping>
        <identity value="EHM" />
        <map value="Dossamtycke" />
      </mapping>
    </element>
    <element id="Consent.id">
      <path value="Consent.id" />
      <definition value="UUID identifying the consent" />
      <comment value="The only time that a resource does not have an id is when it is being submitted to the server using a create operation.&#xD;&#xA;This id is identified by the URI http://electronichealth.se/identifier/nllconsentid in documentation and external systems." />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Samtyckes-id" />
      </mapping>
    </element>
    <element id="Consent.meta">
      <path value="Consent.meta" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.meta.lastUpdated">
      <path value="Consent.meta.lastUpdated" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.meta.security">
      <path value="Consent.meta.security" />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <valueSet value="http://ehalsomyndigheten.se/fhir/ValueSet/security-labels" />
      </binding>
    </element>
    <element id="Consent.meta.security.system">
      <path value="Consent.meta.security.system" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.meta.security.version">
      <path value="Consent.meta.security.version" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.meta.security.code">
      <path value="Consent.meta.security.code" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.status">
      <path value="Consent.status" />
      <short value="active | inactive" />
      <definition value="Indicates the current state of this consent. A consent is active if current date is &gt;= period.start and &lt;= period.end." />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://ehalsomyndigheten.se/fhir/ValueSet/multi-dose-disp-consent-status" />
      </binding>
      <mapping>
        <identity value="EHM" />
        <map value="Samtyckesstatus" />
      </mapping>
    </element>
    <element id="Consent.scope">
      <path value="Consent.scope" />
      <definition value="A multi dose disp consent gives healthcare personnel the right to see, create and update the specified patient's prescriptions and dispenses." />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Tillämpningsområde" />
      </mapping>
    </element>
    <element id="Consent.scope.coding">
      <path value="Consent.scope.coding" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.scope.coding.system">
      <path value="Consent.scope.coding.system" />
      <fixedUri value="http://terminology.hl7.org/CodeSystem/consentscope" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.scope.coding.version">
      <path value="Consent.scope.coding.version" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.scope.coding.code">
      <path value="Consent.scope.coding.code" />
      <fixedCode value="patient-privacy" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.category">
      <path value="Consent.category" />
      <definition value="The category code consent-dose-disp is used within the Swedish National Medication List for multi dose disp consents (sv. dossamtycke)." />
      <max value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://ehalsomyndigheten.se/fhir/ValueSet/consent-category-codes" />
      </binding>
      <mapping>
        <identity value="EHM" />
        <map value="Samtyckestyp" />
      </mapping>
    </element>
    <element id="Consent.category.coding">
      <path value="Consent.category.coding" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.category.coding.system">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
        <valueCode value="normative" />
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
        <valueCode value="4.0.0" />
      </extension>
      <path value="Consent.category.coding.system" />
      <min value="1" />
      <fixedUri value="http://ehalsomyndigheten.se/fhir/CodeSystem/library" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.category.coding.version">
      <path value="Consent.category.coding.version" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.category.coding.code">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
        <valueCode value="normative" />
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
        <valueCode value="4.0.0" />
      </extension>
      <path value="Consent.category.coding.code" />
      <definition value="The category code consent-dose-disp is used within the Swedish National Medication List for multi dose disp consents (sv. dossamtycke)." />
      <min value="1" />
      <fixedCode value="consent-dose-disp" />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Samtyckestyp" />
      </mapping>
    </element>
    <element id="Consent.patient">
      <path value="Consent.patient" />
      <definition value="The patient to whom this multi dose dispense consent applies." />
      <comment value="_" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/StructureDefinition/NLLPatient" />
        <aggregation value="referenced" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Patientreferens" />
      </mapping>
    </element>
    <element id="Consent.patient.reference">
      <path value="Consent.patient.reference" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.policy">
      <path value="Consent.policy" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.policy.uri">
      <path value="Consent.policy.uri" />
      <fixedUri value="https://ehalsomyndigheten.se/nationellalakemedelslistan/policy" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision">
      <path value="Consent.provision" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.period">
      <path value="Consent.provision.period" />
      <comment value="A Period specifies a range of time; the context of use will specify whether the entire range applies.&#xA;&#xA;Period is not used for a duration (a measure of elapsed time). See [Duration](datatypes.html#Duration)." />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.period.start">
      <path value="Consent.provision.period.start" />
      <short value="Start time of the consent." />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Gilltig från och med" />
      </mapping>
    </element>
    <element id="Consent.provision.period.end">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
        <valueCode value="normative" />
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
        <valueCode value="4.0.0" />
      </extension>
      <path value="Consent.provision.period.end" />
      <short value="End time of the consent." />
      <definition value="The end of the period. The boundary is inclusive." />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Giltig till och med" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>