This page is part of the DK MedCom HospitalNotification TestScripts (v3.0.1: Release) based on FHIR R4. . For a full list of available versions, see the Directory of published versions
Active as of 2023-05-25 |
{
"resourceType" : "TestScript",
"id" : "hospitalnotification-send-mors-emer",
"meta" : {
"profile" : [
"http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript"
]
},
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative: TestScript</b><a name=\"hospitalnotification-send-mors-emer\"> </a></p><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">Resource TestScript "hospitalnotification-send-mors-emer" </p><p style=\"margin-bottom: 0px\">Profile: <a href=\"file://D:\\GitHub\\Touchstone\\testing-ig\\output/StructureDefinition-testscript.html\">AEGIS Touchstone Testing TestScript Profile</a></p></div><p><b>url</b>: <code>http://medcomfhir.dk/ig/hospitalnotificationtestscript/hospitalnotification-send-mors-emer</code></p><p><b>version</b>: 3.0.1</p><p><b>name</b>: HospitalNotificationTestScript</p><p><b>title</b>: Send: Deceased - deceased during hospital stay - MORS-EMER</p><p><b>status</b>: active</p><p><b>date</b>: 2023-05-25</p><p><b>publisher</b>: MedCom</p><p><b>contact</b>: MedCom: <a href=\"mailto:mailto:fhir@medcom.dk\">mailto:fhir@medcom.dk</a></p><p><b>description</b>: Send: Deceased - deceased during hospital stay</p><p><b>copyright</b>: MedCom 2021</p><h3>Origins</h3><table class=\"grid\"><tr><td>-</td><td><b>Index</b></td><td><b>Profile</b></td></tr><tr><td>*</td><td>1</td><td>FHIR Client (Details: http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types code FHIR-Client = 'FHIR Client', stated as 'null')</td></tr></table><h3>Destinations</h3><table class=\"grid\"><tr><td>-</td><td><b>Index</b></td><td><b>Profile</b></td></tr><tr><td>*</td><td>1</td><td>FHIR Server (Details: http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types code FHIR-Server = 'FHIR Server', stated as 'null')</td></tr></table><blockquote><p><b>fixture</b></p><blockquote><p><b>id</b></p>create-STAA-01</blockquote><p><b>autocreate</b>: false</p><p><b>autodelete</b>: false</p><p><b>resource</b>: <a href=\"/FHIRSandbox/MedCom/HospitalNotification/v300/Send/Fixtures/HospitalNotification-fixture.xml\">/FHIRSandbox/MedCom/HospitalNotification/v300/Send/Fixtures/HospitalNotification-fixture.xml</a></p></blockquote><blockquote><p><b>fixture</b></p><blockquote><p><b>id</b></p>create-MORS-02</blockquote><p><b>autocreate</b>: false</p><p><b>autodelete</b>: false</p><p><b>resource</b>: <a href=\"/FHIRSandbox/MedCom/HospitalNotification/v300/Send/Fixtures/HospitalNotification-fixture.xml\">/FHIRSandbox/MedCom/HospitalNotification/v300/Send/Fixtures/HospitalNotification-fixture.xml</a></p></blockquote><p><b>profile</b>: <a href=\"http://medcomfhir.dk/ig/hospitalnotification/StructureDefinition/medcom-hospitalNotification-message\">http://medcomfhir.dk/ig/hospitalnotification/StructureDefinition/medcom-hospitalNotification-message</a> "MedComHospitalNotificationMessage"</p><blockquote><p><b>variable</b></p><p><b>name</b>: messageHeaderid-STAA</p><p><b>expression</b>: Bundle.entry[0].fullUrl</p><p><b>sourceId</b>: create-message-STAA</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: episodeOfCareID-STAA</p><p><b>expression</b>: Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value</p><p><b>sourceId</b>: create-message-STAA</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: searchParamIdentifier-STAA</p><p><b>expression</b>: Bundle.entry.resource.ofType(MessageHeader).id</p><p><b>sourceId</b>: create-message-STAA</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: occurredDateTime-STAA</p><p><b>expression</b>: Bundle.entry.resource.ofType(Provenance).where(target.reference = %resource.entry[0].fullUrl).occurred</p><p><b>sourceId</b>: create-message-STAA</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: messageHeaderid-MORS</p><p><b>expression</b>: Bundle.entry[0].fullUrl</p><p><b>sourceId</b>: create-message-MORS</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: episodeOfCareID-MORS</p><p><b>expression</b>: Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value</p><p><b>sourceId</b>: create-message-MORS</p></blockquote><blockquote><p><b>test</b></p><blockquote><p><b>id</b></p>hospitalnotification-create-STAA-01</blockquote><p><b>name</b>: Create a HospitalNotification STAA Message 01</p><p><b>description</b>: Post HospitalNotification to the server.</p><blockquote><p><b>action</b></p><h3>Operations</h3><table class=\"grid\"><tr><td>-</td><td><b>Type</b></td><td><b>Resource</b></td><td><b>Description</b></td><td><b>Destination</b></td><td><b>EncodeRequestUrl</b></td><td><b>Origin</b></td><td><b>ResponseId</b></td><td><b>SourceId</b></td></tr><tr><td>*</td><td>Create (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code create = 'Create', stated as 'null')</td><td>Bundle</td><td>Post a Hospitalnotification</td><td>1</td><td>true</td><td>1</td><td>create-message-STAA</td><td>create-STAA-01</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Operator</b></td><td><b>ResponseCode</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the returned HTTP status is okay or created.</td><td>response</td><td>in</td><td>200,201</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Resource</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the client request payload contains a Bundle resource type.</td><td>request</td><td>Bundle</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>ValidateProfileId</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Validates the bundle against http://medcomfhir.dk/ig/hospitalnotification/ImplementationGuide/dk.fhir.ig.dk-medcom-hospitalnotification</td><td>request</td><td>hospitalnotification</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the request resource contains the expected eventCoding.code.</td><td>request</td><td>Bundle.entry.resource.ofType(MessageHeader).event.as(Coding).select(code = 'hospital-notification-message').allTrue()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>Operator</b></td><td><b>Value</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the Encounter class of the request resource is EMER.</td><td>request</td><td>Bundle.entry.resource.ofType(Encounter).class.code</td><td>equals</td><td>EMER</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>Operator</b></td><td><b>Value</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the Encounter status of the request resource is in-progress.</td><td>request</td><td>Bundle.entry.resource.ofType(Encounter).status</td><td>equals</td><td>in-progress</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the request resource contains the expected activity code.</td><td>request</td><td>Bundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'admit-emergency').exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>Operator</b></td><td><b>Value</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the report of admission flag is true.</td><td>request</td><td>Bundle.entry.resource.ofType(MessageHeader).extension.where(url='http://medcomfhir.dk/ig/hospitalnotification/StructureDefinition/medcom-messaging-reportOfAdmissionExtension').value</td><td>equals</td><td>true</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the target reference in Provenance equals MessageHeader.id</td><td>request</td><td>Bundle.entry.resource.ofType(Provenance).where(target.reference = %resource.entry[0].fullUrl).exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the episodeOfCare-identifier has the structure of an UUID</td><td>request</td><td>Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value.matches('[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}')</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the a receiver of the report of admission exists, when the flag is true, and doesn't exists when the flag is false.</td><td>request</td><td>Bundle.entry.resource.ofType(MessageHeader).extension.where(url='http://medcomfhir.dk/ig/hospitalnotification/StructureDefinition/medcom-messaging-reportOfAdmissionRecipientExtension').exists() = true</td><td>false</td></tr></table></blockquote></blockquote><blockquote><p><b>test</b></p><blockquote><p><b>id</b></p>hospitalnotification-create-MORS-02</blockquote><p><b>name</b>: Create a HospitalNotification MORS Message 02</p><p><b>description</b>: Post HospitalNotification to the server.</p><blockquote><p><b>action</b></p><h3>Operations</h3><table class=\"grid\"><tr><td>-</td><td><b>Type</b></td><td><b>Resource</b></td><td><b>Description</b></td><td><b>Destination</b></td><td><b>EncodeRequestUrl</b></td><td><b>Origin</b></td><td><b>ResponseId</b></td><td><b>SourceId</b></td></tr><tr><td>*</td><td>Create (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code create = 'Create', stated as 'null')</td><td>Bundle</td><td>Post a Hospitalnotification</td><td>1</td><td>true</td><td>1</td><td>create-message-MORS</td><td>create-MORS-02</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Operator</b></td><td><b>ResponseCode</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the returned HTTP status is okay or created.</td><td>response</td><td>in</td><td>200,201</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Resource</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the client request payload contains a Bundle resource type.</td><td>request</td><td>Bundle</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>ValidateProfileId</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Validates the bundle against http://medcomfhir.dk/ig/hospitalnotification/ImplementationGuide/dk.fhir.ig.dk-medcom-hospitalnotification</td><td>request</td><td>hospitalnotification</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the previous MessageHeader fullURL is identical to Provenance.entity.what</td><td>request</td><td>Bundle.entry.resource.ofType(Provenance).where(entity.what.reference = '${messageHeaderid-STAA}').count() = 1</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the request resource contains the expected eventCoding.code.</td><td>request</td><td>Bundle.entry.resource.ofType(MessageHeader).event.as(Coding).select(code = 'hospital-notification-message').allTrue()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>Operator</b></td><td><b>Value</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the role is set to revision. Not used when testing the first message in a stream</td><td>request</td><td>Bundle.entry.resource.ofType(Provenance).entity.role</td><td>equals</td><td>revision</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>Operator</b></td><td><b>Value</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the Encounter class of the request resource is EMER.</td><td>request</td><td>Bundle.entry.resource.ofType(Encounter).class.code</td><td>equals</td><td>EMER</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>Operator</b></td><td><b>Value</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the Encounter status of the request resource is finished.</td><td>request</td><td>Bundle.entry.resource.ofType(Encounter).status</td><td>equals</td><td>finished</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the request resource contains the expected activity code.</td><td>request</td><td>Bundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'admit-emergency').exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the target reference in Provenance equals MessageHeader.id</td><td>request</td><td>Bundle.entry.resource.ofType(Provenance).where(target.reference = %resource.entry[0].fullUrl).exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>Operator</b></td><td><b>Value</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the 2 Provenance instances exists.</td><td>request</td><td>Bundle.entry.resource.ofType(Provenance).count()</td><td>equals</td><td>2</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the episodeOfCare-identifier is episodeOfCareID-STAA</td><td>request</td><td>Bundle.entry.resource.ofType(Encounter).where(episodeOfCare.identifier.value = '${episodeOfCareID-STAA}').count() = 1</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td>-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>Operator</b></td><td><b>Value</b></td><td><b>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that the patient.deceased is set to true</td><td>request</td><td>Bundle.entry.resource.ofType(Patient).deceased</td><td>equals</td><td>true</td><td>false</td></tr></table></blockquote></blockquote></div>"
},
"url" : "http://medcomfhir.dk/ig/hospitalnotificationtestscript/hospitalnotification-send-mors-emer",
"version" : "3.0.1",
"name" : "HospitalNotificationTestScript",
"title" : "Send: Deceased - deceased during hospital stay - MORS-EMER",
"status" : "active",
"date" : "2023-05-25",
"publisher" : "MedCom",
"contact" : [
{
"name" : "MedCom",
"telecom" : [
{
"system" : "email",
"value" : "mailto:fhir@medcom.dk"
}
]
}
],
"description" : "Send: Deceased - deceased during hospital stay",
"copyright" : "MedCom 2021",
"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-STAA-01",
"autocreate" : false,
"autodelete" : false,
"resource" : {
"reference" : "/FHIRSandbox/MedCom/HospitalNotification/v300/Send/Fixtures/HospitalNotification-fixture.xml"
}
},
{
"id" : "create-MORS-02",
"autocreate" : false,
"autodelete" : false,
"resource" : {
"reference" : "/FHIRSandbox/MedCom/HospitalNotification/v300/Send/Fixtures/HospitalNotification-fixture.xml"
}
}
],
"profile" : [
{
"id" : "hospitalnotification",
"reference" : "http://medcomfhir.dk/ig/hospitalnotification/StructureDefinition/medcom-hospitalNotification-message"
}
],
"variable" : [
{
"name" : "messageHeaderid-STAA",
"expression" : "Bundle.entry[0].fullUrl",
"sourceId" : "create-message-STAA"
},
{
"name" : "episodeOfCareID-STAA",
"expression" : "Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value",
"sourceId" : "create-message-STAA"
},
{
"name" : "searchParamIdentifier-STAA",
"expression" : "Bundle.entry.resource.ofType(MessageHeader).id",
"sourceId" : "create-message-STAA"
},
{
"name" : "occurredDateTime-STAA",
"expression" : "Bundle.entry.resource.ofType(Provenance).where(target.reference = %resource.entry[0].fullUrl).occurred",
"sourceId" : "create-message-STAA"
},
{
"name" : "messageHeaderid-MORS",
"expression" : "Bundle.entry[0].fullUrl",
"sourceId" : "create-message-MORS"
},
{
"name" : "episodeOfCareID-MORS",
"expression" : "Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value",
"sourceId" : "create-message-MORS"
}
],
"test" : [
{
"id" : "hospitalnotification-create-STAA-01",
"name" : "Create a HospitalNotification STAA Message 01",
"description" : "Post HospitalNotification to the server.",
"action" : [
{
"operation" : {
"type" : {
"system" : "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
"code" : "create"
},
"resource" : "Bundle",
"description" : "Post a Hospitalnotification",
"destination" : 1,
"encodeRequestUrl" : true,
"origin" : 1,
"responseId" : "create-message-STAA",
"sourceId" : "create-STAA-01"
}
},
{
"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" : "Validates the bundle against http://medcomfhir.dk/ig/hospitalnotification/ImplementationGuide/dk.fhir.ig.dk-medcom-hospitalnotification",
"direction" : "request",
"validateProfileId" : "hospitalnotification",
"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).select(code = 'hospital-notification-message').allTrue()",
"warningOnly" : false
}
},
{
"assert" : {
"description" : "Confirm that the Encounter class of the request resource is EMER.",
"direction" : "request",
"expression" : "Bundle.entry.resource.ofType(Encounter).class.code",
"operator" : "equals",
"value" : "EMER",
"warningOnly" : false
}
},
{
"assert" : {
"description" : "Confirm that the Encounter status of the request resource is in-progress.",
"direction" : "request",
"expression" : "Bundle.entry.resource.ofType(Encounter).status",
"operator" : "equals",
"value" : "in-progress",
"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 = 'admit-emergency').exists()",
"warningOnly" : false
}
},
{
"assert" : {
"description" : "Confirm that the report of admission flag is true.",
"direction" : "request",
"expression" : "Bundle.entry.resource.ofType(MessageHeader).extension.where(url='http://medcomfhir.dk/ig/hospitalnotification/StructureDefinition/medcom-messaging-reportOfAdmissionExtension').value",
"operator" : "equals",
"value" : "true",
"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 = %resource.entry[0].fullUrl).exists()",
"warningOnly" : false
}
},
{
"assert" : {
"description" : "Confirm that the episodeOfCare-identifier has the structure of an UUID",
"direction" : "request",
"expression" : "Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value.matches('[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 the a receiver of the report of admission exists, when the flag is true, and doesn't exists when the flag is false.",
"direction" : "request",
"expression" : "Bundle.entry.resource.ofType(MessageHeader).extension.where(url='http://medcomfhir.dk/ig/hospitalnotification/StructureDefinition/medcom-messaging-reportOfAdmissionRecipientExtension').exists() = true",
"warningOnly" : false
}
}
]
},
{
"id" : "hospitalnotification-create-MORS-02",
"name" : "Create a HospitalNotification MORS Message 02",
"description" : "Post HospitalNotification to the server.",
"action" : [
{
"operation" : {
"type" : {
"system" : "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
"code" : "create"
},
"resource" : "Bundle",
"description" : "Post a Hospitalnotification",
"destination" : 1,
"encodeRequestUrl" : true,
"origin" : 1,
"responseId" : "create-message-MORS",
"sourceId" : "create-MORS-02"
}
},
{
"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" : "Validates the bundle against http://medcomfhir.dk/ig/hospitalnotification/ImplementationGuide/dk.fhir.ig.dk-medcom-hospitalnotification",
"direction" : "request",
"validateProfileId" : "hospitalnotification",
"warningOnly" : false
}
},
{
"assert" : {
"description" : "Confirm that the previous MessageHeader fullURL is identical to Provenance.entity.what",
"direction" : "request",
"expression" : "Bundle.entry.resource.ofType(Provenance).where(entity.what.reference = '${messageHeaderid-STAA}').count() = 1",
"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).select(code = 'hospital-notification-message').allTrue()",
"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.role",
"operator" : "equals",
"value" : "revision",
"warningOnly" : false
}
},
{
"assert" : {
"description" : "Confirm that the Encounter class of the request resource is EMER.",
"direction" : "request",
"expression" : "Bundle.entry.resource.ofType(Encounter).class.code",
"operator" : "equals",
"value" : "EMER",
"warningOnly" : false
}
},
{
"assert" : {
"description" : "Confirm that the Encounter status of the request resource is finished.",
"direction" : "request",
"expression" : "Bundle.entry.resource.ofType(Encounter).status",
"operator" : "equals",
"value" : "finished",
"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 = 'admit-emergency').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 = %resource.entry[0].fullUrl).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 the episodeOfCare-identifier is episodeOfCareID-STAA",
"direction" : "request",
"expression" : "Bundle.entry.resource.ofType(Encounter).where(episodeOfCare.identifier.value = '${episodeOfCareID-STAA}').count() = 1",
"warningOnly" : false
}
},
{
"assert" : {
"description" : "Confirm that the patient.deceased is set to true",
"direction" : "request",
"expression" : "Bundle.entry.resource.ofType(Patient).deceased",
"operator" : "equals",
"value" : "true",
"warningOnly" : false
}
}
]
}
]
}
IG © 2020+ . Package medcom.fhir.dk.hospitalnotificationtestscripts#3.0.1 based on FHIR 4.0.1. Generated 2023-05-26
Links: Table of Contents |
QA Report