Scenario: [1:25]
TC-AUD-001 | REQ-AUD-001 GET /AuditEvent/{id} returns 200 and resourceType = AuditEvent
ms: 9995
>>
Background:
12
* url baseUrl
0
03:39:33.362 baseUrl: https://hapi.fhir.org/baseR4
03:39:33.363 fhirVersion: 4.0.1
13
Given path 'AuditEvent'
0
14
And param _count = '1'
0
15
When method GET
5008
03:39:33.365 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
03:39:38.371 response time in milliseconds: 5005
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:39:38 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: BGQ0kBTpmjWUOq4p
1 < Last-Modified: Thu, 16 Apr 2026 03:39:38 GMT
{
"resourceType": "Bundle",
"id": "81f68249-e29c-4222-940f-4c088f3a7179",
"meta": {
"lastUpdated": "2026-04-16T03:39:38.318+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=81f68249-e29c-4222-940f-4c088f3a7179&_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'
0
22
* if (auditEventAvailable) karate.log('Resolved auditEventId: ' + auditEventId)
1
03:39:38.376 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 })
4980
>>
audit.assert-audit-read
4970
4
Given url baseUrl
0
5
And path 'AuditEvent', auditEventId
1
6
When method GET
4965
03:39:38.389 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
03:39:43.352 response time in milliseconds: 4962
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:39:43 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: eM1pMdOn8gdxv0ct
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
03:39:43.358 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: 9988
>>
Background:
12
* url baseUrl
0
03:39:34.365 baseUrl: https://hapi.fhir.org/baseR4
03:39:34.365 fhirVersion: 4.0.1
13
Given path 'AuditEvent'
0
14
And param _count = '1'
0
15
When method GET
4997
03:39:34.371 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
03:39:39.363 response time in milliseconds: 4991
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:39:39 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: nBduKd3PHPaIyj5Z
1 < Last-Modified: Thu, 16 Apr 2026 03:39:38 GMT
{
"resourceType": "Bundle",
"id": "81f68249-e29c-4222-940f-4c088f3a7179",
"meta": {
"lastUpdated": "2026-04-16T03:39:38.318+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=81f68249-e29c-4222-940f-4c088f3a7179&_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
03:39:39.368 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')
0
32
* if (auditEventAvailable) karate.call('classpath:audit/assert-audit-type.feature', { auditEventId: auditEventId, baseUrl: baseUrl })
4986
>>
audit.assert-audit-type
4978
5
Given url baseUrl
0
6
And path 'AuditEvent', auditEventId
1
7
When method GET
4972
03:39:39.378 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
03:39:44.349 response time in milliseconds: 4970
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:39:44 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: ouNYaKFHYJmviyia
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
3
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
03:39:44.355 type.system: http://terminology.hl7.org/CodeSystem/audit-event-type
16
* karate.log('type.code: ' + typeCode)
0
03:39:44.355 type.code: rest
Scenario: [3:34]
TC-AUD-003 | REQ-AUD-003 recorded timestamp is present
ms: 9956
>>
Background:
12
* url baseUrl
0
03:39:36.395 baseUrl: https://hapi.fhir.org/baseR4
03:39:36.395 fhirVersion: 4.0.1
13
Given path 'AuditEvent'
0
14
And param _count = '1'
0
15
When method GET
4978
03:39:36.398 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
03:39:41.374 response time in milliseconds: 4975
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:39:41 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: BQB6AhQrkL1Zr59D
1 < Last-Modified: Thu, 16 Apr 2026 03:39:38 GMT
{
"resourceType": "Bundle",
"id": "81f68249-e29c-4222-940f-4c088f3a7179",
"meta": {
"lastUpdated": "2026-04-16T03:39:38.318+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=81f68249-e29c-4222-940f-4c088f3a7179&_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
03:39:41.379 Resolved auditEventId: 121538577
23
* if (!auditEventAvailable) karate.log('TC-AUD block: SKIP — no AuditEvent resources on server')
0
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 })
4972
>>
audit.assert-audit-recorded
4965
4
Given url baseUrl
0
5
And path 'AuditEvent', auditEventId
1
6
When method GET
4963
03:39:41.388 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
03:39:46.350 response time in milliseconds: 4961
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:39:46 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: gdBWB6sZQapcqy63
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
03:39:46.352 recorded: 2026-02-11T18:07:16Z
Scenario: [4:38]
TC-AUD-004 | REQ-AUD-004 agent array is present
ms: 9982
>>
Background:
12
* url baseUrl
0
03:39:40.369 baseUrl: https://hapi.fhir.org/baseR4
03:39:40.369 fhirVersion: 4.0.1
13
Given path 'AuditEvent'
0
14
And param _count = '1'
0
15
When method GET
4997
03:39:40.371 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
03:39:45.366 response time in milliseconds: 4994
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:39:45 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: 52RMQML55PwQMYUL
1 < Last-Modified: Thu, 16 Apr 2026 03:39:38 GMT
{
"resourceType": "Bundle",
"id": "81f68249-e29c-4222-940f-4c088f3a7179",
"meta": {
"lastUpdated": "2026-04-16T03:39:38.318+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=81f68249-e29c-4222-940f-4c088f3a7179&_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'
0
21
* match auditResourceType == 'AuditEvent'
0
22
* if (auditEventAvailable) karate.log('Resolved auditEventId: ' + auditEventId)
1
03:39:45.370 Resolved auditEventId: 121538577
23
* if (!auditEventAvailable) karate.log('TC-AUD block: SKIP — no AuditEvent resources on server')
1
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 })
4981
>>
audit.assert-audit-agent
4970
4
Given url baseUrl
0
5
And path 'AuditEvent', auditEventId
1
6
When method GET
4967
03:39:45.384 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
03:39:50.349 response time in milliseconds: 4965
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:39:50 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: NUQQnnxxZjaartlS
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
03:39:50.352 agent count: 1
Scenario: [5:42]
TC-AUD-005 | REQ-AUD-005 outcome field is present
ms: 9990
>>
Background:
12
* url baseUrl
0
03:39:42.359 baseUrl: https://hapi.fhir.org/baseR4
03:39:42.359 fhirVersion: 4.0.1
13
Given path 'AuditEvent'
0
14
And param _count = '1'
0
15
When method GET
5002
03:39:42.362 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
03:39:47.362 response time in milliseconds: 5000
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:39:47 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: 4n9PbTQo2FGXCcv2
1 < Last-Modified: Thu, 16 Apr 2026 03:39:38 GMT
{
"resourceType": "Bundle",
"id": "81f68249-e29c-4222-940f-4c088f3a7179",
"meta": {
"lastUpdated": "2026-04-16T03:39:38.318+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=81f68249-e29c-4222-940f-4c088f3a7179&_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
03:39:47.365 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 })
4984
>>
audit.assert-audit-outcome
4980
4
Given url baseUrl
0
5
And path 'AuditEvent', auditEventId
0
6
When method GET
4978
03:39:47.372 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
03:39:52.349 response time in milliseconds: 4976
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:39:52 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: 8ap5CcsHTUemZMOl
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
03:39:52.350 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
03:39:43.364 baseUrl: https://hapi.fhir.org/baseR4
03:39:43.365 fhirVersion: 4.0.1
13
Given path 'AuditEvent'
0
14
And param _count = '1'
0
15
When method GET
4997
03:39:43.366 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
03:39:48.362 response time in milliseconds: 4995
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:39:48 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: 0UWb7PbvavCmGytH
1 < Last-Modified: Thu, 16 Apr 2026 03:39:38 GMT
{
"resourceType": "Bundle",
"id": "81f68249-e29c-4222-940f-4c088f3a7179",
"meta": {
"lastUpdated": "2026-04-16T03:39:38.318+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=81f68249-e29c-4222-940f-4c088f3a7179&_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'
0
21
* match auditResourceType == 'AuditEvent'
0
22
* if (auditEventAvailable) karate.log('Resolved auditEventId: ' + auditEventId)
1
03:39:48.366 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 })
4988
>>
audit.assert-audit-capture
4982
4
Given url baseUrl
0
5
And path 'AuditEvent', auditEventId
0
6
When method GET
4978
03:39:48.373 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
03:39:53.349 response time in milliseconds: 4976
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:39:53 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: FiP7xUankLDM0tfd
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')
2
03:39:53.352 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'))
2
10
* assert fileExists == true
0
Scenario: [7:50]
TC-AUD-007 | REQ-GEN-002b meta.versionId is present
ms: 9990
>>
Background:
12
* url baseUrl
0
03:39:44.359 baseUrl: https://hapi.fhir.org/baseR4
03:39:44.359 fhirVersion: 4.0.1
13
Given path 'AuditEvent'
0
14
And param _count = '1'
0
15
When method GET
5005
03:39:44.361 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
03:39:49.364 response time in milliseconds: 5002
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:39:49 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: KEVo4bWCBJ4tso1A
1 < Last-Modified: Thu, 16 Apr 2026 03:39:38 GMT
{
"resourceType": "Bundle",
"id": "81f68249-e29c-4222-940f-4c088f3a7179",
"meta": {
"lastUpdated": "2026-04-16T03:39:38.318+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=81f68249-e29c-4222-940f-4c088f3a7179&_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
03:39:49.368 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 })
4982
>>
audit.assert-audit-version
4977
4
Given url baseUrl
0
5
And path 'AuditEvent', auditEventId
0
6
When method GET
4975
03:39:49.375 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
03:39:54.348 response time in milliseconds: 4973
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:39:54 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: Ne83scARfkVX3Y3C
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
03:39:54.350 meta.versionId: 1