Serenity BDD Report
Home > Requirements > Stufe5 > Medikation > Testing search parameters against observation resources for status-related observations (@observation-statuses-search)
Report generated 01-09-2026 07:10

Feature: Testing search parameters against observation resources for status-related observations (@observation-statuses-search)

Scenarios

Given the Test Description: "The system under test MUST find previously created Observation resources when searched using the supported parameters and return them in the search results (SEARCH)."

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

  • The Observation-Breastfeeding-Read test case must have been executed successfully beforehand.
  • The Observation-Pregnancy-Status-Read test case must have been executed successfully beforehand.
  • The Observation-Expected-Pregnancy-Delivery-Date-Read test case must have been executed successfully beforehand.
  • The Observation-Smoking-Status-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 "Observation"

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

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

Examples:

searchParamValuesearchParamType
_idtoken
_countnumber
statustoken
categorytoken
codetoken
patientreference
datedate
combo-codetoken
combo-code-value-quantitycomposite
component-codetoken
encounterreference

Examples:

searchParamValuesearchParamType
_hasstring
_tagtoken
subjectreference

When Get FHIR resource at "http://fhirserver/Observation/?_id={observationId}" with content type "xml"

And FHIR current response body is a valid CORE resource and conforms to profile "https://hl7.org/fhir/StructureDefinition/Bundle"

And response bundle contains resource with ID "{observationId}" with error message "The requested Observation {observationId} is not contained in the response bundle"

Examples:

observationId
${data.medication-observation-alcohol-abuse-read-id}
${data.medication-observation-breastfeeding-read-id}
${data.medication-observation-pregnancy-status-read-id}
${data.medication-observation-expected-pregnancy-delivery-date-read-id}
${data.medication-observation-smoking-status-read-id}

When Get FHIR resource at "http://fhirserver/Observation/?status=http://hl7.org/fhir/observation-status%7Cfinal&encounter=Encounter/${data.encounter-read-in-progress-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(status = 'final')" with error message 'There are search results, but they do not fully match the status search criteria'

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

When Get FHIR resource at "http://fhirserver/Observation/?code=http://loinc.org%7C{loincCode}&encounter=Encounter/${data.encounter-read-in-progress-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(code.coding.where(code = '{loincCode}' and system = 'http://loinc.org').exists())" with error message 'There are search results, but they do not fully match the code search criteria'

And response bundle contains resource with ID "{observationId}" with error message "The requested Observation {observationId} is not contained in the response bundle"

Examples:

loincCodeobservationId
74043-1${data.medication-observation-alcohol-abuse-read-id}
63895-7${data.medication-observation-breastfeeding-read-id}
82810-3${data.medication-observation-pregnancy-status-read-id}
11779-6${data.medication-observation-expected-pregnancy-delivery-date-read-id}
72166-2${data.medication-observation-smoking-status-read-id}

When Get FHIR resource at "http://fhirserver/Observation/?patient=Patient/${data.patient-read-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 "Patient/${data.patient-read-id}"

When Get FHIR resource at "http://fhirserver/Observation/?date=2026-01-06&encounter=Encounter/${data.encounter-read-in-progress-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(effective.toString().contains('2026-01-06'))" with error message 'There are search results, but they do not fully match the date search criteria'

When Get FHIR resource at "http://fhirserver/Observation/?encounter=Encounter/${data.encounter-read-in-progress-id}&patient=Patient/${data.patient-read-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 "Patient/${data.patient-read-id}"

When Post FHIR search request to "http://fhirserver/Observation/_search" with content type "xml" and parameters:

_tag_count
${data.tag-system}${data.tag-value}

And FHIR current response body evaluates the FHIRPath 'entry.resource.count() } 0 and entry.resource.count() {= ${data.search-count}' with error message 'Invalid 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/Observation/?subject=Patient/${data.patient-read-extended-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 "Patient/${data.patient-read-extended-id}"

Feature Coverage By Scenario

Test Outcomes

Test Performance

Key Statistics

Number of Scenarios 11 Total Duration 1m 35s
Total Number of Test Cases 32 Fastest Test 442ms
Number of Manual Test Cases 0 Slowest Test 8s
Tests Started Sep 01, 2026 07:10:27 Average Execution Time 2s
Tests Finished Sep 01, 2026 07:12:02 Cumulative Test Time
(sum of all individual test durations)
1m 35s

Automated Tests

feature Scenario Context Steps Started Total Duration Result
Testing search parameters against Observation resources for status-related observations (@Observation-Statuses-Search) Precondition 2 07:10:27 442ms SUCCESS
Testing search parameters against Observation resources for status-related observations (@Observation-Statuses-Search) Read and Validation of the CapabilityStatement 2 07:10:27 2s 771ms SUCCESS
Testing search parameters against Observation resources for status-related observations (@Observation-Statuses-Search) Validation of the search parameter definitions in the CapabilityStatement
14 passing test cases
2 07:10:30 1m 13s SUCCESS
Testing search parameters against Observation resources for status-related observations (@Observation-Statuses-Search) Search for Observation resources by ID
5 passing test cases
3 07:11:43 3s 784ms SUCCESS
Testing search parameters against Observation resources for status-related observations (@Observation-Statuses-Search) Search for Observation resources by Status "final" and Encounter 4 07:11:47 1s 418ms SUCCESS
Testing search parameters against Observation resources for status-related observations (@Observation-Statuses-Search) Search for Observation resources by Code and Encounter
5 passing test cases
4 07:11:48 9s 815ms SUCCESS
Testing search parameters against Observation resources for status-related observations (@Observation-Statuses-Search) Search for Observation resources by Patient (search parameter 'patient') 3 07:11:58 807ms SUCCESS
Testing search parameters against Observation resources for status-related observations (@Observation-Statuses-Search) Search for Observation resources by Date and Encounter 3 07:11:59 797ms SUCCESS
Testing search parameters against Observation resources for status-related observations (@Observation-Statuses-Search) Search for Observation resources by Encounter and Patient 3 07:12:00 885ms SUCCESS
Testing search parameters against Observation resources for status-related observations (@Observation-Statuses-Search) Optional Search for Observation resources that have the given Tag, group by _count 3 07:12:01 1s 021ms SUCCESS
Testing search parameters against Observation resources for status-related observations (@Observation-Statuses-Search) Optional Search for Observation resources by Subject (search parameter 'subject') 3 07:12:02 802ms 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 = 'Observation' 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 = 'Observation' 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 = 'Observation' 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 = 'Observation' and searchParam.where(name = 'status' and type = 'token').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 = 'Observation' and searchParam.where(name = 'category' 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 = 'Observation' and searchParam.where(name = 'code' 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 = 'Observation' and searchParam.where(name = 'patient' and type = 'reference').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 = 'Observation' and searchParam.where(name = 'date' and type = 'date').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 = 'Observation' and searchParam.where(name = 'combo-code' and type = 'token').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 = 'Observation' and searchParam.where(name = 'combo-code-value-quantity' and type = 'composite').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 = 'Observation' and searchParam.where(name = 'component-code' 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
Validation of the search parameter definitions in the CapabilityStatement INFO - rest.where(mode = 'server').resource.where(type = 'Observation' and searchParam.where(name = 'encounter' and type = 'reference').exists()).exists()  Details
Validation of the search parameter definitions in the CapabilityStatement RBellog 11  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 = 'Observation' and searchParam.where(name = '_has' and type = 'string').exists()).exists()  Details
Validation of the search parameter definitions in the CapabilityStatement RBellog 12  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 = 'Observation' and searchParam.where(name = '_tag' and type = 'token').exists()).exists()  Details
Validation of the search parameter definitions in the CapabilityStatement RBellog 13  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 = 'Observation' and searchParam.where(name = 'subject' and type = 'reference').exists()).exists()  Details
Validation of the search parameter definitions in the CapabilityStatement RBellog 14  Download Evidence
Validation of the search parameter definitions in the CapabilityStatement Evidence Report  Download Evidence
Search for Observation resources by ID WARN - Profile reference 'https://gematik.de/fhir/isik/StructureDefinition/ISiKAlkoholAbusus' has not been checked because it is unknown  Details
Search for Observation resources by ID WARN - Resource meta.profile differs from the passed profile for validation: meta.profile=[]; passed=https://hl7.org/fhir/StructureDefinition/Bundle  Details
Search for Observation resources by ID INFO - entry.resource.where(id.replaceMatches('/_history/.+','').matches('\\bAlcohol-Abuse-Read-Example$')).count() = 1  Details
Search for Observation resources by ID RBellog 1  Download Evidence
Search for Observation resources by ID Evidence Report  Download Evidence
Search for Observation resources by ID WARN - Profile reference 'https://gematik.de/fhir/isik/StructureDefinition/ISiKStillstatus' has not been checked because it is unknown  Details
Search for Observation resources by ID WARN - Resource meta.profile differs from the passed profile for validation: meta.profile=[]; passed=https://hl7.org/fhir/StructureDefinition/Bundle  Details
Search for Observation resources by ID INFO - entry.resource.where(id.replaceMatches('/_history/.+','').matches('\\bBreastfeeding-Read-Example$')).count() = 1  Details
Search for Observation resources by ID RBellog 2  Download Evidence
Search for Observation resources by ID Evidence Report  Download Evidence
Search for Observation resources by ID WARN - Profile reference 'https://gematik.de/fhir/isik/StructureDefinition/ISiKSchwangerschaftsstatus' has not been checked because it is unknown  Details
Search for Observation resources by ID WARN - Resource meta.profile differs from the passed profile for validation: meta.profile=[]; passed=https://hl7.org/fhir/StructureDefinition/Bundle  Details
Search for Observation resources by ID INFO - entry.resource.where(id.replaceMatches('/_history/.+','').matches('\\bPregnancy-Status-Read-Example$')).count() = 1  Details
Search for Observation resources by ID RBellog 3  Download Evidence
Search for Observation resources by ID Evidence Report  Download Evidence
Search for Observation resources by ID WARN - Profile reference 'https://gematik.de/fhir/isik/StructureDefinition/ISiKSchwangerschaftErwarteterEntbindungstermin' has not been checked because it is unknown  Details
Search for Observation resources by ID WARN - Resource meta.profile differs from the passed profile for validation: meta.profile=[]; passed=https://hl7.org/fhir/StructureDefinition/Bundle  Details
Search for Observation resources by ID INFO - entry.resource.where(id.replaceMatches('/_history/.+','').matches('\\bExpected-Pregnancy-Delivery-Date-Read-Example$')).count() = 1  Details
Search for Observation resources by ID RBellog 4  Download Evidence
Search for Observation resources by ID Evidence Report  Download Evidence
Search for Observation resources by ID WARN - Profile reference 'https://gematik.de/fhir/isik/StructureDefinition/ISiKRaucherStatus' has not been checked because it is unknown  Details
Search for Observation resources by ID WARN - Resource meta.profile differs from the passed profile for validation: meta.profile=[]; passed=https://hl7.org/fhir/StructureDefinition/Bundle  Details
Search for Observation resources by ID INFO - entry.resource.where(id.replaceMatches('/_history/.+','').matches('\\bSmoking-Status-Read-Example$')).count() = 1  Details
Search for Observation resources by ID RBellog 5  Download Evidence
Search for Observation resources by ID Evidence Report  Download Evidence
Search for Observation resources by Status "final" and Encounter INFO - entry.resource.count() > 0  Details
Search for Observation resources by Status "final" and Encounter INFO - entry.resource.all(status = 'final')  Details
Search for Observation resources by Status "final" and Encounter INFO - entry.resource.all(encounter.reference.replaceMatches("/_history/.+","").matches("\\bEncounter-Read-In-Progress-Example$"))  Details
Search for Observation resources by Status "final" and Encounter RBellog 0  Download Evidence
Search for Observation resources by Status "final" and Encounter Evidence Report  Download Evidence
Search for Observation resources by Code and Encounter INFO - entry.resource.count() > 0  Details
Search for Observation resources by Code and Encounter INFO - entry.resource.all(code.coding.where(code = '74043-1' and system = 'http://loinc.org').exists())  Details
Search for Observation resources by Code and Encounter INFO - entry.resource.where(id.replaceMatches('/_history/.+','').matches('\\bAlcohol-Abuse-Read-Example$')).count() = 1  Details
Search for Observation resources by Code and Encounter RBellog 1  Download Evidence
Search for Observation resources by Code and Encounter Evidence Report  Download Evidence
Search for Observation resources by Code and Encounter INFO - entry.resource.count() > 0  Details
Search for Observation resources by Code and Encounter INFO - entry.resource.all(code.coding.where(code = '63895-7' and system = 'http://loinc.org').exists())  Details
Search for Observation resources by Code and Encounter INFO - entry.resource.where(id.replaceMatches('/_history/.+','').matches('\\bBreastfeeding-Read-Example$')).count() = 1  Details
Search for Observation resources by Code and Encounter RBellog 2  Download Evidence
Search for Observation resources by Code and Encounter Evidence Report  Download Evidence
Search for Observation resources by Code and Encounter INFO - entry.resource.count() > 0  Details
Search for Observation resources by Code and Encounter INFO - entry.resource.all(code.coding.where(code = '82810-3' and system = 'http://loinc.org').exists())  Details
Search for Observation resources by Code and Encounter INFO - entry.resource.where(id.replaceMatches('/_history/.+','').matches('\\bPregnancy-Status-Read-Example$')).count() = 1  Details
Search for Observation resources by Code and Encounter RBellog 3  Download Evidence
Search for Observation resources by Code and Encounter Evidence Report  Download Evidence
Search for Observation resources by Code and Encounter INFO - entry.resource.count() > 0  Details
Search for Observation resources by Code and Encounter INFO - entry.resource.all(code.coding.where(code = '11779-6' and system = 'http://loinc.org').exists())  Details
Search for Observation resources by Code and Encounter INFO - entry.resource.where(id.replaceMatches('/_history/.+','').matches('\\bExpected-Pregnancy-Delivery-Date-Read-Example$')).count() = 1  Details
Search for Observation resources by Code and Encounter RBellog 4  Download Evidence
Search for Observation resources by Code and Encounter Evidence Report  Download Evidence
Search for Observation resources by Code and Encounter INFO - entry.resource.count() > 0  Details
Search for Observation resources by Code and Encounter INFO - entry.resource.all(code.coding.where(code = '72166-2' and system = 'http://loinc.org').exists())  Details
Search for Observation resources by Code and Encounter INFO - entry.resource.where(id.replaceMatches('/_history/.+','').matches('\\bSmoking-Status-Read-Example$')).count() = 1  Details
Search for Observation resources by Code and Encounter RBellog 5  Download Evidence
Search for Observation resources by Code and Encounter Evidence Report  Download Evidence
Search for Observation resources by Patient (search parameter 'patient') INFO - entry.resource.count() > 0  Details
Search for Observation resources by Patient (search parameter 'patient') INFO - entry.resource.all(subject.reference.replaceMatches('/_history/.+','').matches('\\bPatient/Patient-Read-Example$'))  Details
Search for Observation resources by Patient (search parameter 'patient') RBellog 0  Download Evidence
Search for Observation resources by Patient (search parameter 'patient') Evidence Report  Download Evidence
Search for Observation resources by Date and Encounter INFO - entry.resource.count() > 0  Details
Search for Observation resources by Date and Encounter INFO - entry.resource.all(effective.toString().contains('2026-01-06'))  Details
Search for Observation resources by Date and Encounter RBellog 0  Download Evidence
Search for Observation resources by Date and Encounter Evidence Report  Download Evidence
Search for Observation resources by Encounter and Patient INFO - entry.resource.count() > 0  Details
Search for Observation resources by Encounter and Patient INFO - entry.resource.all(subject.reference.replaceMatches('/_history/.+','').matches('\\bPatient/Patient-Read-Example$'))  Details
Search for Observation resources by Encounter and Patient RBellog 0  Download Evidence
Search for Observation resources by Encounter and Patient Evidence Report  Download Evidence
Optional Search for Observation resources that have the given Tag, group by _count INFO - entry.resource.count() > 0 and entry.resource.count() <= 20  Details
Optional Search for Observation resources that have the given Tag, group by _count INFO - entry.resource.all(meta.tag.where(code='external').exists())  Details
Optional Search for Observation resources that have the given Tag, group by _count RBellog 0  Download Evidence
Optional Search for Observation resources that have the given Tag, group by _count Evidence Report  Download Evidence
Optional Search for Observation resources by Subject (search parameter 'subject') INFO - entry.resource.count() > 0  Details
Optional Search for Observation resources by Subject (search parameter 'subject') INFO - entry.resource.all(subject.reference.replaceMatches('/_history/.+','').matches('\\bPatient/Patient-Read-Extended-Example$'))  Details
Optional Search for Observation resources by Subject (search parameter 'subject') RBellog 0  Download Evidence
Optional Search for Observation resources by Subject (search parameter 'subject') Evidence Report  Download Evidence
Serenity BDD version 5.3.10