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

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" with content type "xml"

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

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 13 Total Duration 13s
Total Number of Test Cases 21 Fastest Test 212ms
Number of Manual Test Cases 0 Slowest Test 1s
Tests Started März 23, 2026 09:38:17 Average Execution Time 624ms
Tests Finished März 23, 2026 09:38:30 Total Execution Time 13s

Automated Tests

feature Scenario Context Steps Started Total Duration Result
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Precondition 2 09:38:17 417ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Read and Validation of the CapabilityStatement 2 09:38:17 976ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Validation of the search parameter definitions in the CapabilityStatement
9 passing test cases
1 09:38:18 1s 963ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Search for the DocumentReference metadata by ID 2 09:38:20 764ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Search for the DocumentReference by Count 2 09:38:21 885ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Search for DocumentReference that belong to a Patient 3 09:38:22 1s 067ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Search for the DocumentReference that belong to a Patient, by Document Tag 3 UNDEFINED
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Search for the DocumentReference that belong to a Patient, by Document Status 3 09:38:23 1s 287ms 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 09:38:24 925ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Search for DocumentReference that belong to a Patient, knowing their identifier 2 09:38:25 767ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Search for the DocumentReference that belong to a Patient, by Type 3 09:38:26 1s 144ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Search for the DocumentReference that belong to a Patient, by Category 3 09:38:27 885ms SUCCESS
Testing search parameters against a resource of type DocumentReference (@DocumentReference-Search) Search for the DocumentReference that belong to a Patient, by Encounter 3 09:38:28 1s 022ms 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 09:38:29 1s 056ms SUCCESS

Manual Tests

No manual tests were recorded
Serenity BDD version 4.3.2