Summary| Tags| Feature: patient/patient.feature| Patient Resource Validation
Scenario: [1:34] TC-PAT-001 | REQ-PAT-001 GET /Patient/{id} returns 200 and resourceType = Patient
ms: 9999
>>
Background:
21
* url baseUrl
0
21:56:08.227 baseUrl: https://hapi.fhir.org/baseR4 21:56:08.227 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5015
21:56:08.229 request: 1 > GET https://hapi.fhir.org/baseR4/Patient?_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:56:13.243 response time in milliseconds: 5014 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:56:13 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: 8gLas6EqZNK0nB5M 1 < Last-Modified: Tue, 21 Apr 2026 21:56:13 GMT { "resourceType": "Bundle", "id": "a4296544-fad7-45e4-b2ad-f72f2f9f009a", "meta": { "lastUpdated": "2026-04-21T21:56:13.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=1" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=a4296544-fad7-45e4-b2ad-f72f2f9f009a&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90270587", "resource": { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } } ] }
25
Then status 200
0
26
* def patientId = response.entry[0].resource.id
0
27
* karate.log('Resolved patientId:', patientId)
0
21:56:13.244 Resolved patientId: 90270587
28
Given path 'Patient', patientId
0
29
When method GET
4980
21:56:13.245 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90270587 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:56:18.224 response time in milliseconds: 4979 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:56:18 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"1" 2 < X-Request-ID: c0Wx0PpGPOCV4uIT 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90270587/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:41 GMT { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }
30
Then status 200
0
31
* def patientResponse = response
0
32
* match patientResponse.resourceType == 'Patient'
0
35
Then match patientResponse.resourceType == 'Patient'
0
36
* karate.write(patientResponse, 'responses/patient/patient-read.json')
1
21:56:18.226 write to file: target/responses/patient/patient-read.json
Scenario: [2:38] TC-PAT-002 | REQ-PAT-002 name.family is present and non-empty
ms: 9988
>>
Background:
21
* url baseUrl
0
21:56:09.235 baseUrl: https://hapi.fhir.org/baseR4 21:56:09.235 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5000
21:56:09.236 request: 1 > GET https://hapi.fhir.org/baseR4/Patient?_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:56:14.236 response time in milliseconds: 4999 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:56:14 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: XHIK0DjnbrRT4mJ3 1 < Last-Modified: Tue, 21 Apr 2026 21:56:13 GMT { "resourceType": "Bundle", "id": "a4296544-fad7-45e4-b2ad-f72f2f9f009a", "meta": { "lastUpdated": "2026-04-21T21:56:13.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=1" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=a4296544-fad7-45e4-b2ad-f72f2f9f009a&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90270587", "resource": { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } } ] }
25
Then status 200
0
26
* def patientId = response.entry[0].resource.id
0
27
* karate.log('Resolved patientId:', patientId)
0
21:56:14.236 Resolved patientId: 90270587
28
Given path 'Patient', patientId
0
29
When method GET
4986
21:56:14.237 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90270587 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:56:19.222 response time in milliseconds: 4985 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:56:19 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"1" 2 < X-Request-ID: 3o8vzxX8U9o6dMqi 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90270587/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:41 GMT { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }
30
Then status 200
0
31
* def patientResponse = response
0
32
* match patientResponse.resourceType == 'Patient'
0
39
Then match patientResponse.name == '#[_ > 0]'
1
40
And match patientResponse.name[0].family == '#string'
0
Scenario: [3:42] TC-PAT-003 | REQ-PAT-003 identifier system and value are present
ms: 9996
>>
Background:
21
* url baseUrl
0
21:56:10.228 baseUrl: https://hapi.fhir.org/baseR4 21:56:10.228 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5009
21:56:10.229 request: 1 > GET https://hapi.fhir.org/baseR4/Patient?_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:56:15.237 response time in milliseconds: 5008 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:56:15 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: w2FtfgnwImB8CjMA 1 < Last-Modified: Tue, 21 Apr 2026 21:56:13 GMT { "resourceType": "Bundle", "id": "a4296544-fad7-45e4-b2ad-f72f2f9f009a", "meta": { "lastUpdated": "2026-04-21T21:56:13.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=1" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=a4296544-fad7-45e4-b2ad-f72f2f9f009a&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90270587", "resource": { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } } ] }
25
Then status 200
0
26
* def patientId = response.entry[0].resource.id
0
27
* karate.log('Resolved patientId:', patientId)
0
21:56:15.238 Resolved patientId: 90270587
28
Given path 'Patient', patientId
0
29
When method GET
4984
21:56:15.239 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90270587 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:56:20.222 response time in milliseconds: 4983 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:56:20 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"1" 2 < X-Request-ID: IHNnmicigGmVMZXa 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90270587/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:41 GMT { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }
30
Then status 200
0
31
* def patientResponse = response
0
32
* match patientResponse.resourceType == 'Patient'
0
43
* def hasIdentifier = patientResponse.identifier != null && patientResponse.identifier.length > 0
0
44
* if (!hasIdentifier) karate.log('TC-PAT-003: SKIP — identifier not present on resolved patient ' + patientId)
1
21:56:20.224 TC-PAT-003: SKIP — identifier not present on resolved patient 90270587
45
* if (hasIdentifier) karate.match(patientResponse.identifier[0].system, '#present')
0
46
* if (hasIdentifier) karate.match(patientResponse.identifier[0].value, '#present')
0
Scenario: [4:48] TC-PAT-004 | REQ-PAT-004 birthDate format is YYYY-MM-DD
ms: 9991
>>
Background:
21
* url baseUrl
0
21:56:11.232 baseUrl: https://hapi.fhir.org/baseR4 21:56:11.232 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5005
21:56:11.233 request: 1 > GET https://hapi.fhir.org/baseR4/Patient?_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:56:16.237 response time in milliseconds: 5003 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:56:16 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: ZgiipHsQ554sHd0H 1 < Last-Modified: Tue, 21 Apr 2026 21:56:13 GMT { "resourceType": "Bundle", "id": "a4296544-fad7-45e4-b2ad-f72f2f9f009a", "meta": { "lastUpdated": "2026-04-21T21:56:13.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=1" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=a4296544-fad7-45e4-b2ad-f72f2f9f009a&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90270587", "resource": { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } } ] }
25
Then status 200
0
26
* def patientId = response.entry[0].resource.id
0
27
* karate.log('Resolved patientId:', patientId)
0
21:56:16.237 Resolved patientId: 90270587
28
Given path 'Patient', patientId
0
29
When method GET
4985
21:56:16.238 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90270587 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:56:21.222 response time in milliseconds: 4984 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:56:21 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"1" 2 < X-Request-ID: n5BqYvDCPPyGcS69 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90270587/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:41 GMT { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }
30
Then status 200
0
31
* def patientResponse = response
0
32
* match patientResponse.resourceType == 'Patient'
0
49
* karate.log('birthDate:', patientResponse.birthDate)
0
21:56:21.223 birthDate: 1980-01-02
50
Then match patientResponse.birthDate == '#regex [0-9]{4}-[0-9]{2}-[0-9]{2}'
0
Scenario: [5:52] TC-PAT-005 | REQ-PAT-005 gender is one of male female other unknown
ms: 9997
>>
Background:
21
* url baseUrl
0
21:56:17.226 baseUrl: https://hapi.fhir.org/baseR4 21:56:17.226 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5009
21:56:17.227 request: 1 > GET https://hapi.fhir.org/baseR4/Patient?_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:56:22.235 response time in milliseconds: 5007 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:56:22 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: btVwUgdkOCeiApdP 1 < Last-Modified: Tue, 21 Apr 2026 21:56:13 GMT { "resourceType": "Bundle", "id": "a4296544-fad7-45e4-b2ad-f72f2f9f009a", "meta": { "lastUpdated": "2026-04-21T21:56:13.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=1" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=a4296544-fad7-45e4-b2ad-f72f2f9f009a&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90270587", "resource": { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } } ] }
25
Then status 200
0
26
* def patientId = response.entry[0].resource.id
0
27
* karate.log('Resolved patientId:', patientId)
0
21:56:22.235 Resolved patientId: 90270587
28
Given path 'Patient', patientId
0
29
When method GET
4987
21:56:22.236 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90270587 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:56:27.223 response time in milliseconds: 4986 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:56:27 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"1" 2 < X-Request-ID: iuOlhdfiuytdkwt5 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90270587/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:41 GMT { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }
30
Then status 200
0
31
* def patientResponse = response
0
32
* match patientResponse.resourceType == 'Patient'
0
53
* karate.log('gender:', patientResponse.gender)
0
21:56:27.224 gender: female
54
Then match patientResponse.gender == '#regex (male|female|other|unknown)'
0
Scenario: [6:56] TC-PAT-006 | REQ-PAT-006 | REQ-GEN-002a meta.lastUpdated is present and non-null
ms: 9994
>>
Background:
21
* url baseUrl
0
21:56:18.228 baseUrl: https://hapi.fhir.org/baseR4 21:56:18.228 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5008
21:56:18.229 request: 1 > GET https://hapi.fhir.org/baseR4/Patient?_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:56:23.236 response time in milliseconds: 5007 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:56:23 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: lBqDfFRZ16N0AHVC 1 < Last-Modified: Tue, 21 Apr 2026 21:56:13 GMT { "resourceType": "Bundle", "id": "a4296544-fad7-45e4-b2ad-f72f2f9f009a", "meta": { "lastUpdated": "2026-04-21T21:56:13.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=1" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=a4296544-fad7-45e4-b2ad-f72f2f9f009a&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90270587", "resource": { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } } ] }
25
Then status 200
0
26
* def patientId = response.entry[0].resource.id
0
27
* karate.log('Resolved patientId:', patientId)
0
21:56:23.237 Resolved patientId: 90270587
28
Given path 'Patient', patientId
0
29
When method GET
4986
21:56:23.237 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90270587 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:56:28.223 response time in milliseconds: 4985 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:56:28 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"1" 2 < X-Request-ID: dvrdiyUDiQ6UStX8 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90270587/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:41 GMT { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }
30
Then status 200
0
31
* def patientResponse = response
0
32
* match patientResponse.resourceType == 'Patient'
0
57
Then match patientResponse.meta.lastUpdated == '#present'
0
Scenario: [7:59] TC-PAT-007 | REQ-PAT-007 | REQ-OO-001 non-existent ID returns 404 and OperationOutcome
ms: 15003
>>
Background:
21
* url baseUrl
0
21:56:19.226 baseUrl: https://hapi.fhir.org/baseR4 21:56:19.226 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5010
21:56:19.227 request: 1 > GET https://hapi.fhir.org/baseR4/Patient?_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:56:24.236 response time in milliseconds: 5008 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:56:24 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: KXLvNbUQ0ptFPRmI 1 < Last-Modified: Tue, 21 Apr 2026 21:56:13 GMT { "resourceType": "Bundle", "id": "a4296544-fad7-45e4-b2ad-f72f2f9f009a", "meta": { "lastUpdated": "2026-04-21T21:56:13.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=1" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=a4296544-fad7-45e4-b2ad-f72f2f9f009a&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90270587", "resource": { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } } ] }
25
Then status 200
0
26
* def patientId = response.entry[0].resource.id
0
27
* karate.log('Resolved patientId:', patientId)
0
21:56:24.236 Resolved patientId: 90270587
28
Given path 'Patient', patientId
0
29
When method GET
4986
21:56:24.237 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90270587 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:56:29.222 response time in milliseconds: 4984 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:56:29 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"1" 2 < X-Request-ID: ZIt5PmVPh5v35bUf 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90270587/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:41 GMT { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }
30
Then status 200
0
31
* def patientResponse = response
0
32
* match patientResponse.resourceType == 'Patient'
0
60
Given path 'Patient', 'INVALID-ID-99999'
0
61
When method GET
5005
21:56:29.223 request: 3 > GET https://hapi.fhir.org/baseR4/Patient/INVALID-ID-99999 3 > Host: hapi.fhir.org 3 > Connection: Keep-Alive 3 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 3 > Accept-Encoding: gzip,deflate 21:56:34.228 response time in milliseconds: 5005 3 < 404 3 < Server: nginx/1.24.0 (Ubuntu) 3 < Date: Tue, 21 Apr 2026 21:56:34 GMT 3 < Content-Type: application/fhir+json;charset=utf-8 3 < Transfer-Encoding: chunked 3 < Connection: keep-alive 3 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 3 < X-Request-ID: 5XUmlIte7tn6c8Vs { "resourceType": "OperationOutcome", "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">ERROR</td><td>[]</td><td>HAPI-2001: Resource Patient/INVALID-ID-99999 is not known</td></tr></table></div>" }, "issue": [ { "severity": "error", "code": "processing", "diagnostics": "HAPI-2001: Resource Patient/INVALID-ID-99999 is not known" } ] }
62
Then status 404
0
63
And match response.resourceType == 'OperationOutcome'
0
64
And match response.issue == '#[_ > 0]'
0
65
* karate.log('404 severity:', response.issue[0].severity)
1
21:56:34.229 404 severity: error
66
* karate.log('404 code:', response.issue[0].code)
0
21:56:34.229 404 code: processing
Scenario: [8:68] TC-PAT-008 | REQ-PAT-008 search by family name returns Bundle searchset
ms: 15031
>>
Background:
21
* url baseUrl
0
21:56:20.226 baseUrl: https://hapi.fhir.org/baseR4 21:56:20.226 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5010
21:56:20.227 request: 1 > GET https://hapi.fhir.org/baseR4/Patient?_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:56:25.235 response time in milliseconds: 5008 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:56:25 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: iQFvpvrR1xfjQwdO 1 < Last-Modified: Tue, 21 Apr 2026 21:56:13 GMT { "resourceType": "Bundle", "id": "a4296544-fad7-45e4-b2ad-f72f2f9f009a", "meta": { "lastUpdated": "2026-04-21T21:56:13.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=1" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=a4296544-fad7-45e4-b2ad-f72f2f9f009a&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90270587", "resource": { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } } ] }
25
Then status 200
0
26
* def patientId = response.entry[0].resource.id
0
27
* karate.log('Resolved patientId:', patientId)
0
21:56:25.236 Resolved patientId: 90270587
28
Given path 'Patient', patientId
0
29
When method GET
4987
21:56:25.237 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90270587 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:56:30.222 response time in milliseconds: 4985 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:56:30 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"1" 2 < X-Request-ID: CdA8DvnB1sTh9n6i 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90270587/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:41 GMT { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }
30
Then status 200
0
31
* def patientResponse = response
0
32
* match patientResponse.resourceType == 'Patient'
0
69
Given path 'Patient'
0
70
And param family = 'Smith'
0
71
And param _count = '5'
0
72
When method GET
5034
21:56:30.224 request: 3 > GET https://hapi.fhir.org/baseR4/Patient?family=Smith&_count=5 3 > Host: hapi.fhir.org 3 > Connection: Keep-Alive 3 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 3 > Accept-Encoding: gzip,deflate 21:56:35.256 response time in milliseconds: 5032 3 < 200 3 < Server: nginx/1.24.0 (Ubuntu) 3 < Date: Tue, 21 Apr 2026 21:56:35 GMT 3 < Content-Type: application/fhir+json;charset=utf-8 3 < Transfer-Encoding: chunked 3 < Connection: keep-alive 3 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 3 < X-Request-ID: yBQSPQcGLvaVb3oS 3 < Last-Modified: Tue, 21 Apr 2026 21:56:35 GMT { "resourceType": "Bundle", "id": "b0b5e64e-8f9f-4b62-bd3d-7ff70ac18b46", "meta": { "lastUpdated": "2026-04-21T21:56:35.202+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=5&family=Smith" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=b0b5e64e-8f9f-4b62-bd3d-7ff70ac18b46&_getpagesoffset=5&_count=5&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/ailovdisyb2", "resource": { "resourceType": "Patient", "id": "ailovdisyb2", "meta": { "versionId": "3", "lastUpdated": "2026-03-29T07:29:11.918+00:00", "source": "#OFNJcnTuyQKtw8Dh" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Darcy <b>SMITH </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>01 January 1970</span></td></tr></tbody></table></div>" }, "name": [ { "use": "official", "family": "Smith", "given": [ "Darcy" ] } ], "gender": "female", "birthDate": "1970-01-01" }, "search": { "mode": "match" } }, { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/frt2", "resource": { "resourceType": "Patient", "id": "frt2", "meta": { "versionId": "16", "lastUpdated": "2026-04-20T08:24:20.073+00:00", "source": "#jFKPHKIGX8VuKIZK" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Darcy <b>SMITH </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>01 January 1976</span></td></tr></tbody></table></div>" }, "name": [ { "use": "official", "family": "Smith", "given": [ "Darcy" ] } ], "gender": "female", "birthDate": "1976-01-01" }, "search": { "mode": "match" } }, { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/lalo2", "resource": { "resourceType": "Patient", "id": "lalo2", "meta": { "versionId": "1", "lastUpdated": "2026-02-11T20:37:05.645+00:00", "source": "#wC66RvGxKjoPBkGv" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Darcy <b>SMITH </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>01 January 1970</span></td></tr></tbody></table></div>" }, "name": [ { "use": "official", "family": "Smith", "given": [ "Darcy" ] } ], "gender": "female", "birthDate": "1970-01-01" }, "search": { "mode": "match" } }, { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/131283961", "resource": { "resourceType": "Patient", "id": "131283961", "meta": { "versionId": "1", "lastUpdated": "2026-02-23T09:18:07.304+00:00", "source": "#Nvbo5BygeJUay01L" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Alice <b>SMITH </b></div><table class=\"hapiPropertyTable\"><tbody/></table></div>" }, "name": [ { "family": "Smith", "given": [ "Alice" ] } ] }, "search": { "mode": "match" } }, { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/131283982", "resource": { "resourceType": "Patient", "id": "131283982", "meta": { "versionId": "3", "lastUpdated": "2026-04-20T03:34:40.147+00:00", "source": "#rtqTcgKTto1RMdcQ" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">John Smith <b>SMITH </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>01 January 1998</span></td></tr></tbody></table></div>" }, "name": [ { "use": "official", "family": "Smith", "given": [ "John", "Smith" ] } ], "gender": "male", "birthDate": "1998-01-01" }, "search": { "mode": "match" } } ] }
73
Then status 200
0
74
And match response.resourceType == 'Bundle'
0
75
And match response.type == 'searchset'
0
Scenario: [9:77] TC-PAT-009 | REQ-GEN-001 captured patient-read.json exists for HL7 Validator
ms: 9998
>>
Background:
21
* url baseUrl
0
21:56:21.225 baseUrl: https://hapi.fhir.org/baseR4 21:56:21.225 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5010
21:56:21.226 request: 1 > GET https://hapi.fhir.org/baseR4/Patient?_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:56:26.235 response time in milliseconds: 5009 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:56:26 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: EAIUSUINvaP2vEyL 1 < Last-Modified: Tue, 21 Apr 2026 21:56:13 GMT { "resourceType": "Bundle", "id": "a4296544-fad7-45e4-b2ad-f72f2f9f009a", "meta": { "lastUpdated": "2026-04-21T21:56:13.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=1" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=a4296544-fad7-45e4-b2ad-f72f2f9f009a&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90270587", "resource": { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } } ] }
25
Then status 200
0
26
* def patientId = response.entry[0].resource.id
0
27
* karate.log('Resolved patientId:', patientId)
0
21:56:26.236 Resolved patientId: 90270587
28
Given path 'Patient', patientId
0
29
When method GET
4986
21:56:26.236 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90270587 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:56:31.222 response time in milliseconds: 4985 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:56:31 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"1" 2 < X-Request-ID: zvgQZQNjOrQooPLu 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90270587/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:41 GMT { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }
30
Then status 200
0
31
* def patientResponse = response
0
32
* match patientResponse.resourceType == 'Patient'
0
# karate.write() resolves paths relative to target/ under Maven
79
* def fileExists = java.nio.file.Files.exists(java.nio.file.Paths.get('target/responses/patient/patient-read.json'))
1
80
* assert fileExists == true
0
Scenario: [10:82] TC-PAT-010 | REQ-GEN-002b meta.versionId is present and non-null
ms: 9997
>>
Background:
21
* url baseUrl
0
21:56:27.226 baseUrl: https://hapi.fhir.org/baseR4 21:56:27.226 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5010
21:56:27.227 request: 1 > GET https://hapi.fhir.org/baseR4/Patient?_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:56:32.236 response time in milliseconds: 5009 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:56:32 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: znTcRbjh0r3yIAai 1 < Last-Modified: Tue, 21 Apr 2026 21:56:13 GMT { "resourceType": "Bundle", "id": "a4296544-fad7-45e4-b2ad-f72f2f9f009a", "meta": { "lastUpdated": "2026-04-21T21:56:13.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=1" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=a4296544-fad7-45e4-b2ad-f72f2f9f009a&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90270587", "resource": { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } } ] }
25
Then status 200
0
26
* def patientId = response.entry[0].resource.id
0
27
* karate.log('Resolved patientId:', patientId)
0
21:56:32.237 Resolved patientId: 90270587
28
Given path 'Patient', patientId
0
29
When method GET
4987
21:56:32.237 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90270587 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:56:37.224 response time in milliseconds: 4986 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:56:37 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"1" 2 < X-Request-ID: LzneJBvfUh8tCmxB 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90270587/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:41 GMT { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }
30
Then status 200
0
31
* def patientResponse = response
0
32
* match patientResponse.resourceType == 'Patient'
0
83
Then match patientResponse.meta.versionId == '#present'
0
Scenario: [11:85] TC-PAT-011 | REQ-GEN-003 | REQ-OO-001 malformed JSON body returns 400 and OperationOutcome
ms: 15001
>>
Background:
21
* url baseUrl
0
21:56:28.225 baseUrl: https://hapi.fhir.org/baseR4 21:56:28.225 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5011
21:56:28.226 request: 1 > GET https://hapi.fhir.org/baseR4/Patient?_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:56:33.236 response time in milliseconds: 5010 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:56:33 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: 1JQv9BJMju31uM9L 1 < Last-Modified: Tue, 21 Apr 2026 21:56:13 GMT { "resourceType": "Bundle", "id": "a4296544-fad7-45e4-b2ad-f72f2f9f009a", "meta": { "lastUpdated": "2026-04-21T21:56:13.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=1" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=a4296544-fad7-45e4-b2ad-f72f2f9f009a&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90270587", "resource": { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } } ] }
25
Then status 200
0
26
* def patientId = response.entry[0].resource.id
0
27
* karate.log('Resolved patientId:', patientId)
0
21:56:33.237 Resolved patientId: 90270587
28
Given path 'Patient', patientId
0
29
When method GET
4985
21:56:33.238 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90270587 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:56:38.222 response time in milliseconds: 4984 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:56:38 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"1" 2 < X-Request-ID: KtUvmr43eNoTvVd9 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90270587/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:41 GMT { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }
30
Then status 200
0
31
* def patientResponse = response
0
32
* match patientResponse.resourceType == 'Patient'
0
# HAPI may return 422 instead of 400 for malformed JSON — report as finding if so
87
Given path 'Patient'
0
88
And header Content-Type = 'application/fhir+json'
0
89
And request 'this is not valid json'
0
90
When method POST
5003
21:56:38.224 request: 3 > POST https://hapi.fhir.org/baseR4/Patient 3 > Content-Type: application/fhir+json; charset=UTF-8 3 > Content-Length: 22 3 > Host: hapi.fhir.org 3 > Connection: Keep-Alive 3 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 3 > Accept-Encoding: gzip,deflate this is not valid json 21:56:43.225 response time in milliseconds: 5001 3 < 400 3 < Server: nginx/1.24.0 (Ubuntu) 3 < Date: Tue, 21 Apr 2026 21:56:43 GMT 3 < Content-Type: application/fhir+json;charset=utf-8 3 < Transfer-Encoding: chunked 3 < Connection: keep-alive 3 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 3 < X-Request-ID: PDAfP26i1vme49zS { "resourceType": "OperationOutcome", "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">ERROR</td><td>[]</td><td>HAPI-0450: Failed to parse request body as JSON resource. Error was: HAPI-1861: Failed to parse JSON encoded FHIR content: HAPI-1859: Content does not appear to be FHIR JSON, first non-whitespace character was: 't' (must be '{')</td></tr></table></div>" }, "issue": [ { "severity": "error", "code": "processing", "diagnostics": "HAPI-0450: Failed to parse request body as JSON resource. Error was: HAPI-1861: Failed to parse JSON encoded FHIR content: HAPI-1859: Content does not appear to be FHIR JSON, first non-whitespace character was: 't' (must be '{')" } ] }
91
Then status 400
0
92
And match response.resourceType == 'OperationOutcome'
0
93
And match response.issue == '#[_ > 0]'
1
Scenario: [12:95] TC-PAT-012 | REQ-PAT-012 Conditional read returns 304 Not Modified when ETag matches
ms: 14997
>>
Background:
21
* url baseUrl
0
21:56:31.225 baseUrl: https://hapi.fhir.org/baseR4 21:56:31.225 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5009
21:56:31.226 request: 1 > GET https://hapi.fhir.org/baseR4/Patient?_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:56:36.235 response time in milliseconds: 5009 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:56:36 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: Wx9hLR463SX9uzOs 1 < Last-Modified: Tue, 21 Apr 2026 21:56:13 GMT { "resourceType": "Bundle", "id": "a4296544-fad7-45e4-b2ad-f72f2f9f009a", "meta": { "lastUpdated": "2026-04-21T21:56:13.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=1" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=a4296544-fad7-45e4-b2ad-f72f2f9f009a&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90270587", "resource": { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } } ] }
25
Then status 200
0
26
* def patientId = response.entry[0].resource.id
0
27
* karate.log('Resolved patientId:', patientId)
0
21:56:36.236 Resolved patientId: 90270587
28
Given path 'Patient', patientId
0
29
When method GET
4988
21:56:36.236 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90270587 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:56:41.223 response time in milliseconds: 4987 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:56:41 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"1" 2 < X-Request-ID: do0StGzsuZCR47jD 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90270587/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:41 GMT { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }
30
Then status 200
0
31
* def patientResponse = response
0
32
* match patientResponse.resourceType == 'Patient'
0
96
* def versionId = patientResponse.meta.versionId
0
97
* def etag = 'W/"' + versionId + '"'
0
98
Given path 'Patient', patientId
0
99
And header If-None-Match = etag
0
100
When method GET
4998
21:56:41.225 request: 3 > GET https://hapi.fhir.org/baseR4/Patient/90270587 3 > If-None-Match: W/"1" 3 > Host: hapi.fhir.org 3 > Connection: Keep-Alive 3 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 3 > Accept-Encoding: gzip,deflate 21:56:46.222 response time in milliseconds: 4997 3 < 304 3 < Server: nginx/1.24.0 (Ubuntu) 3 < Date: Tue, 21 Apr 2026 21:56:46 GMT 3 < Content-Type: application/fhir+json;charset=utf-8 3 < Connection: keep-alive 3 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 3 < X-Request-ID: R8b6koug1HfR87qa
101
Then status 304
0
102
* karate.log('Conditional read 304 confirmed for ETag: ' + etag)
0
21:56:46.223 Conditional read 304 confirmed for ETag: W/"1"
Scenario: [13:104] TC-PAT-013 | REQ-PAT-013 search by gender returns searchset Bundle
ms: 15039
>>
Background:
21
* url baseUrl
0
21:56:34.231 baseUrl: https://hapi.fhir.org/baseR4 21:56:34.231 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5008
21:56:34.233 request: 1 > GET https://hapi.fhir.org/baseR4/Patient?_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:56:39.240 response time in milliseconds: 5006 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:56: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: D8U42bGHeLdQqY7v 1 < Last-Modified: Tue, 21 Apr 2026 21:56:13 GMT { "resourceType": "Bundle", "id": "a4296544-fad7-45e4-b2ad-f72f2f9f009a", "meta": { "lastUpdated": "2026-04-21T21:56:13.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=1" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=a4296544-fad7-45e4-b2ad-f72f2f9f009a&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90270587", "resource": { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } } ] }
25
Then status 200
0
26
* def patientId = response.entry[0].resource.id
0
27
* karate.log('Resolved patientId:', patientId)
0
21:56:39.240 Resolved patientId: 90270587
28
Given path 'Patient', patientId
0
29
When method GET
4983
21:56:39.241 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90270587 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:56:44.223 response time in milliseconds: 4981 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:56:44 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"1" 2 < X-Request-ID: AZ387NqJZTTc3Hi8 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90270587/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:41 GMT { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }
30
Then status 200
0
31
* def patientResponse = response
0
32
* match patientResponse.resourceType == 'Patient'
0
105
Given path 'Patient'
0
106
And param gender = 'female'
0
107
And param _count = '5'
0
108
When method GET
5046
21:56:44.224 request: 3 > GET https://hapi.fhir.org/baseR4/Patient?gender=female&_count=5 3 > Host: hapi.fhir.org 3 > Connection: Keep-Alive 3 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 3 > Accept-Encoding: gzip,deflate 21:56:49.269 response time in milliseconds: 5045 3 < 200 3 < Server: nginx/1.24.0 (Ubuntu) 3 < Date: Tue, 21 Apr 2026 21:56:49 GMT 3 < Content-Type: application/fhir+json;charset=utf-8 3 < Transfer-Encoding: chunked 3 < Connection: keep-alive 3 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 3 < X-Request-ID: Jq1Oj01vyZwWgpLq 3 < Last-Modified: Tue, 21 Apr 2026 21:56:49 GMT { "resourceType": "Bundle", "id": "607d46a7-6ccd-4807-9311-bcd6919b2e48", "meta": { "lastUpdated": "2026-04-21T21:56:49.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=5&gender=female" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=607d46a7-6ccd-4807-9311-bcd6919b2e48&_getpagesoffset=5&_count=5&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/89181652", "resource": { "resourceType": "Patient", "id": "89181652", "meta": { "versionId": "3", "lastUpdated": "2026-03-16T19:47:47.396+00:00", "source": "#mXZ7ErlHmWoVdFq7", "profile": [ "https://hl7.pt/fhir/patient-visit/StructureDefinition/PTPatient" ] }, "identifier": [ { "use": "official", "type": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/v2-0203", "code": "HC", "display": "Health Card Number" } ], "text": "Numero Nacional de Utente" }, "system": "http://spms.min-saude.pt/rnu/identifiers/patient-id", "value": "lol" } ], "active": true, "name": [ { "use": "official", "family": "Karla", "given": [ "Nutela" ] } ], "gender": "female", "birthDate": "1975-01-02" }, "search": { "mode": "match" } }, { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/89384554", "resource": { "resourceType": "Patient", "id": "89384554", "meta": { "versionId": "3", "lastUpdated": "2026-04-07T11:12:29.561+00:00", "source": "#8AAY1G17xfM37DcO" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Leedidson", "given": [ "Karl" ] } ], "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } }, { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/89389617", "resource": { "resourceType": "Patient", "id": "89389617", "meta": { "versionId": "3", "lastUpdated": "2026-03-17T16:21:13.846+00:00", "source": "#7H4uwgUBTCjykZlK" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } }, { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/89460561", "resource": { "resourceType": "Patient", "id": "89460561", "meta": { "versionId": "3", "lastUpdated": "2026-03-17T16:21:15.846+00:00", "source": "#HyEemCjD1grgpsBd" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } }, { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/89669462", "resource": { "resourceType": "Patient", "id": "89669462", "meta": { "versionId": "3", "lastUpdated": "2026-03-17T16:21:17.845+00:00", "source": "#odVGUV53We28ZVET" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } } ] }
109
Then status 200
0
110
And assert responseTime < 10000
0
111
And match responseHeaders['Content-Type'][0] contains 'application/fhir+json'
0
112
And match response.resourceType == 'Bundle'
0
113
And match response.type == 'searchset'
0
114
* karate.log('Gender search total: ' + response.total)
0
21:56:49.271 Gender search total: undefined
Scenario: [14:116] TC-PAT-014 | REQ-PAT-014 search by birthdate returns searchset Bundle
ms: 15013
>>
Background:
21
* url baseUrl
0
21:56:35.259 baseUrl: https://hapi.fhir.org/baseR4 21:56:35.259 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
4977
21:56:35.260 request: 1 > GET https://hapi.fhir.org/baseR4/Patient?_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:56:40.236 response time in milliseconds: 4976 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:56:40 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: ORQDvs29Vq6toCmd 1 < Last-Modified: Tue, 21 Apr 2026 21:56:13 GMT { "resourceType": "Bundle", "id": "a4296544-fad7-45e4-b2ad-f72f2f9f009a", "meta": { "lastUpdated": "2026-04-21T21:56:13.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=1" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=a4296544-fad7-45e4-b2ad-f72f2f9f009a&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90270587", "resource": { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } } ] }
25
Then status 200
0
26
* def patientId = response.entry[0].resource.id
0
27
* karate.log('Resolved patientId:', patientId)
0
21:56:40.237 Resolved patientId: 90270587
28
Given path 'Patient', patientId
0
29
When method GET
4985
21:56:40.238 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90270587 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:56:45.222 response time in milliseconds: 4984 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:56:45 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"1" 2 < X-Request-ID: LObBDcIKuOUYTfmd 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90270587/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:41 GMT { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }
30
Then status 200
0
31
* def patientResponse = response
0
32
* match patientResponse.resourceType == 'Patient'
0
117
Given path 'Patient'
0
118
And param birthdate = 'ge1980-01-01'
0
119
And param _count = '5'
0
120
When method GET
5048
21:56:45.223 request: 3 > GET https://hapi.fhir.org/baseR4/Patient?birthdate=ge1980-01-01&_count=5 3 > Host: hapi.fhir.org 3 > Connection: Keep-Alive 3 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 3 > Accept-Encoding: gzip,deflate 21:56:50.271 response time in milliseconds: 5047 3 < 200 3 < Server: nginx/1.24.0 (Ubuntu) 3 < Date: Tue, 21 Apr 2026 21:56:50 GMT 3 < Content-Type: application/fhir+json;charset=utf-8 3 < Transfer-Encoding: chunked 3 < Connection: keep-alive 3 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 3 < X-Request-ID: 2T2Duu0SxsQKL5J2 3 < Last-Modified: Tue, 21 Apr 2026 21:56:50 GMT { "resourceType": "Bundle", "id": "fd070d2f-682c-4642-aefc-f1efc6a5d697", "meta": { "lastUpdated": "2026-04-21T21:56:50.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=5&birthdate=ge1980-01-01" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=fd070d2f-682c-4642-aefc-f1efc6a5d697&_getpagesoffset=5&_count=5&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90203735", "resource": { "resourceType": "Patient", "id": "90203735", "meta": { "versionId": "4", "lastUpdated": "2026-03-23T05:54:27.643+00:00", "source": "#23cJRHdQXTzhiSfT" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "male", "birthDate": "1980-01-01" }, "search": { "mode": "match" } }, { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/T-MULTIPLE-OBSERVATIONLAB-CODES", "resource": { "resourceType": "Patient", "id": "T-MULTIPLE-OBSERVATIONLAB-CODES", "meta": { "versionId": "1", "lastUpdated": "2026-02-10T13:37:36.357+00:00", "source": "#PqTCbkme7E6kYVGK", "profile": [ "https://www.medizininformatik-initiative.de/fhir/core/modul-person/StructureDefinition/Patient" ] }, "identifier": [ { "use": "usual", "type": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/v2-0203", "code": "MR" } ] }, "system": "http://localIdentifier.de/identifiers/patient", "value": "T-MULTIPLE-OBSERVATIONLAB-CODES" } ], "name": [ { "use": "official", "family": "Covid-Testpatient with a positive lab observation that holds multiple code entries", "given": [ "Deceased" ] } ], "gender": "male", "birthDate": "1980-01-01", "address": [ { "use": "home", "type": "both", "line": [ "Multiple Labcodes Avenue 1" ], "city": "Test city #2", "postalCode": "64756", "country": "DE" } ] }, "search": { "mode": "match" } }, { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/115524137", "resource": { "resourceType": "Patient", "id": "115524137", "meta": { "versionId": "1", "lastUpdated": "2026-02-11T08:28:21.450+00:00", "source": "#aJzEQ1jvc5OnJlSV" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>01 January 1980</span></td></tr></tbody></table></div>" }, "gender": "male", "birthDate": "1980-01-01" }, "search": { "mode": "match" } }, { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/129339617", "resource": { "resourceType": "Patient", "id": "129339617", "meta": { "versionId": "1", "lastUpdated": "2026-02-12T06:03:46.079+00:00", "source": "#f9wAw3RotUv3JZIg" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>01 January 1980</span></td></tr></tbody></table></div>" }, "gender": "male", "birthDate": "1980-01-01" }, "search": { "mode": "match" } }, { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/131267835", "resource": { "resourceType": "Patient", "id": "131267835", "meta": { "versionId": "1", "lastUpdated": "2026-02-12T21:13:54.351+00:00", "source": "#Gog4am7T9fWN8JrO" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Pacemaker <b>TEST </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>01 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Test", "given": [ "Pacemaker" ] } ], "gender": "male", "birthDate": "1980-01-01" }, "search": { "mode": "match" } } ] }
121
Then status 200
0
122
And assert responseTime < 10000
0
123
And match responseHeaders['Content-Type'][0] contains 'application/fhir+json'
0
124
And match response.resourceType == 'Bundle'
0
125
And match response.type == 'searchset'
0
126
* karate.log('Birthdate search total: ' + response.total)
0
21:56:50.272 Birthdate search total: undefined
Scenario: [15:128] TC-PAT-015 | REQ-PAT-015 search by identifier returns searchset Bundle
ms: 15009
>>
Background:
21
* url baseUrl
0
21:56:37.226 baseUrl: https://hapi.fhir.org/baseR4 21:56:37.226 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5009
21:56:37.227 request: 1 > GET https://hapi.fhir.org/baseR4/Patient?_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:56:42.235 response time in milliseconds: 5007 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:56:42 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: xfbD24LjoWYWHknd 1 < Last-Modified: Tue, 21 Apr 2026 21:56:13 GMT { "resourceType": "Bundle", "id": "a4296544-fad7-45e4-b2ad-f72f2f9f009a", "meta": { "lastUpdated": "2026-04-21T21:56:13.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=1" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=a4296544-fad7-45e4-b2ad-f72f2f9f009a&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90270587", "resource": { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } } ] }
25
Then status 200
0
26
* def patientId = response.entry[0].resource.id
0
27
* karate.log('Resolved patientId:', patientId)
0
21:56:42.236 Resolved patientId: 90270587
28
Given path 'Patient', patientId
0
29
When method GET
4992
21:56:42.236 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90270587 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:56:47.228 response time in milliseconds: 4986 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:56:47 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"1" 2 < X-Request-ID: gk1bEJt1CNp1ZyWP 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90270587/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:41 GMT { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }
30
Then status 200
0
31
* def patientResponse = response
0
32
* match patientResponse.resourceType == 'Patient'
1
129
* def identifierValue = patientResponse.identifier != null && patientResponse.identifier.length > 0 ? patientResponse.identifier[0].value : 'UNKNOWN'
0
130
Given path 'Patient'
0
131
And param identifier = identifierValue
0
132
And param _count = '5'
0
133
When method GET
5005
21:56:47.230 request: 3 > GET https://hapi.fhir.org/baseR4/Patient?identifier=UNKNOWN&_count=5 3 > Host: hapi.fhir.org 3 > Connection: Keep-Alive 3 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 3 > Accept-Encoding: gzip,deflate 21:56:52.234 response time in milliseconds: 5003 3 < 200 3 < Server: nginx/1.24.0 (Ubuntu) 3 < Date: Tue, 21 Apr 2026 21:56:52 GMT 3 < Content-Type: application/fhir+json;charset=utf-8 3 < Transfer-Encoding: chunked 3 < Connection: keep-alive 3 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 3 < X-Request-ID: CDJIEdHf2y6U5DiF 3 < Last-Modified: Tue, 21 Apr 2026 21:56:52 GMT { "resourceType": "Bundle", "id": "b64d8513-509c-4905-b9db-eb287d8d16e7", "meta": { "lastUpdated": "2026-04-21T21:56:52.201+00:00" }, "type": "searchset", "total": 0, "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=5&identifier=UNKNOWN" } ] }
134
Then status 200
0
135
And assert responseTime < 10000
0
136
And match responseHeaders['Content-Type'][0] contains 'application/fhir+json'
0
137
And match response.resourceType == 'Bundle'
0
138
And match response.type == 'searchset'
0
139
* karate.log('Identifier search total: ' + response.total)
0
21:56:52.235 Identifier search total: 0
Scenario: [16:141] TC-PAT-016 | REQ-PAT-016 search by _id returns searchset Bundle
ms: 15005
>>
Background:
21
* url baseUrl
0
21:56:43.229 baseUrl: https://hapi.fhir.org/baseR4 21:56:43.229 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5010
21:56:43.229 request: 1 > GET https://hapi.fhir.org/baseR4/Patient?_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:56:48.239 response time in milliseconds: 5010 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:56: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: 74mqy2UIIUsw4wNo 1 < Last-Modified: Tue, 21 Apr 2026 21:56:13 GMT { "resourceType": "Bundle", "id": "a4296544-fad7-45e4-b2ad-f72f2f9f009a", "meta": { "lastUpdated": "2026-04-21T21:56:13.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=1" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=a4296544-fad7-45e4-b2ad-f72f2f9f009a&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90270587", "resource": { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } } ] }
25
Then status 200
0
26
* def patientId = response.entry[0].resource.id
0
27
* karate.log('Resolved patientId:', patientId)
0
21:56:48.240 Resolved patientId: 90270587
28
Given path 'Patient', patientId
0
29
When method GET
4983
21:56:48.240 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90270587 2 > Host: hapi.fhir.org 2 > Connection: Keep-Alive 2 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 2 > Accept-Encoding: gzip,deflate 21:56:53.223 response time in milliseconds: 4982 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:56:53 GMT 2 < Content-Type: application/fhir+json;charset=utf-8 2 < Transfer-Encoding: chunked 2 < Connection: keep-alive 2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 2 < ETag: W/"1" 2 < X-Request-ID: OHFQdpyYi36w9aQL 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90270587/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:41 GMT { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }
30
Then status 200
0
31
* def patientResponse = response
0
32
* match patientResponse.resourceType == 'Patient'
0
142
Given path 'Patient'
0
143
And param _id = patientId
0
144
And param _count = '5'
0
145
When method GET
5009
21:56:53.225 request: 3 > GET https://hapi.fhir.org/baseR4/Patient?_id=90270587&_count=5 3 > Host: hapi.fhir.org 3 > Connection: Keep-Alive 3 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 3 > Accept-Encoding: gzip,deflate 21:56:58.232 response time in milliseconds: 5007 3 < 200 3 < Server: nginx/1.24.0 (Ubuntu) 3 < Date: Tue, 21 Apr 2026 21:56:58 GMT 3 < Content-Type: application/fhir+json;charset=utf-8 3 < Transfer-Encoding: chunked 3 < Connection: keep-alive 3 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 3 < X-Request-ID: M8FEGcPsmhIx8Qyl 3 < Last-Modified: Tue, 21 Apr 2026 21:56:58 GMT { "resourceType": "Bundle", "id": "671a9d6c-4277-4823-b0bc-3f01cacb0402", "meta": { "lastUpdated": "2026-04-21T21:56:58.201+00:00" }, "type": "searchset", "total": 1, "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=5&_id=90270587" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90270587", "resource": { "resourceType": "Patient", "id": "90270587", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:41.642+00:00", "source": "#TGA68OVVF6gisl3w" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Nuñez <b>KARLA </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>02 January 1980</span></td></tr></tbody></table></div>" }, "name": [ { "family": "Karla", "given": [ "Nuñez" ] } ], "gender": "female", "birthDate": "1980-01-02" }, "search": { "mode": "match" } } ] }
146
Then status 200
0
147
And assert responseTime < 10000
0
148
And match responseHeaders['Content-Type'][0] contains 'application/fhir+json'
0
149
And match response.resourceType == 'Bundle'
0
150
And match response.type == 'searchset'
0
151
And match response.entry[0].resource.id == patientId
0
152
* karate.log('_id search confirmed patientId: ' + patientId)
0
21:56:58.234 _id search confirmed patientId: 90270587