Scenario: [1:25]
TC-AUD-001 | REQ-AUD-001 GET /AuditEvent/{id} returns 200 and resourceType = AuditEvent
ms: 9998
>>
Background:
12
* url baseUrl
0
21:54:51.816 baseUrl: https://hapi.fhir.org/baseR4
21:54:51.816 fhirVersion: 4.0.1
13
Given path 'AuditEvent'
0
14
And param _count = '1'
0
15
When method GET
5013
21:54:51.818 request:
1 > GET https://hapi.fhir.org/baseR4/AuditEvent?_count=1
1 > Host: hapi.fhir.org
1 > Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18)
1 > Accept-Encoding: gzip,deflate
21:54:56.829 response time in milliseconds: 5011
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Tue, 21 Apr 2026 21:54:56 GMT
1 < Content-Type: application/fhir+json;charset=utf-8
1 < Transfer-Encoding: chunked
1 < Connection: keep-alive
1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4)
1 < X-Request-ID: TGOhglzOJR6EHuqB
1 < Last-Modified: Tue, 21 Apr 2026 21:54:56 GMT
{
"resourceType": "Bundle",
"id": "d8d7679f-f8eb-456c-862a-446f253b5990",
"meta": {
"lastUpdated": "2026-04-21T21:54:56.783+00:00"
},
"type": "searchset",
"link": [ {
"relation": "self",
"url": "https://hapi.fhir.org/baseR4/AuditEvent?_count=1"
}, {
"relation": "next",
"url": "https://hapi.fhir.org/baseR4?_getpages=d8d7679f-f8eb-456c-862a-446f253b5990&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset"
} ],
"entry": [ {
"fullUrl": "https://hapi.fhir.org/baseR4/AuditEvent/121538577",
"resource": {
"resourceType": "AuditEvent",
"id": "121538577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-11T18:07:19.357+00:00",
"source": "#E5nvD1zU87MuFOWe"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-event-type",
"code": "rest",
"display": "RESTful Operation"
},
"subtype": [ {
"system": "http://hl7.org/fhir/restful-interaction",
"code": "read",
"display": "read"
} ],
"action": "R",
"recorded": "2026-02-11T18:07:16Z",
"outcome": "0",
"agent": [ {
"type": {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
"code": "CST",
"display": "Custodian"
} ]
},
"who": {
"display": "Rail FHIR Agent"
},
"requestor": true
} ],
"source": {
"observer": {
"display": "Juggernaut Rail Platform"
}
},
"entity": [ {
"what": {
"reference": "Patient/121537908"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-entity-type",
"code": "1",
"display": "Person"
},
"role": {
"system": "http://terminology.hl7.org/CodeSystem/object-role",
"code": "1",
"display": "Patient"
},
"detail": [ {
"type": "receipt_id",
"valueString": "9cce92a2a63c6c4f"
}, {
"type": "cdt",
"valueString": "7b18d26bcbdf8b02bd779080a844aeb44cb432c8d13205f9903ded0959236b52"
} ]
} ]
},
"search": {
"mode": "match"
}
} ]
}
16
Then status 200
0
17
* def hasEntry = response.entry != null && response.entry.length > 0
0
18
* def auditEventAvailable = hasEntry
0
19
* def auditEventId = hasEntry ? response.entry[0].resource.id : null
1
20
* def auditResourceType = auditEventAvailable ? response.entry[0].resource.resourceType : 'AuditEvent'
1
21
* match auditResourceType == 'AuditEvent'
1
22
* if (auditEventAvailable) karate.log('Resolved auditEventId: ' + auditEventId)
1
21:54:56.835 Resolved auditEventId: 121538577
23
* if (!auditEventAvailable) karate.log('TC-AUD block: SKIP — no AuditEvent resources on server')
1
26
* if (!auditEventAvailable) karate.log('TC-AUD-001: SKIP — no AuditEvent resources on server')
1
27
* if (auditEventAvailable) karate.call('classpath:audit/assert-audit-read.feature', { auditEventId: auditEventId, baseUrl: baseUrl })
4977
>>
audit.assert-audit-read
4968
4
Given url baseUrl
0
5
And path 'AuditEvent', auditEventId
1
6
When method GET
4962
21:54:56.848 request:
1 > GET https://hapi.fhir.org/baseR4/AuditEvent/121538577
1 > Host: hapi.fhir.org
1 > Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18)
1 > Accept-Encoding: gzip,deflate
21:55:01.808 response time in milliseconds: 4960
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Tue, 21 Apr 2026 21:55:01 GMT
1 < Content-Type: application/fhir+json;charset=utf-8
1 < Transfer-Encoding: chunked
1 < Connection: keep-alive
1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4)
1 < ETag: W/"1"
1 < X-Request-ID: 8Ve8Ts76u6Tfp1SK
1 < Content-Location: https://hapi.fhir.org/baseR4/AuditEvent/121538577/_history/1
1 < Last-Modified: Wed, 11 Feb 2026 18:07:19 GMT
{
"resourceType": "AuditEvent",
"id": "121538577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-11T18:07:19.357+00:00",
"source": "#E5nvD1zU87MuFOWe"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-event-type",
"code": "rest",
"display": "RESTful Operation"
},
"subtype": [ {
"system": "http://hl7.org/fhir/restful-interaction",
"code": "read",
"display": "read"
} ],
"action": "R",
"recorded": "2026-02-11T18:07:16Z",
"outcome": "0",
"agent": [ {
"type": {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
"code": "CST",
"display": "Custodian"
} ]
},
"who": {
"display": "Rail FHIR Agent"
},
"requestor": true
} ],
"source": {
"observer": {
"display": "Juggernaut Rail Platform"
}
},
"entity": [ {
"what": {
"reference": "Patient/121537908"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-entity-type",
"code": "1",
"display": "Person"
},
"role": {
"system": "http://terminology.hl7.org/CodeSystem/object-role",
"code": "1",
"display": "Patient"
},
"detail": [ {
"type": "receipt_id",
"valueString": "9cce92a2a63c6c4f"
}, {
"type": "cdt",
"valueString": "7b18d26bcbdf8b02bd779080a844aeb44cb432c8d13205f9903ded0959236b52"
} ]
} ]
}
7
Then status 200
0
8
And match response.resourceType == 'AuditEvent'
1
9
* karate.write(response, 'responses/audit/audit-event-read.json')
4
21:55:01.814 write to file: target/responses/audit/audit-event-read.json
28
* if (auditEventAvailable) karate.match(responseTime < 10000, true)
1
Scenario: [2:30]
TC-AUD-002 | REQ-AUD-002 type.system and type.code are present
ms: 9966
>>
Background:
12
* url baseUrl
0
21:54:52.845 baseUrl: https://hapi.fhir.org/baseR4
21:54:52.845 fhirVersion: 4.0.1
13
Given path 'AuditEvent'
0
14
And param _count = '1'
0
15
When method GET
4970
21:54:52.848 request:
1 > GET https://hapi.fhir.org/baseR4/AuditEvent?_count=1
1 > Host: hapi.fhir.org
1 > Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18)
1 > Accept-Encoding: gzip,deflate
21:54:57.816 response time in milliseconds: 4967
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Tue, 21 Apr 2026 21:54:57 GMT
1 < Content-Type: application/fhir+json;charset=utf-8
1 < Transfer-Encoding: chunked
1 < Connection: keep-alive
1 < X-Cache: HIT from https://hapi.fhir.org/baseR4
1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4)
1 < X-Request-ID: B79nM6lJ7FPxatsx
1 < Last-Modified: Tue, 21 Apr 2026 21:54:56 GMT
{
"resourceType": "Bundle",
"id": "d8d7679f-f8eb-456c-862a-446f253b5990",
"meta": {
"lastUpdated": "2026-04-21T21:54:56.783+00:00"
},
"type": "searchset",
"link": [ {
"relation": "self",
"url": "https://hapi.fhir.org/baseR4/AuditEvent?_count=1"
}, {
"relation": "next",
"url": "https://hapi.fhir.org/baseR4?_getpages=d8d7679f-f8eb-456c-862a-446f253b5990&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset"
} ],
"entry": [ {
"fullUrl": "https://hapi.fhir.org/baseR4/AuditEvent/121538577",
"resource": {
"resourceType": "AuditEvent",
"id": "121538577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-11T18:07:19.357+00:00",
"source": "#E5nvD1zU87MuFOWe"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-event-type",
"code": "rest",
"display": "RESTful Operation"
},
"subtype": [ {
"system": "http://hl7.org/fhir/restful-interaction",
"code": "read",
"display": "read"
} ],
"action": "R",
"recorded": "2026-02-11T18:07:16Z",
"outcome": "0",
"agent": [ {
"type": {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
"code": "CST",
"display": "Custodian"
} ]
},
"who": {
"display": "Rail FHIR Agent"
},
"requestor": true
} ],
"source": {
"observer": {
"display": "Juggernaut Rail Platform"
}
},
"entity": [ {
"what": {
"reference": "Patient/121537908"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-entity-type",
"code": "1",
"display": "Person"
},
"role": {
"system": "http://terminology.hl7.org/CodeSystem/object-role",
"code": "1",
"display": "Patient"
},
"detail": [ {
"type": "receipt_id",
"valueString": "9cce92a2a63c6c4f"
}, {
"type": "cdt",
"valueString": "7b18d26bcbdf8b02bd779080a844aeb44cb432c8d13205f9903ded0959236b52"
} ]
} ]
},
"search": {
"mode": "match"
}
} ]
}
16
Then status 200
0
17
* def hasEntry = response.entry != null && response.entry.length > 0
1
18
* def auditEventAvailable = hasEntry
0
19
* def auditEventId = hasEntry ? response.entry[0].resource.id : null
1
20
* def auditResourceType = auditEventAvailable ? response.entry[0].resource.resourceType : 'AuditEvent'
1
21
* match auditResourceType == 'AuditEvent'
0
22
* if (auditEventAvailable) karate.log('Resolved auditEventId: ' + auditEventId)
1
21:54:57.821 Resolved auditEventId: 121538577
23
* if (!auditEventAvailable) karate.log('TC-AUD block: SKIP — no AuditEvent resources on server')
1
31
* if (!auditEventAvailable) karate.log('TC-AUD-002: SKIP — no AuditEvent resources on server')
1
32
* if (auditEventAvailable) karate.call('classpath:audit/assert-audit-type.feature', { auditEventId: auditEventId, baseUrl: baseUrl })
4990
>>
audit.assert-audit-type
4983
5
Given url baseUrl
0
6
And path 'AuditEvent', auditEventId
1
7
When method GET
4974
21:54:57.831 request:
1 > GET https://hapi.fhir.org/baseR4/AuditEvent/121538577
1 > Host: hapi.fhir.org
1 > Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18)
1 > Accept-Encoding: gzip,deflate
21:55:02.804 response time in milliseconds: 4971
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Tue, 21 Apr 2026 21:55:02 GMT
1 < Content-Type: application/fhir+json;charset=utf-8
1 < Transfer-Encoding: chunked
1 < Connection: keep-alive
1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4)
1 < ETag: W/"1"
1 < X-Request-ID: EKywTVaslodmQxth
1 < Content-Location: https://hapi.fhir.org/baseR4/AuditEvent/121538577/_history/1
1 < Last-Modified: Wed, 11 Feb 2026 18:07:19 GMT
{
"resourceType": "AuditEvent",
"id": "121538577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-11T18:07:19.357+00:00",
"source": "#E5nvD1zU87MuFOWe"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-event-type",
"code": "rest",
"display": "RESTful Operation"
},
"subtype": [ {
"system": "http://hl7.org/fhir/restful-interaction",
"code": "read",
"display": "read"
} ],
"action": "R",
"recorded": "2026-02-11T18:07:16Z",
"outcome": "0",
"agent": [ {
"type": {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
"code": "CST",
"display": "Custodian"
} ]
},
"who": {
"display": "Rail FHIR Agent"
},
"requestor": true
} ],
"source": {
"observer": {
"display": "Juggernaut Rail Platform"
}
},
"entity": [ {
"what": {
"reference": "Patient/121537908"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-entity-type",
"code": "1",
"display": "Person"
},
"role": {
"system": "http://terminology.hl7.org/CodeSystem/object-role",
"code": "1",
"display": "Patient"
},
"detail": [ {
"type": "receipt_id",
"valueString": "9cce92a2a63c6c4f"
}, {
"type": "cdt",
"valueString": "7b18d26bcbdf8b02bd779080a844aeb44cb432c8d13205f9903ded0959236b52"
} ]
} ]
}
8
Then status 200
0
9
And match response.type == '#present'
1
10
* def typeIsArray = response.type instanceof Array
4
11
* def typeSystem = typeIsArray ? response.type[0].system : response.type.system
0
12
* def typeCode = typeIsArray ? response.type[0].code : response.type.code
0
13
* match typeSystem == '#present'
0
14
* match typeCode == '#present'
0
15
* karate.log('type.system: ' + typeSystem)
1
21:55:02.812 type.system: http://terminology.hl7.org/CodeSystem/audit-event-type
16
* karate.log('type.code: ' + typeCode)
0
21:55:02.812 type.code: rest
Scenario: [3:34]
TC-AUD-003 | REQ-AUD-003 recorded timestamp is present
ms: 9965
>>
Background:
12
* url baseUrl
0
21:54:54.839 baseUrl: https://hapi.fhir.org/baseR4
21:54:54.839 fhirVersion: 4.0.1
13
Given path 'AuditEvent'
0
14
And param _count = '1'
0
15
When method GET
4973
21:54:54.842 request:
1 > GET https://hapi.fhir.org/baseR4/AuditEvent?_count=1
1 > Host: hapi.fhir.org
1 > Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18)
1 > Accept-Encoding: gzip,deflate
21:54:59.813 response time in milliseconds: 4971
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Tue, 21 Apr 2026 21:54:59 GMT
1 < Content-Type: application/fhir+json;charset=utf-8
1 < Transfer-Encoding: chunked
1 < Connection: keep-alive
1 < X-Cache: HIT from https://hapi.fhir.org/baseR4
1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4)
1 < X-Request-ID: iDgq5RV66MnxVMRW
1 < Last-Modified: Tue, 21 Apr 2026 21:54:56 GMT
{
"resourceType": "Bundle",
"id": "d8d7679f-f8eb-456c-862a-446f253b5990",
"meta": {
"lastUpdated": "2026-04-21T21:54:56.783+00:00"
},
"type": "searchset",
"link": [ {
"relation": "self",
"url": "https://hapi.fhir.org/baseR4/AuditEvent?_count=1"
}, {
"relation": "next",
"url": "https://hapi.fhir.org/baseR4?_getpages=d8d7679f-f8eb-456c-862a-446f253b5990&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset"
} ],
"entry": [ {
"fullUrl": "https://hapi.fhir.org/baseR4/AuditEvent/121538577",
"resource": {
"resourceType": "AuditEvent",
"id": "121538577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-11T18:07:19.357+00:00",
"source": "#E5nvD1zU87MuFOWe"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-event-type",
"code": "rest",
"display": "RESTful Operation"
},
"subtype": [ {
"system": "http://hl7.org/fhir/restful-interaction",
"code": "read",
"display": "read"
} ],
"action": "R",
"recorded": "2026-02-11T18:07:16Z",
"outcome": "0",
"agent": [ {
"type": {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
"code": "CST",
"display": "Custodian"
} ]
},
"who": {
"display": "Rail FHIR Agent"
},
"requestor": true
} ],
"source": {
"observer": {
"display": "Juggernaut Rail Platform"
}
},
"entity": [ {
"what": {
"reference": "Patient/121537908"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-entity-type",
"code": "1",
"display": "Person"
},
"role": {
"system": "http://terminology.hl7.org/CodeSystem/object-role",
"code": "1",
"display": "Patient"
},
"detail": [ {
"type": "receipt_id",
"valueString": "9cce92a2a63c6c4f"
}, {
"type": "cdt",
"valueString": "7b18d26bcbdf8b02bd779080a844aeb44cb432c8d13205f9903ded0959236b52"
} ]
} ]
},
"search": {
"mode": "match"
}
} ]
}
16
Then status 200
0
17
* def hasEntry = response.entry != null && response.entry.length > 0
1
18
* def auditEventAvailable = hasEntry
0
19
* def auditEventId = hasEntry ? response.entry[0].resource.id : null
1
20
* def auditResourceType = auditEventAvailable ? response.entry[0].resource.resourceType : 'AuditEvent'
1
21
* match auditResourceType == 'AuditEvent'
0
22
* if (auditEventAvailable) karate.log('Resolved auditEventId: ' + auditEventId)
1
21:54:59.818 Resolved auditEventId: 121538577
23
* if (!auditEventAvailable) karate.log('TC-AUD block: SKIP — no AuditEvent resources on server')
1
35
* if (!auditEventAvailable) karate.log('TC-AUD-003: SKIP — no AuditEvent resources on server')
0
36
* if (auditEventAvailable) karate.call('classpath:audit/assert-audit-recorded.feature', { auditEventId: auditEventId, baseUrl: baseUrl })
4987
>>
audit.assert-audit-recorded
4981
4
Given url baseUrl
0
5
And path 'AuditEvent', auditEventId
1
6
When method GET
4980
21:54:59.825 request:
1 > GET https://hapi.fhir.org/baseR4/AuditEvent/121538577
1 > Host: hapi.fhir.org
1 > Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18)
1 > Accept-Encoding: gzip,deflate
21:55:04.804 response time in milliseconds: 4978
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Tue, 21 Apr 2026 21:55:04 GMT
1 < Content-Type: application/fhir+json;charset=utf-8
1 < Transfer-Encoding: chunked
1 < Connection: keep-alive
1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4)
1 < ETag: W/"1"
1 < X-Request-ID: WHlasJsA51BEVtuV
1 < Content-Location: https://hapi.fhir.org/baseR4/AuditEvent/121538577/_history/1
1 < Last-Modified: Wed, 11 Feb 2026 18:07:19 GMT
{
"resourceType": "AuditEvent",
"id": "121538577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-11T18:07:19.357+00:00",
"source": "#E5nvD1zU87MuFOWe"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-event-type",
"code": "rest",
"display": "RESTful Operation"
},
"subtype": [ {
"system": "http://hl7.org/fhir/restful-interaction",
"code": "read",
"display": "read"
} ],
"action": "R",
"recorded": "2026-02-11T18:07:16Z",
"outcome": "0",
"agent": [ {
"type": {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
"code": "CST",
"display": "Custodian"
} ]
},
"who": {
"display": "Rail FHIR Agent"
},
"requestor": true
} ],
"source": {
"observer": {
"display": "Juggernaut Rail Platform"
}
},
"entity": [ {
"what": {
"reference": "Patient/121537908"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-entity-type",
"code": "1",
"display": "Person"
},
"role": {
"system": "http://terminology.hl7.org/CodeSystem/object-role",
"code": "1",
"display": "Patient"
},
"detail": [ {
"type": "receipt_id",
"valueString": "9cce92a2a63c6c4f"
}, {
"type": "cdt",
"valueString": "7b18d26bcbdf8b02bd779080a844aeb44cb432c8d13205f9903ded0959236b52"
} ]
} ]
}
7
Then status 200
0
8
And match response.recorded == '#present'
1
9
* karate.log('recorded: ' + response.recorded)
1
21:55:04.805 recorded: 2026-02-11T18:07:16Z
Scenario: [4:38]
TC-AUD-004 | REQ-AUD-004 agent array is present
ms: 9977
>>
Background:
12
* url baseUrl
0
21:54:58.828 baseUrl: https://hapi.fhir.org/baseR4
21:54:58.829 fhirVersion: 4.0.1
13
Given path 'AuditEvent'
1
14
And param _count = '1'
0
15
When method GET
4988
21:54:58.832 request:
1 > GET https://hapi.fhir.org/baseR4/AuditEvent?_count=1
1 > Host: hapi.fhir.org
1 > Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18)
1 > Accept-Encoding: gzip,deflate
21:55:03.817 response time in milliseconds: 4985
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Tue, 21 Apr 2026 21:55:03 GMT
1 < Content-Type: application/fhir+json;charset=utf-8
1 < Transfer-Encoding: chunked
1 < Connection: keep-alive
1 < X-Cache: HIT from https://hapi.fhir.org/baseR4
1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4)
1 < X-Request-ID: 2RJkAyxwNVKuwffN
1 < Last-Modified: Tue, 21 Apr 2026 21:54:56 GMT
{
"resourceType": "Bundle",
"id": "d8d7679f-f8eb-456c-862a-446f253b5990",
"meta": {
"lastUpdated": "2026-04-21T21:54:56.783+00:00"
},
"type": "searchset",
"link": [ {
"relation": "self",
"url": "https://hapi.fhir.org/baseR4/AuditEvent?_count=1"
}, {
"relation": "next",
"url": "https://hapi.fhir.org/baseR4?_getpages=d8d7679f-f8eb-456c-862a-446f253b5990&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset"
} ],
"entry": [ {
"fullUrl": "https://hapi.fhir.org/baseR4/AuditEvent/121538577",
"resource": {
"resourceType": "AuditEvent",
"id": "121538577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-11T18:07:19.357+00:00",
"source": "#E5nvD1zU87MuFOWe"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-event-type",
"code": "rest",
"display": "RESTful Operation"
},
"subtype": [ {
"system": "http://hl7.org/fhir/restful-interaction",
"code": "read",
"display": "read"
} ],
"action": "R",
"recorded": "2026-02-11T18:07:16Z",
"outcome": "0",
"agent": [ {
"type": {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
"code": "CST",
"display": "Custodian"
} ]
},
"who": {
"display": "Rail FHIR Agent"
},
"requestor": true
} ],
"source": {
"observer": {
"display": "Juggernaut Rail Platform"
}
},
"entity": [ {
"what": {
"reference": "Patient/121537908"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-entity-type",
"code": "1",
"display": "Person"
},
"role": {
"system": "http://terminology.hl7.org/CodeSystem/object-role",
"code": "1",
"display": "Patient"
},
"detail": [ {
"type": "receipt_id",
"valueString": "9cce92a2a63c6c4f"
}, {
"type": "cdt",
"valueString": "7b18d26bcbdf8b02bd779080a844aeb44cb432c8d13205f9903ded0959236b52"
} ]
} ]
},
"search": {
"mode": "match"
}
} ]
}
16
Then status 200
0
17
* def hasEntry = response.entry != null && response.entry.length > 0
1
18
* def auditEventAvailable = hasEntry
0
19
* def auditEventId = hasEntry ? response.entry[0].resource.id : null
0
20
* def auditResourceType = auditEventAvailable ? response.entry[0].resource.resourceType : 'AuditEvent'
0
21
* match auditResourceType == 'AuditEvent'
0
22
* if (auditEventAvailable) karate.log('Resolved auditEventId: ' + auditEventId)
1
21:55:03.821 Resolved auditEventId: 121538577
23
* if (!auditEventAvailable) karate.log('TC-AUD block: SKIP — no AuditEvent resources on server')
0
39
* if (!auditEventAvailable) karate.log('TC-AUD-004: SKIP — no AuditEvent resources on server')
0
40
* if (auditEventAvailable) karate.call('classpath:audit/assert-audit-agent.feature', { auditEventId: auditEventId, baseUrl: baseUrl })
4985
>>
audit.assert-audit-agent
4979
4
Given url baseUrl
0
5
And path 'AuditEvent', auditEventId
0
6
When method GET
4976
21:55:03.829 request:
1 > GET https://hapi.fhir.org/baseR4/AuditEvent/121538577
1 > Host: hapi.fhir.org
1 > Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18)
1 > Accept-Encoding: gzip,deflate
21:55:08.804 response time in milliseconds: 4974
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Tue, 21 Apr 2026 21:55:08 GMT
1 < Content-Type: application/fhir+json;charset=utf-8
1 < Transfer-Encoding: chunked
1 < Connection: keep-alive
1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4)
1 < ETag: W/"1"
1 < X-Request-ID: Tw1TBb0MwuXkC43r
1 < Content-Location: https://hapi.fhir.org/baseR4/AuditEvent/121538577/_history/1
1 < Last-Modified: Wed, 11 Feb 2026 18:07:19 GMT
{
"resourceType": "AuditEvent",
"id": "121538577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-11T18:07:19.357+00:00",
"source": "#E5nvD1zU87MuFOWe"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-event-type",
"code": "rest",
"display": "RESTful Operation"
},
"subtype": [ {
"system": "http://hl7.org/fhir/restful-interaction",
"code": "read",
"display": "read"
} ],
"action": "R",
"recorded": "2026-02-11T18:07:16Z",
"outcome": "0",
"agent": [ {
"type": {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
"code": "CST",
"display": "Custodian"
} ]
},
"who": {
"display": "Rail FHIR Agent"
},
"requestor": true
} ],
"source": {
"observer": {
"display": "Juggernaut Rail Platform"
}
},
"entity": [ {
"what": {
"reference": "Patient/121537908"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-entity-type",
"code": "1",
"display": "Person"
},
"role": {
"system": "http://terminology.hl7.org/CodeSystem/object-role",
"code": "1",
"display": "Patient"
},
"detail": [ {
"type": "receipt_id",
"valueString": "9cce92a2a63c6c4f"
}, {
"type": "cdt",
"valueString": "7b18d26bcbdf8b02bd779080a844aeb44cb432c8d13205f9903ded0959236b52"
} ]
} ]
}
7
Then status 200
0
8
And match response.agent == '#[_ > 0]'
1
9
* karate.log('agent count: ' + response.agent.length)
1
21:55:08.807 agent count: 1
Scenario: [5:42]
TC-AUD-005 | REQ-AUD-005 outcome field is present
ms: 9989
>>
Background:
12
* url baseUrl
0
21:55:00.817 baseUrl: https://hapi.fhir.org/baseR4
21:55:00.817 fhirVersion: 4.0.1
13
Given path 'AuditEvent'
0
14
And param _count = '1'
0
15
When method GET
4998
21:55:00.820 request:
1 > GET https://hapi.fhir.org/baseR4/AuditEvent?_count=1
1 > Host: hapi.fhir.org
1 > Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18)
1 > Accept-Encoding: gzip,deflate
21:55:05.816 response time in milliseconds: 4996
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Tue, 21 Apr 2026 21:55:05 GMT
1 < Content-Type: application/fhir+json;charset=utf-8
1 < Transfer-Encoding: chunked
1 < Connection: keep-alive
1 < X-Cache: HIT from https://hapi.fhir.org/baseR4
1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4)
1 < X-Request-ID: 1W1LY6jsWp82ulW5
1 < Last-Modified: Tue, 21 Apr 2026 21:54:56 GMT
{
"resourceType": "Bundle",
"id": "d8d7679f-f8eb-456c-862a-446f253b5990",
"meta": {
"lastUpdated": "2026-04-21T21:54:56.783+00:00"
},
"type": "searchset",
"link": [ {
"relation": "self",
"url": "https://hapi.fhir.org/baseR4/AuditEvent?_count=1"
}, {
"relation": "next",
"url": "https://hapi.fhir.org/baseR4?_getpages=d8d7679f-f8eb-456c-862a-446f253b5990&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset"
} ],
"entry": [ {
"fullUrl": "https://hapi.fhir.org/baseR4/AuditEvent/121538577",
"resource": {
"resourceType": "AuditEvent",
"id": "121538577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-11T18:07:19.357+00:00",
"source": "#E5nvD1zU87MuFOWe"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-event-type",
"code": "rest",
"display": "RESTful Operation"
},
"subtype": [ {
"system": "http://hl7.org/fhir/restful-interaction",
"code": "read",
"display": "read"
} ],
"action": "R",
"recorded": "2026-02-11T18:07:16Z",
"outcome": "0",
"agent": [ {
"type": {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
"code": "CST",
"display": "Custodian"
} ]
},
"who": {
"display": "Rail FHIR Agent"
},
"requestor": true
} ],
"source": {
"observer": {
"display": "Juggernaut Rail Platform"
}
},
"entity": [ {
"what": {
"reference": "Patient/121537908"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-entity-type",
"code": "1",
"display": "Person"
},
"role": {
"system": "http://terminology.hl7.org/CodeSystem/object-role",
"code": "1",
"display": "Patient"
},
"detail": [ {
"type": "receipt_id",
"valueString": "9cce92a2a63c6c4f"
}, {
"type": "cdt",
"valueString": "7b18d26bcbdf8b02bd779080a844aeb44cb432c8d13205f9903ded0959236b52"
} ]
} ]
},
"search": {
"mode": "match"
}
} ]
}
16
Then status 200
0
17
* def hasEntry = response.entry != null && response.entry.length > 0
1
18
* def auditEventAvailable = hasEntry
0
19
* def auditEventId = hasEntry ? response.entry[0].resource.id : null
0
20
* def auditResourceType = auditEventAvailable ? response.entry[0].resource.resourceType : 'AuditEvent'
0
21
* match auditResourceType == 'AuditEvent'
0
22
* if (auditEventAvailable) karate.log('Resolved auditEventId: ' + auditEventId)
1
21:55:05.819 Resolved auditEventId: 121538577
23
* if (!auditEventAvailable) karate.log('TC-AUD block: SKIP — no AuditEvent resources on server')
0
43
* if (!auditEventAvailable) karate.log('TC-AUD-005: SKIP — no AuditEvent resources on server')
0
44
* if (auditEventAvailable) karate.call('classpath:audit/assert-audit-outcome.feature', { auditEventId: auditEventId, baseUrl: baseUrl })
4987
>>
audit.assert-audit-outcome
4982
4
Given url baseUrl
0
5
And path 'AuditEvent', auditEventId
0
6
When method GET
4980
21:55:05.826 request:
1 > GET https://hapi.fhir.org/baseR4/AuditEvent/121538577
1 > Host: hapi.fhir.org
1 > Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18)
1 > Accept-Encoding: gzip,deflate
21:55:10.805 response time in milliseconds: 4978
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Tue, 21 Apr 2026 21:55:10 GMT
1 < Content-Type: application/fhir+json;charset=utf-8
1 < Transfer-Encoding: chunked
1 < Connection: keep-alive
1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4)
1 < ETag: W/"1"
1 < X-Request-ID: DCJkRWQtqhJrXRek
1 < Content-Location: https://hapi.fhir.org/baseR4/AuditEvent/121538577/_history/1
1 < Last-Modified: Wed, 11 Feb 2026 18:07:19 GMT
{
"resourceType": "AuditEvent",
"id": "121538577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-11T18:07:19.357+00:00",
"source": "#E5nvD1zU87MuFOWe"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-event-type",
"code": "rest",
"display": "RESTful Operation"
},
"subtype": [ {
"system": "http://hl7.org/fhir/restful-interaction",
"code": "read",
"display": "read"
} ],
"action": "R",
"recorded": "2026-02-11T18:07:16Z",
"outcome": "0",
"agent": [ {
"type": {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
"code": "CST",
"display": "Custodian"
} ]
},
"who": {
"display": "Rail FHIR Agent"
},
"requestor": true
} ],
"source": {
"observer": {
"display": "Juggernaut Rail Platform"
}
},
"entity": [ {
"what": {
"reference": "Patient/121537908"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-entity-type",
"code": "1",
"display": "Person"
},
"role": {
"system": "http://terminology.hl7.org/CodeSystem/object-role",
"code": "1",
"display": "Patient"
},
"detail": [ {
"type": "receipt_id",
"valueString": "9cce92a2a63c6c4f"
}, {
"type": "cdt",
"valueString": "7b18d26bcbdf8b02bd779080a844aeb44cb432c8d13205f9903ded0959236b52"
} ]
} ]
}
7
Then status 200
0
8
And match response.outcome == '#present'
1
9
* karate.log('outcome: ' + response.outcome)
1
21:55:10.807 outcome: 0
Scenario: [6:46]
TC-AUD-006 | REQ-GEN-001 captured audit-event-read.json exists for HL7 Validator
ms: 9989
>>
Background:
12
* url baseUrl
0
21:55:01.820 baseUrl: https://hapi.fhir.org/baseR4
21:55:01.820 fhirVersion: 4.0.1
13
Given path 'AuditEvent'
0
14
And param _count = '1'
0
15
When method GET
4996
21:55:01.822 request:
1 > GET https://hapi.fhir.org/baseR4/AuditEvent?_count=1
1 > Host: hapi.fhir.org
1 > Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18)
1 > Accept-Encoding: gzip,deflate
21:55:06.816 response time in milliseconds: 4994
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Tue, 21 Apr 2026 21:55:06 GMT
1 < Content-Type: application/fhir+json;charset=utf-8
1 < Transfer-Encoding: chunked
1 < Connection: keep-alive
1 < X-Cache: HIT from https://hapi.fhir.org/baseR4
1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4)
1 < X-Request-ID: NmHYEFUyBKTA8lNy
1 < Last-Modified: Tue, 21 Apr 2026 21:54:56 GMT
{
"resourceType": "Bundle",
"id": "d8d7679f-f8eb-456c-862a-446f253b5990",
"meta": {
"lastUpdated": "2026-04-21T21:54:56.783+00:00"
},
"type": "searchset",
"link": [ {
"relation": "self",
"url": "https://hapi.fhir.org/baseR4/AuditEvent?_count=1"
}, {
"relation": "next",
"url": "https://hapi.fhir.org/baseR4?_getpages=d8d7679f-f8eb-456c-862a-446f253b5990&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset"
} ],
"entry": [ {
"fullUrl": "https://hapi.fhir.org/baseR4/AuditEvent/121538577",
"resource": {
"resourceType": "AuditEvent",
"id": "121538577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-11T18:07:19.357+00:00",
"source": "#E5nvD1zU87MuFOWe"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-event-type",
"code": "rest",
"display": "RESTful Operation"
},
"subtype": [ {
"system": "http://hl7.org/fhir/restful-interaction",
"code": "read",
"display": "read"
} ],
"action": "R",
"recorded": "2026-02-11T18:07:16Z",
"outcome": "0",
"agent": [ {
"type": {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
"code": "CST",
"display": "Custodian"
} ]
},
"who": {
"display": "Rail FHIR Agent"
},
"requestor": true
} ],
"source": {
"observer": {
"display": "Juggernaut Rail Platform"
}
},
"entity": [ {
"what": {
"reference": "Patient/121537908"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-entity-type",
"code": "1",
"display": "Person"
},
"role": {
"system": "http://terminology.hl7.org/CodeSystem/object-role",
"code": "1",
"display": "Patient"
},
"detail": [ {
"type": "receipt_id",
"valueString": "9cce92a2a63c6c4f"
}, {
"type": "cdt",
"valueString": "7b18d26bcbdf8b02bd779080a844aeb44cb432c8d13205f9903ded0959236b52"
} ]
} ]
},
"search": {
"mode": "match"
}
} ]
}
16
Then status 200
0
17
* def hasEntry = response.entry != null && response.entry.length > 0
1
18
* def auditEventAvailable = hasEntry
0
19
* def auditEventId = hasEntry ? response.entry[0].resource.id : null
0
20
* def auditResourceType = auditEventAvailable ? response.entry[0].resource.resourceType : 'AuditEvent'
0
21
* match auditResourceType == 'AuditEvent'
0
22
* if (auditEventAvailable) karate.log('Resolved auditEventId: ' + auditEventId)
1
21:55:06.819 Resolved auditEventId: 121538577
23
* if (!auditEventAvailable) karate.log('TC-AUD block: SKIP — no AuditEvent resources on server')
0
47
* if (!auditEventAvailable) karate.log('TC-AUD-006: SKIP — no AuditEvent captured, server returned no resources')
0
48
* if (auditEventAvailable) karate.call('classpath:audit/assert-audit-capture.feature', { auditEventId: auditEventId, baseUrl: baseUrl })
4990
>>
audit.assert-audit-capture
4986
4
Given url baseUrl
0
5
And path 'AuditEvent', auditEventId
0
6
When method GET
4981
21:55:06.825 request:
1 > GET https://hapi.fhir.org/baseR4/AuditEvent/121538577
1 > Host: hapi.fhir.org
1 > Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18)
1 > Accept-Encoding: gzip,deflate
21:55:11.805 response time in milliseconds: 4979
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Tue, 21 Apr 2026 21:55:11 GMT
1 < Content-Type: application/fhir+json;charset=utf-8
1 < Transfer-Encoding: chunked
1 < Connection: keep-alive
1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4)
1 < ETag: W/"1"
1 < X-Request-ID: K1FTN1ZZ4TbPS2Dh
1 < Content-Location: https://hapi.fhir.org/baseR4/AuditEvent/121538577/_history/1
1 < Last-Modified: Wed, 11 Feb 2026 18:07:19 GMT
{
"resourceType": "AuditEvent",
"id": "121538577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-11T18:07:19.357+00:00",
"source": "#E5nvD1zU87MuFOWe"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-event-type",
"code": "rest",
"display": "RESTful Operation"
},
"subtype": [ {
"system": "http://hl7.org/fhir/restful-interaction",
"code": "read",
"display": "read"
} ],
"action": "R",
"recorded": "2026-02-11T18:07:16Z",
"outcome": "0",
"agent": [ {
"type": {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
"code": "CST",
"display": "Custodian"
} ]
},
"who": {
"display": "Rail FHIR Agent"
},
"requestor": true
} ],
"source": {
"observer": {
"display": "Juggernaut Rail Platform"
}
},
"entity": [ {
"what": {
"reference": "Patient/121537908"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-entity-type",
"code": "1",
"display": "Person"
},
"role": {
"system": "http://terminology.hl7.org/CodeSystem/object-role",
"code": "1",
"display": "Patient"
},
"detail": [ {
"type": "receipt_id",
"valueString": "9cce92a2a63c6c4f"
}, {
"type": "cdt",
"valueString": "7b18d26bcbdf8b02bd779080a844aeb44cb432c8d13205f9903ded0959236b52"
} ]
} ]
}
7
Then status 200
0
8
* karate.write(response, 'responses/audit/audit-event-read.json')
3
21:55:11.807 write to file: target/responses/audit/audit-event-read.json
9
* def fileExists = java.nio.file.Files.exists(java.nio.file.Paths.get('target/responses/audit/audit-event-read.json'))
1
10
* assert fileExists == true
0
Scenario: [7:50]
TC-AUD-007 | REQ-GEN-002b meta.versionId is present
ms: 9987
>>
Background:
12
* url baseUrl
0
21:55:02.818 baseUrl: https://hapi.fhir.org/baseR4
21:55:02.818 fhirVersion: 4.0.1
13
Given path 'AuditEvent'
0
14
And param _count = '1'
0
15
When method GET
4999
21:55:02.820 request:
1 > GET https://hapi.fhir.org/baseR4/AuditEvent?_count=1
1 > Host: hapi.fhir.org
1 > Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18)
1 > Accept-Encoding: gzip,deflate
21:55:07.817 response time in milliseconds: 4997
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Tue, 21 Apr 2026 21:55:07 GMT
1 < Content-Type: application/fhir+json;charset=utf-8
1 < Transfer-Encoding: chunked
1 < Connection: keep-alive
1 < X-Cache: HIT from https://hapi.fhir.org/baseR4
1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4)
1 < X-Request-ID: r93JzE5u1RdOWPad
1 < Last-Modified: Tue, 21 Apr 2026 21:54:56 GMT
{
"resourceType": "Bundle",
"id": "d8d7679f-f8eb-456c-862a-446f253b5990",
"meta": {
"lastUpdated": "2026-04-21T21:54:56.783+00:00"
},
"type": "searchset",
"link": [ {
"relation": "self",
"url": "https://hapi.fhir.org/baseR4/AuditEvent?_count=1"
}, {
"relation": "next",
"url": "https://hapi.fhir.org/baseR4?_getpages=d8d7679f-f8eb-456c-862a-446f253b5990&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset"
} ],
"entry": [ {
"fullUrl": "https://hapi.fhir.org/baseR4/AuditEvent/121538577",
"resource": {
"resourceType": "AuditEvent",
"id": "121538577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-11T18:07:19.357+00:00",
"source": "#E5nvD1zU87MuFOWe"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-event-type",
"code": "rest",
"display": "RESTful Operation"
},
"subtype": [ {
"system": "http://hl7.org/fhir/restful-interaction",
"code": "read",
"display": "read"
} ],
"action": "R",
"recorded": "2026-02-11T18:07:16Z",
"outcome": "0",
"agent": [ {
"type": {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
"code": "CST",
"display": "Custodian"
} ]
},
"who": {
"display": "Rail FHIR Agent"
},
"requestor": true
} ],
"source": {
"observer": {
"display": "Juggernaut Rail Platform"
}
},
"entity": [ {
"what": {
"reference": "Patient/121537908"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-entity-type",
"code": "1",
"display": "Person"
},
"role": {
"system": "http://terminology.hl7.org/CodeSystem/object-role",
"code": "1",
"display": "Patient"
},
"detail": [ {
"type": "receipt_id",
"valueString": "9cce92a2a63c6c4f"
}, {
"type": "cdt",
"valueString": "7b18d26bcbdf8b02bd779080a844aeb44cb432c8d13205f9903ded0959236b52"
} ]
} ]
},
"search": {
"mode": "match"
}
} ]
}
16
Then status 200
0
17
* def hasEntry = response.entry != null && response.entry.length > 0
1
18
* def auditEventAvailable = hasEntry
0
19
* def auditEventId = hasEntry ? response.entry[0].resource.id : null
0
20
* def auditResourceType = auditEventAvailable ? response.entry[0].resource.resourceType : 'AuditEvent'
0
21
* match auditResourceType == 'AuditEvent'
0
22
* if (auditEventAvailable) karate.log('Resolved auditEventId: ' + auditEventId)
1
21:55:07.821 Resolved auditEventId: 121538577
23
* if (!auditEventAvailable) karate.log('TC-AUD block: SKIP — no AuditEvent resources on server')
0
51
* if (!auditEventAvailable) karate.log('TC-AUD-007: SKIP — no AuditEvent resources on server')
0
52
* if (auditEventAvailable) karate.call('classpath:audit/assert-audit-version.feature', { auditEventId: auditEventId, baseUrl: baseUrl })
4983
>>
audit.assert-audit-version
4979
4
Given url baseUrl
0
5
And path 'AuditEvent', auditEventId
0
6
When method GET
4977
21:55:07.827 request:
1 > GET https://hapi.fhir.org/baseR4/AuditEvent/121538577
1 > Host: hapi.fhir.org
1 > Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18)
1 > Accept-Encoding: gzip,deflate
21:55:12.804 response time in milliseconds: 4976
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Tue, 21 Apr 2026 21:55:12 GMT
1 < Content-Type: application/fhir+json;charset=utf-8
1 < Transfer-Encoding: chunked
1 < Connection: keep-alive
1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4)
1 < ETag: W/"1"
1 < X-Request-ID: FtT5F2w81sxSji3O
1 < Content-Location: https://hapi.fhir.org/baseR4/AuditEvent/121538577/_history/1
1 < Last-Modified: Wed, 11 Feb 2026 18:07:19 GMT
{
"resourceType": "AuditEvent",
"id": "121538577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-11T18:07:19.357+00:00",
"source": "#E5nvD1zU87MuFOWe"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-event-type",
"code": "rest",
"display": "RESTful Operation"
},
"subtype": [ {
"system": "http://hl7.org/fhir/restful-interaction",
"code": "read",
"display": "read"
} ],
"action": "R",
"recorded": "2026-02-11T18:07:16Z",
"outcome": "0",
"agent": [ {
"type": {
"coding": [ {
"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
"code": "CST",
"display": "Custodian"
} ]
},
"who": {
"display": "Rail FHIR Agent"
},
"requestor": true
} ],
"source": {
"observer": {
"display": "Juggernaut Rail Platform"
}
},
"entity": [ {
"what": {
"reference": "Patient/121537908"
},
"type": {
"system": "http://terminology.hl7.org/CodeSystem/audit-entity-type",
"code": "1",
"display": "Person"
},
"role": {
"system": "http://terminology.hl7.org/CodeSystem/object-role",
"code": "1",
"display": "Patient"
},
"detail": [ {
"type": "receipt_id",
"valueString": "9cce92a2a63c6c4f"
}, {
"type": "cdt",
"valueString": "7b18d26bcbdf8b02bd779080a844aeb44cb432c8d13205f9903ded0959236b52"
} ]
} ]
}
7
Then status 200
0
8
And match response.meta.versionId == '#present'
1
9
* karate.log('meta.versionId: ' + response.meta.versionId)
1
21:55:12.805 meta.versionId: 1