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: 9992
>>
Background:
21
* url baseUrl
0
03:40:49.359 baseUrl: https://hapi.fhir.org/baseR4 03:40:49.359 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5009
03:40:49.360 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 03:40:54.369 response time in milliseconds: 5008 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:40: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 < X-Request-ID: wZkr9UR0zbsEzVwh 1 < Last-Modified: Thu, 16 Apr 2026 03:40:54 GMT { "resourceType": "Bundle", "id": "209b4f30-e030-4f0c-b9a6-6c345d1db11f", "meta": { "lastUpdated": "2026-04-16T03:40:54.317+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=209b4f30-e030-4f0c-b9a6-6c345d1db11f&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90264223", "resource": { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:40:54.369 Resolved patientId: 90264223
28
Given path 'Patient', patientId
0
29
When method GET
4981
03:40:54.370 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90264223 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 03:40:59.350 response time in milliseconds: 4979 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:40:59 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: gm2VsTN8tsncLe1c 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90264223/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:06 GMT { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:40:59.352 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: 9994
>>
Background:
21
* url baseUrl
0
03:40:50.356 baseUrl: https://hapi.fhir.org/baseR4 03:40:50.356 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5008
03:40:50.357 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 03:40:55.365 response time in milliseconds: 5007 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:40:55 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: qSrINZfAIIETAnGl 1 < Last-Modified: Thu, 16 Apr 2026 03:40:54 GMT { "resourceType": "Bundle", "id": "209b4f30-e030-4f0c-b9a6-6c345d1db11f", "meta": { "lastUpdated": "2026-04-16T03:40:54.317+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=209b4f30-e030-4f0c-b9a6-6c345d1db11f&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90264223", "resource": { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:40:55.365 Resolved patientId: 90264223
28
Given path 'Patient', patientId
0
29
When method GET
4984
03:40:55.366 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90264223 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 03:41:00.349 response time in milliseconds: 4982 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:41:00 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: X2i1j5qDXb9hi8NJ 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90264223/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:06 GMT { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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: 9998
>>
Background:
21
* url baseUrl
0
03:40:51.353 baseUrl: https://hapi.fhir.org/baseR4 03:40:51.353 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5010
03:40:51.354 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 03:40:56.363 response time in milliseconds: 5009 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:40:56 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: 3nwQXf3pwEFuax0o 1 < Last-Modified: Thu, 16 Apr 2026 03:40:54 GMT { "resourceType": "Bundle", "id": "209b4f30-e030-4f0c-b9a6-6c345d1db11f", "meta": { "lastUpdated": "2026-04-16T03:40:54.317+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=209b4f30-e030-4f0c-b9a6-6c345d1db11f&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90264223", "resource": { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:40:56.364 Resolved patientId: 90264223
28
Given path 'Patient', patientId
0
29
When method GET
4985
03:40:56.365 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90264223 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 03:41:01.349 response time in milliseconds: 4984 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:41:01 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: 61QKuXBjxFyOSj6H 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90264223/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:06 GMT { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:41:01.351 TC-PAT-003: SKIP — identifier not present on resolved patient 90264223
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
03:40:52.358 baseUrl: https://hapi.fhir.org/baseR4 03:40:52.358 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5003
03:40:52.359 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 03:40:57.361 response time in milliseconds: 5001 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:40:57 GMT 1 < Content-Type: application/fhir+json;charset=utf-8 1 < Transfer-Encoding: chunked 1 < Connection: keep-alive 1 < X-Cache: HIT from https://hapi.fhir.org/baseR4 1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 1 < X-Request-ID: VxM0pHJQyAMFhQ8t 1 < Last-Modified: Thu, 16 Apr 2026 03:40:54 GMT { "resourceType": "Bundle", "id": "209b4f30-e030-4f0c-b9a6-6c345d1db11f", "meta": { "lastUpdated": "2026-04-16T03:40:54.317+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=209b4f30-e030-4f0c-b9a6-6c345d1db11f&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90264223", "resource": { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:40:57.362 Resolved patientId: 90264223
28
Given path 'Patient', patientId
0
29
When method GET
4986
03:40:57.363 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90264223 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 03:41:02.348 response time in milliseconds: 4985 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:41:02 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: KciwEUiKzkuBdCOo 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90264223/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:06 GMT { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:41:02.349 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
03:40:58.353 baseUrl: https://hapi.fhir.org/baseR4 03:40:58.353 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5008
03:40:58.354 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 03:41:03.361 response time in milliseconds: 5006 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:41:03 GMT 1 < Content-Type: application/fhir+json;charset=utf-8 1 < Transfer-Encoding: chunked 1 < Connection: keep-alive 1 < X-Cache: HIT from https://hapi.fhir.org/baseR4 1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 1 < X-Request-ID: Qb845xQe55BwlmQM 1 < Last-Modified: Thu, 16 Apr 2026 03:40:54 GMT { "resourceType": "Bundle", "id": "209b4f30-e030-4f0c-b9a6-6c345d1db11f", "meta": { "lastUpdated": "2026-04-16T03:40:54.317+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=209b4f30-e030-4f0c-b9a6-6c345d1db11f&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90264223", "resource": { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:41:03.361 Resolved patientId: 90264223
28
Given path 'Patient', patientId
0
29
When method GET
4987
03:41:03.362 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90264223 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 03:41:08.348 response time in milliseconds: 4986 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:41:08 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: Lukq6ONL9zF08zMp 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90264223/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:06 GMT { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:41:08.350 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: 9995
>>
Background:
21
* url baseUrl
0
03:40:59.354 baseUrl: https://hapi.fhir.org/baseR4 03:40:59.354 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5005
03:40:59.356 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 03:41:04.360 response time in milliseconds: 5003 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:41:04 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: XNFKLHRMOsvLmzl3 1 < Last-Modified: Thu, 16 Apr 2026 03:40:54 GMT { "resourceType": "Bundle", "id": "209b4f30-e030-4f0c-b9a6-6c345d1db11f", "meta": { "lastUpdated": "2026-04-16T03:40:54.317+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=209b4f30-e030-4f0c-b9a6-6c345d1db11f&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90264223", "resource": { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:41:04.360 Resolved patientId: 90264223
28
Given path 'Patient', patientId
0
29
When method GET
4989
03:41:04.361 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90264223 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 03:41:09.349 response time in milliseconds: 4988 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:41:09 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: ObfYSXGMAN925l2q 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90264223/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:06 GMT { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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: 15006
>>
Background:
21
* url baseUrl
0
03:41:00.352 baseUrl: https://hapi.fhir.org/baseR4 03:41:00.352 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5009
03:41:00.353 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 03:41:05.361 response time in milliseconds: 5007 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:41:05 GMT 1 < Content-Type: application/fhir+json;charset=utf-8 1 < Transfer-Encoding: chunked 1 < Connection: keep-alive 1 < X-Cache: HIT from https://hapi.fhir.org/baseR4 1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 1 < X-Request-ID: VKL5ayi3XetKksJv 1 < Last-Modified: Thu, 16 Apr 2026 03:40:54 GMT { "resourceType": "Bundle", "id": "209b4f30-e030-4f0c-b9a6-6c345d1db11f", "meta": { "lastUpdated": "2026-04-16T03:40:54.317+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=209b4f30-e030-4f0c-b9a6-6c345d1db11f&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90264223", "resource": { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:41:05.361 Resolved patientId: 90264223
28
Given path 'Patient', patientId
0
29
When method GET
4987
03:41:05.362 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90264223 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 03:41:10.349 response time in milliseconds: 4986 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:41:10 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: A5FP56WRfENPFm92 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90264223/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:06 GMT { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
5008
03:41:10.350 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 03:41:15.358 response time in milliseconds: 5007 3 < 404 3 < Server: nginx/1.24.0 (Ubuntu) 3 < Date: Thu, 16 Apr 2026 03:41:15 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: g8b9Dfd53qywjG28 { "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)
0
03:41:15.359 404 severity: error
66
* karate.log('404 code:', response.issue[0].code)
0
03:41:15.359 404 code: processing
Scenario: [8:68] TC-PAT-008 | REQ-PAT-008 search by family name returns Bundle searchset
ms: 15021
>>
Background:
21
* url baseUrl
0
03:41:01.353 baseUrl: https://hapi.fhir.org/baseR4 03:41:01.353 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5008
03:41:01.354 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 03:41:06.362 response time in milliseconds: 5007 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:41:06 GMT 1 < Content-Type: application/fhir+json;charset=utf-8 1 < Transfer-Encoding: chunked 1 < Connection: keep-alive 1 < X-Cache: HIT from https://hapi.fhir.org/baseR4 1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 1 < X-Request-ID: COtSjVEvJZM2vlKN 1 < Last-Modified: Thu, 16 Apr 2026 03:40:54 GMT { "resourceType": "Bundle", "id": "209b4f30-e030-4f0c-b9a6-6c345d1db11f", "meta": { "lastUpdated": "2026-04-16T03:40:54.317+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=209b4f30-e030-4f0c-b9a6-6c345d1db11f&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90264223", "resource": { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:41:06.362 Resolved patientId: 90264223
28
Given path 'Patient', patientId
0
29
When method GET
4987
03:41:06.363 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90264223 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 03:41:11.349 response time in milliseconds: 4986 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:41:11 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: BDNXzROIr6X2kN3T 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90264223/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:06 GMT { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
5024
03:41:11.351 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 03:41:16.374 response time in milliseconds: 5022 3 < 200 3 < Server: nginx/1.24.0 (Ubuntu) 3 < Date: Thu, 16 Apr 2026 03:41:16 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: fLvciRmbXneNTRfY 3 < Last-Modified: Thu, 16 Apr 2026 03:41:16 GMT { "resourceType": "Bundle", "id": "12556a93-d565-4a93-9547-610444a6689b", "meta": { "lastUpdated": "2026-04-16T03:41:16.318+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=12556a93-d565-4a93-9547-610444a6689b&_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": "12", "lastUpdated": "2026-04-11T04:32:50.991+00:00", "source": "#7JgfTD7blhU6boNj" }, "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": "1", "lastUpdated": "2026-02-23T09:51:38.051+00:00", "source": "#wQwlOJeiaj7ENCZS" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">John <b>SMITH </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Date of birth</td><td><span>15 May 1985</span></td></tr></tbody></table></div>" }, "name": [ { "use": "official", "family": "Smith", "given": [ "John" ] } ], "gender": "male", "birthDate": "1985-05-15" }, "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
03:41:02.352 baseUrl: https://hapi.fhir.org/baseR4 03:41:02.352 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5009
03:41:02.354 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 03:41:07.362 response time in milliseconds: 5007 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:41:07 GMT 1 < Content-Type: application/fhir+json;charset=utf-8 1 < Transfer-Encoding: chunked 1 < Connection: keep-alive 1 < X-Cache: HIT from https://hapi.fhir.org/baseR4 1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4) 1 < X-Request-ID: CKYV8CtFE0IgZdp4 1 < Last-Modified: Thu, 16 Apr 2026 03:40:54 GMT { "resourceType": "Bundle", "id": "209b4f30-e030-4f0c-b9a6-6c345d1db11f", "meta": { "lastUpdated": "2026-04-16T03:40:54.317+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=209b4f30-e030-4f0c-b9a6-6c345d1db11f&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90264223", "resource": { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:41:07.362 Resolved patientId: 90264223
28
Given path 'Patient', patientId
0
29
When method GET
4987
03:41:07.363 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90264223 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 03:41:12.349 response time in milliseconds: 4986 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:41:12 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: oZKIuH9SYwrzs8dX 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90264223/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:06 GMT { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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: 9995
>>
Background:
21
* url baseUrl
0
03:41:08.353 baseUrl: https://hapi.fhir.org/baseR4 03:41:08.353 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5008
03:41:08.354 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 03:41:13.361 response time in milliseconds: 5006 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:41:13 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: GWXKR6BKkIoxkjTN 1 < Last-Modified: Thu, 16 Apr 2026 03:40:54 GMT { "resourceType": "Bundle", "id": "209b4f30-e030-4f0c-b9a6-6c345d1db11f", "meta": { "lastUpdated": "2026-04-16T03:40:54.317+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=209b4f30-e030-4f0c-b9a6-6c345d1db11f&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90264223", "resource": { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:41:13.361 Resolved patientId: 90264223
28
Given path 'Patient', patientId
0
29
When method GET
4987
03:41:13.362 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90264223 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 03:41:18.348 response time in milliseconds: 4985 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:41: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: iMGVFruv0tWmzlm7 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90264223/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:06 GMT { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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: 15008
>>
Background:
21
* url baseUrl
0
03:41:09.352 baseUrl: https://hapi.fhir.org/baseR4 03:41:09.352 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5012
03:41:09.353 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 03:41:14.365 response time in milliseconds: 5011 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:41: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: UmTKtdCQrMXRZsKp 1 < Last-Modified: Thu, 16 Apr 2026 03:40:54 GMT { "resourceType": "Bundle", "id": "209b4f30-e030-4f0c-b9a6-6c345d1db11f", "meta": { "lastUpdated": "2026-04-16T03:40:54.317+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=209b4f30-e030-4f0c-b9a6-6c345d1db11f&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90264223", "resource": { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:41:14.365 Resolved patientId: 90264223
28
Given path 'Patient', patientId
0
29
When method GET
4983
03:41:14.366 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90264223 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 03:41:19.348 response time in milliseconds: 4981 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:41: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: iDowGaasJPHRTBYg 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90264223/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:06 GMT { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
5011
03:41:19.349 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 03:41:24.359 response time in milliseconds: 5010 3 < 400 3 < Server: nginx/1.24.0 (Ubuntu) 3 < Date: Thu, 16 Apr 2026 03:41:24 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: 1DukNul1M8aoWzwc { "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]'
0
Scenario: [12:95] TC-PAT-012 | REQ-PAT-012 Conditional read returns 304 Not Modified when ETag matches
ms: 14996
>>
Background:
21
* url baseUrl
0
03:41:12.353 baseUrl: https://hapi.fhir.org/baseR4 03:41:12.353 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5009
03:41:12.354 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 03:41:17.362 response time in milliseconds: 5008 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:41:17 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: wT0SvosX6efz26Rq 1 < Last-Modified: Thu, 16 Apr 2026 03:40:54 GMT { "resourceType": "Bundle", "id": "209b4f30-e030-4f0c-b9a6-6c345d1db11f", "meta": { "lastUpdated": "2026-04-16T03:40:54.317+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=209b4f30-e030-4f0c-b9a6-6c345d1db11f&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90264223", "resource": { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:41:17.363 Resolved patientId: 90264223
28
Given path 'Patient', patientId
0
29
When method GET
4986
03:41:17.363 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90264223 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 03:41:22.349 response time in milliseconds: 4985 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:41:22 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: DwdZzdu2GnS8LuVM 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90264223/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:06 GMT { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:41:22.351 request: 3 > GET https://hapi.fhir.org/baseR4/Patient/90264223 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 03:41:27.348 response time in milliseconds: 4997 3 < 304 3 < Server: nginx/1.24.0 (Ubuntu) 3 < Date: Thu, 16 Apr 2026 03:41:27 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: WBBm7NLzIfBAcelH
101
Then status 304
0
102
* karate.log('Conditional read 304 confirmed for ETag: ' + etag)
0
03:41:27.349 Conditional read 304 confirmed for ETag: W/"1"
Scenario: [13:104] TC-PAT-013 | REQ-PAT-013 search by gender returns searchset Bundle
ms: 15013
>>
Background:
21
* url baseUrl
0
03:41:15.361 baseUrl: https://hapi.fhir.org/baseR4 03:41:15.361 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
4998
03:41:15.362 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 03:41:20.360 response time in milliseconds: 4997 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:41:20 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: 5KXqXbOZ0ewHQ5s2 1 < Last-Modified: Thu, 16 Apr 2026 03:40:54 GMT { "resourceType": "Bundle", "id": "209b4f30-e030-4f0c-b9a6-6c345d1db11f", "meta": { "lastUpdated": "2026-04-16T03:40:54.317+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=209b4f30-e030-4f0c-b9a6-6c345d1db11f&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90264223", "resource": { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:41:20.360 Resolved patientId: 90264223
28
Given path 'Patient', patientId
0
29
When method GET
4989
03:41:20.361 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90264223 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 03:41:25.349 response time in milliseconds: 4987 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:41:25 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: upSXFhnEYoUrQDLP 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90264223/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:06 GMT { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
5023
03:41:25.350 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 03:41:30.373 response time in milliseconds: 5022 3 < 200 3 < Server: nginx/1.24.0 (Ubuntu) 3 < Date: Thu, 16 Apr 2026 03:41:30 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: ryVszZqpvoHX5Bzm 3 < Last-Modified: Thu, 16 Apr 2026 03:41:30 GMT { "resourceType": "Bundle", "id": "b7b5ec87-8fb1-456f-baab-dda5c2d2b727", "meta": { "lastUpdated": "2026-04-16T03:41:30.318+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=b7b5ec87-8fb1-456f-baab-dda5c2d2b727&_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
03:41:30.374 Gender search total: undefined
Scenario: [14:116] TC-PAT-014 | REQ-PAT-014 search by birthdate returns searchset Bundle
ms: 15005
>>
Background:
21
* url baseUrl
0
03:41:16.377 baseUrl: https://hapi.fhir.org/baseR4 03:41:16.377 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
4987
03:41:16.377 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 03:41:21.364 response time in milliseconds: 4986 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:41:21 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: nPDGSaDNA4BBXuhz 1 < Last-Modified: Thu, 16 Apr 2026 03:40:54 GMT { "resourceType": "Bundle", "id": "209b4f30-e030-4f0c-b9a6-6c345d1db11f", "meta": { "lastUpdated": "2026-04-16T03:40:54.317+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=209b4f30-e030-4f0c-b9a6-6c345d1db11f&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90264223", "resource": { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:41:21.364 Resolved patientId: 90264223
28
Given path 'Patient', patientId
0
29
When method GET
4985
03:41:21.365 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90264223 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 03:41:26.349 response time in milliseconds: 4984 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:41:26 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: XphOLgTtnveUgEg0 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90264223/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:06 GMT { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
5031
03:41:26.350 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 03:41:31.380 response time in milliseconds: 5029 3 < 200 3 < Server: nginx/1.24.0 (Ubuntu) 3 < Date: Thu, 16 Apr 2026 03:41:31 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: w7AgMPUPeq2dQ67D 3 < Last-Modified: Thu, 16 Apr 2026 03:41:31 GMT { "resourceType": "Bundle", "id": "b534de09-ea79-4b80-b9d6-7eaed9a648d3", "meta": { "lastUpdated": "2026-04-16T03:41:31.322+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=b534de09-ea79-4b80-b9d6-7eaed9a648d3&_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
03:41:31.382 Birthdate search total: undefined
Scenario: [15:128] TC-PAT-015 | REQ-PAT-015 search by identifier returns searchset Bundle
ms: 15005
>>
Background:
21
* url baseUrl
0
03:41:18.350 baseUrl: https://hapi.fhir.org/baseR4 03:41:18.350 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5013
03:41:18.351 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 03:41:23.364 response time in milliseconds: 5012 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:41: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: Fs3KwsEOr7mqjSNk 1 < Last-Modified: Thu, 16 Apr 2026 03:40:54 GMT { "resourceType": "Bundle", "id": "209b4f30-e030-4f0c-b9a6-6c345d1db11f", "meta": { "lastUpdated": "2026-04-16T03:40:54.317+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=209b4f30-e030-4f0c-b9a6-6c345d1db11f&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90264223", "resource": { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:41:23.364 Resolved patientId: 90264223
28
Given path 'Patient', patientId
0
29
When method GET
4984
03:41:23.365 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90264223 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 03:41:28.349 response time in milliseconds: 4983 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:41: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: PneVFnyrDTvqo8ax 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90264223/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:06 GMT { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
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
03:41:28.350 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 03:41:33.354 response time in milliseconds: 5004 3 < 200 3 < Server: nginx/1.24.0 (Ubuntu) 3 < Date: Thu, 16 Apr 2026 03:41:33 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: p4DYSPmanXjRxwvg 3 < Last-Modified: Thu, 16 Apr 2026 03:41:33 GMT { "resourceType": "Bundle", "id": "d5646fd2-97b7-49e7-bf1b-270a84604583", "meta": { "lastUpdated": "2026-04-16T03:41:33.317+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)
1
03:41:33.356 Identifier search total: 0
Scenario: [16:141] TC-PAT-016 | REQ-PAT-016 search by _id returns searchset Bundle
ms: 14995
>>
Background:
21
* url baseUrl
0
03:41:24.363 baseUrl: https://hapi.fhir.org/baseR4 03:41:24.363 fhirVersion: 4.0.1
22
Given path 'Patient'
0
23
And param _count = '1'
0
24
When method GET
5002
03:41:24.364 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 03:41:29.365 response time in milliseconds: 5000 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Thu, 16 Apr 2026 03:41:29 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: 3NeifWMiXHCt7W6i 1 < Last-Modified: Thu, 16 Apr 2026 03:40:54 GMT { "resourceType": "Bundle", "id": "209b4f30-e030-4f0c-b9a6-6c345d1db11f", "meta": { "lastUpdated": "2026-04-16T03:40:54.317+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=209b4f30-e030-4f0c-b9a6-6c345d1db11f&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90264223", "resource": { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:41:29.365 Resolved patientId: 90264223
28
Given path 'Patient', patientId
0
29
When method GET
4982
03:41:29.366 request: 2 > GET https://hapi.fhir.org/baseR4/Patient/90264223 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 03:41:34.348 response time in milliseconds: 4981 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Thu, 16 Apr 2026 03:41:34 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: lB96N9cu8bu9QpbM 2 < Content-Location: https://hapi.fhir.org/baseR4/Patient/90264223/_history/1 2 < Last-Modified: Mon, 09 Feb 2026 18:36:06 GMT { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
5008
03:41:34.349 request: 3 > GET https://hapi.fhir.org/baseR4/Patient?_id=90264223&_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 03:41:39.357 response time in milliseconds: 5007 3 < 200 3 < Server: nginx/1.24.0 (Ubuntu) 3 < Date: Thu, 16 Apr 2026 03:41:39 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: J1T1T2KWJsYy06Sx 3 < Last-Modified: Thu, 16 Apr 2026 03:41:39 GMT { "resourceType": "Bundle", "id": "ddb7df85-f0ae-4438-a4af-3b95b0615aa1", "meta": { "lastUpdated": "2026-04-16T03:41:39.318+00:00" }, "type": "searchset", "total": 1, "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/Patient?_count=5&_id=90264223" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/Patient/90264223", "resource": { "resourceType": "Patient", "id": "90264223", "meta": { "versionId": "1", "lastUpdated": "2026-02-09T18:36:06.639+00:00", "source": "#nV78G4bswjDzmYjA" }, "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
03:41:39.358 _id search confirmed patientId: 90264223