Serenity BDD Report
Home > Requirements > Stufe5 > Dokumentenaustausch > Testing search parameters against a resource of type documentreference (@documentreference-search)
Report generated 01-09-2026 06:58

Feature: Testing search parameters against a resource of type documentreference (@documentreference-search)

Scenarios

Given the Test Description: "The system under test MUST find a previously created resource when searched using the parameter and return it in the search results (SEARCH)."

Given the Preconditions: - The DocumentReference-Read test case must have been executed successfully beforehand.

When Get FHIR resource at "http://fhirserver/metadata" with content type "json"

And CapabilityStatement contains interaction "search-type" for resource "DocumentReference"

And CapabilityStatement contains definition of search parameter "{searchParamValue}" of type "{searchParamType}" for resource "DocumentReference"

Examples:

searchParamValuesearchParamType
_idtoken
_countnumber
patientreference
statustoken
identifiertoken
typetoken
categorytoken
creationdate
encounterreference

Examples:

searchParamValuesearchParamType
_tagtoken

When Get FHIR resource at "http://fhirserver/DocumentReference/?_id=${data.documentreference-read-id}" with content type "xml"

And response bundle contains resource with ID "${data.documentreference-read-id}" with error message "The requested DocumentReference ${data.documentreference-read-id} is not contained in the response bundle"

When Get FHIR resource at "http://fhirserver/DocumentReference/?_count=1" with content type "xml"

And FHIR current response body evaluates the FHIRPath 'entry.resource.count() } 0 and entry.resource.count() {= 1' with error message 'The _count parameter was not applied as expected'

When Get FHIR resource at "http://fhirserver/DocumentReference/?patient=Patient/${data.documentreference-read-patient-id}" with content type "xml"

And FHIR current response body evaluates the FHIRPath 'entry.resource.count() } 0' with error message 'No search results were found'

And element "subject" in all bundle resources references resource with ID "${data.documentreference-read-patient-id}"

When Get FHIR resource at "http://fhirserver/DocumentReference/?_tag=${data.tag-system}%7C${data.tag-value}&patient=Patient/${data.documentreference-read-patient-id}" with content type "xml"

And FHIR current response body evaluates the FHIRPath 'entry.resource.count() } 0' with error message 'No search results were found'

And FHIR current response body evaluates the FHIRPath "entry.resource.all(meta.tag.where(code='${data.tag-value}').exists())" with error message 'There are search results, but they do not fully match the search criteria'

When Get FHIR resource at "http://fhirserver/DocumentReference/?status=current&patient=Patient/${data.documentreference-read-patient-id}" with content type "json"

And FHIR current response body evaluates the FHIRPath 'entry.resource.count() } 0' with error message 'No search results were found'

And FHIR current response body evaluates the FHIRPath "entry.resource.all(status = 'current')" with error message 'There are search results, but they do not fully match the search criteria.'

When Get FHIR resource at "http://fhirserver/DocumentReference/?identifier=${data.documentreference-search-identifier-value}&patient=Patient/${data.documentreference-read-patient-id}" with content type "json"

And FHIR current response body evaluates the FHIRPath 'entry.resource.count() } 0' with error message 'No search results were found'

And FHIR current response body evaluates the FHIRPath "entry.resource.all(identifier.where(value = '${data.documentreference-search-identifier-value}').exists())" with error message 'There are search results, but they do not fully match the search criteria.'

Then Get FHIR resource at "http://fhirserver/DocumentReference/?patient.identifier=${data.documentreference-search-patient-identifier-system}%7C${data.documentreference-search-patient-identifier-value}&patient=Patient/${data.documentreference-read-patient-id}" with content type "json"

And FHIR current response body evaluates the FHIRPath 'entry.resource.count() } 0' with error message 'No search results were found.'

When Get FHIR resource at "http://fhirserver/DocumentReference/?type=${data.documentreference-search-type-code}&patient=Patient/${data.documentreference-read-patient-id}" with content type "json"

And FHIR current response body evaluates the FHIRPath 'entry.resource.count() } 0' with error message 'No search results were found'

And FHIR current response body evaluates the FHIRPath "entry.resource.all(type.coding.where(code = '${data.documentreference-search-type-code}').exists())" with error message 'There are search results, but they do not fully match the search criteria.'

When Get FHIR resource at "http://fhirserver/DocumentReference/?category=${data.documentreference-search-class-code}&patient=Patient/${data.documentreference-read-patient-id}" with content type "xml"

And FHIR current response body evaluates the FHIRPath 'entry.resource.count() } 0' with error message 'No search results were found'

And FHIR current response body evaluates the FHIRPath "entry.resource.all(category.coding.where(code = '${data.documentreference-search-class-code}').exists())" with error message 'There are search results, but they do not fully match the search criteria.'

When Get FHIR resource at "http://fhirserver/DocumentReference/?encounter=Encounter/${data.documentreference-read-encounter-id}&patient=Patient/${data.documentreference-read-patient-id}" with content type "json"

And FHIR current response body evaluates the FHIRPath 'entry.resource.count() } 0' with error message 'No search results were found'

And FHIR current response body evaluates the FHIRPath "entry.resource.all(context.encounter.where(reference.replaceMatches('/_history/.+','').matches('\b${data.documentreference-read-encounter-id}$')).exists())" with error message 'The requested DocumentReference ${data.documentreference-read-id} is not contained in the response bundle'

When Get FHIR resource at "http://fhirserver/DocumentReference/?creation=2026-01-31&patient=Patient/${data.documentreference-read-patient-id}" with content type "xml"

And FHIR current response body evaluates the FHIRPath 'entry.resource.count() } 0' with error message 'No search results were found'

And FHIR current response body evaluates the FHIRPath "entry.resource.all(content.attachment.where(creation.toString().contains('2026-01-31')).exists())" with error message 'There are search results, but they do not fully match the search criteria.'

Feature Coverage By Scenario

Test Outcomes

Test Performance

Key Statistics

Number of Scenarios 14 Total Duration 20s
Total Number of Test Cases 23 Fastest Test 283ms
Number of Manual Test Cases 0 Slowest Test 5s
Tests Started Sep 01, 2026 06:58:19 Average Execution Time 878ms
Tests Finished Sep 01, 2026 06:58:39 Cumulative Test Time
(sum of all individual test durations)
20s

Automated Tests

feature Scenario Context Steps Started Total Duration Result
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Precondition 2 06:58:19 424ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Read and Validation of the CapabilityStatement 2 06:58:19 4s 112ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Validation of the search parameter definitions in the CapabilityStatement
10 passing test cases
1 06:58:23 3s 153ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Search for the DocumentReference metadata by ID 2 06:58:26 5s 609ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Search for the DocumentReference by Count 2 06:58:32 540ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Search for DocumentReference that belong to a Patient 3 06:58:32 833ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Optional Search for the DocumentReference that belong to a Patient, by Tag 3 06:58:33 722ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Search for the DocumentReference that belong to a Patient, by Document Status 3 06:58:34 715ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Search for the DocumentReference that belong to a Patient, by Document Identifier 3 06:58:35 705ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Search for DocumentReference that belong to a Patient, knowing their identifier 2 06:58:35 527ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Search for the DocumentReference that belong to a Patient, by Type 3 06:58:36 756ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Search for the DocumentReference that belong to a Patient, by Category 3 06:58:37 738ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Search for the DocumentReference that belong to a Patient, by Encounter 3 06:58:38 725ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Search for the DocumentReference that belong to a Patient, by Creation Date 3 06:58:38 722ms SUCCESS

Manual Tests

No manual tests were recorded

Evidence

Scenario Title Details
Precondition RBellog 0  Download Evidence
Read and Validation of the CapabilityStatement INFO - rest.where(mode = 'server').resource.where(type = 'DocumentReference' and interaction.where(code = 'search-type').exists()).exists()  Details
Read and Validation of the CapabilityStatement RBellog 0  Download Evidence
Read and Validation of the CapabilityStatement Evidence Report  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement INFO - rest.where(mode = 'server').resource.where(type = 'DocumentReference' and searchParam.where(name = '_id' and type = 'token').exists()).exists()  Details
Validation of the search parameter definitions in the CapabilityStatement RBellog 1  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement Evidence Report  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement INFO - rest.where(mode = 'server').resource.where(type = 'DocumentReference' and searchParam.where(name = '_count' and type = 'number').exists()).exists()  Details
Validation of the search parameter definitions in the CapabilityStatement RBellog 2  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement Evidence Report  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement INFO - rest.where(mode = 'server').resource.where(type = 'DocumentReference' and searchParam.where(name = 'patient' and type = 'reference').exists()).exists()  Details
Validation of the search parameter definitions in the CapabilityStatement RBellog 3  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement Evidence Report  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement INFO - rest.where(mode = 'server').resource.where(type = 'DocumentReference' and searchParam.where(name = 'status' and type = 'token').exists()).exists()  Details
Validation of the search parameter definitions in the CapabilityStatement RBellog 4  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement Evidence Report  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement INFO - rest.where(mode = 'server').resource.where(type = 'DocumentReference' and searchParam.where(name = 'identifier' and type = 'token').exists()).exists()  Details
Validation of the search parameter definitions in the CapabilityStatement RBellog 5  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement Evidence Report  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement INFO - rest.where(mode = 'server').resource.where(type = 'DocumentReference' and searchParam.where(name = 'type' and type = 'token').exists()).exists()  Details
Validation of the search parameter definitions in the CapabilityStatement RBellog 6  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement Evidence Report  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement INFO - rest.where(mode = 'server').resource.where(type = 'DocumentReference' and searchParam.where(name = 'category' and type = 'token').exists()).exists()  Details
Validation of the search parameter definitions in the CapabilityStatement RBellog 7  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement Evidence Report  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement INFO - rest.where(mode = 'server').resource.where(type = 'DocumentReference' and searchParam.where(name = 'creation' and type = 'date').exists()).exists()  Details
Validation of the search parameter definitions in the CapabilityStatement RBellog 8  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement Evidence Report  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement INFO - rest.where(mode = 'server').resource.where(type = 'DocumentReference' and searchParam.where(name = 'encounter' and type = 'reference').exists()).exists()  Details
Validation of the search parameter definitions in the CapabilityStatement RBellog 9  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement Evidence Report  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement INFO - rest.where(mode = 'server').resource.where(type = 'DocumentReference' and searchParam.where(name = '_tag' and type = 'token').exists()).exists()  Details
Validation of the search parameter definitions in the CapabilityStatement RBellog 10  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement Evidence Report  Download Evidence
Search for the DocumentReference metadata by ID INFO - entry.resource.where(id.replaceMatches('/_history/.+','').matches('\\bDocumentReference-Read-Example$')).count() = 1  Details
Search for the DocumentReference metadata by ID RBellog 0  Download Evidence
Search for the DocumentReference metadata by ID Evidence Report  Download Evidence
Search for the DocumentReference by Count INFO - entry.resource.count() > 0 and entry.resource.count() <= 1  Details
Search for the DocumentReference by Count RBellog 0  Download Evidence
Search for the DocumentReference by Count Evidence Report  Download Evidence
Search for DocumentReference that belong to a Patient INFO - entry.resource.count() > 0  Details
Search for DocumentReference that belong to a Patient INFO - entry.resource.all(subject.reference.replaceMatches('/_history/.+','').matches('\\bPatient-Read-Example$'))  Details
Search for DocumentReference that belong to a Patient RBellog 0  Download Evidence
Search for DocumentReference that belong to a Patient Evidence Report  Download Evidence
Optional Search for the DocumentReference that belong to a Patient, by Tag INFO - entry.resource.count() > 0  Details
Optional Search for the DocumentReference that belong to a Patient, by Tag INFO - entry.resource.all(meta.tag.where(code='external').exists())  Details
Optional Search for the DocumentReference that belong to a Patient, by Tag RBellog 0  Download Evidence
Optional Search for the DocumentReference that belong to a Patient, by Tag Evidence Report  Download Evidence
Search for the DocumentReference that belong to a Patient, by Document Status INFO - entry.resource.count() > 0  Details
Search for the DocumentReference that belong to a Patient, by Document Status INFO - entry.resource.all(status = 'current')  Details
Search for the DocumentReference that belong to a Patient, by Document Status RBellog 0  Download Evidence
Search for the DocumentReference that belong to a Patient, by Document Status Evidence Report  Download Evidence
Search for the DocumentReference that belong to a Patient, by Document Identifier INFO - entry.resource.count() > 0  Details
Search for the DocumentReference that belong to a Patient, by Document Identifier INFO - entry.resource.all(identifier.where(value = '129.6.58.42.33726').exists())  Details
Search for the DocumentReference that belong to a Patient, by Document Identifier RBellog 0  Download Evidence
Search for the DocumentReference that belong to a Patient, by Document Identifier Evidence Report  Download Evidence
Search for DocumentReference that belong to a Patient, knowing their identifier INFO - entry.resource.count() > 0  Details
Search for DocumentReference that belong to a Patient, knowing their identifier RBellog 0  Download Evidence
Search for DocumentReference that belong to a Patient, knowing their identifier Evidence Report  Download Evidence
Search for the DocumentReference that belong to a Patient, by Type INFO - entry.resource.count() > 0  Details
Search for the DocumentReference that belong to a Patient, by Type INFO - entry.resource.all(type.coding.where(code = 'VL160105').exists())  Details
Search for the DocumentReference that belong to a Patient, by Type RBellog 0  Download Evidence
Search for the DocumentReference that belong to a Patient, by Type Evidence Report  Download Evidence
Search for the DocumentReference that belong to a Patient, by Category INFO - entry.resource.count() > 0  Details
Search for the DocumentReference that belong to a Patient, by Category INFO - entry.resource.all(category.coding.where(code = 'DUR').exists())  Details
Search for the DocumentReference that belong to a Patient, by Category RBellog 0  Download Evidence
Search for the DocumentReference that belong to a Patient, by Category Evidence Report  Download Evidence
Search for the DocumentReference that belong to a Patient, by Encounter INFO - entry.resource.count() > 0  Details
Search for the DocumentReference that belong to a Patient, by Encounter INFO - entry.resource.all(context.encounter.where(reference.replaceMatches('/_history/.+','').matches('\\bEncounter-Read-Finished-Example$')).exists())  Details
Search for the DocumentReference that belong to a Patient, by Encounter RBellog 0  Download Evidence
Search for the DocumentReference that belong to a Patient, by Encounter Evidence Report  Download Evidence
Search for the DocumentReference that belong to a Patient, by Creation Date INFO - entry.resource.count() > 0  Details
Search for the DocumentReference that belong to a Patient, by Creation Date INFO - entry.resource.all(content.attachment.where(creation.toString().contains('2026-01-31')).exists())  Details
Search for the DocumentReference that belong to a Patient, by Creation Date RBellog 0  Download Evidence
Search for the DocumentReference that belong to a Patient, by Creation Date Evidence Report  Download Evidence
Serenity BDD version 5.3.10