StructureDefinition AuditEvent

Created by the central GMS infrastructure on any CRUD event.

Can be searched on for auditability and obtaining status history for Tasks (as an alternative to the Task _history option).

It is not expected or permitted that a client system would update or post AuditEvents to the central service.

AuditEvents are expected to be created for any CRUD events which affect resources on the server. Where resources do not exist on the server, e.g. empty SearchSets or failed POSTs, no AuditEvents will be created. Failed updates may still trigger creation of AuditEvent resources but the outcome.code will record that the event was unsuccessful.

AuditEvents for resources created by the server will record the server identity within the who element.

The below profile is therefore provided to support parsing for clients if returned through a GET request.

Profile url FHIR Module Normative Status
http://hl7.org/fhir/StructureDefinition/AuditEvent HL7 International trial-use

idΣ0..1string
metaΣ0..1Meta
implicitRulesΣ ?!0..1uri
language0..1codeBinding
text0..1Narrative
contained0..*Resource
extensionI0..*Extension
modifierExtension?! I0..*Extension
typeΣ1..1CodingBinding
subtypeΣ0..*CodingBinding
actionΣ0..1codeBinding
periodI0..1Period
recordedΣ1..1instant
outcomeΣ0..1codeBinding
outcomeDescΣ0..1string
purposeOfEventΣ0..*CodeableConceptBinding
id0..1string
extensionI0..*Extension
modifierExtensionΣ ?! I0..*Extension
type0..1CodeableConceptBinding
role0..*CodeableConcept
whoΣ I0..1Reference(PractitionerRole | Practitioner | Organization | Device | Patient | RelatedPerson)
altId0..1string
name0..1string
requestorΣ1..1boolean
locationI0..1Reference(Location)
policy0..*uri
media0..1CodingBinding
id0..1string
extensionI0..*Extension
modifierExtensionΣ ?! I0..*Extension
address0..1string
type0..1codeBinding
purposeOfUse0..*CodeableConceptBinding
id0..1string
extensionI0..*Extension
modifierExtensionΣ ?! I0..*Extension
site0..1string
observerΣ I1..1Reference(PractitionerRole | Practitioner | Organization | Device | Patient | RelatedPerson)
type0..*CodingBinding
id0..1string
extensionI0..*Extension
modifierExtensionΣ ?! I0..*Extension
whatΣ I0..1Reference(Resource)
type0..1CodingBinding
role0..1CodingBinding
lifecycle0..1CodingBinding
securityLabel0..*CodingBinding
nameΣ I0..1string
description0..1string
queryΣ I0..1base64Binary
id0..1string
extensionI0..*Extension
modifierExtensionΣ ?! I0..*Extension
type1..1string
valueStringstring
valueBase64Binarybase64Binary



Additional Guidance

action

SHALL be present. Code from base HL7 resource, only C (create), R (read) and U (update) would usually be expected.
"action": "U",

agent

SHOULD be present for any user initiated actions. Reference to the user or system that triggered the creation/read/update. Identity SHOULD be determined through the appropriate authentication token within the request header, e.g. CIS2 auth token.
"agent":  [
        {
            "type": {
                "coding":  [
                    {
                        "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
                        "code": "AUT",
                        "display": "author (originator)"
                    }
                ]
            },
            "who": {
                "reference": "PractitionerRole/PractitionerRole-TestClinicalScientist-Example",
                "identifier": {
                    "system": "https://fhir.nhs.uk/Id/sds-user-id",
                    "value": "9999999997"
                }
            },
            "name": "Test Clinical Scientist",
            "requestor": true
        }
    ],

entity

SHOULD be present where the resource exists on the server. Reference to the resource which was affected by the event.
"entity":  [
        {
            "what": {
                "reference": "Task/Task-NonWGSRareDiseaseTestOrderRejected-Example"
            },
            "type": {
                "system": "http://hl7.org/fhir/resource-types",
                "code": "Task",
                "display": "Task"
            },
            "role": {
                "system": "http://terminology.hl7.org/CodeSystem/object-role",
                "code": "20",
                "display": "Job"
            }
        }
    ]