HospitalNotification Testscripts
3.0.1 - ci-build

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

: HospitalNotification_TestScript_MORS - TTL Representation

Active as of 2023-05-25

Raw ttl | Download


@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

 a fhir:TestScript ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "hospitalnotification-send-mors"] ; # 
  fhir:meta [
    ( fhir:profile [
fhir:v "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript"^^xsd:anyURI ;
fhir:link <http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript>     ] )
  ] ; # 
  fhir:text [
fhir:status [ fhir:v "generated" ] ;
fhir:div "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative: TestScript</b><a name=\"hospitalnotification-send-mors\"> </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 &quot;hospitalnotification-send-mors&quot; </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</code></p><p><b>version</b>: 3.0.1</p><p><b>name</b>: HospitalNotificationTestScript</p><p><b>title</b>: Send: Deceased - dead at arrival to the hospital - MORS</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 - dead at arrival to the hospital.</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-MORS-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><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> &quot;MedComHospitalNotificationMessage&quot;</p><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>variable</b></p><p><b>name</b>: searchParamIdentifier-MORS</p><p><b>expression</b>: Bundle.entry.resource.ofType(MessageHeader).id</p><p><b>sourceId</b>: create-message-MORS</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: occurredDateTime-MORS</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-MORS</p></blockquote><blockquote><p><b>test</b></p><blockquote><p><b>id</b></p>hospitalnotification-create-MORS-01</blockquote><p><b>name</b>: Create a HospitalNotification MORS 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-MORS</td><td>create-MORS-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 IMP.</td><td>request</td><td>Bundle.entry.resource.ofType(Encounter).class.code</td><td>equals</td><td>IMP</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-inpatient').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 false.</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>false</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() = false</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>"
  ] ; # 
  fhir:url [ fhir:v "http://medcomfhir.dk/ig/hospitalnotificationtestscript/hospitalnotification-send-mors"^^xsd:anyURI] ; # 
  fhir:version [ fhir:v "3.0.1"] ; # 
  fhir:name [ fhir:v "HospitalNotificationTestScript"] ; # 
  fhir:title [ fhir:v "Send: Deceased - dead at arrival to the hospital - MORS"] ; # 
  fhir:status [ fhir:v "active"] ; # 
  fhir:date [ fhir:v "2023-05-25"^^xsd:date] ; # 
  fhir:publisher [ fhir:v "MedCom"] ; # 
  fhir:contact ( [
fhir:name [ fhir:v "MedCom" ] ;
    ( fhir:telecom [
fhir:system [ fhir:v "email" ] ;
fhir:value [ fhir:v "mailto:fhir@medcom.dk" ]     ] )
  ] ) ; # 
  fhir:description [ fhir:v "Send: Deceased - dead at arrival to the hospital."] ; # 
  fhir:copyright [ fhir:v "MedCom 2021"] ; # 
  fhir:origin ( [
fhir:index [ fhir:v "1"^^xsd:integer ] ;
fhir:profile [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types"^^xsd:anyURI ] ;
fhir:code [ fhir:v "FHIR-Client" ]     ]
  ] ) ; # 
  fhir:destination ( [
fhir:index [ fhir:v "1"^^xsd:integer ] ;
fhir:profile [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types"^^xsd:anyURI ] ;
fhir:code [ fhir:v "FHIR-Server" ]     ]
  ] ) ; # 
  fhir:fixture ( [
fhir:id [ fhir:v "create-MORS-01" ] ;
fhir:autocreate [ fhir:v "false"^^xsd:boolean ] ;
fhir:autodelete [ fhir:v "false"^^xsd:boolean ] ;
fhir:resource [
fhir:reference [ fhir:v "/FHIRSandbox/MedCom/HospitalNotification/v300/Send/Fixtures/HospitalNotification-fixture.xml" ]     ]
  ] ) ; # 
  fhir:profile ( [
fhir:link <http://medcomfhir.dk/ig/hospitalnotification/StructureDefinition/medcom-hospitalNotification-message> ;
fhir:id [ fhir:v "hospitalnotification" ] ;
fhir:reference [ fhir:v "http://medcomfhir.dk/ig/hospitalnotification/StructureDefinition/medcom-hospitalNotification-message" ]
  ] ) ; # 
  fhir:variable ( [
fhir:name [ fhir:v "messageHeaderid-MORS" ] ;
fhir:expression [ fhir:v "Bundle.entry[0].fullUrl" ] ;
fhir:sourceId [ fhir:v "create-message-MORS" ]
  ] [
fhir:name [ fhir:v "episodeOfCareID-MORS" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value" ] ;
fhir:sourceId [ fhir:v "create-message-MORS" ]
  ] [
fhir:name [ fhir:v "searchParamIdentifier-MORS" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(MessageHeader).id" ] ;
fhir:sourceId [ fhir:v "create-message-MORS" ]
  ] [
fhir:name [ fhir:v "occurredDateTime-MORS" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(Provenance).where(target.reference = %resource.entry[0].fullUrl).occurred" ] ;
fhir:sourceId [ fhir:v "create-message-MORS" ]
  ] ) ; # 
  fhir:test ( [
fhir:id [ fhir:v "hospitalnotification-create-MORS-01" ] ;
fhir:name [ fhir:v "Create a HospitalNotification MORS Message 01" ] ;
fhir:description [ fhir:v "Post HospitalNotification to the server." ] ;
    ( fhir:action [
fhir:operation [
fhir:type [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/testscript-operation-codes"^^xsd:anyURI ] ;
fhir:code [ fhir:v "create" ]         ] ;
fhir:resource [ fhir:v "Bundle" ] ;
fhir:description [ fhir:v "Post a Hospitalnotification" ] ;
fhir:destination [ fhir:v "1"^^xsd:integer ] ;
fhir:encodeRequestUrl [ fhir:v "true"^^xsd:boolean ] ;
fhir:origin [ fhir:v "1"^^xsd:integer ] ;
fhir:responseId [ fhir:v "create-message-MORS" ] ;
fhir:sourceId [ fhir:v "create-MORS-01" ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that the returned HTTP status is okay or created." ] ;
fhir:direction [ fhir:v "response" ] ;
fhir:operator [ fhir:v "in" ] ;
fhir:responseCode [ fhir:v "200,201" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that the client request payload contains a Bundle resource type." ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:resource [ fhir:v "Bundle" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Validates the bundle against http://medcomfhir.dk/ig/hospitalnotification/ImplementationGuide/dk.fhir.ig.dk-medcom-hospitalnotification" ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:validateProfileId [ fhir:v "hospitalnotification" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that the request resource contains the expected eventCoding.code." ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(MessageHeader).event.as(Coding).select(code = 'hospital-notification-message').allTrue()" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that the Encounter class of the request resource is IMP." ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(Encounter).class.code" ] ;
fhir:operator [ fhir:v "equals" ] ;
fhir:value [ fhir:v "IMP" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that the Encounter status of the request resource is in-progress." ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(Encounter).status" ] ;
fhir:operator [ fhir:v "equals" ] ;
fhir:value [ fhir:v "in-progress" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that the request resource contains the expected activity code." ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'admit-inpatient').exists()" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that the report of admission flag is false." ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(MessageHeader).extension.where(url='http://medcomfhir.dk/ig/hospitalnotification/StructureDefinition/medcom-messaging-reportOfAdmissionExtension').value" ] ;
fhir:operator [ fhir:v "equals" ] ;
fhir:value [ fhir:v "false" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that the target reference in Provenance equals MessageHeader.id" ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(Provenance).where(target.reference = %resource.entry[0].fullUrl).exists()" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that the episodeOfCare-identifier has the structure of an UUID" ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "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}')" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "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." ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(MessageHeader).extension.where(url='http://medcomfhir.dk/ig/hospitalnotification/StructureDefinition/medcom-messaging-reportOfAdmissionRecipientExtension').exists() = false" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that the patient.deceased is set to true" ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(Patient).deceased" ] ;
fhir:operator [ fhir:v "equals" ] ;
fhir:value [ fhir:v "true" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] )
  ] ) . #