{
  "resourceType": "StructureDefinition",
  "id": "profile-consent-management-provenance",
  "url": "http://fhir.de/ConsentManagement/StructureDefinition/Provenance",
  "version": "2.0.3",
  "name": "ConsentManagementProvenance",
  "title": "Consent Management Provenance",
  "status": "active",
  "experimental": false,
  "date": "2026-03-02",
  "publisher": "AG Einwilligungsmanagement des Interoperabilitätsforums",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "https://wiki.hl7.de/index.php?title=Einwilligungsmanagement_(Projekt)"
        }
      ]
    }
  ],
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w3c.prov",
      "uri": "http://www.w3.org/ns/prov",
      "name": "W3C PROV"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    },
    {
      "identity": "fhirauditevent",
      "uri": "http://hl7.org/fhir/auditevent",
      "name": "FHIR AuditEvent Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Provenance",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Provenance",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Provenance.target",
        "path": "Provenance.target",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://fhir.de/ConsentManagement/StructureDefinition/QuestionnaireResponse",
              "http://fhir.de/ConsentManagement/StructureDefinition/Consent"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Provenance.target.reference",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Provenance.target.reference",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Provenance.recorded",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Provenance.recorded",
        "mustSupport": true
      },
      {
        "id": "Provenance.agent",
        "path": "Provenance.agent",
        "definition": "An dieser Stelle soll die verwendete Software dokumentiert werden. Über die Form der Dokumentation wird hier keine Aussage getroffen, d.h. auch eine freitextliche Angabe (agent.who.display) ist möglich.\r\n\r\nOptional können die an der Erstellung der Einwilligung beteiligten Personen und/oder Organisationen hier referenziert werden, sofern im konkreten Anwendungsfall die Referenzierung mittels signature.who nicht ausreicht.",
        "mustSupport": true
      },
      {
        "id": "Provenance.agent.who",
        "path": "Provenance.agent.who",
        "mustSupport": true
      },
      {
        "id": "Provenance.entity",
        "path": "Provenance.entity",
        "mustSupport": true
      },
      {
        "id": "Provenance.entity.role",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Provenance.entity.role",
        "fixedCode": "source",
        "mustSupport": true
      },
      {
        "id": "Provenance.entity.what",
        "path": "Provenance.entity.what",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://fhir.de/ConsentManagement/StructureDefinition/DocumentReference",
              "http://fhir.de/ConsentManagement/StructureDefinition/QuestionnaireResponse"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Provenance.entity.what.reference",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Provenance.entity.what.reference",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Provenance.signature",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Provenance.signature",
        "mustSupport": true
      },
      {
        "id": "Provenance.signature.extension",
        "path": "Provenance.signature.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Provenance.signature.extension:where",
        "path": "Provenance.signature.extension",
        "sliceName": "where",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://fhir.de/ConsentManagement/StructureDefinition/SignatureLocation"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Provenance.signature.extension:where.value[x]",
        "path": "Provenance.signature.extension.value[x]",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Provenance.signature.type",
        "path": "Provenance.signature.type",
        "mustSupport": true,
        "binding": {
          "strength": "extensible"
        }
      },
      {
        "id": "Provenance.signature.type.system",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Provenance.signature.type.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Provenance.signature.type.code",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Provenance.signature.type.code",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Provenance.signature.when",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Provenance.signature.when",
        "mustSupport": true
      },
      {
        "id": "Provenance.signature.who",
        "path": "Provenance.signature.who",
        "mustSupport": true
      },
      {
        "id": "Provenance.signature.onBehalfOf",
        "path": "Provenance.signature.onBehalfOf",
        "mustSupport": true
      },
      {
        "id": "Provenance.signature.data",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Provenance.signature.data",
        "mustSupport": true
      }
    ]
  }
}