Name | /FHIRSandbox/DaVinci/FHIR4-0-1-PAS/PAS-2-0-1/03-PAS-Pended/01-PAS-Subscriptions/01-RESTHooks/02-dv-pas-03-RestHookSubListener |
Description | Rest Hook listener for testing Rest Hook Subscriptions as defined in DaVinci PAS IG version 1.2.0. This test listens for the Notification on the Subscription that a change has occurred on the Claim, then turns around an inquires on it. redirectURL = the url that the empty POST is expected to be sent to as defined by the Subscription resource origin 1: client which will request the created/updated claimResponse once prompted by the empty POST origin 2: client endpoint that the empty POST will originate from destination 1: server to accept the empty POST (endpoint in Touchstone should not matter, it is being overridden by the endpointURL variable destination 2: server with created/updated claimResponse on it (should also be the server with the Subscription resource) |
Version | 1 | Latest | 1 |
<?xml version="1.0" encoding="UTF-8"?>
<TestScript xmlns="http://hl7.org/fhir">
<id value="pas-subscriptions-RestHookSubscriptionListener"/>
<meta>
<profile value="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript"/>
</meta>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule">
<extension url="ruleId">
<valueId value="rule-validate-pas-claimresponse-bundle-claimresponse"/>
</extension>
<extension url="path">
<valueString value="/FHIRCommon/_reference/rule/AssertValidateJSONExtractProfileId.groovy"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="jsonPath"/>
</extension>
<extension url="value">
<valueString value="$.entry[?(@.resource.resourceType == 'ClaimResponse')].resource"/>
</extension>
</extension>
<extension url="param">
<extension url="name">
<valueString value="profileId"/>
</extension>
<extension url="value">
<valueString value="PASClaimResponseProfile"/>
</extension>
</extension>
</extension>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule">
<extension url="ruleId">
<valueId value="rule-validate-pas-claiminqresponse-bundle-claimresponse"/>
</extension>
<extension url="path">
<valueString value="/FHIRCommon/_reference/rule/AssertValidateJSONExtractProfileId.groovy"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="jsonPath"/>
</extension>
<extension url="value">
<valueString value="$.entry[?(@.resource.resourceType == 'ClaimResponse')].resource"/>
</extension>
</extension>
<extension url="param">
<extension url="name">
<valueString value="profileId"/>
</extension>
<extension url="value">
<valueString value="PASClaimInquiryResponseProfile"/>
</extension>
</extension>
</extension>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule">
<extension url="ruleId">
<valueId value="rule-validate-pas-claim-inquiry-bundle-claim"/>
</extension>
<extension url="path">
<valueString value="/FHIRCommon/_reference/rule/AssertValidateJSONExtractProfileId-withFhirPath.groovy"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="jsonPath"/>
</extension>
<extension url="value">
<valueString value="$.entry[?(@.resource.resourceType == 'Claim')].resource"/>
</extension>
</extension>
<extension url="param">
<extension url="name">
<valueString value="fhirPath"/>
</extension>
<extension url="value">
<valueString value="Bundle.entry.resource.as(Claim)"/>
</extension>
</extension>
<extension url="param">
<extension url="name">
<valueString value="profileId"/>
</extension>
<extension url="value">
<valueString value="PASClaimProfile"/>
</extension>
</extension>
</extension>
<url value="http://wildfhir.aegis.net/FHIRSandbox/DaVinci/fhir4-0-1-PAS/PAS-2-0-1/03-PAS-Pended/01-PAS-Subscriptions/01-RESTHooks/02-dv-pas-03-RestHookSubListener.xml"/>
<name value="RestHookSubscriptionListener"/>
<status value="active"/>
<date value="2024-01-05"/>
<publisher value="AEGIS.net, Inc."/>
<contact>
<name value="Touchstone Support"/>
<telecom>
<system value="email"/>
<value value="Touchstone_Support@aegis.net"/>
<use value="work"/>
</telecom>
</contact>
<description value="Rest Hook listener for testing Rest Hook Subscriptions as defined in DaVinci PAS IG version 1.2.0. This test listens for the Notification on the Subscription that a change has occurred on the Claim, then turns around an inquires on it. redirectURL = the url that the empty POST is expected to be sent to as defined by the Subscription resource origin 1: client which will request the created/updated claimResponse once prompted by the empty POST origin 2: client endpoint that the empty POST will originate from destination 1: server to accept the empty POST (endpoint in Touchstone should not matter, it is being overridden by the endpointURL variable destination 2: server with created/updated claimResponse on it (should also be the server with the Subscription resource)"/>
<copyright value="This FHIR Test Script is licensed under Creative Commons (CC0) 'No Rights Reserved'. Learn more at https://creativecommons.org/licenses"/>
<origin>
<index value="1"/>
<profile>
<system value="http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types"/>
<code value="FHIR-Client"/>
</profile>
</origin>
<origin>
<index value="2"/>
<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>
<destination>
<index value="2"/>
<profile>
<system value="http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types"/>
<code value="FHIR-Server"/>
</profile>
</destination>
<fixture id="claim-inquiry-request-bundle">
<autocreate value="false"/>
<autodelete value="false"/>
<resource>
<reference value="./_reference/resources/rest-hook-subscription-claim-inq.json"/>
</resource>
</fixture>
<profile id="PASClaimResponseProfile">
<reference value="http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-claimresponse"/>
</profile>
<profile id="BackportStatusProfile">
<reference value="http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-subscription-status-r4"/>
</profile>
<profile id="PASRequestBundleProfile">
<reference value="http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-pas-inquiry-request-bundle"/>
</profile>
<profile id="PASResponseBundleProfile">
<reference value="http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-pas-inquiry-response-bundle"/>
</profile>
<profile id="PASClaimProfile">
<reference value="http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-claim-inquiry"/>
</profile>
<profile id="PASClaimInquiryResponseProfile">
<reference value="http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-claiminquiryresponse"/>
</profile>
<variable>
<name value="redirectURL"/>
<description value="the url that the empty POST is expected to be sent to as defined by the Subscription resource"/>
<hint value="the url that the empty POST is expected to be sent to as defined by the Subscription resource"/>
</variable>
<test id="RestHookListener">
<name value="RestHookListener"/>
<description value="Rest Hook Listener test to catch the notification sent by the server that the Subscription was created on."/>
<action>
<operation>
<type>
<system value="http://hl7.org/fhir/testscript-operation-codes"/>
<code value="search"/>
</type>
<description value="Listen for the empty notification post"/>
<destination value="1"/>
<encodeRequestUrl value="false"/>
<method value="post"/>
<origin value="2"/>
<url value="${redirectURL}"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<direction value="response"/>
<responseCode value="200"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<operation>
<type>
<system value="http://touchstone.com/fhir/testscript-operation-codes-extended"/>
<code value="inquiry"/>
</type>
<resource value="Claim"/>
<description value="Test Da Vinci PAS Claim $inquiry operation with HTTP Header Accept set to JSON format once a notification is returned indicating a change on the Claim."/>
<accept value="json"/>
<contentType value="json"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="/$inquiry"/>
<sourceId value="claim-inquiry-request-bundle"/>
</operation>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Confirm that the client requested an Accept of the FHIR JSON mime type 'application/fhir+json'."/>
<direction value="request"/>
<headerField value="Accept"/>
<operator value="contains"/>
<value value="application/fhir+json"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Confirm that the client request included a Content-Type of the FHIR JSON format."/>
<direction value="request"/>
<contentType value="json"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<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>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Confirm that the returned Bundle type is collection."/>
<direction value="request"/>
<operator value="equals"/>
<path value=".type"/>
<value value="collection"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Confirm that the request Bundle.entry contains a single Claim resource."/>
<direction value="request"/>
<expression value="Bundle.entry.select(resource as Claim).count()"/>
<value value="1"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Validate that the PAS Inquiry Bundle resource contents conforms to the Da Vinci PAS IG."/>
<direction value="request"/>
<validateProfileId value="PASRequestBundleProfile"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-rule">
<extension url="ruleId">
<valueId value="rule-validate-pas-claim-inquiry-bundle-claim"/>
</extension>
</extension>
<description value="Validate PAS Claim within the request PAS Bundle."/>
<direction value="request"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 200(Okay)."/>
<direction value="response"/>
<responseCode value="200"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Confirm that the returned HTTP Header Content-Type is present."/>
<direction value="response"/>
<headerField value="Content-Type"/>
<operator value="notEmpty"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Confirm that the returned HTTP Header Content-Type contains the FHIR mime-type 'application/fhir+json'."/>
<direction value="response"/>
<headerField value="Content-Type"/>
<operator value="contains"/>
<value value="application/fhir+json"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Confirm that the returned resource type is Bundle."/>
<direction value="response"/>
<resource value="Bundle"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Confirm that the returned Bundle type is collection."/>
<direction value="response"/>
<operator value="equals"/>
<path value=".type"/>
<value value="collection"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Confirm that the returned Bundle.entry contains a single ClaimResponse resource."/>
<direction value="response"/>
<expression value="Bundle.entry.select(resource as ClaimResponse).count()"/>
<value value="1"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Confirm that the returned Bundle conforms to the Da Vinci PAS IG."/>
<direction value="response"/>
<validateProfileId value="PASResponseBundleProfile"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-rule">
<extension url="ruleId">
<valueId value="rule-validate-pas-claiminqresponse-bundle-claimresponse"/>
</extension>
</extension>
<description value="Validate PAS ClaimResponse within the response PAS Bundle."/>
<direction value="response"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
</TestScript>