Serenity BDD Report
Home > Requirements > Stufe5 > Terminplanung > Testing search parameters against the appointment resource (@appointment-search)
Report generated 23-03-2026 09:41

Feature: Testing search parameters against the appointment resource (@appointment-search)

Scenarios

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

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

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

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

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

Examples:

searchParamValuesearchParamType
_idtoken
_tagtoken
_countnumber
statustoken
service-typetoken
specialtytoken
datedate
slotreference
actorreference

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

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

And Check if current response of resource "Appointment" is valid isik5 resource and conforms to profile "https://gematik.de/fhir/isik/StructureDefinition/ISiKTermin"

When Get FHIR resource at "http://fhirserver/Appointment/?_tag=${data.tag-system}%7C${data.tag-value}" 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/Appointment/?_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'

Then Get FHIR resource at "http://fhirserver/Appointment/?status=cancelled" with content type "json"

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

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

Then Get FHIR resource at "http://fhirserver/Appointment/?service-type=${data.schedule-read-servicetype-code}" with content type "json"

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

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

Then Get FHIR resource at "http://fhirserver/Appointment/?specialty=http://ihe-d.de/CodeSystems/AerztlicheFachrichtungen%7CNEUR" with content type "json"

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

And FHIR current response body evaluates the FHIRPath "entry.resource.ofType(Appointment).all(specialty.coding.where(code = 'NEUR' and system ='http://ihe-d.de/CodeSystems/AerztlicheFachrichtungen').exists())" with error message 'There are search results, but they do not fully match the search criteria.'

Then Get FHIR resource at "http://fhirserver/Appointment/?date=${data.slot-read-start}" with content type "xml"

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

And FHIR current response body evaluates the FHIRPath "entry.resource.ofType(Appointment).all(start.toString().contains('${data.slot-read-start}') or start ~ @${data.slot-read-start})" with error message 'There are search results, but they do not fully match the search criteria.'

Then Get FHIR resource at "http://fhirserver/Appointment/?slot=${data.slot-read-id}" with content type "xml"

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

And FHIR current response body evaluates the FHIRPath "entry.resource.ofType(Appointment).all(slot.where(reference.replaceMatches('/_history/.+','').matches('\b${data.slot-read-id}$')).exists())" with error message 'There are search results, but they do not fully match the search criteria.'

Then Get FHIR resource at "http://fhirserver/Appointment/?actor=Patient/${data.appointment-patient-id}" with content type "json"

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

And FHIR current response body evaluates the FHIRPath "entry.resource.ofType(Appointment).all(participant.where(actor.where(reference.replaceMatches('/_history/.+','').matches('\b${data.appointment-patient-id}$') and display.exists()).exists()).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 11 Total Duration 11s
Total Number of Test Cases 19 Fastest Test 214ms
Number of Manual Test Cases 0 Slowest Test 1s
Tests Started März 23, 2026 09:41:45 Average Execution Time 586ms
Tests Finished März 23, 2026 09:41:56 Total Execution Time 11s

Automated Tests

feature Scenario Context Steps Started Total Duration Result
Testing search parameters against the Appointment resource (@Appointment-Search) Precondition 2 09:41:45 428ms SUCCESS
Testing search parameters against the Appointment resource (@Appointment-Search) Read and Validation of the CapabilityStatement 2 09:41:46 793ms SUCCESS
Testing search parameters against the Appointment resource (@Appointment-Search) Validation of the search parameter definitions in the CapabilityStatement
9 passing test cases
1 09:41:46 2s 142ms SUCCESS
Testing search parameters against the Appointment resource (@Appointment-Search) Search for the Appointment by ID 3 09:41:49 910ms SUCCESS
Testing search parameters against the Appointment resource (@Appointment-Search) Search for the Appointment by Tag 3 UNDEFINED
Testing search parameters against the Appointment resource (@Appointment-Search) Search for the Appointment by Count 2 09:41:50 794ms SUCCESS
Testing search parameters against the Appointment resource (@Appointment-Search) Search for the Appointment by Status 3 09:41:50 976ms SUCCESS
Testing search parameters against the Appointment resource (@Appointment-Search) Search for the Appointment by Service Type 3 09:41:51 1s 169ms SUCCESS
Testing search parameters against the Appointment resource (@Appointment-Search) Search for the Appointment by Specialty 3 09:41:52 936ms SUCCESS
Testing search parameters against the Appointment resource (@Appointment-Search) Search for the Appointment by Date 3 09:41:53 976ms SUCCESS
Testing search parameters against the Appointment resource (@Appointment-Search) Search for the Appointment by Slot 3 09:41:54 1s 132ms SUCCESS
Testing search parameters against the Appointment resource (@Appointment-Search) Search for the Appointment by Actor 3 09:41:56 927ms SUCCESS

Manual Tests

No manual tests were recorded
Serenity BDD version 4.3.2