<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="http://electronichealth.se/fhir/StructureDefinition/NLLMultiDoseDispConsent" />
  <name value="NLLMultiDoseDispConsent" />
  <status value="draft" />
  <fhirVersion value="4.0.0" />
  <mapping>
    <identity value="EHM" />
    <name value="E-hälsomyndigheten Information Model" />
  </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 amount of information needed when a patient starts (or stops) receiving medication in multi dose dispense bags (sv: blir dospatient)" />
      <mapping>
        <identity value="EHM" />
        <map value="Dossamtycke" />
      </mapping>
    </element>
    <element id="Consent.extension">
      <path value="Consent.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Consent.extension:eventHistory">
      <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.extension" />
      <sliceName value="eventHistory" />
      <short value="A list of events of interest in the lifecycle" />
      <definition value="Links to Provenance records for past versions of this resource that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the resource." />
      <min value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLMultiDoseEvent" />
      </type>
      <mapping>
        <identity value="EHM" />
        <map value="Händelse avseende patientens läkemedelslista" />
      </mapping>
    </element>
    <element id="Consent.category">
      <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" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="coding.system" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <mustSupport value="true" />
    </element>
    <element id="Consent.category:consentDoseDisp">
      <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" />
      <sliceName value="consentDoseDisp" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Consent.category:consentDoseDisp.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" />
      <fixedUri value="http://electronichealth.se/fhir/ValueSet/consent-types-1" />
    </element>
    <element id="Consent.category:consentDoseDisp.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" />
      <fixedCode value="consent-dose-disp" />
    </element>
    <element id="Consent.patient">
      <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.patient" />
      <definition value="The patient to whom this multi dose dispense consent applies." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/StructureDefinition/NLLPatient" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Dospatient" />
      </mapping>
    </element>
    <element id="Consent.dateTime">
      <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.dateTime" />
      <short value="When this Consent was created" />
      <definition value="Defines when this consent for being a multi dose dispense patient was issued / created. Will be set to the date and time that the consent was registered. Read only." />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Registreringstidpunkt" />
      </mapping>
    </element>
    <element id="Consent.provision.period">
      <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" />
      <mustSupport value="true" />
    </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, used when consent should be ended." />
      <definition value="The end of the period. Used when the consent for receiving multi dose dispensed medication should be ended. In this scenario, the end date should be defined in an update action." />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Giltig till och med" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>