Acknowledgement Test scripts
2.0.0 - release

This page is part of the DK MedCom Acknowledgement TestScripts (v2.0.0: Release) based on FHIR R4. . For a full list of available versions, see the Directory of published versions

: Acknowledgement_TestScript_OK-duplicate-hospitalnotification - 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 "acknowledgement-send-ok-duplicate-hospitalnotification"] ; # 
  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=\"acknowledgement-send-ok-duplicate-hospitalnotification\"> </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;acknowledgement-send-ok-duplicate-hospitalnotification&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/acknowledgementtestscript/acknowledgement-send-ok-duplicate-hospitalnotification</code></p><p><b>version</b>: 2.0.0</p><p><b>name</b>: AcknowledgementTestScript</p><p><b>title</b>: Send duplicate acknowledgement - OK</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 duplicate acknowledgement - OK</p><p><b>copyright</b>: MedCom 2023</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/Acknowledgement/draft/Send/Fixtures/HospitalNotification-fixture-STIN-ok.xml\">/FHIRSandbox/MedCom/Acknowledgement/draft/Send/Fixtures/HospitalNotification-fixture-STIN-ok.xml</a></p></blockquote><blockquote><p><b>fixture</b></p><blockquote><p><b>id</b></p>create-STIN2-03</blockquote><p><b>autocreate</b>: false</p><p><b>autodelete</b>: false</p><p><b>resource</b>: <a href=\"/FHIRSandbox/MedCom/Acknowledgement/draft/Send/Fixtures/HospitalNotification-fixture-STIN-ok.xml\">/FHIRSandbox/MedCom/Acknowledgement/draft/Send/Fixtures/HospitalNotification-fixture-STIN-ok.xml</a></p></blockquote><blockquote><p><b>fixture</b></p><blockquote><p><b>id</b></p>create-ok-02</blockquote><p><b>autocreate</b>: false</p><p><b>autodelete</b>: false</p><p><b>resource</b>: <a href=\"/FHIRSandbox/MedCom/Acknowledgement/draft/Send/Fixtures/Acknowledgement-fixture.xml\">/FHIRSandbox/MedCom/Acknowledgement/draft/Send/Fixtures/Acknowledgement-fixture.xml</a></p></blockquote><blockquote><p><b>fixture</b></p><blockquote><p><b>id</b></p>create-ok-04</blockquote><p><b>autocreate</b>: false</p><p><b>autodelete</b>: false</p><p><b>resource</b>: <a href=\"/FHIRSandbox/MedCom/Acknowledgement/draft/Send/Fixtures/Acknowledgement-fixture.xml\">/FHIRSandbox/MedCom/Acknowledgement/draft/Send/Fixtures/Acknowledgement-fixture.xml</a></p></blockquote><p><b>profile</b>: <a href=\"http://medcomfhir.dk/ig/acknowledgement/StructureDefinition/medcom-messaging-acknowledgement\">http://medcomfhir.dk/ig/acknowledgement/StructureDefinition/medcom-messaging-acknowledgement</a> &quot;MedComAcknowledgementMessage&quot;</p><blockquote><p><b>variable</b></p><p><b>name</b>: destinationUri-STIN</p><p><b>expression</b>: Bundle.entry.resource.ofType(MessageHeader).destination.endpoint</p><p><b>sourceId</b>: create-STIN-01</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: bundleid-STIN-01</p><p><b>expression</b>: Bundle.id</p><p><b>sourceId</b>: create-STIN-01</p></blockquote><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-STIN-01</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: destinationUri-STIN2</p><p><b>expression</b>: Bundle.entry.resource.ofType(MessageHeader).destination.endpoint</p><p><b>sourceId</b>: create-STIN2-03</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: bundleid-STIN2-03</p><p><b>expression</b>: Bundle.id</p><p><b>sourceId</b>: create-STIN2-03</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: messageHeaderid-STIN2</p><p><b>expression</b>: Bundle.entry[0].fullUrl</p><p><b>sourceId</b>: create-STIN2-03</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: bundleid-ok-02</p><p><b>expression</b>: Bundle.id</p><p><b>sourceId</b>: create-message-ok-02</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: bundletimestamp-ok-02</p><p><b>expression</b>: Bundle.timestamp</p><p><b>sourceId</b>: create-message-ok-02</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: bundleid-ok-04</p><p><b>expression</b>: Bundle.id</p><p><b>sourceId</b>: create-message-ok-04</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: bundletimestamp-ok-04</p><p><b>expression</b>: Bundle.timestamp</p><p><b>sourceId</b>: create-message-ok-04</p></blockquote><blockquote><p><b>setup</b></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>Accept</b></td><td><b>EncodeRequestUrl</b></td><td><b>Params</b></td></tr><tr><td>*</td><td>Delete (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code delete = 'Delete', stated as 'null')</td><td>Bundle</td><td>System-generated search and delete operations from conditional delete on Bundle MessageHeader.destination.endpoint</td><td>xml</td><td>true</td><td>?message.destination-uri=${destinationUri-STIN}</td></tr></table></blockquote><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>Accept</b></td><td><b>ContentType</b></td><td><b>EncodeRequestUrl</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>Create the Bundle resource in XML format on the destination server.</td><td>xml</td><td>xml</td><td>true</td><td>create-STIN-01</td></tr></table></blockquote><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>Accept</b></td><td><b>ContentType</b></td><td><b>EncodeRequestUrl</b></td><td><b>Params</b></td><td><b>SourceId</b></td></tr><tr><td>*</td><td>Create using Update (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code updateCreate = 'Create using Update', stated as 'null')</td><td>Bundle</td><td>Update the Bundle.id in XML format on the destination server, so it corresponds to $bundleid-STIN-01.</td><td>xml</td><td>xml</td><td>true</td><td>/${bundleid-STIN-01}</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>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>Accept</b></td><td><b>ContentType</b></td><td><b>EncodeRequestUrl</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>Create the Bundle resource in XML format on the destination server.</td><td>xml</td><td>xml</td><td>true</td><td>create-STIN2-03</td></tr></table></blockquote><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>Accept</b></td><td><b>ContentType</b></td><td><b>EncodeRequestUrl</b></td><td><b>Params</b></td><td><b>SourceId</b></td></tr><tr><td>*</td><td>Create using Update (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code updateCreate = 'Create using Update', stated as 'null')</td><td>Bundle</td><td>Update the Bundle.id in XML format on the destination server, so it corresponds to $bundleid-STIN2-03.</td><td>xml</td><td>xml</td><td>true</td><td>/${bundleid-STIN2-03}</td><td>create-STIN2-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><blockquote><p><b>test</b></p><blockquote><p><b>id</b></p>message-read-STIN-01</blockquote><p><b>name</b>: Get a STIN message 01</p><p><b>description</b>: GET a message. The expected response is a 200(OK) with a payload of the message resource in XML format.</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>Accept</b></td><td><b>Destination</b></td><td><b>EncodeRequestUrl</b></td><td><b>Origin</b></td><td><b>Params</b></td></tr><tr><td>*</td><td>Read (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code read = 'Read', stated as 'null')</td><td>Bundle</td><td>Receive message</td><td>xml</td><td>1</td><td>true</td><td>1</td><td>/${bundleid-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><blockquote><p><b>test</b></p><blockquote><p><b>id</b></p>message-create-ok-02</blockquote><p><b>name</b>: Create an Acknowledegment ok Message 02</p><p><b>description</b>: Post Acknowledegment 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>RequestId</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 an Acknowledegment</td><td>1</td><td>true</td><td>1</td><td>create-message-ok-02</td><td>create-ok-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/acknowledgement/StructureDefinition/medcom-messaging-acknowledgement</td><td>request</td><td>acknowledgement</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 = 'acknowledgement-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>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that MessageHeader.responseCode equals to ok</td><td>request</td><td>Bundle.entry.resource.ofType(MessageHeader).response.code = 'ok'</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 a OperationOutcome instance is included, when the responseCode is 'transient-error' or 'fatal-error'</td><td>request</td><td>Bundle.entry.resource.ofType(MessageHeader).response.code = 'ok' or ((Bundle.entry.resource.ofType(MessageHeader).response.code = 'transient-error' or Bundle.entry.resource.ofType(MessageHeader).response.code = 'fatal-error') and Bundle.entry.resource.ofType(OperationOutcome).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 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>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 2 Provenance instances exists.</td><td>request</td><td>Bundle.entry.resource.ofType(Provenance).count() = 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 one Provenance instance contains the expected activity code.</td><td>request</td><td>Bundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'acknowledgement').count() = 1</td><td>false</td></tr></table></blockquote></blockquote><blockquote><p><b>test</b></p><blockquote><p><b>id</b></p>message-read-STIN2-03</blockquote><p><b>name</b>: Get a STIN2 message 03</p><p><b>description</b>: GET a message. The expected response is a 200(OK) with a payload of the message resource in XML format.</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>Accept</b></td><td><b>Destination</b></td><td><b>EncodeRequestUrl</b></td><td><b>Origin</b></td><td><b>Params</b></td></tr><tr><td>*</td><td>Read (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code read = 'Read', stated as 'null')</td><td>Bundle</td><td>Receive message</td><td>xml</td><td>1</td><td>true</td><td>1</td><td>/${bundleid-STIN2-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><blockquote><p><b>test</b></p><blockquote><p><b>id</b></p>message-create-ok-04</blockquote><p><b>name</b>: Create an Acknowledegment ok Message 04</p><p><b>description</b>: Post Acknowledegment 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>RequestId</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 an Acknowledegment</td><td>1</td><td>true</td><td>1</td><td>create-message-ok-04</td><td>create-ok-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/acknowledgement/StructureDefinition/medcom-messaging-acknowledgement</td><td>request</td><td>acknowledgement</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-STIN2}').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 = 'acknowledgement-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>WarningOnly</b></td></tr><tr><td>*</td><td>Confirm that MessageHeader.responseCode equals to ok</td><td>request</td><td>Bundle.entry.resource.ofType(MessageHeader).response.code = 'ok'</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 a OperationOutcome instance is included, when the responseCode is 'transient-error' or 'fatal-error'</td><td>request</td><td>Bundle.entry.resource.ofType(MessageHeader).response.code = 'ok' or ((Bundle.entry.resource.ofType(MessageHeader).response.code = 'transient-error' or Bundle.entry.resource.ofType(MessageHeader).response.code = 'fatal-error') and Bundle.entry.resource.ofType(OperationOutcome).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 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>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 2 Provenance instances exists.</td><td>request</td><td>Bundle.entry.resource.ofType(Provenance).count() = 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 one Provenance instance contains the expected activity code.</td><td>request</td><td>Bundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'acknowledgement').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 Bundle.timestamp of the two Acknowledgements are different.</td><td>request</td><td>'${bundletimestamp-ok-02}' != '${bundletimestamp-ok-04}'</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 Bundle.id of the two Acknowledgements are different.</td><td>request</td><td>'${bundleid-ok-02}' != '${bundleid-ok-04}'</td><td>false</td></tr></table></blockquote></blockquote></div>"
  ] ; # 
  fhir:url [ fhir:v "http://medcomfhir.dk/ig/acknowledgementtestscript/acknowledgement-send-ok-duplicate-hospitalnotification"^^xsd:anyURI] ; # 
  fhir:version [ fhir:v "2.0.0"] ; # 
  fhir:name [ fhir:v "AcknowledgementTestScript"] ; # 
  fhir:title [ fhir:v "Send duplicate acknowledgement - OK"] ; # 
  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 duplicate acknowledgement - OK"] ; # 
  fhir:copyright [ fhir:v "MedCom 2023"] ; # 
  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-STIN-01" ] ;
fhir:autocreate [ fhir:v "false"^^xsd:boolean ] ;
fhir:autodelete [ fhir:v "false"^^xsd:boolean ] ;
fhir:resource [
fhir:reference [ fhir:v "/FHIRSandbox/MedCom/Acknowledgement/draft/Send/Fixtures/HospitalNotification-fixture-STIN-ok.xml" ]     ]
  ] [
fhir:id [ fhir:v "create-STIN2-03" ] ;
fhir:autocreate [ fhir:v "false"^^xsd:boolean ] ;
fhir:autodelete [ fhir:v "false"^^xsd:boolean ] ;
fhir:resource [
fhir:reference [ fhir:v "/FHIRSandbox/MedCom/Acknowledgement/draft/Send/Fixtures/HospitalNotification-fixture-STIN-ok.xml" ]     ]
  ] [
fhir:id [ fhir:v "create-ok-02" ] ;
fhir:autocreate [ fhir:v "false"^^xsd:boolean ] ;
fhir:autodelete [ fhir:v "false"^^xsd:boolean ] ;
fhir:resource [
fhir:reference [ fhir:v "/FHIRSandbox/MedCom/Acknowledgement/draft/Send/Fixtures/Acknowledgement-fixture.xml" ]     ]
  ] [
fhir:id [ fhir:v "create-ok-04" ] ;
fhir:autocreate [ fhir:v "false"^^xsd:boolean ] ;
fhir:autodelete [ fhir:v "false"^^xsd:boolean ] ;
fhir:resource [
fhir:reference [ fhir:v "/FHIRSandbox/MedCom/Acknowledgement/draft/Send/Fixtures/Acknowledgement-fixture.xml" ]     ]
  ] ) ; # 
  fhir:profile ( [
fhir:link <http://medcomfhir.dk/ig/acknowledgement/StructureDefinition/medcom-messaging-acknowledgement> ;
fhir:id [ fhir:v "acknowledgement" ] ;
fhir:reference [ fhir:v "http://medcomfhir.dk/ig/acknowledgement/StructureDefinition/medcom-messaging-acknowledgement" ]
  ] ) ; # 
  fhir:variable ( [
fhir:name [ fhir:v "destinationUri-STIN" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(MessageHeader).destination.endpoint" ] ;
fhir:sourceId [ fhir:v "create-STIN-01" ]
  ] [
fhir:name [ fhir:v "bundleid-STIN-01" ] ;
fhir:expression [ fhir:v "Bundle.id" ] ;
fhir:sourceId [ fhir:v "create-STIN-01" ]
  ] [
fhir:name [ fhir:v "messageHeaderid-STIN" ] ;
fhir:expression [ fhir:v "Bundle.entry[0].fullUrl" ] ;
fhir:sourceId [ fhir:v "create-STIN-01" ]
  ] [
fhir:name [ fhir:v "destinationUri-STIN2" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(MessageHeader).destination.endpoint" ] ;
fhir:sourceId [ fhir:v "create-STIN2-03" ]
  ] [
fhir:name [ fhir:v "bundleid-STIN2-03" ] ;
fhir:expression [ fhir:v "Bundle.id" ] ;
fhir:sourceId [ fhir:v "create-STIN2-03" ]
  ] [
fhir:name [ fhir:v "messageHeaderid-STIN2" ] ;
fhir:expression [ fhir:v "Bundle.entry[0].fullUrl" ] ;
fhir:sourceId [ fhir:v "create-STIN2-03" ]
  ] [
fhir:name [ fhir:v "bundleid-ok-02" ] ;
fhir:expression [ fhir:v "Bundle.id" ] ;
fhir:sourceId [ fhir:v "create-message-ok-02" ]
  ] [
fhir:name [ fhir:v "bundletimestamp-ok-02" ] ;
fhir:expression [ fhir:v "Bundle.timestamp" ] ;
fhir:sourceId [ fhir:v "create-message-ok-02" ]
  ] [
fhir:name [ fhir:v "bundleid-ok-04" ] ;
fhir:expression [ fhir:v "Bundle.id" ] ;
fhir:sourceId [ fhir:v "create-message-ok-04" ]
  ] [
fhir:name [ fhir:v "bundletimestamp-ok-04" ] ;
fhir:expression [ fhir:v "Bundle.timestamp" ] ;
fhir:sourceId [ fhir:v "create-message-ok-04" ]
  ] ) ; # 
  fhir:setup [
    ( fhir:action [
fhir:operation [
fhir:type [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/testscript-operation-codes"^^xsd:anyURI ] ;
fhir:code [ fhir:v "delete" ]         ] ;
fhir:resource [ fhir:v "Bundle" ] ;
fhir:description [ fhir:v "System-generated search and delete operations from conditional delete on Bundle MessageHeader.destination.endpoint" ] ;
fhir:accept [ fhir:v "xml" ] ;
fhir:encodeRequestUrl [ fhir:v "true"^^xsd:boolean ] ;
fhir:params [ fhir:v "?message.destination-uri=${destinationUri-STIN}" ]       ]     ] [
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 "Create the Bundle resource in XML format on the destination server." ] ;
fhir:accept [ fhir:v "xml" ] ;
fhir:contentType [ fhir:v "xml" ] ;
fhir:encodeRequestUrl [ fhir:v "true"^^xsd:boolean ] ;
fhir:sourceId [ fhir:v "create-STIN-01" ]       ]     ] [
fhir:operation [
fhir:type [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/testscript-operation-codes"^^xsd:anyURI ] ;
fhir:code [ fhir:v "updateCreate" ]         ] ;
fhir:resource [ fhir:v "Bundle" ] ;
fhir:description [ fhir:v "Update the Bundle.id in XML format on the destination server, so it corresponds to $bundleid-STIN-01." ] ;
fhir:accept [ fhir:v "xml" ] ;
fhir:contentType [ fhir:v "xml" ] ;
fhir:encodeRequestUrl [ fhir:v "true"^^xsd:boolean ] ;
fhir:params [ fhir:v "/${bundleid-STIN-01}" ] ;
fhir:sourceId [ fhir:v "create-STIN-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: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 "Create the Bundle resource in XML format on the destination server." ] ;
fhir:accept [ fhir:v "xml" ] ;
fhir:contentType [ fhir:v "xml" ] ;
fhir:encodeRequestUrl [ fhir:v "true"^^xsd:boolean ] ;
fhir:sourceId [ fhir:v "create-STIN2-03" ]       ]     ] [
fhir:operation [
fhir:type [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/testscript-operation-codes"^^xsd:anyURI ] ;
fhir:code [ fhir:v "updateCreate" ]         ] ;
fhir:resource [ fhir:v "Bundle" ] ;
fhir:description [ fhir:v "Update the Bundle.id in XML format on the destination server, so it corresponds to $bundleid-STIN2-03." ] ;
fhir:accept [ fhir:v "xml" ] ;
fhir:contentType [ fhir:v "xml" ] ;
fhir:encodeRequestUrl [ fhir:v "true"^^xsd:boolean ] ;
fhir:params [ fhir:v "/${bundleid-STIN2-03}" ] ;
fhir:sourceId [ fhir:v "create-STIN2-03" ]       ]     ] [
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:test ( [
fhir:id [ fhir:v "message-read-STIN-01" ] ;
fhir:name [ fhir:v "Get a STIN message 01" ] ;
fhir:description [ fhir:v "GET a message. The expected response is a 200(OK) with a payload of the message resource in XML format." ] ;
    ( fhir:action [
fhir:operation [
fhir:type [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/testscript-operation-codes"^^xsd:anyURI ] ;
fhir:code [ fhir:v "read" ]         ] ;
fhir:resource [ fhir:v "Bundle" ] ;
fhir:description [ fhir:v "Receive message" ] ;
fhir:accept [ fhir:v "xml" ] ;
fhir:destination [ fhir:v "1"^^xsd:integer ] ;
fhir:encodeRequestUrl [ fhir:v "true"^^xsd:boolean ] ;
fhir:origin [ fhir:v "1"^^xsd:integer ] ;
fhir:params [ fhir:v "/${bundleid-STIN-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:id [ fhir:v "message-create-ok-02" ] ;
fhir:name [ fhir:v "Create an Acknowledegment ok Message 02" ] ;
fhir:description [ fhir:v "Post Acknowledegment 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 an Acknowledegment" ] ;
fhir:destination [ fhir:v "1"^^xsd:integer ] ;
fhir:encodeRequestUrl [ fhir:v "true"^^xsd:boolean ] ;
fhir:origin [ fhir:v "1"^^xsd:integer ] ;
fhir:requestId [ fhir:v "create-message-ok-02" ] ;
fhir:sourceId [ fhir:v "create-ok-02" ]       ]     ] [
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/acknowledgement/StructureDefinition/medcom-messaging-acknowledgement" ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:validateProfileId [ fhir:v "acknowledgement" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that the previous MessageHeader fullURL is identical to Provenance.entity.what" ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(Provenance).where(entity.what.reference = '${messageHeaderid-STIN}').count() = 1" ] ;
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 = 'acknowledgement-message').allTrue()" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that MessageHeader.responseCode equals to ok" ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(MessageHeader).response.code = 'ok'" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that a OperationOutcome instance is included, when the responseCode is 'transient-error' or 'fatal-error'" ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(MessageHeader).response.code = 'ok' or ((Bundle.entry.resource.ofType(MessageHeader).response.code = 'transient-error' or Bundle.entry.resource.ofType(MessageHeader).response.code = 'fatal-error') and Bundle.entry.resource.ofType(OperationOutcome).exists())" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that the role is set to revision. Not used when testing the first message in a stream" ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(Provenance).entity.role" ] ;
fhir:operator [ fhir:v "equals" ] ;
fhir:value [ fhir:v "revision" ] ;
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 2 Provenance instances exists." ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(Provenance).count() = 2" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that the one Provenance instance contains the expected activity code." ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'acknowledgement').count() = 1" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] )
  ] [
fhir:id [ fhir:v "message-read-STIN2-03" ] ;
fhir:name [ fhir:v "Get a STIN2 message 03" ] ;
fhir:description [ fhir:v "GET a message. The expected response is a 200(OK) with a payload of the message resource in XML format." ] ;
    ( fhir:action [
fhir:operation [
fhir:type [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/testscript-operation-codes"^^xsd:anyURI ] ;
fhir:code [ fhir:v "read" ]         ] ;
fhir:resource [ fhir:v "Bundle" ] ;
fhir:description [ fhir:v "Receive message" ] ;
fhir:accept [ fhir:v "xml" ] ;
fhir:destination [ fhir:v "1"^^xsd:integer ] ;
fhir:encodeRequestUrl [ fhir:v "true"^^xsd:boolean ] ;
fhir:origin [ fhir:v "1"^^xsd:integer ] ;
fhir:params [ fhir:v "/${bundleid-STIN2-03}" ]       ]     ] [
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:id [ fhir:v "message-create-ok-04" ] ;
fhir:name [ fhir:v "Create an Acknowledegment ok Message 04" ] ;
fhir:description [ fhir:v "Post Acknowledegment 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 an Acknowledegment" ] ;
fhir:destination [ fhir:v "1"^^xsd:integer ] ;
fhir:encodeRequestUrl [ fhir:v "true"^^xsd:boolean ] ;
fhir:origin [ fhir:v "1"^^xsd:integer ] ;
fhir:requestId [ fhir:v "create-message-ok-04" ] ;
fhir:sourceId [ fhir:v "create-ok-04" ]       ]     ] [
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/acknowledgement/StructureDefinition/medcom-messaging-acknowledgement" ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:validateProfileId [ fhir:v "acknowledgement" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that the previous MessageHeader fullURL is identical to Provenance.entity.what" ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(Provenance).where(entity.what.reference = '${messageHeaderid-STIN2}').count() = 1" ] ;
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 = 'acknowledgement-message').allTrue()" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that MessageHeader.responseCode equals to ok" ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(MessageHeader).response.code = 'ok'" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that a OperationOutcome instance is included, when the responseCode is 'transient-error' or 'fatal-error'" ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(MessageHeader).response.code = 'ok' or ((Bundle.entry.resource.ofType(MessageHeader).response.code = 'transient-error' or Bundle.entry.resource.ofType(MessageHeader).response.code = 'fatal-error') and Bundle.entry.resource.ofType(OperationOutcome).exists())" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that the role is set to revision. Not used when testing the first message in a stream" ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(Provenance).entity.role" ] ;
fhir:operator [ fhir:v "equals" ] ;
fhir:value [ fhir:v "revision" ] ;
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 2 Provenance instances exists." ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(Provenance).count() = 2" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that the one Provenance instance contains the expected activity code." ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "Bundle.entry.resource.ofType(Provenance).where(activity.coding.code = 'acknowledgement').count() = 1" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that the Bundle.timestamp of the two Acknowledgements are different." ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "'${bundletimestamp-ok-02}' != '${bundletimestamp-ok-04}'" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] [
fhir:assert [
fhir:description [ fhir:v "Confirm that the Bundle.id of the two Acknowledgements are different." ] ;
fhir:direction [ fhir:v "request" ] ;
fhir:expression [ fhir:v "'${bundleid-ok-02}' != '${bundleid-ok-04}'" ] ;
fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]       ]     ] )
  ] ) . #