Name | /FHIR3-5-0-Advanced/Patient/02-vread/fhir-api-r4-patient-vread-02-notfound |
Description | FHIR API R4 (v3.5.0) Advanced Operation Tests - Patient vread test suite against a single server for a known, not found resource instance. All tests perform the read operation for a specified Patient resource id and version id representing an unknown Patient. Assertions test all required and optional response HTTP Headers and validate the returned payload. |
Version | 1 | Latest | 1 |
<?xml version="1.0" encoding="UTF-8"?>
<TestScript xmlns="http://hl7.org/fhir">
<id value="fhir-api-r4-patient-vread-02-notfound"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml">
<p>FHIR API R4 (v3.5.0) - Patient Version Read Not Found Resource Suite</p>
</div>
</text>
<url value="http://wildfhir.aegis.net/fhir3-3-0/TestScript/fhir-api-r4-patient-vread-02-notfound"/>
<name value="FHIR API R4 (v3.5.0) - Patient Version Read Not Found Resource Suite"/>
<status value="active"/>
<date value="2018-08-24"/>
<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="FHIR API R4 (v3.5.0) Advanced Operation Tests - Patient vread test suite against a single server for a known, not found resource instance. All tests perform the read operation for a specified Patient resource id and version id representing an unknown Patient. Assertions test all required and optional response HTTP Headers and validate the returned payload."/>
<copyright value="(c) AEGIS.net, Inc. 2015+"/>
<fixture id="resource-read-json-min">
<autocreate value="false"/>
<autodelete value="false"/>
<resource>
<reference value="./_reference/resources/Patient-read-json-min.json"/>
</resource>
</fixture>
<fixture id="resource-read-xml-min">
<autocreate value="false"/>
<autodelete value="false"/>
<resource>
<reference value="./_reference/resources/Patient-read-xml-min.xml"/>
</resource>
</fixture>
<profile id="resource-profile">
<reference value="http://hl7.org/fhir/StructureDefinition/Patient"/>
</profile>
<variable>
<name value="NotFoundPatientResourceId"/>
<description value="Enter a Patient resource id that does not exist on the destination system."/>
<hint value="[Not Found Resource Id]"/>
</variable>
<variable>
<name value="NotFoundPatientVersionId"/>
<description value="Enter a Patient version id that does not exist on the destination system."/>
<hint value="[Not Found Version Id]"/>
</variable>
<rule id="rule-AssertResourceIfBody">
<resource>
<reference value="/FHIRCommon/_reference/rule/AssertResourceIfBody.groovy"/>
</resource>
<param>
<name value="resourceOperator"/>
<value value="equals"/>
</param>
<param>
<name value="bodyOperator"/>
<value value="notEmpty"/>
</param>
</rule>
<ruleset id="ruleset-readnotfound-headers">
<resource>
<reference value="/FHIRCommon/_reference/ruleset/RuleSet-ReadNotFoundHeaders-Groovy.xml"/>
</resource>
<rule>
<ruleId value="assertContentTypeIfBody"/>
</rule>
<rule>
<ruleId value="assertContentTypeMimeTypeIfBody"/>
</rule>
<rule>
<ruleId value="assertContentTypeCharsetIfBody"/>
</rule>
</ruleset>
<test id="01-VreadNotFoundJSON">
<name value="VreadNotFoundJSON"/>
<description value="Test the vread operation for a known, not found (never existed) Patient resource instance. The expected HTTP response is 404 (Not Found) and optional content of an OperationOutcome resource in JSON format."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="vread"/>
</type>
<resource value="Patient"/>
<description value="Patient vread operation for a known, not found (never existed) resource instance."/>
<accept value="json"/>
<contentType value="none"/>
<encodeRequestUrl value="true"/>
<params value="/${NotFoundPatientResourceId}/_history/${NotFoundPatientVersionId}"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 404(Not Found)."/>
<direction value="response"/>
<responseCode value="404"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Complex ruleset assertion to conditionally validate expected HTTP Header Content-Type."/>
<direction value="response"/>
<ruleset>
<rulesetId value="ruleset-readnotfound-headers"/>
<rule>
<ruleId value="assertContentTypeMimeTypeIfBody"/>
<param>
<name value="headerExpectedValue"/>
<value value="application/fhir+json"/>
</param>
</rule>
</ruleset>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Complex rule assertion to conditionally validate that the returned resource type is OperationOutcome."/>
<direction value="response"/>
<rule>
<ruleId value="rule-AssertResourceIfBody"/>
<param>
<name value="resource"/>
<value value="OperationOutcome"/>
</param>
</rule>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="02-VreadNotFoundXML">
<name value="VreadNotFoundXML"/>
<description value="Test the vread operation for a known, not found (never existed) Patient resource instance. The expected HTTP response is 404 (Not Found) and optional content of an OperationOutcome resource in XML format."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="vread"/>
</type>
<resource value="Patient"/>
<description value="Patient vread operation for a known, not found (never existed) resource instance."/>
<accept value="xml"/>
<contentType value="none"/>
<encodeRequestUrl value="true"/>
<params value="/${NotFoundPatientResourceId}/_history/${NotFoundPatientVersionId}"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 404(Not Found)."/>
<direction value="response"/>
<responseCode value="404"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Complex ruleset assertion to conditionally validate expected HTTP Header Content-Type."/>
<direction value="response"/>
<ruleset>
<rulesetId value="ruleset-readnotfound-headers"/>
<rule>
<ruleId value="assertContentTypeMimeTypeIfBody"/>
<param>
<name value="headerExpectedValue"/>
<value value="application/fhir+xml"/>
</param>
</rule>
</ruleset>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Complex rule assertion to conditionally validate that the returned resource type is OperationOutcome."/>
<direction value="response"/>
<rule>
<ruleId value="rule-AssertResourceIfBody"/>
<param>
<name value="resource"/>
<value value="OperationOutcome"/>
</param>
</rule>
<warningOnly value="false"/>
</assert>
</action>
</test>
</TestScript>