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 |
<TestScript xmlns="http://hl7.org/fhir">
<id value="hospitalnotification-PF-send-imp-01"/>
<meta>
<profile
value="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript"/>
</meta>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml"><p><b>Generated Narrative: TestScript</b><a name="hospitalnotification-PF-send-imp-01"> </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-PF-send-imp-01" </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-PF-send-imp-01</code></p><p><b>version</b>: 3.0.1</p><p><b>name</b>: HospitalNotificationTestScript</p><p><b>title</b>: Send: Admit patient, register patient as being on leave, register patient as returned from leave, discharge patient. - PF-send-imp-01</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: Admit patient, register patient as being on leave, register patient as returned from leave, discharge patient.</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-STIN-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-STOR-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><blockquote><p><b>fixture</b></p><blockquote><p><b>id</b></p>create-SLOR-03</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-SLHJ-04</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-STIN</p><p><b>expression</b>: Bundle.entry[0].fullUrl</p><p><b>sourceId</b>: create-message-STIN</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: episodeOfCareID-STIN</p><p><b>expression</b>: Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value</p><p><b>sourceId</b>: create-message-STIN</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: searchParamIdentifier-STIN</p><p><b>expression</b>: Bundle.entry.resource.ofType(MessageHeader).id</p><p><b>sourceId</b>: create-message-STIN</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: occurredDateTime-STIN</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-STIN</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: messageHeaderid-STOR</p><p><b>expression</b>: Bundle.entry[0].fullUrl</p><p><b>sourceId</b>: create-message-STOR</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: episodeOfCareID-STOR</p><p><b>expression</b>: Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value</p><p><b>sourceId</b>: create-message-STOR</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: messageHeaderid-SLOR</p><p><b>expression</b>: Bundle.entry[0].fullUrl</p><p><b>sourceId</b>: create-message-SLOR</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: episodeOfCareID-SLOR</p><p><b>expression</b>: Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value</p><p><b>sourceId</b>: create-message-SLOR</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: messageHeaderid-SLHJ</p><p><b>expression</b>: Bundle.entry[0].fullUrl</p><p><b>sourceId</b>: create-message-SLHJ</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: episodeOfCareID-SLHJ</p><p><b>expression</b>: Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value</p><p><b>sourceId</b>: create-message-SLHJ</p></blockquote><blockquote><p><b>test</b></p><blockquote><p><b>id</b></p>hospitalnotification-create-STIN-01</blockquote><p><b>name</b>: Create a HospitalNotification STIN 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-STIN</td><td>create-STIN-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 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-STOR-02</blockquote><p><b>name</b>: Create a HospitalNotification STOR 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-STOR</td><td>create-STOR-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-STIN}').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 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 onleave.</td><td>request</td><td>Bundle.entry.resource.ofType(Encounter).status</td><td>equals</td><td>onleave</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 = 'start-leave-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>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-STIN</td><td>request</td><td>Bundle.entry.resource.ofType(Encounter).where(episodeOfCare.identifier.value = '${episodeOfCareID-STIN}').count() = 1</td><td>false</td></tr></table></blockquote></blockquote><blockquote><p><b>test</b></p><blockquote><p><b>id</b></p>hospitalnotification-create-SLOR-03</blockquote><p><b>name</b>: Create a HospitalNotification SLOR Message 03</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-SLOR</td><td>create-SLOR-03</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-STOR}').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 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 = 'end-leave-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>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 3 Provenance instances exists.</td><td>request</td><td>Bundle.entry.resource.ofType(Provenance).count()</td><td>equals</td><td>3</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-STOR</td><td>request</td><td>Bundle.entry.resource.ofType(Encounter).where(episodeOfCare.identifier.value = '${episodeOfCareID-STOR}').count() = 1</td><td>false</td></tr></table></blockquote></blockquote><blockquote><p><b>test</b></p><blockquote><p><b>id</b></p>hospitalnotification-create-SLHJ-04</blockquote><p><b>name</b>: Create a HospitalNotification SLHJ Message 04</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-SLHJ</td><td>create-SLHJ-04</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-SLOR}').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 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 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 = 'discharge-patient-home').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 4 Provenance instances exists.</td><td>request</td><td>Bundle.entry.resource.ofType(Provenance).count()</td><td>equals</td><td>4</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-SLOR</td><td>request</td><td>Bundle.entry.resource.ofType(Encounter).where(episodeOfCare.identifier.value = '${episodeOfCareID-SLOR}').count() = 1</td><td>false</td></tr></table></blockquote></blockquote></div>
</text>
<url
value="http://medcomfhir.dk/ig/hospitalnotificationtestscript/hospitalnotification-PF-send-imp-01"/>
<version value="3.0.1"/>
<name value="HospitalNotificationTestScript"/>
<title
value="Send: Admit patient, register patient as being on leave, register patient as returned from leave, discharge patient. - PF-send-imp-01"/>
<status value="active"/>
<date value="2023-05-25"/>
<publisher value="MedCom"/>
<contact>
<name value="MedCom"/>
<telecom>
<system value="email"/>
<value value="mailto:fhir@medcom.dk"/>
</telecom>
</contact>
<description
value="Send: Admit patient, register patient as being on leave, register patient as returned from leave, discharge patient."/>
<copyright value="MedCom 2021"/>
<origin>
<index value="1"/>
<profile>
<system
value="http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types"/>
<code value="FHIR-Client"/>
</profile>
</origin>
<destination>
<index value="1"/>
<profile>
<system
value="http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types"/>
<code value="FHIR-Server"/>
</profile>
</destination>
<fixture id="create-STIN-01">
<autocreate value="false"/>
<autodelete value="false"/>
<resource>
<reference
value="/FHIRSandbox/MedCom/HospitalNotification/v300/Send/Fixtures/HospitalNotification-fixture.xml"/>
</resource>
</fixture>
<fixture id="create-STOR-02">
<autocreate value="false"/>
<autodelete value="false"/>
<resource>
<reference
value="/FHIRSandbox/MedCom/HospitalNotification/v300/Send/Fixtures/HospitalNotification-fixture.xml"/>
</resource>
</fixture>
<fixture id="create-SLOR-03">
<autocreate value="false"/>
<autodelete value="false"/>
<resource>
<reference
value="/FHIRSandbox/MedCom/HospitalNotification/v300/Send/Fixtures/HospitalNotification-fixture.xml"/>
</resource>
</fixture>
<fixture id="create-SLHJ-04">
<autocreate value="false"/>
<autodelete value="false"/>
<resource>
<reference
value="/FHIRSandbox/MedCom/HospitalNotification/v300/Send/Fixtures/HospitalNotification-fixture.xml"/>
</resource>
</fixture>
<profile id="hospitalnotification">
<reference
value="http://medcomfhir.dk/ig/hospitalnotification/StructureDefinition/medcom-hospitalNotification-message"/>
</profile>
<variable>
<name value="messageHeaderid-STIN"/>
<expression value="Bundle.entry[0].fullUrl"/>
<sourceId value="create-message-STIN"/>
</variable>
<variable>
<name value="episodeOfCareID-STIN"/>
<expression
value="Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value"/>
<sourceId value="create-message-STIN"/>
</variable>
<variable>
<name value="searchParamIdentifier-STIN"/>
<expression value="Bundle.entry.resource.ofType(MessageHeader).id"/>
<sourceId value="create-message-STIN"/>
</variable>
<variable>
<name value="occurredDateTime-STIN"/>
<expression
value="Bundle.entry.resource.ofType(Provenance).where(target.reference = %resource.entry[0].fullUrl).occurred"/>
<sourceId value="create-message-STIN"/>
</variable>
<variable>
<name value="messageHeaderid-STOR"/>
<expression value="Bundle.entry[0].fullUrl"/>
<sourceId value="create-message-STOR"/>
</variable>
<variable>
<name value="episodeOfCareID-STOR"/>
<expression
value="Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value"/>
<sourceId value="create-message-STOR"/>
</variable>
<variable>
<name value="messageHeaderid-SLOR"/>
<expression value="Bundle.entry[0].fullUrl"/>
<sourceId value="create-message-SLOR"/>
</variable>
<variable>
<name value="episodeOfCareID-SLOR"/>
<expression
value="Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value"/>
<sourceId value="create-message-SLOR"/>
</variable>
<variable>
<name value="messageHeaderid-SLHJ"/>
<expression value="Bundle.entry[0].fullUrl"/>
<sourceId value="create-message-SLHJ"/>
</variable>
<variable>
<name value="episodeOfCareID-SLHJ"/>
<expression
value="Bundle.entry.resource.ofType(Encounter).episodeOfCare.identifier.value"/>
<sourceId value="create-message-SLHJ"/>
</variable>
<test id="hospitalnotification-create-STIN-01">
<name value="Create a HospitalNotification STIN Message 01"/>
<description value="Post HospitalNotification to the server."/>
<action>
<operation>
<type>
<system
value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="create"/>
</type>
<resource value="Bundle"/>
<description value="Post a Hospitalnotification"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<responseId value="create-message-STIN"/>
<sourceId value="create-STIN-01"/>
</operation>
</action>
<action>
<assert>
<description
value="Confirm that the returned HTTP status is okay or created."/>
<direction value="response"/>
<operator value="in"/>
<responseCode value="200,201"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the client request payload contains a Bundle resource type."/>
<direction value="request"/>
<resource value="Bundle"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Validates the bundle against http://medcomfhir.dk/ig/hospitalnotification/ImplementationGuide/dk.fhir.ig.dk-medcom-hospitalnotification"/>
<direction value="request"/>
<validateProfileId value="hospitalnotification"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the request resource contains the expected eventCoding.code."/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(MessageHeader).event.as(Coding).select(code = 'hospital-notification-message').allTrue()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the Encounter class of the request resource is IMP."/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Encounter).class.code"/>
<operator value="equals"/>
<value value="IMP"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the Encounter status of the request resource is in-progress."/>
<direction value="request"/>
<expression value="Bundle.entry.resource.ofType(Encounter).status"/>
<operator value="equals"/>
<value value="in-progress"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the request resource contains the expected activity code."/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'admit-inpatient').exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the report of admission flag is true."/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(MessageHeader).extension.where(url='http://medcomfhir.dk/ig/hospitalnotification/StructureDefinition/medcom-messaging-reportOfAdmissionExtension').value"/>
<operator value="equals"/>
<value value="true"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the target reference in Provenance equals MessageHeader.id"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Provenance).where(target.reference = %resource.entry[0].fullUrl).exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the episodeOfCare-identifier has the structure of an UUID"/>
<direction value="request"/>
<expression
value="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 value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="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 value="request"/>
<expression
value="Bundle.entry.resource.ofType(MessageHeader).extension.where(url='http://medcomfhir.dk/ig/hospitalnotification/StructureDefinition/medcom-messaging-reportOfAdmissionRecipientExtension').exists() = true"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="hospitalnotification-create-STOR-02">
<name value="Create a HospitalNotification STOR Message 02"/>
<description value="Post HospitalNotification to the server."/>
<action>
<operation>
<type>
<system
value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="create"/>
</type>
<resource value="Bundle"/>
<description value="Post a Hospitalnotification"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<responseId value="create-message-STOR"/>
<sourceId value="create-STOR-02"/>
</operation>
</action>
<action>
<assert>
<description
value="Confirm that the returned HTTP status is okay or created."/>
<direction value="response"/>
<operator value="in"/>
<responseCode value="200,201"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the client request payload contains a Bundle resource type."/>
<direction value="request"/>
<resource value="Bundle"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Validates the bundle against http://medcomfhir.dk/ig/hospitalnotification/ImplementationGuide/dk.fhir.ig.dk-medcom-hospitalnotification"/>
<direction value="request"/>
<validateProfileId value="hospitalnotification"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the previous MessageHeader fullURL is identical to Provenance.entity.what"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Provenance).where(entity.what.reference = '${messageHeaderid-STIN}').count() = 1"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the request resource contains the expected eventCoding.code."/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(MessageHeader).event.as(Coding).select(code = 'hospital-notification-message').allTrue()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the role is set to revision. Not used when testing the first message in a stream"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Provenance).entity.role"/>
<operator value="equals"/>
<value value="revision"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the Encounter class of the request resource is IMP."/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Encounter).class.code"/>
<operator value="equals"/>
<value value="IMP"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the Encounter status of the request resource is onleave."/>
<direction value="request"/>
<expression value="Bundle.entry.resource.ofType(Encounter).status"/>
<operator value="equals"/>
<value value="onleave"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the request resource contains the expected activity code."/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'start-leave-inpatient').exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the target reference in Provenance equals MessageHeader.id"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Provenance).where(target.reference = %resource.entry[0].fullUrl).exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the 2 Provenance instances exists."/>
<direction value="request"/>
<expression value="Bundle.entry.resource.ofType(Provenance).count()"/>
<operator value="equals"/>
<value value="2"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the episodeOfCare-identifier is episodeOfCareID-STIN"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Encounter).where(episodeOfCare.identifier.value = '${episodeOfCareID-STIN}').count() = 1"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="hospitalnotification-create-SLOR-03">
<name value="Create a HospitalNotification SLOR Message 03"/>
<description value="Post HospitalNotification to the server."/>
<action>
<operation>
<type>
<system
value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="create"/>
</type>
<resource value="Bundle"/>
<description value="Post a Hospitalnotification"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<responseId value="create-message-SLOR"/>
<sourceId value="create-SLOR-03"/>
</operation>
</action>
<action>
<assert>
<description
value="Confirm that the returned HTTP status is okay or created."/>
<direction value="response"/>
<operator value="in"/>
<responseCode value="200,201"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the client request payload contains a Bundle resource type."/>
<direction value="request"/>
<resource value="Bundle"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Validates the bundle against http://medcomfhir.dk/ig/hospitalnotification/ImplementationGuide/dk.fhir.ig.dk-medcom-hospitalnotification"/>
<direction value="request"/>
<validateProfileId value="hospitalnotification"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the previous MessageHeader fullURL is identical to Provenance.entity.what"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Provenance).where(entity.what.reference = '${messageHeaderid-STOR}').count() = 1"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the request resource contains the expected eventCoding.code."/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(MessageHeader).event.as(Coding).select(code = 'hospital-notification-message').allTrue()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the role is set to revision. Not used when testing the first message in a stream"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Provenance).entity.role"/>
<operator value="equals"/>
<value value="revision"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the Encounter class of the request resource is IMP."/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Encounter).class.code"/>
<operator value="equals"/>
<value value="IMP"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the Encounter status of the request resource is in-progress."/>
<direction value="request"/>
<expression value="Bundle.entry.resource.ofType(Encounter).status"/>
<operator value="equals"/>
<value value="in-progress"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the request resource contains the expected activity code."/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'end-leave-inpatient').exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the target reference in Provenance equals MessageHeader.id"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Provenance).where(target.reference = %resource.entry[0].fullUrl).exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the 3 Provenance instances exists."/>
<direction value="request"/>
<expression value="Bundle.entry.resource.ofType(Provenance).count()"/>
<operator value="equals"/>
<value value="3"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the episodeOfCare-identifier is episodeOfCareID-STOR"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Encounter).where(episodeOfCare.identifier.value = '${episodeOfCareID-STOR}').count() = 1"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="hospitalnotification-create-SLHJ-04">
<name value="Create a HospitalNotification SLHJ Message 04"/>
<description value="Post HospitalNotification to the server."/>
<action>
<operation>
<type>
<system
value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="create"/>
</type>
<resource value="Bundle"/>
<description value="Post a Hospitalnotification"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<responseId value="create-message-SLHJ"/>
<sourceId value="create-SLHJ-04"/>
</operation>
</action>
<action>
<assert>
<description
value="Confirm that the returned HTTP status is okay or created."/>
<direction value="response"/>
<operator value="in"/>
<responseCode value="200,201"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the client request payload contains a Bundle resource type."/>
<direction value="request"/>
<resource value="Bundle"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Validates the bundle against http://medcomfhir.dk/ig/hospitalnotification/ImplementationGuide/dk.fhir.ig.dk-medcom-hospitalnotification"/>
<direction value="request"/>
<validateProfileId value="hospitalnotification"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the previous MessageHeader fullURL is identical to Provenance.entity.what"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Provenance).where(entity.what.reference = '${messageHeaderid-SLOR}').count() = 1"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the request resource contains the expected eventCoding.code."/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(MessageHeader).event.as(Coding).select(code = 'hospital-notification-message').allTrue()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the role is set to revision. Not used when testing the first message in a stream"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Provenance).entity.role"/>
<operator value="equals"/>
<value value="revision"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the Encounter class of the request resource is IMP."/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Encounter).class.code"/>
<operator value="equals"/>
<value value="IMP"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the Encounter status of the request resource is finished."/>
<direction value="request"/>
<expression value="Bundle.entry.resource.ofType(Encounter).status"/>
<operator value="equals"/>
<value value="finished"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the request resource contains the expected activity code."/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'discharge-patient-home').exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the target reference in Provenance equals MessageHeader.id"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Provenance).where(target.reference = %resource.entry[0].fullUrl).exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the 4 Provenance instances exists."/>
<direction value="request"/>
<expression value="Bundle.entry.resource.ofType(Provenance).count()"/>
<operator value="equals"/>
<value value="4"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description
value="Confirm that the episodeOfCare-identifier is episodeOfCareID-SLOR"/>
<direction value="request"/>
<expression
value="Bundle.entry.resource.ofType(Encounter).where(episodeOfCare.identifier.value = '${episodeOfCareID-SLOR}').count() = 1"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
</TestScript>
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