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-tec-02.json
FHIR VersionR4
Sourcehttp://medcomfhir.dk/ig/carecommunicationtestscripts/5.0.0/TestScript-carecommunication-send-tec-02.html
URLhttp://medcomfhir.dk/ig/carecommunicationtestscript/carecommunication-send-tec-02
Version5.0.0
Statusactive
Date2025-10-15
NameCareCommunicationTestScript
TitleSend CareCommunication with sender and recipient
Realmdk
DescriptionSend CareCommunication with sender and recipient
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-tec-02

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

url: TestScript Send CareCommunication with sender and recipient

version: 5.0.0

name: CareCommunicationTestScript

title: Send CareCommunication with sender and recipient

status: Aktiv

date: 2025-10-15

contact: MedCom: mailto:fhir@medcom.dk

description:

Send CareCommunication with sender and recipient

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

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: searchParamIdentifier-new-message

expression: Bundle.entry.resource.ofType(MessageHeader).id

sourceId: create-new-message

test

id

carecommunication-create-new-message-01

name: Create a CareCommunication new-message Message 01

description: Post CareCommunication to the server.

action

Operations

-TypeResourceDescriptionDestinationEncodeRequestUrlOriginSourceId
*Test script operation code create: CreateBundlePost a carecommunication1true1create-new-message-01

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 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 request resource contains the expected activity code.requestBundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'new-message').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

-DescriptionDirectionExpressionWarningOnly
*Confirm that the Communication.identifier is a UUID v4.requestBundle.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

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that a specific sender is includedrequestBundle.entry.resource.ofType(Communication).extension.where(url = 'http://medcomfhir.dk/ig/core/StructureDefinition/medcom-core-sender-extension').exists()false

action

Asserts

-DescriptionDirectionExpressionWarningOnly
*Confirm that a specific recipient is includedrequestBundle.entry.resource.ofType(Communication).recipient.exists()false

Source1

{
  "resourceType": "TestScript",
  "id": "carecommunication-send-tec-02",
  "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-tec-02",
  "version": "5.0.0",
  "name": "CareCommunicationTestScript",
  "title": "Send CareCommunication with sender and recipient",
  "status": "active",
  "date": "2025-10-15",
  "contact": [
    {
      "name": "MedCom",
      "telecom": [
        {
          "system": "email",
          "value": "mailto:fhir@medcom.dk"
        }
      ]
    }
  ],
  "description": "Send CareCommunication with sender and recipient",
  "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"
      }
    }
  ],
  "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": "searchParamIdentifier-new-message",
      "expression": "Bundle.entry.resource.ofType(MessageHeader).id",
      "sourceId": "create-new-message"
    }
  ],
  "test": [
    {
      "id": "carecommunication-create-new-message-01",
      "name": "Create a CareCommunication new-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-new-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 = 'new-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
          }
        },
        {
          "assert": {
            "description": "Confirm that a specific sender is included",
            "direction": "request",
            "expression": "Bundle.entry.resource.ofType(Communication).extension.where(url = 'http://medcomfhir.dk/ig/core/StructureDefinition/medcom-core-sender-extension').exists()",
            "warningOnly": false
          }
        },
        {
          "assert": {
            "description": "Confirm that a specific recipient is included",
            "direction": "request",
            "expression": "Bundle.entry.resource.ofType(Communication).recipient.exists()",
            "warningOnly": false
          }
        }
      ]
    }
  ]
}