FHIR © HL7.org  |  FHIRsmith 4.0.1  |  Server Home  |  XIG Home  |  XIG Stats  | 

FHIR IG analytics

Packagemedcom.fhir.dk.carecommunicationtestscripts
Resource TypeTestScript
IdTestScript-carecommunication-send-forward-changecategory.json
FHIR VersionR4
Sourcehttp://medcomfhir.dk/ig/carecommunicationtestscripts/5.0.0/TestScript-carecommunication-send-forward-changecategory.html
URLhttp://medcomfhir.dk/ig/carecommunicationtestscript/carecommunication-send-forward-changecategory
Version5.0.0
Statusactive
Date2025-10-15
NameCareCommunicationTestScript
TitleForward CareCommunication with changed category
Realmdk
DescriptionForward CareCommunication with changed category
CopyrightMedCom 2023

Resources that use this resource

No resources found


Resources that this resource uses

No resources found


Narrative

Note: links and images are rebased to the (stated) source

Generated Narrative: TestScript carecommunication-send-forward-changecategory

Profile: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript

url: TestScript Forward CareCommunication with changed category

version: 5.0.0

name: CareCommunicationTestScript

title: Forward CareCommunication with changed category

status: Aktiv

date: 2025-10-15

contact: MedCom: mailto:fhir@medcom.dk

description:

Forward CareCommunication with changed category

jurisdiction: Denmark

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.xml

fixture

id

create-forward-message-02

autocreate: 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-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: hospitalSOR-new-message-01

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

sourceId: create-new-message-01

variable

name: messageHeaderid-forward-message-02

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

sourceId: create-forward-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-forward-message-02

expression: Bundle.entry.resource.ofType(Communication).category.coding.code

sourceId: create-forward-message-02

variable

name: identifier-new-message-01

expression: Bundle.entry.resource.ofType(Communication).identifier.value

sourceId: create-new-message-01

variable

name: identifier-forward-message-02

expression: Bundle.entry.resource.ofType(Communication).identifier.value

sourceId: create-forward-message-02

setup

action

Operations

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

action

Operations

-TypeResourceDescriptionAcceptContentTypeDestinationEncodeRequestUrlParamsSourceId
*Test script operation code updateCreate: Create using UpdateBundleCreate or Update the Bundle.id in XML format on the destination server, so it corresponds to $bundleid-new-message-01.xmlxml1true/${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

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

action

Asserts

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

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 referenced in Provenance.entity.whatrequestBundle.entry.resource.ofType(Provenance).where(entity.what.reference.contains('${messageHeaderid-new-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).code = 'care-communication-message'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 (source.endpoint) is different from the previous message.requestBundle.entry.resource.ofType(MessageHeader).source.endpoint != '${hospitalSOR-new-message-01}'false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the communication.category changed in the replyrequestBundle.entry.resource.ofType(Communication).category.coding.code != '${category-new-message-01}'false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that the communication.identifier is different in the the two messagesrequestBundle.entry.resource.ofType(Communication).identifier.value != '${identifier-new-message-01}'false

Source1

{
  "resourceType": "TestScript",
  "id": "carecommunication-send-forward-changecategory",
  "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-forward-changecategory",
  "version": "5.0.0",
  "name": "CareCommunicationTestScript",
  "title": "Forward CareCommunication with changed category",
  "status": "active",
  "date": "2025-10-15",
  "contact": [
    {
      "name": "MedCom",
      "telecom": [
        {
          "system": "email",
          "value": "mailto:fhir@medcom.dk"
        }
      ]
    }
  ],
  "description": "Forward CareCommunication with changed category",
  "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-new-message-01",
      "autocreate": false,
      "autodelete": false,
      "resource": {
        "reference": "../Fixtures/CareCommunication-fixture.xml"
      }
    },
    {
      "id": "create-forward-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-new-message-01",
      "expression": "Bundle.entry[0].resource.id",
      "sourceId": "create-new-message-01"
    },
    {
      "name": "destinationUri-new-message-01",
      "expression": "Bundle.entry.resource.ofType(MessageHeader).destination.endpoint",
      "sourceId": "create-new-message-01"
    },
    {
      "name": "bundleid-new-message-01",
      "expression": "Bundle.id",
      "sourceId": "create-new-message-01"
    },
    {
      "name": "hospitalSOR-new-message-01",
      "expression": "Bundle.entry.resource.ofType(MessageHeader).source.endpoint",
      "sourceId": "create-new-message-01"
    },
    {
      "name": "messageHeaderid-forward-message-02",
      "expression": "Bundle.entry[0].resource.id",
      "sourceId": "create-forward-message-02"
    },
    {
      "name": "category-new-message-01",
      "expression": "Bundle.entry.resource.ofType(Communication).category.coding.code",
      "sourceId": "create-new-message-01"
    },
    {
      "name": "category-forward-message-02",
      "expression": "Bundle.entry.resource.ofType(Communication).category.coding.code",
      "sourceId": "create-forward-message-02"
    },
    {
      "name": "identifier-new-message-01",
      "expression": "Bundle.entry.resource.ofType(Communication).identifier.value",
      "sourceId": "create-new-message-01"
    },
    {
      "name": "identifier-forward-message-02",
      "expression": "Bundle.entry.resource.ofType(Communication).identifier.value",
      "sourceId": "create-forward-message-02"
    }
  ],
  "setup": {
    "action": [
      {
        "operation": {
          "type": {
            "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
            "code": "delete"
          },
          "resource": "Bundle",
          "description": "System-generated search, delete operations from conditional delete on Bundle MessageHeader.destination.endpoint",
          "accept": "xml",
          "destination": 1,
          "encodeRequestUrl": true,
          "params": "?message.destination-uri=$destinationUri-new-message"
        }
      },
      {
        "operation": {
          "type": {
            "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
            "code": "updateCreate"
          },
          "resource": "Bundle",
          "description": "Create or Update the Bundle.id in XML format on the destination server, so it corresponds to $bundleid-new-message-01.",
          "accept": "xml",
          "contentType": "xml",
          "destination": 1,
          "encodeRequestUrl": true,
          "params": "/${bundleid-new-message-01}",
          "sourceId": "create-new-message-01"
        }
      },
      {
        "assert": {
          "description": "Confirm that the returned HTTP status is okay or created.",
          "direction": "response",
          "operator": "in",
          "responseCode": "200,201",
          "warningOnly": false
        }
      }
    ]
  },
  "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": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "read"
            },
            "resource": "Bundle",
            "description": "Receive message",
            "accept": "xml",
            "destination": 1,
            "encodeRequestUrl": true,
            "origin": 1,
            "params": "/${bundleid-new-message-01}"
          }
        },
        {
          "assert": {
            "description": "Confirm that the returned HTTP status is okay or created.",
            "direction": "response",
            "operator": "in",
            "responseCode": "200,201",
            "warningOnly": false
          }
        }
      ]
    },
    {
      "id": "carecommunication-create-forward-message-02",
      "name": "Create a CareCommunication forward-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-forward-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 sender SOR number (source.endpoint) is different from the previous message.",
            "direction": "request",
            "expression": "Bundle.entry.resource.ofType(MessageHeader).source.endpoint != '${hospitalSOR-new-message-01}'",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "description": "Confirm that the communication.category changed in the reply",
            "direction": "request",
            "expression": "Bundle.entry.resource.ofType(Communication).category.coding.code != '${category-new-message-01}'",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "description": "Confirm that the communication.identifier is different in the the two messages",
            "direction": "request",
            "expression": "Bundle.entry.resource.ofType(Communication).identifier.value != '${identifier-new-message-01}'",
            "warningOnly": false
          }
        }
      ]
    }
  ]
}