Name | /FHIRSandbox/DaVinci/FHIR4-0-1-Formulary/Formulary-STU2/01-Query/Formulary-STU2-Location-Endpoint-xml |
Description | To test the Formulary Location Resource API. SHALL requirements will be tested with failures and SHOULD requirements will be tested with warnings. |
Version | 2 | Latest | 2 |
<?xml version="1.0" encoding="UTF-8"?>
<TestScript xmlns="http://hl7.org/fhir">
<id value="Formulary-STU2-Location-Endpoint-xml"/>
<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>To test the Formulary Location Resource API. SHALL requirements will be tested with failures and SHOULD requirements will be tested with warnings.</p>
</div>
</text>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule">
<extension url="ruleId">
<valueId value="rule-extract-validate"/>
</extension>
<extension url="path">
<valueString value="/FHIRCommon/_reference/rule/AssertValidateXMLExtractProfileId.groovy"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="xPath"/>
</extension>
<extension url="value">
<valueString value="(Bundle/entry/resource/Location)[1]"/>
</extension>
</extension>
<extension url="param">
<extension url="name">
<valueString value="profileId"/>
</extension>
<extension url="value">
<valueString value="USDF-InsurancePlanLocation-profile"/>
</extension>
</extension>
</extension>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule">
<extension url="ruleId">
<valueId value="historyOrder"/>
</extension>
<extension url="path">
<valueString value="/FHIRCommon/_reference/rule/historyOrder.groovy"/>
</extension>
</extension>
<url value="http://wildfhir.aegis.net/fhir4-0-1/TestScript/Formulary-STU2-Location-Endpoint-xml"/>
<name value="DaVinciFormularyR401LocationXML"/>
<title value="Da Vinci - Formulary - FHIR R4 - 01 Location Endpoint - XML"/>
<status value="active"/>
<date value="2021-12-28"/>
<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="To test the Formulary Location Resource API. SHALL requirements will be tested with failures and SHOULD requirements will be tested with warnings."/>
<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>
<destination>
<index value="1"/>
<profile>
<system value="http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types"/>
<code value="FHIR-Server"/>
</profile>
</destination>
<profile id="USDF-InsurancePlanLocation-profile">
<reference value="http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-InsurancePlanLocation"/>
</profile>
<profile id="bundle-profile">
<reference value="http://hl7.org/fhir/StructureDefinition/Bundle"/>
</profile>
<variable>
<name value="Search-id"/>
<defaultValue value="InsurancePlanLocation1"/>
<description value="Enter the _id search value to find a InsurancePlanLocation resource on the Location endpoint."/>
</variable>
<variable>
<name value="Search-lastUpdated"/>
<defaultValue value="gt2020"/>
<description value="Enter the _lastUpdated search value to find a InsurancePlanLocation resource on the Location endpoint."/>
</variable>
<variable>
<name value="Search-address"/>
<defaultValue value="3300 Washtenaw Avenue, Suite 227"/>
<description value="Enter the address search value to find a InsurancePlanLocation resource on the Location endpoint."/>
</variable>
<variable>
<name value="Search-address-city"/>
<defaultValue value="Ann Arbor"/>
<description value="Enter the address-city search value to find a InsurancePlanLocation resource on the Location endpoint."/>
</variable>
<variable>
<name value="Search-address-state"/>
<defaultValue value="MI"/>
<description value="Enter the address-state search value to find a InsurancePlanLocation resource on the Location endpoint."/>
</variable>
<variable>
<name value="Search-address-postalcode"/>
<defaultValue value="48104"/>
<description value="Enter the address-postalcode search value to find a InsurancePlanLocation resource on the Location endpoint."/>
</variable>
<test id="01-SearchParameter-id">
<name value="SearchParameter-id"/>
<description value="Test the _id Search Parameter on the Location endpoint."/>
<action>
<operation>
<type>
<system value="http://hl7.org/fhir/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="Location"/>
<description value="Test the _id Search Parameter on the Location endpoint."/>
<accept value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="?_id=${Search-id}"/>
<responseId value="SearchIdResponse"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the client requested an Accept of the FHIR XML mime type 'application/fhir+xml'."/>
<direction value="request"/>
<headerField value="Accept"/>
<operator value="contains"/>
<value value="application/fhir+xml"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the client did not request a Content-Type. Warning-Only to allow for systems that automatically send Content-Type."/>
<direction value="request"/>
<headerField value="Content-Type"/>
<operator value="empty"/>
<warningOnly value="true"/>
</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 status is 200(OK)."/>
<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>
<description value="Confirm that the returned HTTP Header Content-Type contains the FHIR mime-type 'application/fhir+xml'."/>
<direction value="response"/>
<contentType value="xml"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<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 Bundle type is 'searchset'."/>
<direction value="response"/>
<operator value="equals"/>
<path value="Bundle/type"/>
<value value="searchset"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that there is at least one entry returned."/>
<direction value="response"/>
<expression value="Bundle.entry.resource.count()"/>
<operator value="greaterThan"/>
<value value="0"/>
<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 and its contents conform to the base FHIR specification."/>
<direction value="response"/>
<validateProfileId value="bundle-profile"/>
<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-extract-validate"/>
</extension>
</extension>
<description value="Validate InsurancePlanLocation-profile within the Bundle."/>
<direction value="response"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="01-SearchParameter-lastUpdated">
<name value="SearchParameter-lastUpdated"/>
<description value="Test the _lastUpdated Search Parameter on the Location endpoint."/>
<action>
<operation>
<type>
<system value="http://hl7.org/fhir/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="Location"/>
<description value="Test the _lastUpdated Search Parameter on the Location endpoint."/>
<accept value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="?_lastUpdated=${Search-lastUpdated}"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the client requested an Accept of the FHIR XML mime type 'application/fhir+xml'."/>
<direction value="request"/>
<headerField value="Accept"/>
<operator value="contains"/>
<value value="application/fhir+xml"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the client did not request a Content-Type. Warning-Only to allow for systems that automatically send Content-Type."/>
<direction value="request"/>
<headerField value="Content-Type"/>
<operator value="empty"/>
<warningOnly value="true"/>
</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 status is 200(OK)."/>
<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>
<description value="Confirm that the returned HTTP Header Content-Type contains the FHIR mime-type 'application/fhir+xml'."/>
<direction value="response"/>
<contentType value="xml"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<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 Bundle type is 'searchset'."/>
<direction value="response"/>
<operator value="equals"/>
<path value="Bundle/type"/>
<value value="searchset"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that there is at least one entry returned."/>
<direction value="response"/>
<expression value="Bundle.entry.resource.count()"/>
<operator value="greaterThan"/>
<value value="0"/>
<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 and its contents conform to the base FHIR specification."/>
<direction value="response"/>
<validateProfileId value="bundle-profile"/>
<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-extract-validate"/>
</extension>
</extension>
<description value="Validate InsurancePlanLocation-profile within the Bundle."/>
<direction value="response"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="01-SearchParameter-address">
<name value="SearchParameter-address"/>
<description value="Test the address Search Parameter on the Location endpoint."/>
<action>
<operation>
<type>
<system value="http://hl7.org/fhir/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="Location"/>
<description value="Test the address Search Parameter on the Location endpoint."/>
<accept value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="?address=${Search-address}"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the client requested an Accept of the FHIR XML mime type 'application/fhir+xml'."/>
<direction value="request"/>
<headerField value="Accept"/>
<operator value="contains"/>
<value value="application/fhir+xml"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the client did not request a Content-Type. Warning-Only to allow for systems that automatically send Content-Type."/>
<direction value="request"/>
<headerField value="Content-Type"/>
<operator value="empty"/>
<warningOnly value="true"/>
</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 status is 200(OK)."/>
<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>
<description value="Confirm that the returned HTTP Header Content-Type contains the FHIR mime-type 'application/fhir+xml'."/>
<direction value="response"/>
<contentType value="xml"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<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 Bundle type is 'searchset'."/>
<direction value="response"/>
<operator value="equals"/>
<path value="Bundle/type"/>
<value value="searchset"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that there is at least one entry returned."/>
<direction value="response"/>
<expression value="Bundle.entry.resource.count()"/>
<operator value="greaterThan"/>
<value value="0"/>
<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 and its contents conform to the base FHIR specification."/>
<direction value="response"/>
<validateProfileId value="bundle-profile"/>
<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-extract-validate"/>
</extension>
</extension>
<description value="Validate InsurancePlanLocation-profile within the Bundle."/>
<direction value="response"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="01-SearchParameter-address-city">
<name value="SearchParameter-address-city"/>
<description value="Test the address-city Search Parameter on the Location endpoint."/>
<action>
<operation>
<type>
<system value="http://hl7.org/fhir/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="Location"/>
<description value="Test the address-city Search Parameter on the Location endpoint."/>
<accept value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="?address-city=${Search-address-city}"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the client requested an Accept of the FHIR XML mime type 'application/fhir+xml'."/>
<direction value="request"/>
<headerField value="Accept"/>
<operator value="contains"/>
<value value="application/fhir+xml"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the client did not request a Content-Type. Warning-Only to allow for systems that automatically send Content-Type."/>
<direction value="request"/>
<headerField value="Content-Type"/>
<operator value="empty"/>
<warningOnly value="true"/>
</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 status is 200(OK)."/>
<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>
<description value="Confirm that the returned HTTP Header Content-Type contains the FHIR mime-type 'application/fhir+xml'."/>
<direction value="response"/>
<contentType value="xml"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<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 Bundle type is 'searchset'."/>
<direction value="response"/>
<operator value="equals"/>
<path value="Bundle/type"/>
<value value="searchset"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that there is at least one entry returned."/>
<direction value="response"/>
<expression value="Bundle.entry.resource.count()"/>
<operator value="greaterThan"/>
<value value="0"/>
<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 and its contents conform to the base FHIR specification."/>
<direction value="response"/>
<validateProfileId value="bundle-profile"/>
<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-extract-validate"/>
</extension>
</extension>
<description value="Validate InsurancePlanLocation-profile within the Bundle."/>
<direction value="response"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="01-SearchParameter-address-state">
<name value="SearchParameter-address-state"/>
<description value="Test the address-state Search Parameter on the Location endpoint."/>
<action>
<operation>
<type>
<system value="http://hl7.org/fhir/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="Location"/>
<description value="Test the address-state Search Parameter on the Location endpoint."/>
<accept value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="?address-state=${Search-address-state}"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the client requested an Accept of the FHIR XML mime type 'application/fhir+xml'."/>
<direction value="request"/>
<headerField value="Accept"/>
<operator value="contains"/>
<value value="application/fhir+xml"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the client did not request a Content-Type. Warning-Only to allow for systems that automatically send Content-Type."/>
<direction value="request"/>
<headerField value="Content-Type"/>
<operator value="empty"/>
<warningOnly value="true"/>
</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 status is 200(OK)."/>
<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>
<description value="Confirm that the returned HTTP Header Content-Type contains the FHIR mime-type 'application/fhir+xml'."/>
<direction value="response"/>
<contentType value="xml"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<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 Bundle type is 'searchset'."/>
<direction value="response"/>
<operator value="equals"/>
<path value="Bundle/type"/>
<value value="searchset"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that there is at least one entry returned."/>
<direction value="response"/>
<expression value="Bundle.entry.resource.count()"/>
<operator value="greaterThan"/>
<value value="0"/>
<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 and its contents conform to the base FHIR specification."/>
<direction value="response"/>
<validateProfileId value="bundle-profile"/>
<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-extract-validate"/>
</extension>
</extension>
<description value="Validate InsurancePlanLocation-profile within the Bundle."/>
<direction value="response"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="01-SearchParameter-address-postalcode">
<name value="SearchParameter-address-postalcode"/>
<description value="Test the address-postalcode Search Parameter on the Location endpoint."/>
<action>
<operation>
<type>
<system value="http://hl7.org/fhir/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="Location"/>
<description value="Test the address-postalcode Search Parameter on the Location endpoint."/>
<accept value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="?address-postalcode=${Search-address-postalcode}"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the client requested an Accept of the FHIR XML mime type 'application/fhir+xml'."/>
<direction value="request"/>
<headerField value="Accept"/>
<operator value="contains"/>
<value value="application/fhir+xml"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the client did not request a Content-Type. Warning-Only to allow for systems that automatically send Content-Type."/>
<direction value="request"/>
<headerField value="Content-Type"/>
<operator value="empty"/>
<warningOnly value="true"/>
</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 status is 200(OK)."/>
<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>
<description value="Confirm that the returned HTTP Header Content-Type contains the FHIR mime-type 'application/fhir+xml'."/>
<direction value="response"/>
<contentType value="xml"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<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 Bundle type is 'searchset'."/>
<direction value="response"/>
<operator value="equals"/>
<path value="Bundle/type"/>
<value value="searchset"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that there is at least one entry returned."/>
<direction value="response"/>
<expression value="Bundle.entry.resource.count()"/>
<operator value="greaterThan"/>
<value value="0"/>
<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 and its contents conform to the base FHIR specification."/>
<direction value="response"/>
<validateProfileId value="bundle-profile"/>
<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-extract-validate"/>
</extension>
</extension>
<description value="Validate InsurancePlanLocation-profile within the Bundle."/>
<direction value="response"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="05-read-Endpoint">
<name value="read-Endpoint"/>
<description value="Test the read endpoint for the Location API"/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="read"/>
</type>
<resource value="Location"/>
<description value="Test the read endpoint for the Location API"/>
<accept value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="/${Search-id}"/>
<responseId value="read-response"/>
</operation>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Verify a response is returned"/>
<direction value="response"/>
<operator value="in"/>
<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="Verify the response is a Location resource"/>
<direction value="response"/>
<resource value="Location"/>
<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="Verify the resource id exists"/>
<direction value="response"/>
<expression value="Location.id.exists()"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="05-vread-Endpoint">
<name value="vread-Endpoint"/>
<description value="Test the vread endpoint for the Location API"/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="vread"/>
</type>
<resource value="Location"/>
<description value="Test the vread endpoint for the Location API"/>
<accept value="xml"/>
<contentType value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<targetId value="read-response"/>
</operation>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Verify a response is returned"/>
<direction value="response"/>
<operator value="in"/>
<responseCode value="200,201"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Verify the response is a Location resource"/>
<direction value="response"/>
<resource value="Location"/>
<warningOnly value="true"/>
</assert>
</action>
</test>
<test id="06-history-Endpoint">
<name value="history-Endpoint"/>
<description value="Test the history endpoint for the Location API"/>
<action>
<operation>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-operation-pagesNext">
<valuePositiveInt value="10"/>
</extension>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="history-instance"/>
</type>
<resource value="Location"/>
<description value="Test the history endpoint for the Location API"/>
<accept value="xml"/>
<contentType value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<params value="/${Search-id}/_history"/>
<responseId value="testHistorySearch-1"/>
</operation>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Verify a response is returned"/>
<direction value="response"/>
<operator value="in"/>
<responseCode value="200"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Verify the response is a Bundle"/>
<direction value="response"/>
<resource value="Bundle"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Verify the response includes History"/>
<direction value="response"/>
<path value="Bundle/type"/>
<value value="history"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Verify the Location resource is found in the Bundle"/>
<direction value="response"/>
<expression value="Bundle.entry.resource.as(Location).exists()"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Validate response bundle"/>
<direction value="response"/>
<validateProfileId value="bundle-profile"/>
<warningOnly value="true"/>
</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="historyOrder"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="sourcePrefix"/>
</extension>
<extension url="value">
<valueString value="testHistorySearch"/>
</extension>
</extension>
</extension>
<description value="Validate History order"/>
<sourceId value="none"/>
<warningOnly value="true"/>
</assert>
</action>
</test>
</TestScript>