Acknowledgement Test scripts
2.0.0 - release

This page is part of the DK MedCom Acknowledgement TestScripts (v2.0.0: Release) based on FHIR R4. . For a full list of available versions, see the Directory of published versions

TestScript: Acknowledgement_TestScript_Transient-error-duplicate-hospitalnotification

Official URL: http://medcomfhir.dk/ig/acknowledgementtestscript/acknowledgement-send-transient-error-duplicate-hospitalnotificat Version: 2.0.0
Active as of 2023-05-25 Responsible: MedCom Computable Name: AcknowledgementTestScript

Copyright/Legal: MedCom 2023

Send acknowledgements, as response to duplicate messages - Transient Error, followed by OK

Generated Narrative: TestScript

Resource TestScript "acknowledgement-send-transient-error-duplicate-hospitalnotificat"

Profile: AEGIS Touchstone Testing TestScript Profile

url: http://medcomfhir.dk/ig/acknowledgementtestscript/acknowledgement-send-transient-error-duplicate-hospitalnotificat

version: 2.0.0

name: AcknowledgementTestScript

title: Send acknowledgements, as response to duplicate messages - Transient Error, followed by OK

status: active

date: 2023-05-25

publisher: MedCom

contact: MedCom: mailto:fhir@medcom.dk

description: Send acknowledgements, as response to duplicate messages - Transient Error, followed by OK

copyright: MedCom 2023

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/Acknowledgement/draft/Send/Fixtures/HospitalNotification-fixture-STIN-transient-error.xml

fixture

id

create-STIN2-03

autocreate: false

autodelete: false

resource: /FHIRSandbox/MedCom/Acknowledgement/draft/Send/Fixtures/HospitalNotification-fixture-STIN-ok.xml

fixture

id

create-transient-error-02

autocreate: false

autodelete: false

resource: /FHIRSandbox/MedCom/Acknowledgement/draft/Send/Fixtures/Acknowledgement-fixture.xml

fixture

id

create-ok-04

autocreate: false

autodelete: false

resource: /FHIRSandbox/MedCom/Acknowledgement/draft/Send/Fixtures/Acknowledgement-fixture.xml

profile: http://medcomfhir.dk/ig/acknowledgement/StructureDefinition/medcom-messaging-acknowledgement "MedComAcknowledgementMessage"

variable

name: destinationUri-STIN

expression: Bundle.entry.resource.ofType(MessageHeader).destination.endpoint

sourceId: create-STIN-01

variable

name: bundleid-STIN-01

expression: Bundle.id

sourceId: create-STIN-01

variable

name: messageHeaderid-STIN

expression: Bundle.entry[0].fullUrl

sourceId: create-STIN-01

variable

name: destinationUri-STIN2

expression: Bundle.entry.resource.ofType(MessageHeader).destination.endpoint

sourceId: create-STIN2-03

variable

name: bundleid-STIN2-03

expression: Bundle.id

sourceId: create-STIN2-03

variable

name: messageHeaderid-STIN2

expression: Bundle.entry[0].fullUrl

sourceId: create-STIN2-03

variable

name: bundleid-transient-error-02

expression: Bundle.id

sourceId: create-message-transient-error-02

variable

name: bundletimestamp-transient-error-02

expression: Bundle.timestamp

sourceId: create-message-transient-error-02

variable

name: bundleid-ok-04

expression: Bundle.id

sourceId: create-message-ok-04

variable

name: bundletimestamp-ok-04

expression: Bundle.timestamp

sourceId: create-message-ok-04

setup

action

Operations

-TypeResourceDescriptionAcceptEncodeRequestUrlParams
*Delete (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code delete = 'Delete', stated as 'null')BundleSystem-generated search and delete operations from conditional delete on Bundle MessageHeader.destination.endpointxmltrue?message.destination-uri=${destinationUri-STIN}

action

Operations

-TypeResourceDescriptionAcceptContentTypeEncodeRequestUrlSourceId
*Create (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code create = 'Create', stated as 'null')BundleCreate the Bundle resource in XML format on the destination server.xmlxmltruecreate-STIN-01

action

Operations

-TypeResourceDescriptionAcceptContentTypeEncodeRequestUrlParamsSourceId
*Create using Update (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code updateCreate = 'Create using Update', stated as 'null')BundleUpdate the Bundle.id in XML format on the destination server, so it corresponds to $bundleid-STIN-01.xmlxmltrue/${bundleid-STIN-01}create-STIN-01

action

Asserts

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

action

Operations

-TypeResourceDescriptionAcceptContentTypeEncodeRequestUrlSourceId
*Create (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code create = 'Create', stated as 'null')BundleCreate the Bundle resource in XML format on the destination server.xmlxmltruecreate-STIN2-03

action

Operations

-TypeResourceDescriptionAcceptContentTypeEncodeRequestUrlParamsSourceId
*Create using Update (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code updateCreate = 'Create using Update', stated as 'null')BundleUpdate the Bundle.id in XML format on the destination server, so it corresponds to $bundleid-STIN2-03.xmlxmltrue/${bundleid-STIN2-03}create-STIN2-03

action

Asserts

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

test

id

message-read-STIN-01

name: Get a STIN message 01

description: GET a message. The expected response is a 200(OK) with a payload of the message resource in XML format.

action

Operations

-TypeResourceDescriptionAcceptDestinationEncodeRequestUrlOriginParams
*Read (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code read = 'Read', stated as 'null')BundleReceive messagexml1true1/${bundleid-STIN-01}

action

Asserts

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

test

id

message-create-transient-error-02

name: Create an Acknowledegment transient-error Message 02

description: Post Acknowledegment to the server.

action

Operations

-TypeResourceDescriptionDestinationEncodeRequestUrlOriginRequestIdSourceId
*Create (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code create = 'Create', stated as 'null')BundlePost an Acknowledegment1true1create-message-transient-error-02create-transient-error-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/acknowledgement/StructureDefinition/medcom-messaging-acknowledgementrequestacknowledgementfalse

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 = 'acknowledgement-message').allTrue()false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that MessageHeader.responseCode equals to transient-errorrequestBundle.entry.resource.ofType(MessageHeader).response.code = 'transient-error'false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that a OperationOutcome instance is included, when the responseCode is 'transient-error' or 'fatal-error'requestBundle.entry.resource.ofType(MessageHeader).response.code = 'ok' or ((Bundle.entry.resource.ofType(MessageHeader).response.code = 'transient-error' or Bundle.entry.resource.ofType(MessageHeader).response.code = 'fatal-error') and Bundle.entry.resource.ofType(OperationOutcome).exists())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

-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 2 Provenance instances exists.requestBundle.entry.resource.ofType(Provenance).count() = 2false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the one Provenance instance contains the expected activity code.requestBundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'acknowledgement').count() = 1false

test

id

message-read-STIN2-03

name: Get a STIN2 message 03

description: GET a message. The expected response is a 200(OK) with a payload of the message resource in XML format.

action

Operations

-TypeResourceDescriptionAcceptDestinationEncodeRequestUrlOriginParams
*Read (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code read = 'Read', stated as 'null')BundleReceive messagexml1true1/${bundleid-STIN2-03}

action

Asserts

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

test

id

message-create-ok-04

name: Create an Acknowledegment ok Message 04

description: Post Acknowledegment to the server.

action

Operations

-TypeResourceDescriptionDestinationEncodeRequestUrlOriginRequestIdSourceId
*Create (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code create = 'Create', stated as 'null')BundlePost an Acknowledegment1true1create-message-ok-04create-ok-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/acknowledgement/StructureDefinition/medcom-messaging-acknowledgementrequestacknowledgementfalse

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the previous MessageHeader fullURL is identical to Provenance.entity.whatrequestBundle.entry.resource.ofType(Provenance).where(entity.what.reference = '${messageHeaderid-STIN2}').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 = 'acknowledgement-message').allTrue()false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that MessageHeader.responseCode equals to okrequestBundle.entry.resource.ofType(MessageHeader).response.code = 'ok'false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that a OperationOutcome instance is included, when the responseCode is 'transient-error' or 'fatal-error'requestBundle.entry.resource.ofType(MessageHeader).response.code = 'ok' or ((Bundle.entry.resource.ofType(MessageHeader).response.code = 'transient-error' or Bundle.entry.resource.ofType(MessageHeader).response.code = 'fatal-error') and Bundle.entry.resource.ofType(OperationOutcome).exists())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

-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 2 Provenance instances exists.requestBundle.entry.resource.ofType(Provenance).count() = 2false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the one Provenance instance contains the expected activity code.requestBundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'acknowledgement').count() = 1false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the Bundle.timestamp of the two Acknowledgements are different.request'${bundletimestamp-transient-error-02}' != '${bundletimestamp-ok-04}'false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the Bundle.id of the two Acknowledgements are different.request'${bundleid-transient-error-02}' != '${bundleid-ok-04}'false