Summary| Tags| Feature: diagnostic/diagnostic-report.feature| DiagnosticReport Resource Validation
Scenario: [1:23] TC-DXR-001 | REQ-DXR-001 GET /DiagnosticReport/{id} returns 200 and resourceType = DiagnosticReport
ms: 9981
>>
Background:
12
* url baseUrl
0
21:55:19.248 baseUrl: https://hapi.fhir.org/baseR4 21:55:19.248 fhirVersion: 4.0.1
13
Given path 'DiagnosticReport'
0
14
And params ({ 'subject:missing': 'false', '_count': '1' })
0
15
When method GET
5015
21:55:19.250 request: 1 > GET https://hapi.fhir.org/baseR4/DiagnosticReport?subject%3Amissing=false&_count=1 1 > Host: hapi.fhir.org 1 > Connection: Keep-Alive 1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 1 > Accept-Encoding: gzip,deflate 21:55:24.264 response time in milliseconds: 5013 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:55:24 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: kf88ZzQ0j47oapBg 1 < Last-Modified: Tue, 21 Apr 2026 21:55:24 GMT { "resourceType": "Bundle", "id": "1313b960-1bce-4c94-87c4-f65be0167e91", "meta": { "lastUpdated": "2026-04-21T21:55:24.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/DiagnosticReport?_count=1&subject%3Amissing=false" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=1313b960-1bce-4c94-87c4-f65be0167e91&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/DiagnosticReport/105794583", "resource": { "resourceType": "DiagnosticReport", "id": "105794583", "meta": { "versionId": "1", "lastUpdated": "2026-02-10T17:48:06.615+00:00", "source": "#xZipezmxt7Qc7rF3" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\"> Perfil de laboratorio básico </div><table class=\"hapiPropertyTable\"><tbody><tr><td>Status</td><td>FINAL</td></tr><tr><td>Issued</td><td> 20 February 2025 09:00:00 </td></tr></tbody></table><table class=\"hapiTableOfValues\"><thead><tr><td>Name</td><td>Value</td><td>Interpretation</td><td>Reference Range</td><td>Status</td></tr></thead><tbody><tr class=\"hapiTableOfValuesRowOdd\"><td> Hemoglobina </td><td>14.0 g/dL </td><td/><td> 13.0 g/dL - 17.0 g/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Glucosa en sangre </td><td>95 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>182 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>250 10^3/uL </td><td/><td> 150 10^3/uL - 400 10^3/uL </td><td>FINAL</td></tr></tbody></table></div>" }, "status": "final", "category": [ { "coding": [ { "system": "http://loinc.org", "code": "LAB", "display": "Laboratory" } ] } ], "code": { "coding": [ { "system": "http://loinc.org", "code": "24323-8", "display": "Lab tests report" } ], "text": "Perfil de laboratorio básico" }, "subject": { "reference": "Patient/testmartin" }, "effectiveDateTime": "2025-02-20T08:00:00Z", "issued": "2025-02-20T09:00:00Z", "result": [ { "reference": "Observation/105794579" }, { "reference": "Observation/105794580" }, { "reference": "Observation/105794581" }, { "reference": "Observation/105794582" } ] }, "search": { "mode": "match" } } ] }
16
Then status 200
0
17
* def hasEntry = response.entry != null && response.entry.length > 0
1
18
* match hasEntry == true
0
19
* def diagnosticReportId = response.entry[0].resource.id
0
20
* match response.entry[0].resource.resourceType == 'DiagnosticReport'
0
21
* karate.log('Resolved diagnosticReportId: ' + diagnosticReportId)
0
21:55:24.266 Resolved diagnosticReportId: 105794583
24
Given path 'DiagnosticReport', diagnosticReportId
0
25
When method GET
4960
21:55:24.267 request: 2 > GET https://hapi.fhir.org/baseR4/DiagnosticReport/105794583 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:55:29.225 response time in milliseconds: 4958 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:55: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: tj9j2uOSOM7KkQ4u 2 < Content-Location: https://hapi.fhir.org/baseR4/DiagnosticReport/105794583/_history/1 2 < Last-Modified: Tue, 10 Feb 2026 17:48:06 GMT { "resourceType": "DiagnosticReport", "id": "105794583", "meta": { "versionId": "1", "lastUpdated": "2026-02-10T17:48:06.615+00:00", "source": "#xZipezmxt7Qc7rF3" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\"> Perfil de laboratorio básico </div><table class=\"hapiPropertyTable\"><tbody><tr><td>Status</td><td>FINAL</td></tr><tr><td>Issued</td><td> 20 February 2025 09:00:00 </td></tr></tbody></table><table class=\"hapiTableOfValues\"><thead><tr><td>Name</td><td>Value</td><td>Interpretation</td><td>Reference Range</td><td>Status</td></tr></thead><tbody><tr class=\"hapiTableOfValuesRowOdd\"><td> Hemoglobina </td><td>14.0 g/dL </td><td/><td> 13.0 g/dL - 17.0 g/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Glucosa en sangre </td><td>95 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>182 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>250 10^3/uL </td><td/><td> 150 10^3/uL - 400 10^3/uL </td><td>FINAL</td></tr></tbody></table></div>" }, "status": "final", "category": [ { "coding": [ { "system": "http://loinc.org", "code": "LAB", "display": "Laboratory" } ] } ], "code": { "coding": [ { "system": "http://loinc.org", "code": "24323-8", "display": "Lab tests report" } ], "text": "Perfil de laboratorio básico" }, "subject": { "reference": "Patient/testmartin" }, "effectiveDateTime": "2025-02-20T08:00:00Z", "issued": "2025-02-20T09:00:00Z", "result": [ { "reference": "Observation/105794579" }, { "reference": "Observation/105794580" }, { "reference": "Observation/105794581" }, { "reference": "Observation/105794582" } ] }
26
Then status 200
0
27
And assert responseTime < 10000
0
28
And match responseHeaders['Content-Type'][0] contains 'application/fhir+json'
0
29
And match responseHeaders['ETag'][0] == '#present'
0
30
And match response.resourceType == 'DiagnosticReport'
0
31
* karate.write(response, 'responses/diagnostic/diagnostic-report-read.json')
2
21:55:29.229 write to file: target/responses/diagnostic/diagnostic-report-read.json
Scenario: [2:33] TC-DXR-002 | REQ-DXR-002 status is a valid DiagnosticReport status value
ms: 9988
>>
Background:
12
* url baseUrl
0
21:55:20.235 baseUrl: https://hapi.fhir.org/baseR4 21:55:20.236 fhirVersion: 4.0.1
13
Given path 'DiagnosticReport'
0
14
And params ({ 'subject:missing': 'false', '_count': '1' })
0
15
When method GET
5001
21:55:20.237 request: 1 > GET https://hapi.fhir.org/baseR4/DiagnosticReport?subject%3Amissing=false&_count=1 1 > Host: hapi.fhir.org 1 > Connection: Keep-Alive 1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 1 > Accept-Encoding: gzip,deflate 21:55:25.237 response time in milliseconds: 4999 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:55: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: n8an75q5VKxPmI0a 1 < Last-Modified: Tue, 21 Apr 2026 21:55:24 GMT { "resourceType": "Bundle", "id": "1313b960-1bce-4c94-87c4-f65be0167e91", "meta": { "lastUpdated": "2026-04-21T21:55:24.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/DiagnosticReport?_count=1&subject%3Amissing=false" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=1313b960-1bce-4c94-87c4-f65be0167e91&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/DiagnosticReport/105794583", "resource": { "resourceType": "DiagnosticReport", "id": "105794583", "meta": { "versionId": "1", "lastUpdated": "2026-02-10T17:48:06.615+00:00", "source": "#xZipezmxt7Qc7rF3" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\"> Perfil de laboratorio básico </div><table class=\"hapiPropertyTable\"><tbody><tr><td>Status</td><td>FINAL</td></tr><tr><td>Issued</td><td> 20 February 2025 09:00:00 </td></tr></tbody></table><table class=\"hapiTableOfValues\"><thead><tr><td>Name</td><td>Value</td><td>Interpretation</td><td>Reference Range</td><td>Status</td></tr></thead><tbody><tr class=\"hapiTableOfValuesRowOdd\"><td> Hemoglobina </td><td>14.0 g/dL </td><td/><td> 13.0 g/dL - 17.0 g/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Glucosa en sangre </td><td>95 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>182 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>250 10^3/uL </td><td/><td> 150 10^3/uL - 400 10^3/uL </td><td>FINAL</td></tr></tbody></table></div>" }, "status": "final", "category": [ { "coding": [ { "system": "http://loinc.org", "code": "LAB", "display": "Laboratory" } ] } ], "code": { "coding": [ { "system": "http://loinc.org", "code": "24323-8", "display": "Lab tests report" } ], "text": "Perfil de laboratorio básico" }, "subject": { "reference": "Patient/testmartin" }, "effectiveDateTime": "2025-02-20T08:00:00Z", "issued": "2025-02-20T09:00:00Z", "result": [ { "reference": "Observation/105794579" }, { "reference": "Observation/105794580" }, { "reference": "Observation/105794581" }, { "reference": "Observation/105794582" } ] }, "search": { "mode": "match" } } ] }
16
Then status 200
0
17
* def hasEntry = response.entry != null && response.entry.length > 0
0
18
* match hasEntry == true
0
19
* def diagnosticReportId = response.entry[0].resource.id
0
20
* match response.entry[0].resource.resourceType == 'DiagnosticReport'
0
21
* karate.log('Resolved diagnosticReportId: ' + diagnosticReportId)
0
21:55:25.239 Resolved diagnosticReportId: 105794583
34
Given path 'DiagnosticReport', diagnosticReportId
0
35
When method GET
4984
21:55:25.240 request: 2 > GET https://hapi.fhir.org/baseR4/DiagnosticReport/105794583 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:55:30.223 response time in milliseconds: 4982 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:55: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: 4awr6KRyPGqUdVQk 2 < Content-Location: https://hapi.fhir.org/baseR4/DiagnosticReport/105794583/_history/1 2 < Last-Modified: Tue, 10 Feb 2026 17:48:06 GMT { "resourceType": "DiagnosticReport", "id": "105794583", "meta": { "versionId": "1", "lastUpdated": "2026-02-10T17:48:06.615+00:00", "source": "#xZipezmxt7Qc7rF3" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\"> Perfil de laboratorio básico </div><table class=\"hapiPropertyTable\"><tbody><tr><td>Status</td><td>FINAL</td></tr><tr><td>Issued</td><td> 20 February 2025 09:00:00 </td></tr></tbody></table><table class=\"hapiTableOfValues\"><thead><tr><td>Name</td><td>Value</td><td>Interpretation</td><td>Reference Range</td><td>Status</td></tr></thead><tbody><tr class=\"hapiTableOfValuesRowOdd\"><td> Hemoglobina </td><td>14.0 g/dL </td><td/><td> 13.0 g/dL - 17.0 g/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Glucosa en sangre </td><td>95 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>182 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>250 10^3/uL </td><td/><td> 150 10^3/uL - 400 10^3/uL </td><td>FINAL</td></tr></tbody></table></div>" }, "status": "final", "category": [ { "coding": [ { "system": "http://loinc.org", "code": "LAB", "display": "Laboratory" } ] } ], "code": { "coding": [ { "system": "http://loinc.org", "code": "24323-8", "display": "Lab tests report" } ], "text": "Perfil de laboratorio básico" }, "subject": { "reference": "Patient/testmartin" }, "effectiveDateTime": "2025-02-20T08:00:00Z", "issued": "2025-02-20T09:00:00Z", "result": [ { "reference": "Observation/105794579" }, { "reference": "Observation/105794580" }, { "reference": "Observation/105794581" }, { "reference": "Observation/105794582" } ] }
36
Then status 200
0
37
And match response.status == '#regex (registered|partial|preliminary|final|amended|corrected|appended|cancelled|entered-in-error|unknown)'
1
38
* karate.log('status: ' + response.status)
0
21:55:30.224 status: final
Scenario: [3:40] TC-DXR-003 | REQ-DXR-003 code.coding has system and code
ms: 9996
>>
Background:
12
* url baseUrl
0
21:55:21.230 baseUrl: https://hapi.fhir.org/baseR4 21:55:21.230 fhirVersion: 4.0.1
13
Given path 'DiagnosticReport'
0
14
And params ({ 'subject:missing': 'false', '_count': '1' })
0
15
When method GET
5007
21:55:21.232 request: 1 > GET https://hapi.fhir.org/baseR4/DiagnosticReport?subject%3Amissing=false&_count=1 1 > Host: hapi.fhir.org 1 > Connection: Keep-Alive 1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 1 > Accept-Encoding: gzip,deflate 21:55:26.237 response time in milliseconds: 5005 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:55: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: Rb2erEF2FtXQKyJ2 1 < Last-Modified: Tue, 21 Apr 2026 21:55:24 GMT { "resourceType": "Bundle", "id": "1313b960-1bce-4c94-87c4-f65be0167e91", "meta": { "lastUpdated": "2026-04-21T21:55:24.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/DiagnosticReport?_count=1&subject%3Amissing=false" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=1313b960-1bce-4c94-87c4-f65be0167e91&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/DiagnosticReport/105794583", "resource": { "resourceType": "DiagnosticReport", "id": "105794583", "meta": { "versionId": "1", "lastUpdated": "2026-02-10T17:48:06.615+00:00", "source": "#xZipezmxt7Qc7rF3" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\"> Perfil de laboratorio básico </div><table class=\"hapiPropertyTable\"><tbody><tr><td>Status</td><td>FINAL</td></tr><tr><td>Issued</td><td> 20 February 2025 09:00:00 </td></tr></tbody></table><table class=\"hapiTableOfValues\"><thead><tr><td>Name</td><td>Value</td><td>Interpretation</td><td>Reference Range</td><td>Status</td></tr></thead><tbody><tr class=\"hapiTableOfValuesRowOdd\"><td> Hemoglobina </td><td>14.0 g/dL </td><td/><td> 13.0 g/dL - 17.0 g/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Glucosa en sangre </td><td>95 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>182 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>250 10^3/uL </td><td/><td> 150 10^3/uL - 400 10^3/uL </td><td>FINAL</td></tr></tbody></table></div>" }, "status": "final", "category": [ { "coding": [ { "system": "http://loinc.org", "code": "LAB", "display": "Laboratory" } ] } ], "code": { "coding": [ { "system": "http://loinc.org", "code": "24323-8", "display": "Lab tests report" } ], "text": "Perfil de laboratorio básico" }, "subject": { "reference": "Patient/testmartin" }, "effectiveDateTime": "2025-02-20T08:00:00Z", "issued": "2025-02-20T09:00:00Z", "result": [ { "reference": "Observation/105794579" }, { "reference": "Observation/105794580" }, { "reference": "Observation/105794581" }, { "reference": "Observation/105794582" } ] }, "search": { "mode": "match" } } ] }
16
Then status 200
0
17
* def hasEntry = response.entry != null && response.entry.length > 0
1
18
* match hasEntry == true
0
19
* def diagnosticReportId = response.entry[0].resource.id
0
20
* match response.entry[0].resource.resourceType == 'DiagnosticReport'
0
21
* karate.log('Resolved diagnosticReportId: ' + diagnosticReportId)
0
21:55:26.240 Resolved diagnosticReportId: 105794583
41
Given path 'DiagnosticReport', diagnosticReportId
0
42
When method GET
4984
21:55:26.241 request: 2 > GET https://hapi.fhir.org/baseR4/DiagnosticReport/105794583 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:55:31.224 response time in milliseconds: 4982 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:55: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: Dl6nfWk2EwT4Lrin 2 < Content-Location: https://hapi.fhir.org/baseR4/DiagnosticReport/105794583/_history/1 2 < Last-Modified: Tue, 10 Feb 2026 17:48:06 GMT { "resourceType": "DiagnosticReport", "id": "105794583", "meta": { "versionId": "1", "lastUpdated": "2026-02-10T17:48:06.615+00:00", "source": "#xZipezmxt7Qc7rF3" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\"> Perfil de laboratorio básico </div><table class=\"hapiPropertyTable\"><tbody><tr><td>Status</td><td>FINAL</td></tr><tr><td>Issued</td><td> 20 February 2025 09:00:00 </td></tr></tbody></table><table class=\"hapiTableOfValues\"><thead><tr><td>Name</td><td>Value</td><td>Interpretation</td><td>Reference Range</td><td>Status</td></tr></thead><tbody><tr class=\"hapiTableOfValuesRowOdd\"><td> Hemoglobina </td><td>14.0 g/dL </td><td/><td> 13.0 g/dL - 17.0 g/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Glucosa en sangre </td><td>95 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>182 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>250 10^3/uL </td><td/><td> 150 10^3/uL - 400 10^3/uL </td><td>FINAL</td></tr></tbody></table></div>" }, "status": "final", "category": [ { "coding": [ { "system": "http://loinc.org", "code": "LAB", "display": "Laboratory" } ] } ], "code": { "coding": [ { "system": "http://loinc.org", "code": "24323-8", "display": "Lab tests report" } ], "text": "Perfil de laboratorio básico" }, "subject": { "reference": "Patient/testmartin" }, "effectiveDateTime": "2025-02-20T08:00:00Z", "issued": "2025-02-20T09:00:00Z", "result": [ { "reference": "Observation/105794579" }, { "reference": "Observation/105794580" }, { "reference": "Observation/105794581" }, { "reference": "Observation/105794582" } ] }
43
Then status 200
0
44
And match response.code == '#present'
0
45
And match response.code.coding == '#[_ > 0]'
1
46
And match response.code.coding[0].system == '#present'
0
47
And match response.code.coding[0].code == '#present'
0
48
* karate.log('code system: ' + response.code.coding[0].system)
1
21:55:31.227 code system: http://loinc.org
49
* karate.log('code code: ' + response.code.coding[0].code)
0
21:55:31.227 code code: 24323-8
Scenario: [4:51] TC-DXR-004 | REQ-DXR-004 subject references Patient
ms: 9989
>>
Background:
12
* url baseUrl
0
21:55:22.236 baseUrl: https://hapi.fhir.org/baseR4 21:55:22.236 fhirVersion: 4.0.1
13
Given path 'DiagnosticReport'
0
14
And params ({ 'subject:missing': 'false', '_count': '1' })
0
15
When method GET
4998
21:55:22.238 request: 1 > GET https://hapi.fhir.org/baseR4/DiagnosticReport?subject%3Amissing=false&_count=1 1 > Host: hapi.fhir.org 1 > Connection: Keep-Alive 1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 1 > Accept-Encoding: gzip,deflate 21:55:27.235 response time in milliseconds: 4996 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:55:27 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: StJ4WKv8F5tEqIGi 1 < Last-Modified: Tue, 21 Apr 2026 21:55:24 GMT { "resourceType": "Bundle", "id": "1313b960-1bce-4c94-87c4-f65be0167e91", "meta": { "lastUpdated": "2026-04-21T21:55:24.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/DiagnosticReport?_count=1&subject%3Amissing=false" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=1313b960-1bce-4c94-87c4-f65be0167e91&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/DiagnosticReport/105794583", "resource": { "resourceType": "DiagnosticReport", "id": "105794583", "meta": { "versionId": "1", "lastUpdated": "2026-02-10T17:48:06.615+00:00", "source": "#xZipezmxt7Qc7rF3" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\"> Perfil de laboratorio básico </div><table class=\"hapiPropertyTable\"><tbody><tr><td>Status</td><td>FINAL</td></tr><tr><td>Issued</td><td> 20 February 2025 09:00:00 </td></tr></tbody></table><table class=\"hapiTableOfValues\"><thead><tr><td>Name</td><td>Value</td><td>Interpretation</td><td>Reference Range</td><td>Status</td></tr></thead><tbody><tr class=\"hapiTableOfValuesRowOdd\"><td> Hemoglobina </td><td>14.0 g/dL </td><td/><td> 13.0 g/dL - 17.0 g/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Glucosa en sangre </td><td>95 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>182 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>250 10^3/uL </td><td/><td> 150 10^3/uL - 400 10^3/uL </td><td>FINAL</td></tr></tbody></table></div>" }, "status": "final", "category": [ { "coding": [ { "system": "http://loinc.org", "code": "LAB", "display": "Laboratory" } ] } ], "code": { "coding": [ { "system": "http://loinc.org", "code": "24323-8", "display": "Lab tests report" } ], "text": "Perfil de laboratorio básico" }, "subject": { "reference": "Patient/testmartin" }, "effectiveDateTime": "2025-02-20T08:00:00Z", "issued": "2025-02-20T09:00:00Z", "result": [ { "reference": "Observation/105794579" }, { "reference": "Observation/105794580" }, { "reference": "Observation/105794581" }, { "reference": "Observation/105794582" } ] }, "search": { "mode": "match" } } ] }
16
Then status 200
0
17
* def hasEntry = response.entry != null && response.entry.length > 0
1
18
* match hasEntry == true
0
19
* def diagnosticReportId = response.entry[0].resource.id
0
20
* match response.entry[0].resource.resourceType == 'DiagnosticReport'
0
21
* karate.log('Resolved diagnosticReportId: ' + diagnosticReportId)
0
21:55:27.237 Resolved diagnosticReportId: 105794583
52
Given path 'DiagnosticReport', diagnosticReportId
0
53
When method GET
4987
21:55:27.238 request: 2 > GET https://hapi.fhir.org/baseR4/DiagnosticReport/105794583 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:55:32.224 response time in milliseconds: 4985 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:55:32 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: Zn22LoY6vBVA1dLM 2 < Content-Location: https://hapi.fhir.org/baseR4/DiagnosticReport/105794583/_history/1 2 < Last-Modified: Tue, 10 Feb 2026 17:48:06 GMT { "resourceType": "DiagnosticReport", "id": "105794583", "meta": { "versionId": "1", "lastUpdated": "2026-02-10T17:48:06.615+00:00", "source": "#xZipezmxt7Qc7rF3" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\"> Perfil de laboratorio básico </div><table class=\"hapiPropertyTable\"><tbody><tr><td>Status</td><td>FINAL</td></tr><tr><td>Issued</td><td> 20 February 2025 09:00:00 </td></tr></tbody></table><table class=\"hapiTableOfValues\"><thead><tr><td>Name</td><td>Value</td><td>Interpretation</td><td>Reference Range</td><td>Status</td></tr></thead><tbody><tr class=\"hapiTableOfValuesRowOdd\"><td> Hemoglobina </td><td>14.0 g/dL </td><td/><td> 13.0 g/dL - 17.0 g/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Glucosa en sangre </td><td>95 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>182 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>250 10^3/uL </td><td/><td> 150 10^3/uL - 400 10^3/uL </td><td>FINAL</td></tr></tbody></table></div>" }, "status": "final", "category": [ { "coding": [ { "system": "http://loinc.org", "code": "LAB", "display": "Laboratory" } ] } ], "code": { "coding": [ { "system": "http://loinc.org", "code": "24323-8", "display": "Lab tests report" } ], "text": "Perfil de laboratorio básico" }, "subject": { "reference": "Patient/testmartin" }, "effectiveDateTime": "2025-02-20T08:00:00Z", "issued": "2025-02-20T09:00:00Z", "result": [ { "reference": "Observation/105794579" }, { "reference": "Observation/105794580" }, { "reference": "Observation/105794581" }, { "reference": "Observation/105794582" } ] }
54
Then status 200
0
55
And match response.subject == '#present'
1
56
And match response.subject.reference == '#string'
0
57
And match response.subject.reference == '#regex .*Patient.*'
0
58
* karate.log('subject reference: ' + response.subject.reference)
1
21:55:32.226 subject reference: Patient/testmartin
Scenario: [5:60] TC-DXR-005 | REQ-DXR-005 | REQ-OO-001 non-existent ID returns 404 and OperationOutcome
ms: 9998
>>
Background:
12
* url baseUrl
0
21:55:23.233 baseUrl: https://hapi.fhir.org/baseR4 21:55:23.233 fhirVersion: 4.0.1
13
Given path 'DiagnosticReport'
0
14
And params ({ 'subject:missing': 'false', '_count': '1' })
0
15
When method GET
5003
21:55:23.234 request: 1 > GET https://hapi.fhir.org/baseR4/DiagnosticReport?subject%3Amissing=false&_count=1 1 > Host: hapi.fhir.org 1 > Connection: Keep-Alive 1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 1 > Accept-Encoding: gzip,deflate 21:55:28.236 response time in milliseconds: 5001 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:55:28 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: 9SRGsNbTAM1W4tPA 1 < Last-Modified: Tue, 21 Apr 2026 21:55:24 GMT { "resourceType": "Bundle", "id": "1313b960-1bce-4c94-87c4-f65be0167e91", "meta": { "lastUpdated": "2026-04-21T21:55:24.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/DiagnosticReport?_count=1&subject%3Amissing=false" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=1313b960-1bce-4c94-87c4-f65be0167e91&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/DiagnosticReport/105794583", "resource": { "resourceType": "DiagnosticReport", "id": "105794583", "meta": { "versionId": "1", "lastUpdated": "2026-02-10T17:48:06.615+00:00", "source": "#xZipezmxt7Qc7rF3" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\"> Perfil de laboratorio básico </div><table class=\"hapiPropertyTable\"><tbody><tr><td>Status</td><td>FINAL</td></tr><tr><td>Issued</td><td> 20 February 2025 09:00:00 </td></tr></tbody></table><table class=\"hapiTableOfValues\"><thead><tr><td>Name</td><td>Value</td><td>Interpretation</td><td>Reference Range</td><td>Status</td></tr></thead><tbody><tr class=\"hapiTableOfValuesRowOdd\"><td> Hemoglobina </td><td>14.0 g/dL </td><td/><td> 13.0 g/dL - 17.0 g/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Glucosa en sangre </td><td>95 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>182 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>250 10^3/uL </td><td/><td> 150 10^3/uL - 400 10^3/uL </td><td>FINAL</td></tr></tbody></table></div>" }, "status": "final", "category": [ { "coding": [ { "system": "http://loinc.org", "code": "LAB", "display": "Laboratory" } ] } ], "code": { "coding": [ { "system": "http://loinc.org", "code": "24323-8", "display": "Lab tests report" } ], "text": "Perfil de laboratorio básico" }, "subject": { "reference": "Patient/testmartin" }, "effectiveDateTime": "2025-02-20T08:00:00Z", "issued": "2025-02-20T09:00:00Z", "result": [ { "reference": "Observation/105794579" }, { "reference": "Observation/105794580" }, { "reference": "Observation/105794581" }, { "reference": "Observation/105794582" } ] }, "search": { "mode": "match" } } ] }
16
Then status 200
0
17
* def hasEntry = response.entry != null && response.entry.length > 0
0
18
* match hasEntry == true
0
19
* def diagnosticReportId = response.entry[0].resource.id
0
20
* match response.entry[0].resource.resourceType == 'DiagnosticReport'
0
21
* karate.log('Resolved diagnosticReportId: ' + diagnosticReportId)
0
21:55:28.238 Resolved diagnosticReportId: 105794583
61
Given path 'DiagnosticReport', 'INVALID-ID-99999'
0
62
When method GET
4990
21:55:28.239 request: 2 > GET https://hapi.fhir.org/baseR4/DiagnosticReport/INVALID-ID-99999 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:55:33.228 response time in milliseconds: 4989 2 < 404 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:55:33 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 < X-Request-ID: IDhp1m8JRabKCx4h { "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 DiagnosticReport/INVALID-ID-99999 is not known</td></tr></table></div>" }, "issue": [ { "severity": "error", "code": "processing", "diagnostics": "HAPI-2001: Resource DiagnosticReport/INVALID-ID-99999 is not known" } ] }
63
Then status 404
0
64
And match response.resourceType == 'OperationOutcome'
0
65
And match response.issue == '#[_ > 0]'
1
66
* karate.log('404 severity: ' + response.issue[0].severity)
1
21:55:33.231 404 severity: error
67
* karate.log('404 code: ' + response.issue[0].code)
0
21:55:33.231 404 code: processing
Scenario: [6:69] TC-DXR-006 | REQ-GEN-001 captured diagnostic-report-read.json exists for HL7 Validator
ms: 5006
>>
Background:
12
* url baseUrl
0
21:55:29.233 baseUrl: https://hapi.fhir.org/baseR4 21:55:29.233 fhirVersion: 4.0.1
13
Given path 'DiagnosticReport'
0
14
And params ({ 'subject:missing': 'false', '_count': '1' })
0
15
When method GET
5003
21:55:29.235 request: 1 > GET https://hapi.fhir.org/baseR4/DiagnosticReport?subject%3Amissing=false&_count=1 1 > Host: hapi.fhir.org 1 > Connection: Keep-Alive 1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 1 > Accept-Encoding: gzip,deflate 21:55:34.236 response time in milliseconds: 5001 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:55:34 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: farwzmiWFwQsFlYJ 1 < Last-Modified: Tue, 21 Apr 2026 21:55:24 GMT { "resourceType": "Bundle", "id": "1313b960-1bce-4c94-87c4-f65be0167e91", "meta": { "lastUpdated": "2026-04-21T21:55:24.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/DiagnosticReport?_count=1&subject%3Amissing=false" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=1313b960-1bce-4c94-87c4-f65be0167e91&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/DiagnosticReport/105794583", "resource": { "resourceType": "DiagnosticReport", "id": "105794583", "meta": { "versionId": "1", "lastUpdated": "2026-02-10T17:48:06.615+00:00", "source": "#xZipezmxt7Qc7rF3" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\"> Perfil de laboratorio básico </div><table class=\"hapiPropertyTable\"><tbody><tr><td>Status</td><td>FINAL</td></tr><tr><td>Issued</td><td> 20 February 2025 09:00:00 </td></tr></tbody></table><table class=\"hapiTableOfValues\"><thead><tr><td>Name</td><td>Value</td><td>Interpretation</td><td>Reference Range</td><td>Status</td></tr></thead><tbody><tr class=\"hapiTableOfValuesRowOdd\"><td> Hemoglobina </td><td>14.0 g/dL </td><td/><td> 13.0 g/dL - 17.0 g/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Glucosa en sangre </td><td>95 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>182 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>250 10^3/uL </td><td/><td> 150 10^3/uL - 400 10^3/uL </td><td>FINAL</td></tr></tbody></table></div>" }, "status": "final", "category": [ { "coding": [ { "system": "http://loinc.org", "code": "LAB", "display": "Laboratory" } ] } ], "code": { "coding": [ { "system": "http://loinc.org", "code": "24323-8", "display": "Lab tests report" } ], "text": "Perfil de laboratorio básico" }, "subject": { "reference": "Patient/testmartin" }, "effectiveDateTime": "2025-02-20T08:00:00Z", "issued": "2025-02-20T09:00:00Z", "result": [ { "reference": "Observation/105794579" }, { "reference": "Observation/105794580" }, { "reference": "Observation/105794581" }, { "reference": "Observation/105794582" } ] }, "search": { "mode": "match" } } ] }
16
Then status 200
0
17
* def hasEntry = response.entry != null && response.entry.length > 0
0
18
* match hasEntry == true
0
19
* def diagnosticReportId = response.entry[0].resource.id
0
20
* match response.entry[0].resource.resourceType == 'DiagnosticReport'
0
21
* karate.log('Resolved diagnosticReportId: ' + diagnosticReportId)
0
21:55:34.237 Resolved diagnosticReportId: 105794583
# karate.write() resolves paths under target/ when running under Maven
71
* def fileExists = java.nio.file.Files.exists(java.nio.file.Paths.get('target/responses/diagnostic/diagnostic-report-read.json'))
2
72
* assert fileExists == true
0
Scenario: [7:74] TC-DXR-007 | REQ-GEN-002b meta.versionId is present
ms: 9997
>>
Background:
12
* url baseUrl
0
21:55:30.226 baseUrl: https://hapi.fhir.org/baseR4 21:55:30.226 fhirVersion: 4.0.1
13
Given path 'DiagnosticReport'
0
14
And params ({ 'subject:missing': 'false', '_count': '1' })
0
15
When method GET
5010
21:55:30.228 request: 1 > GET https://hapi.fhir.org/baseR4/DiagnosticReport?subject%3Amissing=false&_count=1 1 > Host: hapi.fhir.org 1 > Connection: Keep-Alive 1 > User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.18) 1 > Accept-Encoding: gzip,deflate 21:55:35.236 response time in milliseconds: 5008 1 < 200 1 < Server: nginx/1.24.0 (Ubuntu) 1 < Date: Tue, 21 Apr 2026 21:55:35 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: 1T7wdH2MmM0KO5JD 1 < Last-Modified: Tue, 21 Apr 2026 21:55:24 GMT { "resourceType": "Bundle", "id": "1313b960-1bce-4c94-87c4-f65be0167e91", "meta": { "lastUpdated": "2026-04-21T21:55:24.201+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://hapi.fhir.org/baseR4/DiagnosticReport?_count=1&subject%3Amissing=false" }, { "relation": "next", "url": "https://hapi.fhir.org/baseR4?_getpages=1313b960-1bce-4c94-87c4-f65be0167e91&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset" } ], "entry": [ { "fullUrl": "https://hapi.fhir.org/baseR4/DiagnosticReport/105794583", "resource": { "resourceType": "DiagnosticReport", "id": "105794583", "meta": { "versionId": "1", "lastUpdated": "2026-02-10T17:48:06.615+00:00", "source": "#xZipezmxt7Qc7rF3" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\"> Perfil de laboratorio básico </div><table class=\"hapiPropertyTable\"><tbody><tr><td>Status</td><td>FINAL</td></tr><tr><td>Issued</td><td> 20 February 2025 09:00:00 </td></tr></tbody></table><table class=\"hapiTableOfValues\"><thead><tr><td>Name</td><td>Value</td><td>Interpretation</td><td>Reference Range</td><td>Status</td></tr></thead><tbody><tr class=\"hapiTableOfValuesRowOdd\"><td> Hemoglobina </td><td>14.0 g/dL </td><td/><td> 13.0 g/dL - 17.0 g/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Glucosa en sangre </td><td>95 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>182 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>250 10^3/uL </td><td/><td> 150 10^3/uL - 400 10^3/uL </td><td>FINAL</td></tr></tbody></table></div>" }, "status": "final", "category": [ { "coding": [ { "system": "http://loinc.org", "code": "LAB", "display": "Laboratory" } ] } ], "code": { "coding": [ { "system": "http://loinc.org", "code": "24323-8", "display": "Lab tests report" } ], "text": "Perfil de laboratorio básico" }, "subject": { "reference": "Patient/testmartin" }, "effectiveDateTime": "2025-02-20T08:00:00Z", "issued": "2025-02-20T09:00:00Z", "result": [ { "reference": "Observation/105794579" }, { "reference": "Observation/105794580" }, { "reference": "Observation/105794581" }, { "reference": "Observation/105794582" } ] }, "search": { "mode": "match" } } ] }
16
Then status 200
0
17
* def hasEntry = response.entry != null && response.entry.length > 0
0
18
* match hasEntry == true
0
19
* def diagnosticReportId = response.entry[0].resource.id
0
20
* match response.entry[0].resource.resourceType == 'DiagnosticReport'
0
21
* karate.log('Resolved diagnosticReportId: ' + diagnosticReportId)
0
21:55:35.238 Resolved diagnosticReportId: 105794583
75
Given path 'DiagnosticReport', diagnosticReportId
0
76
When method GET
4985
21:55:35.239 request: 2 > GET https://hapi.fhir.org/baseR4/DiagnosticReport/105794583 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:55:40.222 response time in milliseconds: 4983 2 < 200 2 < Server: nginx/1.24.0 (Ubuntu) 2 < Date: Tue, 21 Apr 2026 21:55:40 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: VgnOBXsbc28WlM9a 2 < Content-Location: https://hapi.fhir.org/baseR4/DiagnosticReport/105794583/_history/1 2 < Last-Modified: Tue, 10 Feb 2026 17:48:06 GMT { "resourceType": "DiagnosticReport", "id": "105794583", "meta": { "versionId": "1", "lastUpdated": "2026-02-10T17:48:06.615+00:00", "source": "#xZipezmxt7Qc7rF3" }, "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\"> Perfil de laboratorio básico </div><table class=\"hapiPropertyTable\"><tbody><tr><td>Status</td><td>FINAL</td></tr><tr><td>Issued</td><td> 20 February 2025 09:00:00 </td></tr></tbody></table><table class=\"hapiTableOfValues\"><thead><tr><td>Name</td><td>Value</td><td>Interpretation</td><td>Reference Range</td><td>Status</td></tr></thead><tbody><tr class=\"hapiTableOfValuesRowOdd\"><td> Hemoglobina </td><td>14.0 g/dL </td><td/><td> 13.0 g/dL - 17.0 g/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Glucosa en sangre </td><td>95 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>182 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>250 10^3/uL </td><td/><td> 150 10^3/uL - 400 10^3/uL </td><td>FINAL</td></tr></tbody></table></div>" }, "status": "final", "category": [ { "coding": [ { "system": "http://loinc.org", "code": "LAB", "display": "Laboratory" } ] } ], "code": { "coding": [ { "system": "http://loinc.org", "code": "24323-8", "display": "Lab tests report" } ], "text": "Perfil de laboratorio básico" }, "subject": { "reference": "Patient/testmartin" }, "effectiveDateTime": "2025-02-20T08:00:00Z", "issued": "2025-02-20T09:00:00Z", "result": [ { "reference": "Observation/105794579" }, { "reference": "Observation/105794580" }, { "reference": "Observation/105794581" }, { "reference": "Observation/105794582" } ] }
77
Then status 200
0
78
And match response.meta.versionId == '#present'
0
79
* karate.log('meta.versionId: ' + response.meta.versionId)
0
21:55:40.224 meta.versionId: 1