Hello,
I am creating audit event for all actions performed by a FHIR client with a
AuditEventInterceptor extends ThreadLocalCapturingInterceptor
My intend is to create an AuditEvent in case of deletion by using the response from the FHIR server.
But when I save the AuditEvent that I created, it fails as AuditEvent.entity.what references a deleted resource. It there a way to overcome this ?
Thanks.
The AuditEvent looks like below:
{
"resourceType": "AuditEvent",
"type": {
"code": "rest",
"display": "Restful Operation"
},
"subtype": [
{
"code": "delete"
}
],
"action": "D",
"recorded": "2021-05-03T11:04:24.120+02:00",
"outcome": "0",
"agent": [
{
"type": {
"coding": [
{
"code": "humanuser",
"display": "human user"
}
]
},
"who": {
},
"name": "CHRISTOPHE SPIELMANN",
"requestor": true
}
],
"source": {
"site": "ceprescription",
"type": [
{
"code": "3",
"display": "Web Server"
}
]
},
"entity": [
{
"what": {
"reference": "Patient/106146/_history/2"
},
"type": {
"code": "Patient",
"display": "Patient"
},
"description": "deletion of resource Patient/106146/_history/2",
"detail": [
{
"type": "RequestedURL",
}
]
}
]
}