<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="b2cad53e-1da5-4653-bf79-9ed45f433534" />
  <meta>
    <versionId value="1" />
    <lastUpdated value="2024-08-28T06:34:02.402075+00:00" />
  </meta>
  <url value="http://electronichealth.se/fhir/StructureDefinition/NLLDataLock" />
  <version value="1.1.0" />
  <name value="NLLDataLock" />
  <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>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Basic" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Basic" />
  <derivation value="constraint" />
  <differential>
    <element id="Basic">
      <path value="Basic" />
      <short value="Information showing that the target resource has an privacy (sv integritet) or confidenitiality (sv sekretess) lock" />
      <definition value="As described in &quot;Lag (2018:1212) om nationell läkemedelslista&quot; chapter 4, it must be possible for a patient or practitioner to lock parts of a prescription. An active DataLock referencing a resource shows that parts of, or the full resource, should be filtered based on who/what tries to access the information. The filtering is done by the Swedish eHealth Agency, given which role tries to acess the resource (target of the DataLock) and purpose of the access. Creating or in-activating a DataLock is done by the client." />
    </element>
    <element id="Basic.id">
      <path value="Basic.id" />
      <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/nlldatalockid in documentation and external systems." />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Spärr-id" />
      </mapping>
    </element>
    <element id="Basic.meta">
      <path value="Basic.meta" />
      <mustSupport value="true" />
    </element>
    <element id="Basic.meta.versionId">
      <path value="Basic.meta.versionId" />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Spärrversion" />
      </mapping>
    </element>
    <element id="Basic.meta.security">
      <path value="Basic.meta.security" />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <valueSet value="http://ehalsomyndigheten.se/fhir/ValueSet/security-labels" />
      </binding>
    </element>
    <element id="Basic.meta.security.system">
      <path value="Basic.meta.security.system" />
      <mustSupport value="true" />
    </element>
    <element id="Basic.meta.security.version">
      <path value="Basic.meta.security.version" />
      <mustSupport value="true" />
    </element>
    <element id="Basic.meta.security.code">
      <path value="Basic.meta.security.code" />
      <mustSupport value="true" />
    </element>
    <element id="Basic.extension">
      <path value="Basic.extension" />
      <min value="3" />
    </element>
    <element id="Basic.extension:nllTargetPatient">
      <path value="Basic.extension" />
      <sliceName value="nllTargetPatient" />
      <short value="Reference to patient affected by this lock" />
      <definition value="Reference to the patient whos processesing of personal data is affected by the lock." />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLDataLockTarget" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Referens till patient" />
      </mapping>
    </element>
    <element id="Basic.extension:nllPrescriptionChain">
      <path value="Basic.extension" />
      <sliceName value="nllPrescriptionChain" />
      <short value="Prescription chain id" />
      <definition value="Prescription chain id that is locked. All MedicationRequests and MedicationDispenses in the prescription chain are locked." />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLPrescriptionChain" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Förskrivningskedje-id" />
      </mapping>
    </element>
    <element id="Basic.extension:nllLockedSubjectType">
      <path value="Basic.extension" />
      <sliceName value="nllLockedSubjectType" />
      <short value="Type of information locked" />
      <definition value="Type of information locked by the presence of the data lock. The locked information is all treatment reasons (sv: behandlingsorsak) for a confidentiality lock with the type SEKRETESS_PAT. Otherwise it is either a complete prescription chain (sv förskrivningskedja) or all dispenses for paper prescriptions (sv: pappersuttag) for the referenced patient." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLLockedSubjectType" />
      </type>
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://ehalsomyndigheten.se/fhir/ValueSet/locked-subjects" />
      </binding>
      <mapping>
        <identity value="EHM" />
        <map value="Spärrad uppgift" />
      </mapping>
    </element>
    <element id="Basic.extension:nllStatus">
      <path value="Basic.extension" />
      <sliceName value="nllStatus" />
      <short value="The status of the lock, reflects if it is active or not" />
      <definition value="The status of the lock, reflects if it is active or not" />
      <min value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLDataLockStatus" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Spärrstatus" />
      </mapping>
    </element>
    <element id="Basic.extension:nllStatus.value[x]">
      <path value="Basic.extension.value[x]" />
      <binding>
        <strength value="required" />
        <valueSet value="http://ehalsomyndigheten.se/fhir/ValueSet/data-lock-status" />
      </binding>
    </element>
    <element id="Basic.extension:nllLegalGround">
      <path value="Basic.extension" />
      <sliceName value="nllLegalGround" />
      <short value="Legal ground for the data lock" />
      <definition value="The legal ground defines who the lock applies to and the legal ground for setting the data lock. &lt;br&gt;&#xD;&#xA;An privacy lock (INTEGRITET) affects the purpose &quot;health care&quot; (sv &quot;vård&quot;) for health care pracititioners and the purpose &quot;support patient medication use&quot; (sv &quot;underlättande av patients läkemedelsanvändning&quot;) for pharmacy personnel.&lt;br&gt;&#xD;&#xA;A confidentiality lock applies to the patient (SEKRETESS_PAT) or the patient's guardian (SEKRETESS_VH). The confidentiality lock is based on a confidentiality assessment according to the law &quot;Public Access to Information and Secrecy Act&quot; (sv Offentlighets- och sekretesslag)." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://electronichealth.se/fhir/StructureDefinition/NLLDataLockLegalGround" />
      </type>
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://ehalsomyndigheten.se/fhir/ValueSet/data-lock-types" />
      </binding>
      <mapping>
        <identity value="EHM" />
        <map value="Spärrorsak" />
      </mapping>
    </element>
    <element id="Basic.code">
      <path value="Basic.code" />
      <short value="Resource type: Data Lock (sv. Spärr)" />
      <definition value="The type of resource is &quot;Data Lock&quot; (sv. Spärr)" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <description value="Codes for identifying types of Basic" />
        <valueSet value="http://ehalsomyndigheten.se/fhir/ValueSet/basic-resource-types" />
      </binding>
      <mapping>
        <identity value="EHM" />
        <map value="Resurstyp Spärr" />
      </mapping>
    </element>
    <element id="Basic.code.coding">
      <path value="Basic.code.coding" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Basic.code.coding.system">
      <path value="Basic.code.coding.system" />
      <fixedUri value="http://ehalsomyndigheten.se/fhir/CodeSystem/basic-resource-types" />
      <mustSupport value="true" />
    </element>
    <element id="Basic.code.coding.version">
      <path value="Basic.code.coding.version" />
      <mustSupport value="true" />
    </element>
    <element id="Basic.code.coding.code">
      <path value="Basic.code.coding.code" />
      <min value="1" />
      <fixedCode value="datalock" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>