CareCommunication Test scripts
4.0.1 - release

This page is part of the CareCommunication Testscripts (v4.0.1: Release) based on FHIR (HL7® FHIR® Standard) R4. . For a full list of available versions, see the Directory of published versions

TestScript: Forward a part of the CareCommunication thread. Only the message text is expected to be forwarded

Official URL: http://medcomfhir.dk/ig/carecommunicationtestscript/carecommunication-send-forward-partialthread Version: 4.0.1
Active as of 2024-07-15 Computable Name: CareCommunicationTestScript

Copyright/Legal: MedCom 2023

Forward a part of the CareCommunication thread. Only the message text is expected to be forwarded

Generated Narrative: TestScript carecommunication-send-forward-partialthread

url: TestScript Forward a part of the CareCommunication thread. Only the message text is expected to be forwarded

version: 4.0.1

name: CareCommunicationTestScript

title: Forward a part of the CareCommunication thread. Only the message text is expected to be forwarded

status: Active

date: 2024-07-15

contact: MedCom: mailto:fhir@medcom.dk

description:

Forward a part of the CareCommunication thread. Only the message text is expected to be forwarded

copyright:

MedCom 2023

Origins

-IndexProfile
*1Test script profile origin type FHIR-Client: FHIR Client

Destinations

-IndexProfile
*1Test script profile destination type FHIR-Server: FHIR Server

fixture

id

create-new-message-01

autocreate: false

autodelete: false

resource: /Fixtures/CareCommunication-fixture-attachment.xml

fixture

id

create-forward-message-02

autocreate: false

autodelete: false

resource: /Fixtures/CareCommunication-fixture-empty.xml

profile: ??

variable

name: messageHeaderid-new-message-01

expression: Bundle.entry[0].resource.id

sourceId: create-message-new-message-01

variable

name: destinationUri-new-message-01

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

sourceId: create-message-new-message-01

variable

name: bundleid-new-message-01

expression: Bundle.id

sourceId: create-message-new-message-01

variable

name: hospitalSOR-new-message-01

expression: Bundle.entry[0].resource.sender.reference.resolve().identifier.where(system = 'urn:oid:1.2.208.176.1.1').value

sourceId: create-message-new-message-01

variable

name: messageHeaderid-forward-message-02

expression: Bundle.entry[0].resource.id

sourceId: create-message-forward-message-02

setup

action

Operations

-TypeResourceDescriptionAcceptEncodeRequestUrlParams
*Test script operation code delete: DeleteBundleSystem-generated search, delete operations from conditional delete on Bundle MessageHeader.destination.endpointxmltrue?message.destination-uri=${destinationUri-new-message}

action

Operations

-TypeResourceDescriptionAcceptContentTypeEncodeRequestUrlSourceId
*Test script operation code create: CreateBundleCreate the Bundle resource in XML format on the destination server.xmlxmltruecreate-new-message-01

action

Operations

-TypeResourceDescriptionAcceptContentTypeEncodeRequestUrlParamsSourceId
*Test script operation code updateCreate: Create using UpdateBundleUpdate the Bundle.id in XML format on the destination server, so it corresponds to $bundleid-new-message-01.xmlxmltrue/${bundleid-new-message-01}create-new-message-01

action

Asserts

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

test

id

message-read-new-message-01

name: Get a new-message 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
*Test script operation code read: ReadBundleReceive messagexml1true1/${bundleid-new-message-01}

action

Asserts

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

test

id

carecommunication-create-forward-message-02

name: Create a CareCommunication forward-message Message 02

description: Post CareCommunication to the server.

action

Operations

-TypeResourceDescriptionDestinationEncodeRequestUrlOriginRequestIdSourceId
*Test script operation code create: CreateBundlePost a carecommunication1true1create-message-forward-message-02create-forward-message-02

action

Asserts

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

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

-DescriptionDirectionExpressionWarningOnly
*Confirm that the previous MessageHeader.id is identical to Provenance.entity.whatrequestBundle.entry.resource.ofType(Provenance).where(entity.what.reference.contains('${messageHeaderid-reply-message-01}')).exists()false

action

Asserts

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

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the role is set to revision. Not used when testing the first message in a streamrequestBundle.entry.resource.ofType(Provenance).entity.where(role = 'revision').exists()false

action

Asserts

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

action

Asserts

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

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that number of payloads is '2'requestBundle.entry.resource.ofType(Communication).payload.count() = '2'false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the sender SOR number is different from the previous message.requestBundle.entry[0].resource.sender.reference.resolve().identifier.where(system = 'urn:oid:1.2.208.176.1.1').value != ${hospitalSOR-new-message})false