{
  "resourceType": "StructureDefinition",
  "id": "nl-vzvz-AuditEvent",
  "language": "nl-NL",
  "url": "http://vzvz.nl/fhir/StructureDefinition/nl-vzvz-AuditEvent",
  "version": "4.0.0-beta.1",
  "name": "NlVzvzAuditEvent",
  "status": "draft",
  "publisher": "VZVZ",
  "contact": [
    {
      "name": "VZVZ",
      "telecom": [
        {
          "system": "email",
          "value": "standaardisatie@vzvz.nl",
          "use": "work"
        }
      ]
    }
  ],
  "description": "AuditEvent as used by VZVZ to exchange information on logged activities",
  "jurisdiction": [
    {
      "coding": [
        {
          "code": "NL",
          "system": "urn:iso:std:iso:3166",
          "display": "Netherlands"
        }
      ]
    }
  ],
  "copyright": "VZVZ",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "AuditEvent",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/AuditEvent",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "AuditEvent.extension:requestId",
        "path": "AuditEvent.extension",
        "sliceName": "requestId",
        "short": "id of the request that resulted in this AuditEvent",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://vzvz.nl/fhir/StructureDefinition/request-id"
            ]
          }
        ]
      },
      {
        "id": "AuditEvent.extension:traceId",
        "path": "AuditEvent.extension",
        "sliceName": "traceId",
        "short": "overarching id for the entire transaction",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://vzvz.nl/fhir/StructureDefinition/trace-id"
            ]
          }
        ]
      },
      {
        "id": "AuditEvent.type",
        "path": "AuditEvent.type",
        "example": [
          {
            "label": "FHIR based",
            "valueCoding": {
              "code": "rest",
              "system": "http://terminology.hl7.org/CodeSystem/audit-event-type"
            }
          },
          {
            "label": "v3 based",
            "valueCoding": {
              "code": "hl7-v3",
              "system": "http://terminology.hl7.org/CodeSystem/audit-event-type"
            }
          }
        ],
        "binding": {
          "strength": "extensible",
          "valueSet": "http://vzvz.nl/fhir/ValueSet/audit-event-type"
        }
      },
      {
        "id": "AuditEvent.subtype",
        "path": "AuditEvent.subtype",
        "comment": "Only used for FHIR events, not used for V3 events.",
        "example": [
          {
            "label": "FHIR based",
            "valueCoding": {
              "code": "search",
              "system": "http://hl7.org/fhir/restful-interaction"
            }
          },
          {
            "label": "V3 based",
            "valueCoding": {
              "code": "hl7-v3",
              "system": "http://terminology.hl7.org/CodeSystem/audit-event-type"
            }
          }
        ],
        "binding": {
          "strength": "extensible",
          "valueSet": "http://vzvz.nl/fhir/ValueSet/audit-event-sub-type"
        }
      },
      {
        "id": "AuditEvent.action",
        "path": "AuditEvent.action",
        "example": [
          {
            "label": "FHIR based",
            "valueCode": "R"
          },
          {
            "label": "V3 based",
            "valueCode": "E"
          }
        ]
      },
      {
        "id": "AuditEvent.period",
        "path": "AuditEvent.period",
        "comment": "start = timestamp of request sent\r\nend = timestamp of response received\r\nprecision should be at least milliseconds, timezone required",
        "example": [
          {
            "label": "Example",
            "valuePeriod": {
              "start": "2023-09-15T09:38:03.123+00:00",
              "end": "2023-09-15T09:38:03.6+00:00"
            }
          }
        ]
      },
      {
        "id": "AuditEvent.recorded",
        "path": "AuditEvent.recorded",
        "definition": "The time when the event was recorded. - NEN 7513 7.2-3",
        "comment": "time precision at least seconds, timezone mandatory",
        "example": [
          {
            "label": "Example",
            "valueInstant": "2023-09-15T09:38:03+00:00"
          }
        ]
      },
      {
        "id": "AuditEvent.outcome",
        "path": "AuditEvent.outcome",
        "comment": "also add value on success (= 0)",
        "example": [
          {
            "label": "FHIR based - HTTP 5xxx",
            "valueCode": "8"
          },
          {
            "label": "V3 based - CE",
            "valueCode": "4"
          }
        ]
      },
      {
        "id": "AuditEvent.outcomeDesc",
        "path": "AuditEvent.outcomeDesc",
        "definition": "A free text description of the outcome of the event. Human readable message containing HTTP response code, description of result or message, include description of problem (e.g. RTEDEST)"
      },
      {
        "id": "AuditEvent.agent",
        "path": "AuditEvent.agent",
        "comment": "There are at least one agent referring to the source of the event and one agent referring to the destination of the event. Optionally a third agent refers to the patient that is either the initiator of the event and/or the subject."
      },
      {
        "id": "AuditEvent.agent.type",
        "path": "AuditEvent.agent.type",
        "comment": "The type is required, to indicate if this agent instance defines the source, the destination or the patient.",
        "example": [
          {
            "label": "Source",
            "valueCodeableConcept": {
              "coding": [
                {
                  "code": "110153",
                  "system": "http://dicom.nema.org/resources/ontology/DCM",
                  "display": "Source Role ID"
                }
              ]
            }
          },
          {
            "label": "Destination",
            "valueCodeableConcept": {
              "coding": [
                {
                  "code": "110152",
                  "system": "http://dicom.nema.org/resources/ontology/DCM",
                  "display": "Destination Role ID"
                }
              ]
            }
          },
          {
            "label": "Patient",
            "valueCodeableConcept": {
              "coding": [
                {
                  "code": "PAT",
                  "system": "http://terminology.hl7.org/CodeSystem/v3-RoleClass"
                }
              ]
            }
          }
        ],
        "binding": {
          "strength": "extensible",
          "valueSet": "http://vzvz.nl/fhir/ValueSet/participation-role-type"
        }
      },
      {
        "id": "AuditEvent.agent.who",
        "path": "AuditEvent.agent.who",
        "definition": "Reference to the device or the patient involved in the event. Add the patient always as the subject of the event and indicate if the patient is the requestor.",
        "comment": "This element refers to either a Device or a Patient resource. These resources should be included in the instance as contained resources."
      },
      {
        "id": "AuditEvent.agent.name",
        "path": "AuditEvent.agent.name",
        "comment": "Not used in VZVZ"
      },
      {
        "id": "AuditEvent.agent.requestor",
        "path": "AuditEvent.agent.requestor",
        "definition": "Indicator that the user is or is not the requestor, or initiator, for the event being audited. Note that a user can be a person or a device.",
        "comment": "There can only be one initiator. If the initiator is not clear, then do not choose any one agent as the initiator.\r\nUse 'true' for the source and 'false' for the destination.",
        "example": [
          {
            "label": "Source",
            "valueBoolean": true
          },
          {
            "label": "Destination",
            "valueBoolean": false
          },
          {
            "label": "Patient as initiator",
            "valueBoolean": true
          },
          {
            "label": "Patient as subject only",
            "valueBoolean": false
          }
        ]
      },
      {
        "id": "AuditEvent.agent.network",
        "path": "AuditEvent.agent.network",
        "comment": "Usually used to describe the endpoint for a notification"
      },
      {
        "id": "AuditEvent.agent.network.address",
        "path": "AuditEvent.agent.network.address",
        "min": 1
      },
      {
        "id": "AuditEvent.agent.network.type",
        "path": "AuditEvent.agent.network.type",
        "comment": "Usually set to 'URI'",
        "min": 1
      },
      {
        "id": "AuditEvent.source.observer",
        "path": "AuditEvent.source.observer",
        "comment": "The resource this element refers to should be added as contained resource"
      },
      {
        "id": "AuditEvent.entity",
        "path": "AuditEvent.entity",
        "definition": "Specific instances of data or objects that have been accessed. - NEN object"
      },
      {
        "id": "AuditEvent.entity.what",
        "path": "AuditEvent.entity.what",
        "definition": "Identifies a specific instance of the entity. The reference should be version specific. Only relevant for FHIR events."
      },
      {
        "id": "AuditEvent.entity.query",
        "path": "AuditEvent.entity.query",
        "definition": "Use this element to always record the full url, regardless of the action\r\n- base url: if available\r\n- resource or /\r\n- parameters (incl. operations) if applicable"
      }
    ]
  }
}