<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="ConsentSJF" />
  <meta>
    <lastUpdated value="2022-10-20T06:15:56.9744293+00:00" />
  </meta>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-category">
    <valueString value="Foundation.Security" />
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category">
    <valueCode value="patient" />
  </extension>
  <url value="https://fhir.cambio.se/StructureDefinition/ConsentSJF/v1" />
  <version value="1.0.0" />
  <name value="ConsentSJF" />
  <status value="active" />
  <description value="Profile to represent a consent to shared record keeping inbetween care providers in Sweden." />
  <purpose value="To enable creating consents, evaluation and exchange of already stored consents" />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="workflow" />
    <uri value="http://hl7.org/fhir/workflow" />
    <name value="Workflow Pattern" />
  </mapping>
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </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="Consent" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Consent" />
  <derivation value="constraint" />
  <snapshot />
  <differential>
    <element id="Consent.identifier">
      <path value="Consent.identifier" />
      <max value="1" />
    </element>
    <element id="Consent.scope.coding">
      <path value="Consent.scope.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Consent.scope.coding.system">
      <path value="Consent.scope.coding.system" />
      <min value="1" />
      <binding>
        <strength value="extensible" />
        <description value="Consent Scope Codes" />
        <valueSet value="http://hl7.org/fhir/ValueSet/consent-scope" />
      </binding>
    </element>
    <element id="Consent.scope.coding.code">
      <path value="Consent.scope.coding.code" />
      <min value="1" />
      <fixedCode value="patient-privacy" />
    </element>
    <element id="Consent.category">
      <path value="Consent.category" />
      <max value="1" />
    </element>
    <element id="Consent.category.coding">
      <path value="Consent.category.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Consent.category.coding.system">
      <path value="Consent.category.coding.system" />
      <min value="1" />
      <fixedUri value="http://snomed.info/sct" />
    </element>
    <element id="Consent.category.coding.version">
      <path value="Consent.category.coding.version" />
      <min value="1" />
      <fixedString value="http://snomed.info/sct/45991000052106/version/20220531" />
    </element>
    <element id="Consent.category.coding.code">
      <path value="Consent.category.coding.code" />
      <min value="1" />
      <fixedCode value="70831000052108" />
    </element>
    <element id="Consent.patient">
      <path value="Consent.patient" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://commonprofiles.care/StructureDefinition/PatientSEVendorLite" />
      </type>
    </element>
    <element id="Consent.dateTime">
      <path value="Consent.dateTime" />
      <min value="1" />
    </element>
    <element id="Consent.performer">
      <path value="Consent.performer" />
      <max value="0" />
    </element>
    <element id="Consent.organization">
      <path value="Consent.organization" />
      <max value="0" />
    </element>
    <element id="Consent.source[x]">
      <path value="Consent.source[x]" />
      <max value="0" />
    </element>
    <element id="Consent.policy">
      <path value="Consent.policy" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Consent.policy.uri">
      <path value="Consent.policy.uri" />
      <min value="1" />
      <fixedUri value="https://www.riksdagen.se/sv/dokument-lagar/dokument/svensk-forfattningssamling/patientdatalag-2008355_sfs-2008-355" />
    </element>
    <element id="Consent.policyRule">
      <path value="Consent.policyRule" />
      <max value="0" />
    </element>
    <element id="Consent.policyRule.coding">
      <path value="Consent.policyRule.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Consent.policyRule.coding.system">
      <path value="Consent.policyRule.coding.system" />
      <min value="1" />
    </element>
    <element id="Consent.policyRule.coding.version">
      <path value="Consent.policyRule.coding.version" />
      <min value="1" />
    </element>
    <element id="Consent.policyRule.coding.code">
      <path value="Consent.policyRule.coding.code" />
      <min value="1" />
    </element>
    <element id="Consent.verification">
      <path value="Consent.verification" />
      <max value="0" />
    </element>
    <element id="Consent.provision">
      <path value="Consent.provision" />
      <min value="1" />
    </element>
    <element id="Consent.provision.type">
      <path value="Consent.provision.type" />
      <min value="1" />
      <fixedCode value="permit" />
    </element>
    <element id="Consent.provision.period">
      <path value="Consent.provision.period" />
      <min value="1" />
    </element>
    <element id="Consent.provision.actor">
      <path value="Consent.provision.actor" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="role.coding.code" />
        </discriminator>
        <description value="Slices for different actor roles" />
        <ordered value="false" />
        <rules value="closed" />
      </slicing>
      <min value="2" />
    </element>
    <element id="Consent.provision.actor:grantor">
      <path value="Consent.provision.actor" />
      <sliceName value="grantor" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Consent.provision.actor:grantor.role.coding.system">
      <path value="Consent.provision.actor.role.coding.system" />
      <fixedUri value="http://terminology.hl7.org/CodeSystem/v3-RoleCode" />
    </element>
    <element id="Consent.provision.actor:grantor.role.coding.code">
      <path value="Consent.provision.actor.role.coding.code" />
      <min value="1" />
      <fixedCode value="GRANTOR" />
    </element>
    <element id="Consent.provision.actor:grantor.reference">
      <path value="Consent.provision.actor.reference" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
      </type>
    </element>
    <element id="Consent.provision.actor:grantor.reference.identifier">
      <path value="Consent.provision.actor.reference.identifier" />
      <min value="1" />
    </element>
    <element id="Consent.provision.actor:grantor.reference.identifier.system">
      <path value="Consent.provision.actor.reference.identifier.system" />
      <min value="1" />
    </element>
    <element id="Consent.provision.actor:grantor.reference.identifier.value">
      <path value="Consent.provision.actor.reference.identifier.value" />
      <min value="1" />
    </element>
    <element id="Consent.provision.actor:grantee">
      <path value="Consent.provision.actor" />
      <sliceName value="grantee" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Consent.provision.actor:grantee.role.coding.system">
      <path value="Consent.provision.actor.role.coding.system" />
      <fixedUri value="http://terminology.hl7.org/CodeSystem/v3-RoleCode" />
    </element>
    <element id="Consent.provision.actor:grantee.role.coding.code">
      <path value="Consent.provision.actor.role.coding.code" />
      <min value="1" />
      <fixedCode value="GRANTEE" />
    </element>
    <element id="Consent.provision.actor:grantee.reference">
      <path value="Consent.provision.actor.reference" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://commonprofiles.care/StructureDefinition/OrganizationSEVendorLite" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole" />
      </type>
    </element>
    <element id="Consent.provision.actor:grantee.reference.identifier">
      <path value="Consent.provision.actor.reference.identifier" />
      <min value="1" />
    </element>
    <element id="Consent.provision.actor:grantee.reference.identifier.system">
      <path value="Consent.provision.actor.reference.identifier.system" />
      <min value="1" />
      <patternUri value="urn:oid:1.2.752.29.4.19" />
    </element>
    <element id="Consent.provision.actor:grantee.reference.identifier.value">
      <path value="Consent.provision.actor.reference.identifier.value" />
      <min value="1" />
    </element>
    <element id="Consent.provision.actor:primaryauthor">
      <path value="Consent.provision.actor" />
      <sliceName value="primaryauthor" />
      <max value="1" />
    </element>
    <element id="Consent.provision.actor:primaryauthor.role.coding.system">
      <path value="Consent.provision.actor.role.coding.system" />
      <fixedUri value="http://terminology.hl7.org/CodeSystem/contractsignertypecodes" />
    </element>
    <element id="Consent.provision.actor:primaryauthor.role.coding.code">
      <path value="Consent.provision.actor.role.coding.code" />
      <min value="1" />
      <fixedCode value="PRIMARYAUTHOR" />
    </element>
    <element id="Consent.provision.actor:primaryauthor.reference">
      <path value="Consent.provision.actor.reference" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole" />
      </type>
    </element>
    <element id="Consent.provision.actor:primaryauthor.reference.identifier">
      <path value="Consent.provision.actor.reference.identifier" />
      <min value="1" />
    </element>
    <element id="Consent.provision.actor:primaryauthor.reference.identifier.system">
      <path value="Consent.provision.actor.reference.identifier.system" />
      <min value="1" />
      <patternUri value="urn:oid:1.2.752.29.4.19" />
    </element>
    <element id="Consent.provision.actor:primaryauthor.reference.identifier.value">
      <path value="Consent.provision.actor.reference.identifier.value" />
      <min value="1" />
    </element>
    <element id="Consent.provision.action">
      <path value="Consent.provision.action" />
      <max value="0" />
    </element>
    <element id="Consent.provision.securityLabel">
      <path value="Consent.provision.securityLabel" />
      <max value="0" />
    </element>
    <element id="Consent.provision.purpose">
      <path value="Consent.provision.purpose" />
      <max value="0" />
    </element>
    <element id="Consent.provision.class">
      <path value="Consent.provision.class" />
      <max value="0" />
    </element>
    <element id="Consent.provision.code">
      <path value="Consent.provision.code" />
      <max value="0" />
    </element>
    <element id="Consent.provision.dataPeriod">
      <path value="Consent.provision.dataPeriod" />
      <max value="0" />
    </element>
    <element id="Consent.provision.data">
      <path value="Consent.provision.data" />
      <max value="0" />
    </element>
    <element id="Consent.provision.provision">
      <path value="Consent.provision.provision" />
      <max value="0" />
      <contentReference value="http://hl7.org/fhir/StructureDefinition/Consent#Consent.provision" />
    </element>
  </differential>
</StructureDefinition>