{
  "resourceType": "StructureDefinition",
  "url": "https://nijz.si/rdsp/fhir/StructureDefinition/ConsentSIAgent",
  "name": "ConsentSIAgent",
  "status": "draft",
  "fhirVersion": "4.1.0",
  "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": "https://nijz.si/rdsp/fhir/StructureDefinition/ConsentSI",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Consent.identifier",
        "path": "Consent.identifier",
        "min": 1
      },
      {
        "id": "Consent.identifier.system",
        "path": "Consent.identifier.system",
        "fixedUri": "urn:nijz:crpp:consentId"
      },
      {
        "id": "Consent.status",
        "path": "Consent.status",
        "short": "active | inactive"
      },
      {
        "id": "Consent.category.coding.system",
        "path": "Consent.category.coding.system",
        "fixedUri": "urn:nijz:crpp:consentcategory"
      },
      {
        "id": "Consent.category.coding.code",
        "path": "Consent.category.coding.code",
        "fixedCode": "access-eZdravje"
      },
      {
        "id": "Consent.category.coding.display",
        "path": "Consent.category.coding.display",
        "fixedString": "access-eZdravje"
      },
      {
        "id": "Consent.patient",
        "path": "Consent.patient",
        "min": 1
      },
      {
        "id": "Consent.dateTime",
        "path": "Consent.dateTime",
        "min": 1
      },
      {
        "id": "Consent.performer",
        "path": "Consent.performer",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Patient",
              "http://hl7.org/fhir/StructureDefinition/RelatedPerson"
            ]
          }
        ]
      },
      {
        "id": "Consent.organization",
        "path": "Consent.organization",
        "max": "0"
      },
      {
        "id": "Consent.source[x].contentType",
        "path": "Consent.source[x].contentType",
        "max": "0"
      },
      {
        "id": "Consent.source[x].language",
        "path": "Consent.source[x].language",
        "max": "0"
      },
      {
        "id": "Consent.source[x].data",
        "path": "Consent.source[x].data",
        "max": "0"
      },
      {
        "id": "Consent.source[x].size",
        "path": "Consent.source[x].size",
        "max": "0"
      },
      {
        "id": "Consent.source[x].hash",
        "path": "Consent.source[x].hash",
        "max": "0"
      },
      {
        "id": "Consent.policyRule.coding.system",
        "path": "Consent.policyRule.coding.system",
        "fixedUri": "http://terminology.hl7.org/CodeSystem/v3-ActCode"
      },
      {
        "id": "Consent.policyRule.coding.code",
        "path": "Consent.policyRule.coding.code",
        "fixedCode": "OPTIN"
      },
      {
        "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",
        "min": 1
      },
      {
        "id": "Consent.provision.actor.role",
        "path": "Consent.provision.actor.role",
        "binding": {
          "strength": "extensible",
          "valueSet": "urn:nijz:consentagent:roleclassSI"
        }
      },
      {
        "id": "Consent.provision.actor.reference",
        "path": "Consent.provision.actor.reference",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Patient",
              "http://hl7.org/fhir/StructureDefinition/PractitionerRole",
              "http://hl7.org/fhir/StructureDefinition/Practitioner",
              "http://hl7.org/fhir/StructureDefinition/Organization"
            ]
          }
        ]
      },
      {
        "id": "Consent.provision.action",
        "path": "Consent.provision.action",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Consent.provision.action.coding.system",
        "path": "Consent.provision.action.coding.system",
        "fixedUri": "http://terminology.hl7.org/CodeSystem/consentaction"
      },
      {
        "id": "Consent.provision.action.coding.code",
        "path": "Consent.provision.action.coding.code",
        "fixedCode": "access"
      },
      {
        "id": "Consent.provision.action.coding.display",
        "path": "Consent.provision.action.coding.display",
        "fixedString": "Access"
      },
      {
        "id": "Consent.provision.purpose",
        "path": "Consent.provision.purpose",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Consent.provision.purpose.system",
        "path": "Consent.provision.purpose.system",
        "fixedUri": "http://terminology.hl7.org/ValueSet/v3-PurposeOfUse"
      },
      {
        "id": "Consent.provision.purpose.code",
        "path": "Consent.provision.purpose.code",
        "fixedCode": "PATRQT"
      },
      {
        "id": "Consent.provision.purpose.display",
        "path": "Consent.provision.purpose.display",
        "fixedString": "patient requested"
      },
      {
        "id": "Consent.provision.class",
        "path": "Consent.provision.class",
        "max": "0"
      }
    ]
  }
}