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

TestScript: HospitalNotification_TestScript_AN_SLOR

Official URL: http://medcomfhir.dk/ig/hospitalnotificationtestscript/hospitalnotification-send-an-slor Version: 3.0.1
Active as of 2023-05-25 Responsible: MedCom Computable Name: HospitalNotificationTestScript

Copyright/Legal: MedCom 2021

Send: Cancellation End leave

Generated Narrative: TestScript

Resource TestScript "hospitalnotification-send-an-slor"

Profile: AEGIS Touchstone Testing TestScript Profile

url: http://medcomfhir.dk/ig/hospitalnotificationtestscript/hospitalnotification-send-an-slor

version: 3.0.1

name: HospitalNotificationTestScript

title: Send: Cancellation End leave - AN_SLOR

status: active

date: 2023-05-25

publisher: MedCom

contact: MedCom: mailto:fhir@medcom.dk

description: Send: Cancellation End leave

copyright: MedCom 2021

Origins

-IndexProfile
*1FHIR Client (Details: http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types code FHIR-Client = 'FHIR Client', stated as 'null')

Destinations

-IndexProfile
*1FHIR Server (Details: http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types code FHIR-Server = 'FHIR Server', stated as 'null')

fixture

id

create-STIN-01

autocreate: false

autodelete: false

resource: /FHIRSandbox/MedCom/HospitalNotification/v300/Send/Fixtures/HospitalNotification-fixture.xml

fixture

id

create-STOR-02

autocreate: false

autodelete: false

resource: /FHIRSandbox/MedCom/HospitalNotification/v300/Send/Fixtures/HospitalNotification-fixture.xml

fixture

id

create-SLOR-03

autocreate: false

autodelete: false

resource: /FHIRSandbox/MedCom/HospitalNotification/v300/Send/Fixtures/HospitalNotification-fixture.xml

fixture

id

create-AN-SLOR-04

autocreate: 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: messageHeaderid-STOR

expression: Bundle.entry[0].fullUrl

sourceId: create-message-STOR

variable

name: episodeOfCareID-STOR

expression: Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value

sourceId: create-message-STOR

variable

name: messageHeaderid-SLOR

expression: Bundle.entry[0].fullUrl

sourceId: create-message-SLOR

variable

name: episodeOfCareID-SLOR

expression: Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value

sourceId: create-message-SLOR

variable

name: messageHeaderid-AN-SLOR

expression: Bundle.entry[0].fullUrl

sourceId: create-message-AN-SLOR

variable

name: episodeOfCareID-AN-SLOR

expression: Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value

sourceId: create-message-AN-SLOR

test

id

hospitalnotification-create-STIN-01

name: Create a HospitalNotification STIN Message 01

description: Post HospitalNotification to the server.

action

Operations

-TypeResourceDescriptionDestinationEncodeRequestUrlOriginResponseIdSourceId
*Create (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code create = 'Create', stated as 'null')BundlePost a Hospitalnotification1true1create-message-STINcreate-STIN-01

action

Asserts

-DescriptionDirectionOperatorResponseCodeWarningOnly
*Confirm that the returned HTTP status is okay or created.responsein200,201false

action

Asserts

-DescriptionDirectionResourceWarningOnly
*Confirm that the client request payload contains a Bundle resource type.requestBundlefalse

action

Asserts

-DescriptionDirectionValidateProfileIdWarningOnly
*Validates the bundle against http://medcomfhir.dk/ig/hospitalnotification/ImplementationGuide/dk.fhir.ig.dk-medcom-hospitalnotificationrequesthospitalnotificationfalse

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the request resource contains the expected eventCoding.code.requestBundle.entry.resource.ofType(MessageHeader).event.as(Coding).select(code = 'hospital-notification-message').allTrue()false

action

Asserts

-DescriptionDirectionExpressionOperatorValueWarningOnly
*Confirm that the Encounter class of the request resource is IMP.requestBundle.entry.resource.ofType(Encounter).class.codeequalsIMPfalse

action

Asserts

-DescriptionDirectionExpressionOperatorValueWarningOnly
*Confirm that the Encounter status of the request resource is in-progress.requestBundle.entry.resource.ofType(Encounter).statusequalsin-progressfalse

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the request resource contains the expected activity code.requestBundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'admit-inpatient').exists()false

action

Asserts

-DescriptionDirectionExpressionOperatorValueWarningOnly
*Confirm that the report of admission flag is true.requestBundle.entry.resource.ofType(MessageHeader).extension.where(url='http://medcomfhir.dk/ig/hospitalnotification/StructureDefinition/medcom-messaging-reportOfAdmissionExtension').valueequalstruefalse

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the target reference in Provenance equals MessageHeader.idrequestBundle.entry.resource.ofType(Provenance).where(target.reference = %resource.entry[0].fullUrl).exists()false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the episodeOfCare-identifier has the structure of an UUIDrequestBundle.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

-DescriptionDirectionExpressionWarningOnly
*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.requestBundle.entry.resource.ofType(MessageHeader).extension.where(url='http://medcomfhir.dk/ig/hospitalnotification/StructureDefinition/medcom-messaging-reportOfAdmissionRecipientExtension').exists() = truefalse

test

id

hospitalnotification-create-STOR-02

name: Create a HospitalNotification STOR Message 02

description: Post HospitalNotification to the server.

action

Operations

-TypeResourceDescriptionDestinationEncodeRequestUrlOriginResponseIdSourceId
*Create (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code create = 'Create', stated as 'null')BundlePost a Hospitalnotification1true1create-message-STORcreate-STOR-02

action

Asserts

-DescriptionDirectionOperatorResponseCodeWarningOnly
*Confirm that the returned HTTP status is okay or created.responsein200,201false

action

Asserts

-DescriptionDirectionResourceWarningOnly
*Confirm that the client request payload contains a Bundle resource type.requestBundlefalse

action

Asserts

-DescriptionDirectionValidateProfileIdWarningOnly
*Validates the bundle against http://medcomfhir.dk/ig/hospitalnotification/ImplementationGuide/dk.fhir.ig.dk-medcom-hospitalnotificationrequesthospitalnotificationfalse

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the previous MessageHeader fullURL is identical to Provenance.entity.whatrequestBundle.entry.resource.ofType(Provenance).where(entity.what.reference = '${messageHeaderid-STIN}').count() = 1false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the request resource contains the expected eventCoding.code.requestBundle.entry.resource.ofType(MessageHeader).event.as(Coding).select(code = 'hospital-notification-message').allTrue()false

action

Asserts

-DescriptionDirectionExpressionOperatorValueWarningOnly
*Confirm that the role is set to revision. Not used when testing the first message in a streamrequestBundle.entry.resource.ofType(Provenance).entity.roleequalsrevisionfalse

action

Asserts

-DescriptionDirectionExpressionOperatorValueWarningOnly
*Confirm that the Encounter class of the request resource is IMP.requestBundle.entry.resource.ofType(Encounter).class.codeequalsIMPfalse

action

Asserts

-DescriptionDirectionExpressionOperatorValueWarningOnly
*Confirm that the Encounter status of the request resource is onleave.requestBundle.entry.resource.ofType(Encounter).statusequalsonleavefalse

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the request resource contains the expected activity code.requestBundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'start-leave-inpatient').exists()false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the target reference in Provenance equals MessageHeader.idrequestBundle.entry.resource.ofType(Provenance).where(target.reference = %resource.entry[0].fullUrl).exists()false

action

Asserts

-DescriptionDirectionExpressionOperatorValueWarningOnly
*Confirm that the 2 Provenance instances exists.requestBundle.entry.resource.ofType(Provenance).count()equals2false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the episodeOfCare-identifier is episodeOfCareID-STINrequestBundle.entry.resource.ofType(Encounter).where(episodeOfCare.identifier.value = '${episodeOfCareID-STIN}').count() = 1false

test

id

hospitalnotification-create-SLOR-03

name: Create a HospitalNotification SLOR Message 03

description: Post HospitalNotification to the server.

action

Operations

-TypeResourceDescriptionDestinationEncodeRequestUrlOriginResponseIdSourceId
*Create (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code create = 'Create', stated as 'null')BundlePost a Hospitalnotification1true1create-message-SLORcreate-SLOR-03

action

Asserts

-DescriptionDirectionOperatorResponseCodeWarningOnly
*Confirm that the returned HTTP status is okay or created.responsein200,201false

action

Asserts

-DescriptionDirectionResourceWarningOnly
*Confirm that the client request payload contains a Bundle resource type.requestBundlefalse

action

Asserts

-DescriptionDirectionValidateProfileIdWarningOnly
*Validates the bundle against http://medcomfhir.dk/ig/hospitalnotification/ImplementationGuide/dk.fhir.ig.dk-medcom-hospitalnotificationrequesthospitalnotificationfalse

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the previous MessageHeader fullURL is identical to Provenance.entity.whatrequestBundle.entry.resource.ofType(Provenance).where(entity.what.reference = '${messageHeaderid-STOR}').count() = 1false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the request resource contains the expected eventCoding.code.requestBundle.entry.resource.ofType(MessageHeader).event.as(Coding).select(code = 'hospital-notification-message').allTrue()false

action

Asserts

-DescriptionDirectionExpressionOperatorValueWarningOnly
*Confirm that the role is set to revision. Not used when testing the first message in a streamrequestBundle.entry.resource.ofType(Provenance).entity.roleequalsrevisionfalse

action

Asserts

-DescriptionDirectionExpressionOperatorValueWarningOnly
*Confirm that the Encounter class of the request resource is IMP.requestBundle.entry.resource.ofType(Encounter).class.codeequalsIMPfalse

action

Asserts

-DescriptionDirectionExpressionOperatorValueWarningOnly
*Confirm that the Encounter status of the request resource is in-progress.requestBundle.entry.resource.ofType(Encounter).statusequalsin-progressfalse

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the request resource contains the expected activity code.requestBundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'end-leave-inpatient').exists()false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the target reference in Provenance equals MessageHeader.idrequestBundle.entry.resource.ofType(Provenance).where(target.reference = %resource.entry[0].fullUrl).exists()false

action

Asserts

-DescriptionDirectionExpressionOperatorValueWarningOnly
*Confirm that the 3 Provenance instances exists.requestBundle.entry.resource.ofType(Provenance).count()equals3false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the episodeOfCare-identifier is episodeOfCareID-STORrequestBundle.entry.resource.ofType(Encounter).where(episodeOfCare.identifier.value = '${episodeOfCareID-STOR}').count() = 1false

test

id

hospitalnotification-create-AN-SLOR-04

name: Create a HospitalNotification AN-SLOR Message 04

description: Post HospitalNotification to the server.

action

Operations

-TypeResourceDescriptionDestinationEncodeRequestUrlOriginResponseIdSourceId
*Create (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code create = 'Create', stated as 'null')BundlePost a Hospitalnotification1true1create-message-AN-SLORcreate-AN-SLOR-04

action

Asserts

-DescriptionDirectionOperatorResponseCodeWarningOnly
*Confirm that the returned HTTP status is okay or created.responsein200,201false

action

Asserts

-DescriptionDirectionResourceWarningOnly
*Confirm that the client request payload contains a Bundle resource type.requestBundlefalse

action

Asserts

-DescriptionDirectionValidateProfileIdWarningOnly
*Validates the bundle against http://medcomfhir.dk/ig/hospitalnotification/ImplementationGuide/dk.fhir.ig.dk-medcom-hospitalnotificationrequesthospitalnotificationfalse

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the previous MessageHeader fullURL is identical to Provenance.entity.whatrequestBundle.entry.resource.ofType(Provenance).where(entity.what.reference = '${messageHeaderid-SLOR}').count() = 1false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the request resource contains the expected eventCoding.code.requestBundle.entry.resource.ofType(MessageHeader).event.as(Coding).select(code = 'hospital-notification-message').allTrue()false

action

Asserts

-DescriptionDirectionExpressionOperatorValueWarningOnly
*Confirm that the role is set to removal. Not used when testing the first message in a streamrequestBundle.entry.resource.ofType(Provenance).entity.roleequalsremovalfalse

action

Asserts

-DescriptionDirectionExpressionOperatorValueWarningOnly
*Confirm that the Encounter class of the request resource is IMP.requestBundle.entry.resource.ofType(Encounter).class.codeequalsIMPfalse

action

Asserts

-DescriptionDirectionExpressionOperatorValueWarningOnly
*Confirm that the Encounter status of the request resource is onleave.requestBundle.entry.resource.ofType(Encounter).statusequalsonleavefalse

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the request resource contains the expected activity code.requestBundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'cancel-end-leave-inpatient').exists()false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the target reference in Provenance equals MessageHeader.idrequestBundle.entry.resource.ofType(Provenance).where(target.reference = %resource.entry[0].fullUrl).exists()false

action

Asserts

-DescriptionDirectionExpressionOperatorValueWarningOnly
*Confirm that the 4 Provenance instances exists.requestBundle.entry.resource.ofType(Provenance).count()equals4false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the episodeOfCare-identifier is episodeOfCareID-SLORrequestBundle.entry.resource.ofType(Encounter).where(episodeOfCare.identifier.value = '${episodeOfCareID-SLOR}').count() = 1false