HospitalNotification Testscripts
3.0.1 - ci-build
This page is part of the DK MedCom HospitalNotification TestScripts (v3.0.1: Release) based on FHIR R4. . For a full list of available versions, see the Directory of published versions
Official URL: http://medcomfhir.dk/ig/hospitalnotificationtestscript/hospitalnotification-PF-send-imp-05 | Version: 3.0.1 | |||
Active as of 2023-05-25 | Responsible: MedCom | Computable Name: HospitalNotificationTestScript | ||
Copyright/Legal: MedCom 2021 |
Send: Admit patient, correct message due to incorrect hospital department. Evaluation is based on SOR number.
Generated Narrative: TestScript
Resource TestScript "hospitalnotification-PF-send-imp-05"
url: http://medcomfhir.dk/ig/hospitalnotificationtestscript/hospitalnotification-PF-send-imp-05
version: 3.0.1
name: HospitalNotificationTestScript
title: Send: Admit patient, correct message due to incorrect hospital department. Evaluation is based on SOR number.- PF-send-imp-05
status: active
date: 2023-05-25
publisher: MedCom
contact: MedCom: mailto:fhir@medcom.dk
description: Send: Admit patient, correct message due to incorrect hospital department. Evaluation is based on SOR number.
copyright: MedCom 2021
- | Index | Profile |
* | 1 | FHIR Client (Details: http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types code FHIR-Client = 'FHIR Client', stated as 'null') |
- | Index | Profile |
* | 1 | FHIR Server (Details: http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types code FHIR-Server = 'FHIR Server', stated as 'null') |
fixture
id
create-STIN-01autocreate: false
autodelete: false
resource: /FHIRSandbox/MedCom/HospitalNotification/v300/Send/Fixtures/HospitalNotification-fixture.xml
fixture
id
create-RE-STIN-02autocreate: false
autodelete: false
resource: /FHIRSandbox/MedCom/HospitalNotification/v300/Send/Fixtures/HospitalNotification-fixture.xml
profile: http://medcomfhir.dk/ig/hospitalnotification/StructureDefinition/medcom-hospitalNotification-message "MedComHospitalNotificationMessage"
variable
name: messageHeaderid-STIN
expression: Bundle.entry[0].fullUrl
sourceId: create-message-STIN
variable
name: episodeOfCareID-STIN
expression: Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value
sourceId: create-message-STIN
variable
name: searchParamIdentifier-STIN
expression: Bundle.entry.resource.ofType(MessageHeader).id
sourceId: create-message-STIN
variable
name: occurredDateTime-STIN
expression: Bundle.entry.resource.ofType(Provenance).where(target.reference = %resource.entry[0].fullUrl).occurred
sourceId: create-message-STIN
variable
name: hospitalSOR-STIN
expression: Bundle.entry.where(fullUrl = %resource.entry.resource[0].sender.reference).resource.identifier.where(system = 'urn:oid:1.2.208.176.1.1').value
sourceId: create-message-STIN
variable
name: hospitalGLN-STIN
expression: Bundle.entry.where(fullUrl = %resource.entry.resource[0].sender.reference).resource.identifier.where(system = 'https://www.gs1.org/gln').value
sourceId: create-message-STIN
variable
name: messageHeaderid-RE-STIN
expression: Bundle.entry[0].fullUrl
sourceId: create-message-RE-STIN
variable
name: episodeOfCareID-RE-STIN
expression: Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value
sourceId: create-message-RE-STIN
test
id
hospitalnotification-create-STIN-01name: Create a HospitalNotification STIN Message 01
description: Post HospitalNotification to the server.
action
Operations
- Type Resource Description Destination EncodeRequestUrl Origin ResponseId SourceId * Create (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code create = 'Create', stated as 'null') Bundle Post a Hospitalnotification 1 true 1 create-message-STIN create-STIN-01 action
Asserts
- Description Direction Operator ResponseCode WarningOnly * Confirm that the returned HTTP status is okay or created. response in 200,201 false action
Asserts
- Description Direction Resource WarningOnly * Confirm that the client request payload contains a Bundle resource type. request Bundle false action
Asserts
- Description Direction ValidateProfileId WarningOnly * Validates the bundle against http://medcomfhir.dk/ig/hospitalnotification/ImplementationGuide/dk.fhir.ig.dk-medcom-hospitalnotification request hospitalnotification false action
Asserts
- Description Direction Expression WarningOnly * Confirm that the request resource contains the expected eventCoding.code. request Bundle.entry.resource.ofType(MessageHeader).event.as(Coding).select(code = 'hospital-notification-message').allTrue() false action
Asserts
- Description Direction Expression Operator Value WarningOnly * Confirm that the Encounter class of the request resource is IMP. request Bundle.entry.resource.ofType(Encounter).class.code equals IMP false action
Asserts
- Description Direction Expression Operator Value WarningOnly * Confirm that the Encounter status of the request resource is in-progress. request Bundle.entry.resource.ofType(Encounter).status equals in-progress false action
Asserts
- Description Direction Expression WarningOnly * Confirm that the request resource contains the expected activity code. request Bundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'admit-inpatient').exists() false action
Asserts
- Description Direction Expression Operator Value WarningOnly * Confirm that the report of admission flag is true. request Bundle.entry.resource.ofType(MessageHeader).extension.where(url='http://medcomfhir.dk/ig/hospitalnotification/StructureDefinition/medcom-messaging-reportOfAdmissionExtension').value equals true false action
Asserts
- Description Direction Expression WarningOnly * Confirm that the target reference in Provenance equals MessageHeader.id request Bundle.entry.resource.ofType(Provenance).where(target.reference = %resource.entry[0].fullUrl).exists() false action
Asserts
- Description Direction Expression WarningOnly * Confirm that the episodeOfCare-identifier has the structure of an UUID request Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value.matches('[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}') false action
Asserts
- Description Direction Expression WarningOnly * Confirm that the a receiver of the report of admission exists, when the flag is true, and doesn't exists when the flag is false. request Bundle.entry.resource.ofType(MessageHeader).extension.where(url='http://medcomfhir.dk/ig/hospitalnotification/StructureDefinition/medcom-messaging-reportOfAdmissionRecipientExtension').exists() = true false
test
id
hospitalnotification-create-RE-STIN-02name: Create a HospitalNotification RE-STIN Message 02
description: Post HospitalNotification to the server.
action
Operations
- Type Resource Description Destination EncodeRequestUrl Origin ResponseId SourceId * Create (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code create = 'Create', stated as 'null') Bundle Post a Hospitalnotification 1 true 1 create-message-RE-STIN create-RE-STIN-02 action
Asserts
- Description Direction Operator ResponseCode WarningOnly * Confirm that the returned HTTP status is okay or created. response in 200,201 false action
Asserts
- Description Direction Resource WarningOnly * Confirm that the client request payload contains a Bundle resource type. request Bundle false action
Asserts
- Description Direction ValidateProfileId WarningOnly * Validates the bundle against http://medcomfhir.dk/ig/hospitalnotification/ImplementationGuide/dk.fhir.ig.dk-medcom-hospitalnotification request hospitalnotification false action
Asserts
- Description Direction Expression WarningOnly * Confirm that the previous MessageHeader fullURL is identical to Provenance.entity.what request Bundle.entry.resource.ofType(Provenance).where(entity.what.reference = '${messageHeaderid-STIN}').count() = 1 false action
Asserts
- Description Direction Expression WarningOnly * Confirm that the request resource contains the expected eventCoding.code. request Bundle.entry.resource.ofType(MessageHeader).event.as(Coding).select(code = 'hospital-notification-message').allTrue() false action
Asserts
- Description Direction Expression Operator Value WarningOnly * Confirm that the role is set to revision. Not used when testing the first message in a stream request Bundle.entry.resource.ofType(Provenance).entity.role equals revision false action
Asserts
- Description Direction Expression Operator Value WarningOnly * Confirm that the Encounter class of the request resource is IMP. request Bundle.entry.resource.ofType(Encounter).class.code equals IMP false action
Asserts
- Description Direction Expression Operator Value WarningOnly * Confirm that the Encounter status of the request resource is in-progress. request Bundle.entry.resource.ofType(Encounter).status equals in-progress false action
Asserts
- Description Direction Expression WarningOnly * Confirm that the request resource contains the expected activity code. request Bundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'revise-admit-inpatient').exists() false action
Asserts
- Description Direction Expression WarningOnly * Confirm that the target reference in Provenance equals MessageHeader.id request Bundle.entry.resource.ofType(Provenance).where(target.reference = %resource.entry[0].fullUrl).exists() false action
Asserts
- Description Direction Expression Operator Value WarningOnly * Confirm that the 2 Provenance instances exists. request Bundle.entry.resource.ofType(Provenance).count() equals 2 false action
Asserts
- Description Direction Expression WarningOnly * Confirm that the episodeOfCare-identifier is episodeOfCareID-STIN request Bundle.entry.resource.ofType(Encounter).where(episodeOfCare.identifier.value = '${episodeOfCareID-STIN}').count() = 1 false action
Asserts
- Description Direction Expression WarningOnly * Confirm that the sender SOR number is different from the previous message. request Bundle.entry.where(fullUrl = %resource.entry.resource[0].sender.reference).resource.identifier.where(system = 'urn:oid:1.2.208.176.1.1').value != ${hospitalSOR-STIN} false action
Asserts
- Description Direction Expression WarningOnly * Confirm that the sender SOR number is different from the previous message. request Bundle.entry.where(fullUrl = %resource.entry.resource[0].sender.reference).resource.identifier.where(system = 'https://www.gs1.org/gln').value != ${hospitalGLN-STIN} true