Name | /FHIRSandbox/DaVinci/FHIR4-0-1-PDEX/PDEX-STU1/04-PDEX-Interactions/02-PDEX-Device/DV-PDEX-Device-xml |
Description | Tests for Device using the DaVinci PDEX Device resource. Reference http://hl7.org/fhir/us/davinci-pdex/STU1/StructureDefinition-pdex-device.html. Should Support and May Support capabilities will issue warnings if not passed, Shall Support capabilities will fail if not passed. Note that support for Device resource and xml format is a 'should' for DaVinci PDEX. |
Version | 2 | Latest | 2 |
<?xml version="1.0" encoding="UTF-8"?>
<TestScript xmlns="http://hl7.org/fhir">
<id value="dv-pdex-device-xml"/>
<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="historyOrder"/>
</extension>
<extension url="path">
<valueString value="/FHIRCommon/_reference/rule/historyOrder.groovy"/>
</extension>
</extension>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule">
<extension url="ruleId">
<valueId value="assert-by-path"/>
</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/Device"/>
</extension>
</extension>
<extension url="param">
<extension url="name">
<valueString value="profileId"/>
</extension>
<extension url="value">
<valueString value="PDEXDeviceProfile"/>
</extension>
</extension>
</extension>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule">
<extension url="ruleId">
<valueId value="resolveReferences"/>
</extension>
<extension url="path">
<valueString value="/FHIRCommon/_reference/rule/resolveReferences.groovy"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="baseUrl"/>
</extension>
<extension url="value">
<valueString value="${dest1SystemConfig.baseUrl}"/>
</extension>
</extension>
</extension>
<url value="http://wildfhir.aegis.net/fhir4-0-1/TestScript/PDEX_Device_Tests"/>
<name value="PDEX_Device_Tests"/>
<title value="PDEX_Device_Tests"/>
<status value="active"/>
<date value="2021-12-14"/>
<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="Tests for Device using the DaVinci PDEX Device resource. Reference http://hl7.org/fhir/us/davinci-pdex/STU1/StructureDefinition-pdex-device.html. Should Support and May Support capabilities will issue warnings if not passed, Shall Support capabilities will fail if not passed. Note that support for Device resource and xml format is a 'should' for DaVinci PDEX."/>
<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="PDEXDeviceProfile">
<reference value="http://hl7.org/fhir/us/davinci-pdex/StructureDefinition/pdex-device"/>
</profile>
<profile id="BundleProfile">
<reference value="http://hl7.org/fhir/StructureDefinition/Bundle"/>
</profile>
<variable>
<name value="patientId"/>
<description value="Patient id"/>
</variable>
<variable>
<name value="testOneId"/>
<description value="Test 01 resource id"/>
<expression value="Bundle.entry.resource.id"/>
<sourceId value="testOneSearch-1"/>
</variable>
<variable>
<name value="testOneType"/>
<description value="Test 01 resource type code"/>
<expression value="Bundle.entry.resource.type.coding.code"/>
<sourceId value="testOneSearch-1"/>
</variable>
<test id="01-search_by_Patient">
<name value="search_by_Patient"/>
<description value="Search for Device using the Patient id"/>
<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="search"/>
</type>
<resource value="Device"/>
<description value="Search by Patient Id"/>
<accept value="xml"/>
<contentType value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<params value="?patient=${patientId}"/>
<responseId value="testOneSearch-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,201"/>
<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 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="Validate response bundle conforms to the Bundle profile"/>
<direction value="response"/>
<validateProfileId value="BundleProfile"/>
<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 Device resource is found in the Bundle"/>
<direction value="response"/>
<expression value="Bundle.entry.resource.as(Device).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="assert-by-path"/>
</extension>
</extension>
<description value="Validate against the PDEX Device profile if present in Bundle response"/>
<direction value="response"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="02-search_by_type">
<name value="search_by_type"/>
<description value="Search by Device.type"/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="Device"/>
<description value="Search by type"/>
<accept value="xml"/>
<contentType value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<params value="?type=${testOneType}"/>
</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="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 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="Validate response bundle conforms to the Bundle profile"/>
<direction value="response"/>
<validateProfileId value="BundleProfile"/>
<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 Device resource is found in the Bundle"/>
<direction value="response"/>
<expression value="Bundle.entry.resource.as(Device).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="assert-by-path"/>
</extension>
</extension>
<description value="Validate against the PDEX Device profile if present in Bundle response"/>
<direction value="response"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="03-read_interaction">
<name value="read_interaction"/>
<description value="Read Device"/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="read"/>
</type>
<resource value="Device"/>
<description value="Device read operation with HTTP Header Accept set to XML format."/>
<accept value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="/${testOneId}"/>
<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,201"/>
<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 Device resource"/>
<direction value="response"/>
<resource value="Device"/>
<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="Device.id.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>
<description value="Verify Device.patient (mustSupport) exists"/>
<direction value="response"/>
<expression value="Device.patient.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>
<description value="Verify Device.type (mustSupport) exists"/>
<direction value="response"/>
<expression value="Device.type.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>
<description value="Validate response against the PDEX Device profile"/>
<direction value="response"/>
<validateProfileId value="PDEXDeviceProfile"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="05-vread_interaction">
<name value="vread_interaction"/>
<description value="Version read Device"/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="vread"/>
</type>
<resource value="Device"/>
<description value="vRead Device"/>
<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 Device resource"/>
<direction value="response"/>
<resource value="Device"/>
<warningOnly value="true"/>
</assert>
</action>
</test>
<test id="06-history_interaction">
<name value="history_interaction"/>
<description value="History Interactions"/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="history-instance"/>
</type>
<resource value="Device"/>
<description value="History Interactions"/>
<accept value="xml"/>
<contentType value="xml"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<responseId value="testHistorySearch"/>
<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 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 Device resource is found in the Bundle"/>
<direction value="response"/>
<expression value="Bundle.entry.resource.as(Device).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="BundleProfile"/>
<warningOnly value="true"/>
</assert>
</action>
</test>
<test id="07-Resolve-References">
<name value="Resolve-References"/>
<description value="Validate that references in the read Device search resolve"/>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-rule">
<extension url="ruleId">
<valueId value="resolveReferences"/>
</extension>
</extension>
<description value="Validate that references resolve"/>
<direction value="response"/>
<sourceId value="read-response"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
</TestScript>