Scenario: [1:23]
TC-DXR-001 | REQ-DXR-001 GET /DiagnosticReport/{id} returns 200 and resourceType = DiagnosticReport
ms: 9995
>>
Background:
12
* url baseUrl
0
03:40:00.358 baseUrl: https://hapi.fhir.org/baseR4
03:40:00.358 fhirVersion: 4.0.1
13
Given path 'DiagnosticReport'
0
14
And params ({ 'subject:missing': 'false', '_count': '1' })
0
15
When method GET
5022
03:40:00.360 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
03:40:05.381 response time in milliseconds: 5020
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:40:05 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: RjdA89XlrNOhHEJC
1 < Last-Modified: Thu, 16 Apr 2026 03:40:05 GMT
{
"resourceType": "Bundle",
"id": "a53631f7-85c1-49c8-8dbe-363a69e2969c",
"meta": {
"lastUpdated": "2026-04-16T03:40:05.318+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=a53631f7-85c1-49c8-8dbe-363a69e2969c&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset"
} ],
"entry": [ {
"fullUrl": "https://hapi.fhir.org/baseR4/DiagnosticReport/105794577",
"resource": {
"resourceType": "DiagnosticReport",
"id": "105794577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-10T17:48:00.710+00:00",
"source": "#vMoo74UPJEYPGacY"
},
"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 January 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.2 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>92 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>178 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>245 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-01-20T08:00:00Z",
"issued": "2025-01-20T09:00:00Z",
"result": [ {
"reference": "Observation/105794573"
}, {
"reference": "Observation/105794574"
}, {
"reference": "Observation/105794575"
}, {
"reference": "Observation/105794576"
} ]
},
"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)
1
03:40:05.383 Resolved diagnosticReportId: 105794577
24
Given path 'DiagnosticReport', diagnosticReportId
0
25
When method GET
4966
03:40:05.385 request:
2 > GET https://hapi.fhir.org/baseR4/DiagnosticReport/105794577
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:10.350 response time in milliseconds: 4964
2 < 200
2 < Server: nginx/1.24.0 (Ubuntu)
2 < Date: Thu, 16 Apr 2026 03:40: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: wK2PEbM54YnIJI5t
2 < Content-Location: https://hapi.fhir.org/baseR4/DiagnosticReport/105794577/_history/1
2 < Last-Modified: Tue, 10 Feb 2026 17:48:00 GMT
{
"resourceType": "DiagnosticReport",
"id": "105794577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-10T17:48:00.710+00:00",
"source": "#vMoo74UPJEYPGacY"
},
"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 January 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.2 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>92 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>178 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>245 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-01-20T08:00:00Z",
"issued": "2025-01-20T09:00:00Z",
"result": [ {
"reference": "Observation/105794573"
}, {
"reference": "Observation/105794574"
}, {
"reference": "Observation/105794575"
}, {
"reference": "Observation/105794576"
} ]
}
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
03:40:10.353 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: 9975
>>
Background:
12
* url baseUrl
0
03:40:01.374 baseUrl: https://hapi.fhir.org/baseR4
03:40:01.374 fhirVersion: 4.0.1
13
Given path 'DiagnosticReport'
0
14
And params ({ 'subject:missing': 'false', '_count': '1' })
0
15
When method GET
4988
03:40:01.376 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
03:40:06.363 response time in milliseconds: 4986
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:40: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: 66ebt0ge4ZfNE7DI
1 < Last-Modified: Thu, 16 Apr 2026 03:40:05 GMT
{
"resourceType": "Bundle",
"id": "a53631f7-85c1-49c8-8dbe-363a69e2969c",
"meta": {
"lastUpdated": "2026-04-16T03:40:05.318+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=a53631f7-85c1-49c8-8dbe-363a69e2969c&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset"
} ],
"entry": [ {
"fullUrl": "https://hapi.fhir.org/baseR4/DiagnosticReport/105794577",
"resource": {
"resourceType": "DiagnosticReport",
"id": "105794577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-10T17:48:00.710+00:00",
"source": "#vMoo74UPJEYPGacY"
},
"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 January 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.2 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>92 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>178 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>245 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-01-20T08:00:00Z",
"issued": "2025-01-20T09:00:00Z",
"result": [ {
"reference": "Observation/105794573"
}, {
"reference": "Observation/105794574"
}, {
"reference": "Observation/105794575"
}, {
"reference": "Observation/105794576"
} ]
},
"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
03:40:06.365 Resolved diagnosticReportId: 105794577
34
Given path 'DiagnosticReport', diagnosticReportId
0
35
When method GET
4983
03:40:06.366 request:
2 > GET https://hapi.fhir.org/baseR4/DiagnosticReport/105794577
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:11.348 response time in milliseconds: 4982
2 < 200
2 < Server: nginx/1.24.0 (Ubuntu)
2 < Date: Thu, 16 Apr 2026 03:40: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: iSkFKF5ATHC8ygPC
2 < Content-Location: https://hapi.fhir.org/baseR4/DiagnosticReport/105794577/_history/1
2 < Last-Modified: Tue, 10 Feb 2026 17:48:00 GMT
{
"resourceType": "DiagnosticReport",
"id": "105794577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-10T17:48:00.710+00:00",
"source": "#vMoo74UPJEYPGacY"
},
"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 January 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.2 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>92 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>178 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>245 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-01-20T08:00:00Z",
"issued": "2025-01-20T09:00:00Z",
"result": [ {
"reference": "Observation/105794573"
}, {
"reference": "Observation/105794574"
}, {
"reference": "Observation/105794575"
}, {
"reference": "Observation/105794576"
} ]
}
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
03:40:11.350 status: final
Scenario: [3:40]
TC-DXR-003 | REQ-DXR-003 code.coding has system and code
ms: 9994
>>
Background:
12
* url baseUrl
0
03:40:02.358 baseUrl: https://hapi.fhir.org/baseR4
03:40:02.358 fhirVersion: 4.0.1
13
Given path 'DiagnosticReport'
0
14
And params ({ 'subject:missing': 'false', '_count': '1' })
0
15
When method GET
5006
03:40:02.360 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
03:40:07.365 response time in milliseconds: 5004
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:40: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: ky8maN2nSMWV4Bbc
1 < Last-Modified: Thu, 16 Apr 2026 03:40:05 GMT
{
"resourceType": "Bundle",
"id": "a53631f7-85c1-49c8-8dbe-363a69e2969c",
"meta": {
"lastUpdated": "2026-04-16T03:40:05.318+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=a53631f7-85c1-49c8-8dbe-363a69e2969c&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset"
} ],
"entry": [ {
"fullUrl": "https://hapi.fhir.org/baseR4/DiagnosticReport/105794577",
"resource": {
"resourceType": "DiagnosticReport",
"id": "105794577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-10T17:48:00.710+00:00",
"source": "#vMoo74UPJEYPGacY"
},
"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 January 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.2 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>92 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>178 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>245 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-01-20T08:00:00Z",
"issued": "2025-01-20T09:00:00Z",
"result": [ {
"reference": "Observation/105794573"
}, {
"reference": "Observation/105794574"
}, {
"reference": "Observation/105794575"
}, {
"reference": "Observation/105794576"
} ]
},
"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
03:40:07.367 Resolved diagnosticReportId: 105794577
41
Given path 'DiagnosticReport', diagnosticReportId
0
42
When method GET
4983
03:40:07.368 request:
2 > GET https://hapi.fhir.org/baseR4/DiagnosticReport/105794577
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:12.349 response time in milliseconds: 4981
2 < 200
2 < Server: nginx/1.24.0 (Ubuntu)
2 < Date: Thu, 16 Apr 2026 03:40: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: LT0Kc5qqr8ccLiyz
2 < Content-Location: https://hapi.fhir.org/baseR4/DiagnosticReport/105794577/_history/1
2 < Last-Modified: Tue, 10 Feb 2026 17:48:00 GMT
{
"resourceType": "DiagnosticReport",
"id": "105794577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-10T17:48:00.710+00:00",
"source": "#vMoo74UPJEYPGacY"
},
"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 January 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.2 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>92 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>178 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>245 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-01-20T08:00:00Z",
"issued": "2025-01-20T09:00:00Z",
"result": [ {
"reference": "Observation/105794573"
}, {
"reference": "Observation/105794574"
}, {
"reference": "Observation/105794575"
}, {
"reference": "Observation/105794576"
} ]
}
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)
0
03:40:12.352 code system: http://loinc.org
49
* karate.log('code code: ' + response.code.coding[0].code)
0
03:40:12.352 code code: 24323-8
Scenario: [4:51]
TC-DXR-004 | REQ-DXR-004 subject references Patient
ms: 9991
>>
Background:
12
* url baseUrl
0
03:40:03.360 baseUrl: https://hapi.fhir.org/baseR4
03:40:03.360 fhirVersion: 4.0.1
13
Given path 'DiagnosticReport'
0
14
And params ({ 'subject:missing': 'false', '_count': '1' })
0
15
When method GET
5001
03:40:03.362 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
03:40:08.362 response time in milliseconds: 4999
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:40:08 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: QjmQOtQ2Pn9hqMDl
1 < Last-Modified: Thu, 16 Apr 2026 03:40:05 GMT
{
"resourceType": "Bundle",
"id": "a53631f7-85c1-49c8-8dbe-363a69e2969c",
"meta": {
"lastUpdated": "2026-04-16T03:40:05.318+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=a53631f7-85c1-49c8-8dbe-363a69e2969c&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset"
} ],
"entry": [ {
"fullUrl": "https://hapi.fhir.org/baseR4/DiagnosticReport/105794577",
"resource": {
"resourceType": "DiagnosticReport",
"id": "105794577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-10T17:48:00.710+00:00",
"source": "#vMoo74UPJEYPGacY"
},
"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 January 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.2 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>92 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>178 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>245 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-01-20T08:00:00Z",
"issued": "2025-01-20T09:00:00Z",
"result": [ {
"reference": "Observation/105794573"
}, {
"reference": "Observation/105794574"
}, {
"reference": "Observation/105794575"
}, {
"reference": "Observation/105794576"
} ]
},
"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
03:40:08.364 Resolved diagnosticReportId: 105794577
52
Given path 'DiagnosticReport', diagnosticReportId
0
53
When method GET
4986
03:40:08.365 request:
2 > GET https://hapi.fhir.org/baseR4/DiagnosticReport/105794577
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:13.350 response time in milliseconds: 4984
2 < 200
2 < Server: nginx/1.24.0 (Ubuntu)
2 < Date: Thu, 16 Apr 2026 03:40:13 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: Zn3Qx1o4l9lVGT32
2 < Content-Location: https://hapi.fhir.org/baseR4/DiagnosticReport/105794577/_history/1
2 < Last-Modified: Tue, 10 Feb 2026 17:48:00 GMT
{
"resourceType": "DiagnosticReport",
"id": "105794577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-10T17:48:00.710+00:00",
"source": "#vMoo74UPJEYPGacY"
},
"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 January 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.2 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>92 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>178 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>245 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-01-20T08:00:00Z",
"issued": "2025-01-20T09:00:00Z",
"result": [ {
"reference": "Observation/105794573"
}, {
"reference": "Observation/105794574"
}, {
"reference": "Observation/105794575"
}, {
"reference": "Observation/105794576"
} ]
}
54
Then status 200
0
55
And match response.subject == '#present'
0
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)
0
03:40:13.352 subject reference: Patient/testmartin
Scenario: [5:60]
TC-DXR-005 | REQ-DXR-005 | REQ-OO-001 non-existent ID returns 404 and OperationOutcome
ms: 10008
>>
Background:
12
* url baseUrl
0
03:40:04.360 baseUrl: https://hapi.fhir.org/baseR4
03:40:04.360 fhirVersion: 4.0.1
13
Given path 'DiagnosticReport'
0
14
And params ({ 'subject:missing': 'false', '_count': '1' })
0
15
When method GET
5001
03:40:04.362 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
03:40:09.362 response time in milliseconds: 4999
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:40:09 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: sIbT7eiRfaKBWYUv
1 < Last-Modified: Thu, 16 Apr 2026 03:40:05 GMT
{
"resourceType": "Bundle",
"id": "a53631f7-85c1-49c8-8dbe-363a69e2969c",
"meta": {
"lastUpdated": "2026-04-16T03:40:05.318+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=a53631f7-85c1-49c8-8dbe-363a69e2969c&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset"
} ],
"entry": [ {
"fullUrl": "https://hapi.fhir.org/baseR4/DiagnosticReport/105794577",
"resource": {
"resourceType": "DiagnosticReport",
"id": "105794577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-10T17:48:00.710+00:00",
"source": "#vMoo74UPJEYPGacY"
},
"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 January 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.2 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>92 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>178 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>245 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-01-20T08:00:00Z",
"issued": "2025-01-20T09:00:00Z",
"result": [ {
"reference": "Observation/105794573"
}, {
"reference": "Observation/105794574"
}, {
"reference": "Observation/105794575"
}, {
"reference": "Observation/105794576"
} ]
},
"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
03:40:09.363 Resolved diagnosticReportId: 105794577
61
Given path 'DiagnosticReport', 'INVALID-ID-99999'
0
62
When method GET
5002
03:40:09.364 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
03:40:14.366 response time in milliseconds: 5001
2 < 404
2 < Server: nginx/1.24.0 (Ubuntu)
2 < Date: Thu, 16 Apr 2026 03:40:14 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: fzqzqpZeHkHQf9Zy
{
"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)
0
03:40:14.368 404 severity: error
67
* karate.log('404 code: ' + response.issue[0].code)
0
03:40:14.368 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
03:40:10.358 baseUrl: https://hapi.fhir.org/baseR4
03:40:10.358 fhirVersion: 4.0.1
13
Given path 'DiagnosticReport'
0
14
And params ({ 'subject:missing': 'false', '_count': '1' })
0
15
When method GET
5003
03:40:10.360 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
03:40:15.361 response time in milliseconds: 5001
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:40:15 GMT
1 < Content-Type: application/fhir+json;charset=utf-8
1 < Transfer-Encoding: chunked
1 < Connection: keep-alive
1 < X-Cache: HIT from https://hapi.fhir.org/baseR4
1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4)
1 < X-Request-ID: 5Ne2UW3YdrpsN5wc
1 < Last-Modified: Thu, 16 Apr 2026 03:40:05 GMT
{
"resourceType": "Bundle",
"id": "a53631f7-85c1-49c8-8dbe-363a69e2969c",
"meta": {
"lastUpdated": "2026-04-16T03:40:05.318+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=a53631f7-85c1-49c8-8dbe-363a69e2969c&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset"
} ],
"entry": [ {
"fullUrl": "https://hapi.fhir.org/baseR4/DiagnosticReport/105794577",
"resource": {
"resourceType": "DiagnosticReport",
"id": "105794577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-10T17:48:00.710+00:00",
"source": "#vMoo74UPJEYPGacY"
},
"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 January 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.2 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>92 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>178 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>245 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-01-20T08:00:00Z",
"issued": "2025-01-20T09:00:00Z",
"result": [ {
"reference": "Observation/105794573"
}, {
"reference": "Observation/105794574"
}, {
"reference": "Observation/105794575"
}, {
"reference": "Observation/105794576"
} ]
},
"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
03:40:15.363 Resolved diagnosticReportId: 105794577
# 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
03:40:11.353 baseUrl: https://hapi.fhir.org/baseR4
03:40:11.353 fhirVersion: 4.0.1
13
Given path 'DiagnosticReport'
0
14
And params ({ 'subject:missing': 'false', '_count': '1' })
0
15
When method GET
5012
03:40:11.354 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
03:40:16.364 response time in milliseconds: 5010
1 < 200
1 < Server: nginx/1.24.0 (Ubuntu)
1 < Date: Thu, 16 Apr 2026 03:40:16 GMT
1 < Content-Type: application/fhir+json;charset=utf-8
1 < Transfer-Encoding: chunked
1 < Connection: keep-alive
1 < X-Cache: HIT from https://hapi.fhir.org/baseR4
1 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4)
1 < X-Request-ID: AzgtwOo3uQjWcBzA
1 < Last-Modified: Thu, 16 Apr 2026 03:40:05 GMT
{
"resourceType": "Bundle",
"id": "a53631f7-85c1-49c8-8dbe-363a69e2969c",
"meta": {
"lastUpdated": "2026-04-16T03:40:05.318+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=a53631f7-85c1-49c8-8dbe-363a69e2969c&_getpagesoffset=1&_count=1&_pretty=true&_bundletype=searchset"
} ],
"entry": [ {
"fullUrl": "https://hapi.fhir.org/baseR4/DiagnosticReport/105794577",
"resource": {
"resourceType": "DiagnosticReport",
"id": "105794577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-10T17:48:00.710+00:00",
"source": "#vMoo74UPJEYPGacY"
},
"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 January 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.2 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>92 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>178 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>245 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-01-20T08:00:00Z",
"issued": "2025-01-20T09:00:00Z",
"result": [ {
"reference": "Observation/105794573"
}, {
"reference": "Observation/105794574"
}, {
"reference": "Observation/105794575"
}, {
"reference": "Observation/105794576"
} ]
},
"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
03:40:16.365 Resolved diagnosticReportId: 105794577
75
Given path 'DiagnosticReport', diagnosticReportId
0
76
When method GET
4984
03:40:16.366 request:
2 > GET https://hapi.fhir.org/baseR4/DiagnosticReport/105794577
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:21.349 response time in milliseconds: 4982
2 < 200
2 < Server: nginx/1.24.0 (Ubuntu)
2 < Date: Thu, 16 Apr 2026 03:40:21 GMT
2 < Content-Type: application/fhir+json;charset=utf-8
2 < Transfer-Encoding: chunked
2 < Connection: keep-alive
2 < X-Powered-By: HAPI FHIR 8.9.4-SNAPSHOT/eee190b153/2026-02-26 REST Server (FHIR Server; FHIR 4.0.1/R4)
2 < ETag: W/"1"
2 < X-Request-ID: S2NGrLKAJuPh4iR9
2 < Content-Location: https://hapi.fhir.org/baseR4/DiagnosticReport/105794577/_history/1
2 < Last-Modified: Tue, 10 Feb 2026 17:48:00 GMT
{
"resourceType": "DiagnosticReport",
"id": "105794577",
"meta": {
"versionId": "1",
"lastUpdated": "2026-02-10T17:48:00.710+00:00",
"source": "#vMoo74UPJEYPGacY"
},
"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 January 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.2 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>92 mg/dL </td><td/><td> 70 mg/dL - 110 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowOdd\"><td> Colesterol total </td><td>178 mg/dL </td><td/><td> - 200 mg/dL </td><td>FINAL</td></tr><tr class=\"hapiTableOfValuesRowEven\"><td> Plaquetas </td><td>245 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-01-20T08:00:00Z",
"issued": "2025-01-20T09:00:00Z",
"result": [ {
"reference": "Observation/105794573"
}, {
"reference": "Observation/105794574"
}, {
"reference": "Observation/105794575"
}, {
"reference": "Observation/105794576"
} ]
}
77
Then status 200
0
78
And match response.meta.versionId == '#present'
0
79
* karate.log('meta.versionId: ' + response.meta.versionId)
0
03:40:21.350 meta.versionId: 1