CareCommunication Test scripts
4.0.1 - release
CareCommunication Test scripts, published by . This guide is not an authorized publication; it is the continuous build for version 4.0.1 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/medcomdk/dk-medcom-carecommunication-testscripts/ and changes regularly. See the Directory of published versions
Official URL: http://medcomfhir.dk/ig/carecommunicationtestscript/carecommunication-send-reply-changecategory | Version: 4.0.1 | |||
Active as of 2025-02-26 | Computable Name: CareCommunicationTestScript | |||
Copyright/Legal: MedCom 2023 |
Reply CareCommunication with changed category
Profile: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript
url: TestScript Reply CareCommunication with changed category
version: 4.0.1
name: CareCommunicationTestScript
title: Reply CareCommunication with changed category
status: Active
date: 2025-02-26
contact: MedCom: mailto:fhir@medcom.dk
description:
Reply CareCommunication with changed category
copyright:
MedCom 2023
Index | Profile |
1 | Test script profile origin type FHIR-Client: FHIR Client |
Index | Profile |
1 | Test script profile destination type FHIR-Server: FHIR Server |
fixture
id
create-new-message-01autocreate: false
autodelete: false
resource:
../Fixtures/CareCommunication-fixture.xml
fixture
id
create-reply-message-02autocreate: false
autodelete: false
resource:
../Fixtures/CareCommunication-fixture-empty.xml
profile: http://medcomfhir.dk/ig/carecommunication/StructureDefinition/medcom-careCommunication-message
variable
name: messageHeaderid-new-message-01
expression: Bundle.entry[0].resource.id
sourceId: create-new-message-01
variable
name: destinationUri-new-message-01
expression: Bundle.entry.resource.ofType(MessageHeader).destination.endpoint
sourceId: create-new-message-01
variable
name: bundleid-new-message-01
expression: Bundle.id
sourceId: create-new-message-01
variable
name: messageHeaderid-reply-message-02
expression: Bundle.entry[0].resource.id
sourceId: create-reply-message-02
variable
name: category-new-message-01
expression: Bundle.entry.resource.ofType(Communication).category.coding.code
sourceId: create-new-message-01
variable
name: category-reply-message-02
expression: Bundle.entry.resource.ofType(Communication).category.coding.code
sourceId: create-reply-message-02
variable
name: identifier-new-message-01
expression: Bundle.entry.resource.ofType(Communication).identifier.value
sourceId: create-new-message-01
variable
name: identifier-reply-message-02
expression: Bundle.entry.resource.ofType(Communication).identifier.value
sourceId: create-reply-message-02
setup
action
Operations
Type Resource Description Accept Destination EncodeRequestUrl Params Test script operation code delete: Delete Bundle System-generated search, delete operations from conditional delete on Bundle MessageHeader.destination.endpoint xml 1 true ?message.destination-uri=$destinationUri-new-message action
Operations
Type Resource Description Accept ContentType Destination EncodeRequestUrl Params SourceId Test script operation code updateCreate: Create using Update Bundle Create or Update the Bundle.id in XML format on the destination server, so it corresponds to $bundleid-new-message-01. xml xml 1 true /${bundleid-new-message-01} create-new-message-01 action
Asserts
Description Direction Operator ResponseCode WarningOnly Confirm that the returned HTTP status is okay or created. response in 200,201 false
test
id
message-read-new-message-01name: 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
Type Resource Description Accept Destination EncodeRequestUrl Origin Params Test script operation code read: Read Bundle Receive message xml 1 true 1 /${bundleid-new-message-01} action
Asserts
Description Direction Operator ResponseCode WarningOnly Confirm that the returned HTTP status is okay or created. response in 200,201 false
test
id
carecommunication-create-reply-message-02name: Create a CareCommunication reply-message Message 02
description: Post CareCommunication to the server.
action
Operations
Type Resource Description Destination EncodeRequestUrl Origin SourceId Test script operation code create: Create Bundle Post a carecommunication 1 true 1 create-reply-message-02 action
Asserts
Description Direction ValidateProfileId WarningOnly Validates the bundle against http://medcomfhir.dk/ig/carecommunication/ImplementationGuide/dk.fhir.ig.dk-medcom-carecommunication request carecommunication false 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 Expression WarningOnly Confirm that the previous MessageHeader.id is referenced in Provenance.entity.what request Bundle.entry.resource.ofType(Provenance).where(entity.what.reference.contains('${messageHeaderid-new-message-01}')).exists() 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).code = 'care-communication-message' false action
Asserts
Description Direction Expression 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.where(role = 'revision').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.contains(%resource.entry[0].resource.id)).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 number of payloads is '2' request Bundle.entry.resource.ofType(Communication).payload.count() = '2' false action
Asserts
Description Direction Expression WarningOnly Confirm that the communication.category changed in the reply request Bundle.entry.resource.ofType(Communication).category.coding.code != '${category-new-message-01}' false action
Asserts
Description Direction Expression WarningOnly Confirm that the communication.identifier is held the same in the two messages request Bundle.entry.resource.ofType(Communication).identifier.value = '${identifier-new-message-01}' false