Name | /FHIRSandbox/DaVinci/FHIR4-0-1-PlanNetProvDir/Plan-Net-1-1-0/PlanNetProvDir-XML/03-Query/dv-pdex-r4-03-PlanNet-03-Query-01-endpoint-xml |
Description | Da Vinci - PDex Plan Net 1.1.0 - FHIR R4 - Scenario 03 PlanNet - Query - Search for resources that conform to the PlanNet Endpoint profile. This test will query for up to 100 Endpoint resources and require that at least 1 is returned, then using the returned resource data, build queries back to the server, expecting at least one matching resource to each query. |
Version | 1 | Latest | 1 |
<?xml version="1.0" encoding="UTF-8"?>
<TestScript xmlns="http://hl7.org/fhir">
<id value="dv-pdex-r4-03-plannet-03-query-01-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>Da Vinci - PDex - FHIR R4 - 03 PlanNet - 03 Query - 01 Endpoints - XML</p>
</div>
</text>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule">
<extension url="ruleId">
<valueId value="rule-validate-PDex-PlanNet"/>
</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/Endpoint)[1]"/>
</extension>
</extension>
<extension url="param">
<extension url="name">
<valueString value="profileId"/>
</extension>
<extension url="value">
<valueString value="PDex-PlanNet-Endpoint-profile"/>
</extension>
</extension>
</extension>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule">
<extension url="ruleId">
<valueId value="rule-ReplaceNullVariable"/>
</extension>
<extension url="path">
<valueString value="/FHIRCommon/_reference/rule/ReplaceNullVariable.groovy"/>
</extension>
</extension>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule">
<extension url="ruleId">
<valueId value="rule-GetVariable-FhirPath"/>
</extension>
<extension url="path">
<valueString value="/FHIRCommon/_reference/rule/GetVariable-FhirPath.groovy"/>
</extension>
</extension>
<url value="http://wildfhir.aegis.net/fhir4-0-0/TestScript/dv-pdex-r4-03-plannet-03-query-01-endpoint-xml"/>
<name value="DaVinciPDexR403PlanNet03Query01EndpointXML"/>
<title value="Da Vinci - PDex - FHIR R4 - PlanNet - XML"/>
<status value="active"/>
<date value="2023-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="Da Vinci - PDex Plan Net 1.1.0 - FHIR R4 - Scenario 03 PlanNet - Query - Search for resources that conform to the PlanNet Endpoint profile. This test will query for up to 100 Endpoint resources and require that at least 1 is returned, then using the returned resource data, build queries back to the server, expecting at least one matching resource to each query."/>
<copyright value="This FHIR Test Script is licensed under Creative Commons (CC0) 'No Rights Reserved'. Learn more at https://creativecommons.org/licenses"/>
<origin id="SMART-on-FHIR App">
<index value="1"/>
<profile>
<system value="http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types"/>
<code value="FHIR-Client"/>
</profile>
</origin>
<destination id="Payer FHIR Server">
<index value="1"/>
<profile>
<system value="http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types"/>
<code value="FHIR-Server"/>
</profile>
</destination>
<profile id="bundle-profile">
<reference value="http://hl7.org/fhir/StructureDefinition/Bundle"/>
</profile>
<profile id="PDex-PlanNet-Endpoint-profile">
<reference value="http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/plannet-Endpoint"/>
</profile>
<variable>
<name value="organizationValue"/>
<expression value="Bundle.entry.resource.managingOrganization.reference"/>
<sourceId value="searchResponse"/>
</variable>
<variable>
<name value="resourceId"/>
<expression value="Bundle.entry.resource.id"/>
<sourceId value="searchResponse"/>
</variable>
<variable>
<name value="lastUpdatedValue"/>
<expression value="Bundle.entry.resource.meta.lastUpdated"/>
<sourceId value="searchResponse"/>
</variable>
<test id="01-Search-Endpoints">
<name value="SearchEndpoints"/>
<description value="Search for endpoints conforming to the PlanNet-Endpoint profile."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="Endpoint"/>
<description value="Search for endpoints conforming to the PlanNet-Endpoint profile."/>
<accept value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="?_count=100"/>
<responseId value="searchResponse"/>
</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 XML mime type 'application/fhir+xml'."/>
<direction value="request"/>
<headerField value="Accept"/>
<operator value="contains"/>
<value value="application/fhir+xml"/>
<warningOnly value="false"/>
</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>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<direction value="response"/>
<responseCode value="200"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<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+xml'."/>
<direction value="response"/>
<contentType value="xml"/>
<warningOnly value="false"/>
</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>
<description value="Confirm that the returned Bundle type is searchset."/>
<direction value="response"/>
<operator value="equals"/>
<path value="Bundle/type"/>
<value value="searchset"/>
<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 base FHIR specification."/>
<direction value="response"/>
<validateProfileId value="bundle-profile"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned Bundle has at least 1 entry"/>
<direction value="response"/>
<expression value="Bundle.entry.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>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-rule">
<extension url="ruleId">
<valueId value="rule-validate-PDex-PlanNet"/>
</extension>
</extension>
<description value="Validate PDex Endpoint within the search Bundle."/>
<direction value="response"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="02-Search-Endpoints-by-organization">
<name value="SearchEndpoints-by-organization"/>
<description value="Search for endpoints conforming to the PlanNet-Endpoint profile using an organization found on a resource returned in the previous test."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="Endpoint"/>
<description value="Search for endpoints conforming to the PlanNet-Endpoint profile."/>
<accept value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="?organization=${organizationValue}"/>
</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 XML mime type 'application/fhir+xml'."/>
<direction value="request"/>
<headerField value="Accept"/>
<operator value="contains"/>
<value value="application/fhir+xml"/>
<warningOnly value="false"/>
</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>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<direction value="response"/>
<responseCode value="200"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<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+xml'."/>
<direction value="response"/>
<contentType value="xml"/>
<warningOnly value="false"/>
</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>
<description value="Confirm that the returned Bundle type is searchset."/>
<direction value="response"/>
<operator value="equals"/>
<path value="Bundle/type"/>
<value value="searchset"/>
<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 base FHIR specification."/>
<direction value="response"/>
<validateProfileId value="bundle-profile"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned Bundle has more than 0 entries"/>
<direction value="response"/>
<expression value="Bundle.entry.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>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-rule">
<extension url="ruleId">
<valueId value="rule-validate-PDex-PlanNet"/>
</extension>
</extension>
<description value="Validate PDex Endpoint within the search Bundle."/>
<direction value="response"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="03-Search-Endpoints-include-organization">
<name value="SearchEndpoints-include-organization"/>
<description value="Search for endpoints conforming to the PlanNet-Endpoint profile using the _include search using an organization found on a resource returned in the first test."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="Endpoint"/>
<description value="Search for endpoints conforming to the PlanNet-Endpoint profile."/>
<accept value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="?_include=Endpoint:organization&_count=100"/>
</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 XML mime type 'application/fhir+xml'."/>
<direction value="request"/>
<headerField value="Accept"/>
<operator value="contains"/>
<value value="application/fhir+xml"/>
<warningOnly value="false"/>
</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>
<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+xml'."/>
<direction value="response"/>
<contentType value="xml"/>
<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 searchset."/>
<direction value="response"/>
<operator value="equals"/>
<path value="Bundle/type"/>
<value value="searchset"/>
<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 base FHIR specification."/>
<direction value="response"/>
<validateProfileId value="bundle-profile"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned Bundle has more than 0 entries"/>
<direction value="response"/>
<expression value="Bundle.entry.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 has at least one Endpoint resource"/>
<direction value="response"/>
<expression value="Bundle.entry.select(resource as Endpoint).exists()"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned Bundle has at least one Organization resource"/>
<direction value="response"/>
<expression value="Bundle.entry.select(resource as Organization).where((type.coding.code contains 'ntwk').not()).exists()"/>
<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-PDex-PlanNet"/>
</extension>
</extension>
<description value="Validate PDex Endpoint within the search Bundle."/>
<direction value="response"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="04-Search-Endpoints-by-_id">
<name value="Search-Endpoints-by-_id"/>
<description value="Search for Endpoints conforming to the PlanNet-Endpoint profile using _id from an using an organization.id found on a resource returned in the first test."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="Endpoint"/>
<description value="Search for Endpoints conforming to the PlanNet-Endpoint profile."/>
<accept value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="?_id=${resourceId}"/>
</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 XML mime type 'application/fhir+xml'."/>
<direction value="request"/>
<headerField value="Accept"/>
<operator value="contains"/>
<value value="application/fhir+xml"/>
<warningOnly value="false"/>
</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>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<direction value="response"/>
<responseCode value="200"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<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+xml'."/>
<direction value="response"/>
<contentType value="xml"/>
<warningOnly value="false"/>
</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>
<description value="Confirm that the returned Bundle type is searchset."/>
<direction value="response"/>
<operator value="equals"/>
<path value="Bundle/type"/>
<value value="searchset"/>
<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 base FHIR specification."/>
<direction value="response"/>
<validateProfileId value="bundle-profile"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned Bundle has more than 0 entries"/>
<direction value="response"/>
<expression value="Bundle.entry.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>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-rule">
<extension url="ruleId">
<valueId value="rule-validate-PDex-PlanNet"/>
</extension>
</extension>
<description value="Validate PDex Endpoint within the search Bundle."/>
<direction value="response"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="05-Search-Endpoints-by-_lastUpdated">
<name value="Search-Endpoints-by-_lastUpdated"/>
<description value="Search for Endpoints conforming to the PlanNet-Endpoint profile using _lastUpdated from an using an organization.lastUpdated found on a resource returned in the first test."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="Endpoint"/>
<description value="Search for Endpoints conforming to the PlanNet-Endpoint profile."/>
<accept value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="?_lastUpdated=${lastUpdatedValue}"/>
</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 XML mime type 'application/fhir+xml'."/>
<direction value="request"/>
<headerField value="Accept"/>
<operator value="contains"/>
<value value="application/fhir+xml"/>
<warningOnly value="false"/>
</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>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<direction value="response"/>
<responseCode value="200"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<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+xml'."/>
<direction value="response"/>
<contentType value="xml"/>
<warningOnly value="false"/>
</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>
<description value="Confirm that the returned Bundle type is searchset."/>
<direction value="response"/>
<operator value="equals"/>
<path value="Bundle/type"/>
<value value="searchset"/>
<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 base FHIR specification."/>
<direction value="response"/>
<validateProfileId value="bundle-profile"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned Bundle has more than 0 entries"/>
<direction value="response"/>
<expression value="Bundle.entry.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>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-rule">
<extension url="ruleId">
<valueId value="rule-validate-PDex-PlanNet"/>
</extension>
</extension>
<description value="Validate PDex Endpoint within the search Bundle."/>
<direction value="response"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="06-Read-Endpoints">
<name value="ReadEndpoints"/>
<description value="Read an Endpoint conforming to the PlanNet-Endpoint profile. The resourceId for the read is taken from an organization.id found on the response in the first test."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="read"/>
</type>
<resource value="Endpoint"/>
<description value="Read an Endpoint conforming to the PlanNet-Endpoint profile."/>
<accept value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="/${resourceId}"/>
</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 XML mime type 'application/fhir+xml'."/>
<direction value="request"/>
<headerField value="Accept"/>
<operator value="contains"/>
<value value="application/fhir+xml"/>
<warningOnly value="false"/>
</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>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<direction value="response"/>
<responseCode value="200"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<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+xml'."/>
<direction value="response"/>
<contentType value="xml"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned resource type is Endpoint."/>
<direction value="response"/>
<resource value="Endpoint"/>
<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 PDex Endpoint within the response."/>
<direction value="response"/>
<validateProfileId value="PDex-PlanNet-Endpoint-profile"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="07-Vread-Endpoints">
<name value="VreadEndpoints"/>
<description value="Vread an Endpoint conforming to the PlanNet-Endpoint profile. Test systems SHOULD support VRead."/>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-rule">
<extension url="ruleId">
<valueId value="rule-GetVariable-FhirPath"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="fhirPath"/>
</extension>
<extension url="value">
<valueString value="Bundle.entry.resource.meta.versionId"/>
</extension>
</extension>
<extension url="param">
<extension url="name">
<valueString value="outputName"/>
</extension>
<extension url="value">
<valueString value="versionId"/>
</extension>
</extension>
<extension url="output">
<extension url="name">
<valueString value="versionId"/>
</extension>
</extension>
</extension>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Rules to gather the versionId if assigned, else use the default value '1'."/>
<sourceId value="searchResponse"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-rule">
<extension url="ruleId">
<valueId value="rule-ReplaceNullVariable"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="trueValue"/>
</extension>
<extension url="value">
<valueString value="${versionId}"/>
</extension>
</extension>
<extension url="param">
<extension url="name">
<valueString value="defaultValue"/>
</extension>
<extension url="value">
<valueString value="1"/>
</extension>
</extension>
<extension url="param">
<extension url="name">
<valueString value="outputName"/>
</extension>
<extension url="value">
<valueString value="versionId-resolved"/>
</extension>
</extension>
<extension url="output">
<extension url="name">
<valueString value="versionId-resolved"/>
</extension>
</extension>
</extension>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
<valueBoolean value="false"/>
</extension>
<description value="Rules to gather the versionId if assigned, else use the default value '1'."/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="vread"/>
</type>
<resource value="Endpoint"/>
<description value="Vread an Endpoint conforming to the PlanNet-Endpoint profile."/>
<accept value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="/${resourceId}/_history/${versionId-resolved}"/>
</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>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<direction value="response"/>
<responseCode value="200"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP Header Content-Type is present."/>
<direction value="response"/>
<headerField value="Content-Type"/>
<operator value="notEmpty"/>
<warningOnly value="true"/>
</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 Endpoint."/>
<direction value="response"/>
<resource value="Endpoint"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<description value="Validate PDex Endpoint within the response. Warning only because vread is a SHOULD."/>
<direction value="response"/>
<validateProfileId value="PDex-PlanNet-Endpoint-profile"/>
<warningOnly value="true"/>
</assert>
</action>
</test>
</TestScript>