Serenity BDD Report
Home > Requirements > Stufe5 > Basis > Read information from a resource of type encounter with status "finished" (@encounter-read-finished)
Report generated 01-09-2026 07:14

Feature: Read information from a resource of type encounter with status "finished" (@encounter-read-finished)

Scenarios

Given the Test Description: "The system under test must return the complete resource in response to an HTTP GET request to its URL (READ)."

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

  • The test dataset must have been entered in the system under test according to the specifications (manually).
  • The ID of the corresponding FHIR resource for this test dataset and the assigned facility-internal admission number must be stored in the configuration variable 'encounter-read-finished-id'.

Create an Encounter resource with these fields:

  • Admission number: Any (Please, set it in the configuration variable 'encounter-read-finished-identifier-value')
  • Status: finished
  • Type: inpatient (normalstationaer)
  • Patient: the patient from the Account-Read test case
  • Class: IMP
  • Admission reason: referral by a doctor
  • Department: General Surgery
  • Admission reason (first and second level): hospital treatment, fully inpatient
  • Period: 2026-01-06 to 2026-01-08
  • Account: the billing case from the Account-Read test case
  • Account (identifier): the identifier of the linked billing case
  • Location: Room Z001
  • (Optional) Tag: Value defined through the configuration variables 'tag-value' and 'tag-system'

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

And CapabilityStatement contains interaction "read" for resource "Encounter"

When Get FHIR resource at "http://fhirserver/Encounter/${data.encounter-read-finished-id}" with content type "xml"

And FHIR current response body is a valid isik5 resource and conforms to profile "https://gematik.de/fhir/isik/StructureDefinition/ISiKKontaktGesundheitseinrichtung"

And resource has ID "${data.encounter-read-finished-id}" with error message "The returned Encounter resource has not the expected ID"

And TGR current response with attribute "$..status.value" matches "finished"

And FHIR current response body evaluates the FHIRPath "identifier.where(system = '${data.encounter-read-finished-identifier-system}' and value='${data.encounter-read-finished-identifier-value}').exists()" with error message 'The Encounter does not contain the correct admission number'

And FHIR current response body evaluates the FHIRPath "class.where(code = 'IMP' and system = 'http://terminology.hl7.org/CodeSystem/v3-ActCode').exists()" with error message 'The Encounter does not contain the correct class code'

And FHIR current response body evaluates the FHIRPath "type.coding.where(code = 'normalstationaer' and system = 'http://fhir.de/CodeSystem/kontaktart-de').exists()" with error message 'The Encounter does not contain the correct type'

And FHIR current response body evaluates the FHIRPath "serviceType.coding.where(code = '1500' and system = 'http://fhir.de/CodeSystem/dkgev/Fachabteilungsschluessel').exists()" with error message 'The Encounter does not contain the correct department code'

And element "subject" references resource with ID "${data.account-read-patient-id}" with error message "The referenced Patient does not match the expected value"

And FHIR current response body evaluates the FHIRPath "period.start.toString().contains('2026-01-06')" with error message 'The Encounter does not contain a valid start date'

And FHIR current response body evaluates the FHIRPath "period.end.toString().contains('2026-01-08')" with error message 'The Encounter does not contain a valid end date.'

And FHIR current response body evaluates the FHIRPath "hospitalization.admitSource.coding.where(code = 'E' and system = 'http://fhir.de/CodeSystem/dgkev/Aufnahmeanlass').exists()" with error message 'The Encounter does not contain the correct admission reason'

And FHIR current response body evaluates the FHIRPath "extension.where(url = 'http://fhir.de/StructureDefinition/Aufnahmegrund' and extension.where(url = 'ErsteUndZweiteStelle' and value.code = '01' and value.system = 'http://fhir.de/CodeSystem/dkgev/AufnahmegrundErsteUndZweiteStelle').exists()).exists()" with error message 'The encounter does not contain the correct admission reason'

And element "account" references resource with ID "Account/${data.account-read-id}" with error message "The linked billing case does not match the expected value"

And FHIR current response body evaluates the FHIRPath "account.identifier.value = '${data.account-read-identifier-value}'" with error message 'The identifier of the linked billing case does not match the expected value'

And FHIR current response body evaluates the FHIRPath "location.location.identifier.where(system = 'https://test.krankenhaus.de/fhir/sid/zimmerId' and value = 'Z001').exists()" with error message 'The location does not contain the correct code'

Feature Coverage By Scenario

Test Outcomes

Test Performance

Key Statistics

Number of Scenarios 3 Total Duration 13s
Total Number of Test Cases 3 Fastest Test 600ms
Number of Manual Test Cases 0 Slowest Test 8s
Tests Started Sep 01, 2026 07:14:20 Average Execution Time 4s
Tests Finished Sep 01, 2026 07:14:33 Cumulative Test Time
(sum of all individual test durations)
13s

Automated Tests

feature Scenario Context Steps Started Total Duration Result
Read Information from a resource of type Encounter with status "finished" (@Encounter-Read-Finished) Precondition 2 07:14:20 600ms SUCCESS
Read Information from a resource of type Encounter with status "finished" (@Encounter-Read-Finished) Read and Validation of the CapabilityStatement 2 07:14:20 4s 088ms SUCCESS
Read Information from a resource of type Encounter with status "finished" (@Encounter-Read-Finished) Read and Validate finished Encounter by its ID 16 07:14:25 8s 645ms 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 = 'Encounter' and interaction.where(code = 'read').exists()).exists()  Details
Read and Validation of the CapabilityStatement RBellog 0  Download Evidence
Read and Validation of the CapabilityStatement Evidence Report  Download Evidence
Read and Validate finished Encounter by its ID INFO - This element does not match any known slice defined in the profile https://gematik.de/fhir/isik/StructureDefinition/ISiKKontaktGesundheitseinrichtung|5.1.2  Details
Read and Validate finished Encounter by its ID INFO - id.replaceMatches('/_history/.+','').matches('\\bEncounter-Read-Finished-Example$')  Details
Read and Validate finished Encounter by its ID INFO - identifier.where(system = 'https://test.krankenhaus.de/fhir/sid/fallnr' and value='0123456789').exists()  Details
Read and Validate finished Encounter by its ID INFO - class.where(code = 'IMP' and system = 'http://terminology.hl7.org/CodeSystem/v3-ActCode').exists()  Details
Read and Validate finished Encounter by its ID INFO - type.coding.where(code = 'normalstationaer' and system = 'http://fhir.de/CodeSystem/kontaktart-de').exists()  Details
Read and Validate finished Encounter by its ID INFO - serviceType.coding.where(code = '1500' and system = 'http://fhir.de/CodeSystem/dkgev/Fachabteilungsschluessel').exists()  Details
Read and Validate finished Encounter by its ID INFO - subject.reference.replaceMatches('/_history/.+','').matches('\\bAccount-Read-Patient-Example$')  Details
Read and Validate finished Encounter by its ID INFO - period.start.toString().contains('2026-01-06')  Details
Read and Validate finished Encounter by its ID INFO - period.end.toString().contains('2026-01-08')  Details
Read and Validate finished Encounter by its ID INFO - hospitalization.admitSource.coding.where(code = 'E' and system = 'http://fhir.de/CodeSystem/dgkev/Aufnahmeanlass').exists()  Details
Read and Validate finished Encounter by its ID INFO - extension.where(url = 'http://fhir.de/StructureDefinition/Aufnahmegrund' and extension.where(url = 'ErsteUndZweiteStelle' and value.code = '01' and value.system = 'http://fhir.de/CodeSystem/dkgev/AufnahmegrundErsteUndZweiteStelle').exists()).exists()  Details
Read and Validate finished Encounter by its ID INFO - account.reference.replaceMatches('/_history/.+','').matches('\\bAccount/Account-Read-Example$')  Details
Read and Validate finished Encounter by its ID INFO - account.identifier.value = '0123456789'  Details
Read and Validate finished Encounter by its ID INFO - location.location.identifier.where(system = 'https://test.krankenhaus.de/fhir/sid/zimmerId' and value = 'Z001').exists()  Details
Read and Validate finished Encounter by its ID RBellog 0  Download Evidence
Read and Validate finished Encounter by its ID Evidence Report  Download Evidence
Serenity BDD version 5.3.10