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

FHIR IG analytics

Packagedk.ehmi.eds.testscripts
Resource TypeTestScript
IdTestScript-Server-ANS2TestMessageTypeSearch-xml.json
FHIR VersionR4
Sourcehttps://build.fhir.org/ig/medcomdk/dk-ehmi-eds-testscripts/TestScript-Server-ANS2TestMessageTypeSearch-xml.html
URLhttp://medcomehmi.dk/ig/edstestscripts/Server-ANS2TestMessageTypeSearch-xml
Version0.1.0
Statusactive
Date2025-08-18
NameServer-ANS2TestMessageTypeSearch-xml
Realmdk
CopyrightMedCom 2025

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 Server-ANS2TestMessageTypeSearch-xml

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

url: TestScript Server-ANS2TestMessageTypeSearch-xml

version: 0.1.0

name: Server-ANS2TestMessageTypeSearch-xml

status: Aktiv

date: 2025-08-18

publisher: MedCom

contact: MedCom: https://medcom.dk,ehmi@medcom.dk

jurisdiction: Denmark

copyright:

MedCom 2025

Origins

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

Destinations

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

fixture

id

EdsPatientDeliveryStatusCreateFixture

autocreate: false

autodelete: false

resource: ../Fixtures/EdsPatientDeliveryStatusCreateFixture.xml

profile: http://medcomehmi.dk/ig/eds/StructureDefinition/EdsPatientDeliveryStatus

variable

name: RecordedOfResourceToFindInSearch

expression: recorded

sourceId: EdsPatientDeliveryStatusCreateFixture

variable

name: MessageTypeOfCreatedResource

expression: entity.detail.where(type = 'ehmiMessageType').value

sourceId: EdsPatientDeliveryStatusCreateFixture

test

id

SearchPatientDeliveryStatusWithMessageType

name: ANS2 search

description: user story ANS2 search for the created PatientDeliveryStatus object on the SUT with ehmiMessageType

action

Operations

-TypeResourceDescriptionDestinationEncodeRequestUrlOriginParams
*Test script operation code: search (Search)AuditEventSearch for the PatientDeliveryStatus AuditEvent with the type being ${MessageTypeOfCreatedResource}1true1?ehmiMessageType=${MessageTypeOfCreatedResource}

action

Asserts

-DescriptionDirectionExpressionOperatorValueWarningOnly
*Ensure the PatientDeliveryStatus AuditEvent is foundresponseBundle.entry.where(resource.resourceType = 'AuditEvent' and resource.recorded = '${RecordedOfResourceToFindInSearch}').count()equals1false

test

id

SearchPatientDeliveryStatusInvalidMessageType

name: ANS2 invalid search

description: user story ANS2 search for the created PatientDeliveryStatus object on the SUT with an invalid message type. Not expecting to find it

action

Operations

-TypeResourceDescriptionAcceptContentTypeDestinationEncodeRequestUrlOriginParams
*Test script operation code: search (Search)AuditEventSearch for the PatientDeliveryStatus AuditEvent with an invalid message typexmlxml1true1?ehmiMessageType=invalid

action

Asserts

-DescriptionDirectionExpressionOperatorValueWarningOnly
*Ensure the PatientDeliveryStatus AuditEvent is not found with an invalid message typeresponseBundle.entry.where(resource.resourceType = 'AuditEvent' and resource.recorded = '${RecordedOfResourceToFindInSearch}').count()equals0false

Source1

{
  "resourceType": "TestScript",
  "id": "Server-ANS2TestMessageTypeSearch-xml",
  "meta": {
    "profile": [
      "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript"
    ]
  },
  "text": {
    "status": "generated",
    "div": "<!-- snip (see above) -->"
  },
  "url": "http://medcomehmi.dk/ig/edstestscripts/Server-ANS2TestMessageTypeSearch-xml",
  "version": "0.1.0",
  "name": "Server-ANS2TestMessageTypeSearch-xml",
  "status": "active",
  "date": "2025-08-18",
  "publisher": "MedCom",
  "contact": [
    {
      "name": "MedCom",
      "telecom": [
        {
          "system": "url",
          "value": "https://medcom.dk"
        },
        {
          "system": "email",
          "value": "ehmi@medcom.dk"
        }
      ]
    }
  ],
  "jurisdiction": [
    {
      "coding": [
        {
          "system": "urn:iso:std:iso:3166",
          "code": "DK",
          "display": "Denmark"
        }
      ]
    }
  ],
  "copyright": "MedCom 2025",
  "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": "EdsPatientDeliveryStatusCreateFixture",
      "autocreate": false,
      "autodelete": false,
      "resource": {
        "reference": "../Fixtures/EdsPatientDeliveryStatusCreateFixture.xml"
      }
    }
  ],
  "profile": [
    {
      "id": "eds-patient-delivery-status",
      "reference": "http://medcomehmi.dk/ig/eds/StructureDefinition/EdsPatientDeliveryStatus"
    }
  ],
  "variable": [
    {
      "name": "RecordedOfResourceToFindInSearch",
      "expression": "recorded",
      "sourceId": "EdsPatientDeliveryStatusCreateFixture"
    },
    {
      "name": "MessageTypeOfCreatedResource",
      "expression": "entity.detail.where(type = 'ehmiMessageType').value",
      "sourceId": "EdsPatientDeliveryStatusCreateFixture"
    }
  ],
  "test": [
    {
      "id": "SearchPatientDeliveryStatusWithMessageType",
      "name": "ANS2 search",
      "description": "user story ANS2 search for the created PatientDeliveryStatus object on the SUT with ehmiMessageType",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "search"
            },
            "resource": "AuditEvent",
            "description": "Search for the PatientDeliveryStatus AuditEvent with the type being ${MessageTypeOfCreatedResource}",
            "destination": 1,
            "encodeRequestUrl": true,
            "origin": 1,
            "params": "?ehmiMessageType=${MessageTypeOfCreatedResource}"
          }
        },
        {
          "assert": {
            "description": "Ensure the PatientDeliveryStatus AuditEvent is found",
            "direction": "response",
            "expression": "Bundle.entry.where(resource.resourceType = 'AuditEvent' and resource.recorded = '${RecordedOfResourceToFindInSearch}').count()",
            "operator": "equals",
            "value": "1",
            "warningOnly": false
          }
        }
      ]
    },
    {
      "id": "SearchPatientDeliveryStatusInvalidMessageType",
      "name": "ANS2 invalid search",
      "description": "user story ANS2 search for the created PatientDeliveryStatus object on the SUT with an invalid message type. Not expecting to find it",
      "action": [
        {
          "operation": {
            "type": {
              "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code": "search"
            },
            "resource": "AuditEvent",
            "description": "Search for the PatientDeliveryStatus AuditEvent with an invalid message type",
            "accept": "xml",
            "contentType": "xml",
            "destination": 1,
            "encodeRequestUrl": true,
            "origin": 1,
            "params": "?ehmiMessageType=invalid"
          }
        },
        {
          "assert": {
            "description": "Ensure the PatientDeliveryStatus AuditEvent is not found with an invalid message type",
            "direction": "response",
            "expression": "Bundle.entry.where(resource.resourceType = 'AuditEvent' and resource.recorded = '${RecordedOfResourceToFindInSearch}').count()",
            "operator": "equals",
            "value": "0",
            "warningOnly": false
          }
        }
      ]
    }
  ]
}