FHIR IG analytics| Package | medcom.fhir.dk.carecommunicationtestscripts |
| Resource Type | TestScript |
| Id | TestScript-carecommunication-send-reply-forward.json |
| FHIR Version | R4 |
| Source | http://medcomfhir.dk/ig/carecommunicationtestscripts/5.0.0/TestScript-carecommunication-send-reply-new.html |
| URL | http://medcomfhir.dk/ig/carecommunicationtestscript/carecommunication-send-reply-new |
| Version | 5.0.0 |
| Status | active |
| Date | 2025-10-15 |
| Name | CareCommunicationTestScript |
| Title | Reply CareCommunication to a CareCommunication that has been forwarded |
| Realm | dk |
| Description | Reply CareCommunication to a CareCommunication that has been forwarded |
| Copyright | MedCom 2023 |
No resources found
No resources found
Note: links and images are rebased to the (stated) source
Generated Narrative: TestScript carecommunication-send-reply-forward
Profile: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript
url: TestScript Reply CareCommunication to a CareCommunication that has been forwarded
version: 5.0.0
name: CareCommunicationTestScript
title: Reply CareCommunication to a CareCommunication that has been forwarded
status: Aktiv
date: 2025-10-15
contact: MedCom: mailto:fhir@medcom.dk
description:
Reply CareCommunication to a CareCommunication that has been forwarded
jurisdiction: Denmark
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-forward-message-01autocreate: false
autodelete: false
resource:
../Fixtures/CareCommunication-fixture-forward.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|5.0.1
variable
name: messageHeaderid-forward-message-01
expression: Bundle.entry[0].resource.id
sourceId: create-forward-message-01
variable
name: searchParamIdentifier-forward-message
expression: Bundle.entry.resource.ofType(MessageHeader).id
sourceId: create-forward-message
variable
name: messageHeaderid-reply-message-02
expression: Bundle.entry[0].resource.id
sourceId: create-reply-message-02
variable
name: identifier-forward-message-01
expression: Bundle.entry.resource.ofType(Communication).identifier.value
sourceId: create-forward-message-01
variable
name: identifier-reply-message-02
expression: Bundle.entry.resource.ofType(Communication).identifier.value
sourceId: create-reply-message-02
test
id
carecommunication-create-forward-message-01name: Create a CareCommunication forward-message Message 01
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-forward-message-01 action
Asserts
Description Direction ValidateProfileId WarningOnly Validates the bundle against http://medcomfhir.dk/ig/carecommunication/ImplementationGuide/dk.fhir.ig.dk-medcom-carecommunication|5.0.1 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 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 request resource contains the expected activity code. request Bundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'forward-message').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 WarningOnly Confirm that the Communication.identifier is a UUID v4. request Bundle.entry.resource.ofType(Communication).identifier.value.matches('urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}') 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|5.0.1 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.identifier is held the same in the two messages request Bundle.entry.resource.ofType(Communication).identifier.value = '${identifier-forward-message-01}' false
{
"resourceType": "TestScript",
"id": "carecommunication-send-reply-forward",
"meta": {
"profile": [
"http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript"
]
},
"text": {
"status": "generated",
"div": "<!-- snip (see above) -->"
},
"url": "http://medcomfhir.dk/ig/carecommunicationtestscript/carecommunication-send-reply-new",
"version": "5.0.0",
"name": "CareCommunicationTestScript",
"title": "Reply CareCommunication to a CareCommunication that has been forwarded",
"status": "active",
"date": "2025-10-15",
"contact": [
{
"name": "MedCom",
"telecom": [
{
"system": "email",
"value": "mailto:fhir@medcom.dk"
}
]
}
],
"description": "Reply CareCommunication to a CareCommunication that has been forwarded",
"jurisdiction": [
{
"coding": [
{
"system": "urn:iso:std:iso:3166",
"code": "DK",
"display": "Denmark"
}
]
}
],
"copyright": "MedCom 2023",
"origin": [
{
"index": 1,
"profile": {
"system": "http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types",
"code": "FHIR-Client"
}
}
],
"destination": [
{
"index": 1,
"profile": {
"system": "http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types",
"code": "FHIR-Server"
}
}
],
"fixture": [
{
"id": "create-forward-message-01",
"autocreate": false,
"autodelete": false,
"resource": {
"reference": "../Fixtures/CareCommunication-fixture-forward.xml"
}
},
{
"id": "create-reply-message-02",
"autocreate": false,
"autodelete": false,
"resource": {
"reference": "../Fixtures/CareCommunication-fixture-empty.xml"
}
}
],
"profile": [
{
"id": "carecommunication",
"reference": "http://medcomfhir.dk/ig/carecommunication/StructureDefinition/medcom-careCommunication-message|5.0.1"
}
],
"variable": [
{
"name": "messageHeaderid-forward-message-01",
"expression": "Bundle.entry[0].resource.id",
"sourceId": "create-forward-message-01"
},
{
"name": "searchParamIdentifier-forward-message",
"expression": "Bundle.entry.resource.ofType(MessageHeader).id",
"sourceId": "create-forward-message"
},
{
"name": "messageHeaderid-reply-message-02",
"expression": "Bundle.entry[0].resource.id",
"sourceId": "create-reply-message-02"
},
{
"name": "identifier-forward-message-01",
"expression": "Bundle.entry.resource.ofType(Communication).identifier.value",
"sourceId": "create-forward-message-01"
},
{
"name": "identifier-reply-message-02",
"expression": "Bundle.entry.resource.ofType(Communication).identifier.value",
"sourceId": "create-reply-message-02"
}
],
"test": [
{
"id": "carecommunication-create-forward-message-01",
"name": "Create a CareCommunication forward-message Message 01",
"description": "Post CareCommunication to the server.",
"action": [
{
"operation": {
"type": {
"system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
"code": "create"
},
"resource": "Bundle",
"description": "Post a carecommunication",
"destination": 1,
"encodeRequestUrl": true,
"origin": 1,
"sourceId": "create-forward-message-01"
}
},
{
"assert": {
"description": "Validates the bundle against http://medcomfhir.dk/ig/carecommunication/ImplementationGuide/dk.fhir.ig.dk-medcom-carecommunication|5.0.1",
"direction": "request",
"validateProfileId": "carecommunication",
"warningOnly": false
}
},
{
"assert": {
"description": "Confirm that the returned HTTP status is okay or created.",
"direction": "response",
"operator": "in",
"responseCode": "200,201",
"warningOnly": false
}
},
{
"assert": {
"description": "Confirm that the client request payload contains a Bundle resource type.",
"direction": "request",
"resource": "Bundle",
"warningOnly": false
}
},
{
"assert": {
"description": "Confirm that the request resource contains the expected eventCoding.code.",
"direction": "request",
"expression": "Bundle.entry.resource.ofType(MessageHeader).event.as(Coding).code = 'care-communication-message'",
"warningOnly": false
}
},
{
"assert": {
"description": "Confirm that the request resource contains the expected activity code.",
"direction": "request",
"expression": "Bundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'forward-message').exists()",
"warningOnly": false
}
},
{
"assert": {
"description": "Confirm that the target reference in Provenance equals MessageHeader.id",
"direction": "request",
"expression": "Bundle.entry.resource.ofType(Provenance).where(target.reference.contains(%resource.entry[0].resource.id)).exists()",
"warningOnly": false
}
},
{
"assert": {
"description": "Confirm that the Communication.identifier is a UUID v4.",
"direction": "request",
"expression": "Bundle.entry.resource.ofType(Communication).identifier.value.matches('urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}')",
"warningOnly": false
}
}
]
},
{
"id": "carecommunication-create-reply-message-02",
"name": "Create a CareCommunication reply-message Message 02",
"description": "Post CareCommunication to the server.",
"action": [
{
"operation": {
"type": {
"system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
"code": "create"
},
"resource": "Bundle",
"description": "Post a carecommunication",
"destination": 1,
"encodeRequestUrl": true,
"origin": 1,
"sourceId": "create-reply-message-02"
}
},
{
"assert": {
"description": "Validates the bundle against http://medcomfhir.dk/ig/carecommunication/ImplementationGuide/dk.fhir.ig.dk-medcom-carecommunication|5.0.1",
"direction": "request",
"validateProfileId": "carecommunication",
"warningOnly": false
}
},
{
"assert": {
"description": "Confirm that the returned HTTP status is okay or created.",
"direction": "response",
"operator": "in",
"responseCode": "200,201",
"warningOnly": false
}
},
{
"assert": {
"description": "Confirm that the client request payload contains a Bundle resource type.",
"direction": "request",
"resource": "Bundle",
"warningOnly": false
}
},
{
"assert": {
"description": "Confirm that the previous MessageHeader.id is referenced in Provenance.entity.what",
"direction": "request",
"expression": "Bundle.entry.resource.ofType(Provenance).where(entity.what.reference.contains('${messageHeaderid-new-message-01}')).exists()",
"warningOnly": false
}
},
{
"assert": {
"description": "Confirm that the request resource contains the expected eventCoding.code.",
"direction": "request",
"expression": "Bundle.entry.resource.ofType(MessageHeader).event.as(Coding).code = 'care-communication-message'",
"warningOnly": false
}
},
{
"assert": {
"description": "Confirm that the role is set to revision. Not used when testing the first message in a stream",
"direction": "request",
"expression": "Bundle.entry.resource.ofType(Provenance).entity.where(role = 'revision').exists()",
"warningOnly": false
}
},
{
"assert": {
"description": "Confirm that the target reference in Provenance equals MessageHeader.id",
"direction": "request",
"expression": "Bundle.entry.resource.ofType(Provenance).where(target.reference.contains(%resource.entry[0].resource.id)).exists()",
"warningOnly": false
}
},
{
"assert": {
"description": "Confirm that the 2 Provenance instances exists.",
"direction": "request",
"expression": "Bundle.entry.resource.ofType(Provenance).count()",
"operator": "equals",
"value": "2",
"warningOnly": false
}
},
{
"assert": {
"description": "Confirm that number of payloads is '2'",
"direction": "request",
"expression": "Bundle.entry.resource.ofType(Communication).payload.count() = '2'",
"warningOnly": false
}
},
{
"assert": {
"description": "Confirm that the communication.identifier is held the same in the two messages",
"direction": "request",
"expression": "Bundle.entry.resource.ofType(Communication).identifier.value = '${identifier-forward-message-01}'",
"warningOnly": false
}
}
]
}
]
}