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