Test Script

Name/FHIR4-0-0-Advanced/Patient/05-delete/fhir-api-r4-patient-delete-02-conditional-single
DescriptionFHIR API R4 (v4.0.0) Advanced Operation Tests - Patient delete conditional test suite against a single server that supports only single deletion for a known valid resource instance, a non-existent resource instance and a known deleted resource instance. The destination server must also support the create, read and search operations in order to setup (create) the required resource instances and verify the deleted resource instances. Assertions test all required and optional response HTTP Headers and validate the returned payload.
Version4Latest4
Content
<?xml version="1.0" encoding="UTF-8"?>

<TestScript xmlns="http://hl7.org/fhir">  
    <id value="fhir-api-r4-patient-delete-02-conditional-single"/>  
    <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>FHIR API R4 (v4.0.0) - Patient Delete Conditional Single Resource Suite</p> 
        </div> 
    </text>  
    <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-ruleset"> 
        <extension url="rulesetId"> 
            <valueId value="ruleset-deletevalid-headers-body"/> 
        </extension>  
        <extension url="path"> 
            <valueString value="/FHIRCommon/_reference/ruleset/RuleSet-DeleteValidHeadersBody-NoVersioning-Groovy.xml"/> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertResponseCodeOkIfBody"/> 
            </extension> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertResponseCodeNoContentIfNoBody"/> 
            </extension> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertContentTypeIfBody"/> 
            </extension> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertContentTypeCharsetIfBody"/> 
            </extension> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertOperationOutcomeIfError"/> 
            </extension> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertProfileIfOperationOutcome"/> 
            </extension>  
            <extension url="param"> 
                <extension url="name"> 
                    <valueString value="validateProfileId"/> 
                </extension>  
                <extension url="value"> 
                    <valueString value="resource-operationoutcome-profile"/> 
                </extension> 
            </extension> 
        </extension> 
    </extension>  
    <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-ruleset"> 
        <extension url="rulesetId"> 
            <valueId value="ruleset-deletenotexists-headers-body"/> 
        </extension>  
        <extension url="path"> 
            <valueString value="/FHIRCommon/_reference/ruleset/RuleSet-DeleteNotExistsHeadersBody-Groovy.xml"/> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertResponseCodeOkIfBody"/> 
            </extension> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertResponseCodeNoContentIfNoBody"/> 
            </extension> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertContentTypeIfBody"/> 
            </extension> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertContentTypeCharsetIfBody"/> 
            </extension> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertOperationOutcomeIfError"/> 
            </extension> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertProfileIfOperationOutcome"/> 
            </extension>  
            <extension url="param"> 
                <extension url="name"> 
                    <valueString value="validateProfileId"/> 
                </extension>  
                <extension url="value"> 
                    <valueString value="resource-operationoutcome-profile"/> 
                </extension> 
            </extension> 
        </extension> 
    </extension>  
    <url value="http://wildfhir.aegis.net/fhir4-0-0/TestScript/fhir-api-r4-patient-delete-02-conditional-single"/>  
    <name value="FHIR API R4 (v4.0.0) - Patient Delete Conditional Single Resource Suite"/>  
    <status value="active"/>  
    <date value="2019-01-02"/>  
    <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 (v4.0.0) Advanced Operation Tests - Patient delete conditional test suite against a single server that supports only single deletion for a known valid resource instance, a non-existent resource instance and a known deleted resource instance. The destination server must also support the create, read and search operations in order to setup (create) the required resource instances and verify the deleted resource instances. Assertions test all required and optional response HTTP Headers and validate the returned payload."/>  
    <copyright value="(c) AEGIS.net, Inc. 2019"/>  
    <fixture id="resource-delete-conditional-single-01-json-single"> 
        <autocreate value="false"/>  
        <autodelete value="false"/>  
        <resource> 
            <reference value="./_reference/resources/Patient-delete-conditional-single-01-json-single.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-delete-conditional-single-02-xml-single"> 
        <autocreate value="false"/>  
        <autodelete value="false"/>  
        <resource> 
            <reference value="./_reference/resources/Patient-delete-conditional-single-02-xml-single.xml"/> 
        </resource> 
    </fixture>  
    <profile id="resource-profile"> 
        <reference value="http://hl7.org/fhir/StructureDefinition/Patient"/> 
    </profile>  
    <profile id="resource-bundle-profile"> 
        <reference value="http://hl7.org/fhir/StructureDefinition/Bundle"/> 
    </profile>  
    <profile id="resource-operationoutcome-profile"> 
        <reference value="http://hl7.org/fhir/StructureDefinition/OperationOutcome"/> 
    </profile>  
    <variable> 
        <name value="delete-conditional-single-01-json-single-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="delete-conditional-single-01-json-single-search-response"/> 
    </variable>  
    <variable> 
        <name value="search-delete-conditional-single-01-json-single-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-delete-conditional-single-01-json-single"/> 
    </variable>  
    <variable> 
        <name value="search-delete-conditional-single-01-json-single-family"/>  
        <path value="Patient/name[1]/family"/>  
        <sourceId value="resource-delete-conditional-single-01-json-single"/> 
    </variable>  
    <variable> 
        <name value="search-delete-conditional-single-01-json-single-given"/>  
        <path value="Patient/name[1]/given[1]"/>  
        <sourceId value="resource-delete-conditional-single-01-json-single"/> 
    </variable>  
    <variable> 
        <name value="delete-conditional-single-02-xml-single-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="delete-conditional-single-02-xml-single-search-response"/> 
    </variable>  
    <variable> 
        <name value="search-delete-conditional-single-02-xml-single-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-delete-conditional-single-02-xml-single"/> 
    </variable>  
    <variable> 
        <name value="search-delete-conditional-single-02-xml-single-family"/>  
        <path value="Patient/name[1]/family"/>  
        <sourceId value="resource-delete-conditional-single-02-xml-single"/> 
    </variable>  
    <variable> 
        <name value="search-delete-conditional-single-02-xml-single-given"/>  
        <path value="Patient/name[1]/given[1]"/>  
        <sourceId value="resource-delete-conditional-single-02-xml-single"/> 
    </variable>  
    <setup> 
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="System-generated search and delete operations from conditional delete to insure the Patient resource for testing in JSON format does not exist on the server."/>  
                <accept value="json"/>  
                <encodeRequestUrl value="true"/>  
                <params value="?identifier=${search-delete-conditional-single-01-json-single-identifier}&amp;given=${search-delete-conditional-single-01-json-single-given}&amp;family=${search-delete-conditional-single-01-json-single-family}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="create"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Create the Patient resource for testing in JSON format a single match on the destination server."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <encodeRequestUrl value="true"/>  
                <sourceId value="resource-delete-conditional-single-01-json-single"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 201(Created)."/>  
                <direction value="response"/>  
                <responseCode value="201"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="search"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Search for the JSON formatted created test Patient by the unique identifier."/>  
                <accept value="json"/>  
                <encodeRequestUrl value="true"/>  
                <params value="?identifier=${search-delete-conditional-single-01-json-single-identifier}"/>  
                <responseId value="delete-conditional-single-01-json-single-search-response"/> 
            </operation> 
        </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 contains the FHIR mime-type 'application/fhir+json'."/>  
                <contentType value="json"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Bundle."/>  
                <resource value="Bundle"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that returned bundle first entry contains the created version of the Patient."/>  
                <minimumId value="resource-delete-conditional-single-01-json-single"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="System-generated search and delete operations from conditional delete to insure the Patient resource for testing in XML format does not exist on the server."/>  
                <accept value="xml"/>  
                <encodeRequestUrl value="true"/>  
                <params value="?identifier=${search-delete-conditional-single-02-xml-single-identifier}&amp;given=${search-delete-conditional-single-02-xml-single-given}&amp;family=${search-delete-conditional-single-02-xml-single-family}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="create"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Create the Patient resource for testing in XML format a single match on the destination server."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <encodeRequestUrl value="true"/>  
                <sourceId value="resource-delete-conditional-single-02-xml-single"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 201(Created)."/>  
                <direction value="response"/>  
                <responseCode value="201"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="search"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Search for the XML formatted created test Patient by the unique identifier."/>  
                <accept value="xml"/>  
                <encodeRequestUrl value="true"/>  
                <params value="?identifier=${search-delete-conditional-single-02-xml-single-identifier}"/>  
                <responseId value="delete-conditional-single-02-xml-single-search-response"/> 
            </operation> 
        </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 contains the FHIR mime-type 'application/fhir+xml'."/>  
                <contentType value="xml"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Bundle."/>  
                <resource value="Bundle"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that returned bundle first entry contains the created version of the Patient."/>  
                <minimumId value="resource-delete-conditional-single-02-xml-single"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </setup>  
    <test id="01-DeleteConditionalNoMatchJSON"> 
        <name value="DeleteConditionalNoMatchJSON"/>  
        <description value="Test the conditional delete operation using JSON formatting where no matches are found. The expected response is either a 200 (OK) with an optional OperationOutcome in JSON format or 204 (No Content) and the content is empty; i.e. no content."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="deleteCondSingle"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient conditional delete operation where no matches are found."/>  
                <accept value="json"/>  
                <encodeRequestUrl value="true"/>  
                <params value="?family=NOMATCHESFOUNDLASTNAMEJSON&amp;given=NOMATCHESFOUNDFIRSTNAMEJSON"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200 (OK), 204 (No Content) or 404 (Not Found)."/>  
                <direction value="response"/>  
                <operator value="in"/>  
                <responseCode value="200,204,404"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-ruleset"> 
                    <extension url="rulesetId"> 
                        <valueId value="ruleset-deletenotexists-headers-body"/> 
                    </extension>  
                    <extension url="rule"> 
                        <extension url="ruleId"> 
                            <valueId value="assertContentTypeMimeTypeIfBody"/> 
                        </extension>  
                        <extension url="param"> 
                            <extension url="name"> 
                                <valueString value="headerExpectedValue"/> 
                            </extension>  
                            <extension url="value"> 
                                <valueString value="application/fhir+json"/> 
                            </extension> 
                        </extension> 
                    </extension> 
                </extension>  
                <description value="Complex ruleset assertion to conditionally validate expected delete ok response HTTP Headers and body."/>  
                <direction value="response"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </test>  
    <test id="02-DeleteConditionalNoMatchXML"> 
        <name value="DeleteConditionalNoMatchXML"/>  
        <description value="Test the conditional delete operation using XML formatting where no matches are found. The expected response is either a 200 (OK) with an optional OperationOutcome in XML format or 204 (No Content) and the content is empty; i.e. no content."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="deleteCondSingle"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient conditional delete operation where no matches are found."/>  
                <accept value="xml"/>  
                <encodeRequestUrl value="true"/>  
                <params value="?family=NOMATCHESFOUNDLASTNAMEXML&amp;given=NOMATCHESFOUNDFIRSTNAMEXML"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200 (OK), 204 (No Content) or 404 (Not Found)."/>  
                <direction value="response"/>  
                <operator value="in"/>  
                <responseCode value="200,204,404"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-ruleset"> 
                    <extension url="rulesetId"> 
                        <valueId value="ruleset-deletenotexists-headers-body"/> 
                    </extension>  
                    <extension url="rule"> 
                        <extension url="ruleId"> 
                            <valueId value="assertContentTypeMimeTypeIfBody"/> 
                        </extension>  
                        <extension url="param"> 
                            <extension url="name"> 
                                <valueString value="headerExpectedValue"/> 
                            </extension>  
                            <extension url="value"> 
                                <valueString value="application/fhir+xml"/> 
                            </extension> 
                        </extension> 
                    </extension> 
                </extension>  
                <description value="Complex ruleset assertion to conditionally validate expected delete ok response HTTP Headers and body."/>  
                <direction value="response"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </test>  
    <test id="03-DeleteConditionalOneMatchJSON"> 
        <name value="DeleteConditionalOneMatchJSON"/>  
        <description value="Test the conditional delete operation with a match on a single known valid resource instance using JSON formatting. The expected response is either a 200 (OK) with an optional OperationOutcome in JSON format or 204 (No Content) and the content is empty; i.e. no content."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="deleteCondSingle"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient conditional delete operation of a known valid resource instance."/>  
                <accept value="json"/>  
                <encodeRequestUrl value="true"/>  
                <params value="?family=${search-delete-conditional-single-01-json-single-family}&amp;given=${search-delete-conditional-single-01-json-single-given}"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200 (OK), 204 (No Content) or 404 (Not Found)."/>  
                <direction value="response"/>  
                <operator value="in"/>  
                <responseCode value="200,204,404"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-ruleset"> 
                    <extension url="rulesetId"> 
                        <valueId value="ruleset-deletevalid-headers-body"/> 
                    </extension>  
                    <extension url="rule"> 
                        <extension url="ruleId"> 
                            <valueId value="assertContentTypeMimeTypeIfBody"/> 
                        </extension>  
                        <extension url="param"> 
                            <extension url="name"> 
                                <valueString value="headerExpectedValue"/> 
                            </extension>  
                            <extension url="value"> 
                                <valueString value="application/fhir+json"/> 
                            </extension> 
                        </extension> 
                    </extension> 
                </extension>  
                <description value="Complex ruleset assertion to conditionally validate expected delete ok response HTTP Headers and body."/>  
                <direction value="response"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Read the deleted Patient and verify the response is 410 (Gone) or 404 (Not Found) for servers that do not support versioning. The Accept header JSON format is defined for an optionally returned OperationOutcome resource."/>  
                <accept value="json"/>  
                <encodeRequestUrl value="true"/>  
                <params value="/${delete-conditional-single-01-json-single-id}"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 404(Not Found) or 410(Gone)."/>  
                <direction value="response"/>  
                <operator value="in"/>  
                <responseCode value="404,410"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="search"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Search for the deleted Patient by the unique identifier and verify that no matching resource instances are found."/>  
                <accept value="json"/>  
                <encodeRequestUrl value="true"/>  
                <params value="?identifier=${search-delete-conditional-single-01-json-single-identifier}"/> 
            </operation> 
        </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 contains the FHIR mime-type 'application/fhir+json'."/>  
                <direction value="response"/>  
                <contentType value="json"/>  
                <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 conforms to the base FHIR specification."/>  
                <direction value="response"/>  
                <validateProfileId value="resource-bundle-profile"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that there are no records returned."/>  
                <direction value="response"/>  
                <operator value="equals"/>  
                <path value="/Bundle/total"/>  
                <value value="0"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that no entries exist in the Bundle"/>  
                <direction value="response"/>  
                <expression value="where(entry.resource).empty()"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </test>  
    <test id="04-DeleteConditionalOneMatchXML"> 
        <name value="DeleteConditionalOneMatchXML"/>  
        <description value="Test the conditional delete operation with a match on a single known valid resource instance using XML formatting. The expected response is either a 200 (OK) with an optional OperationOutcome in XML format or 204 (No Content) and the content is empty; i.e. no content."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="deleteCondSingle"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient conditional delete operation of a known valid resource instance."/>  
                <accept value="xml"/>  
                <encodeRequestUrl value="true"/>  
                <params value="?family=${search-delete-conditional-single-02-xml-single-family}&amp;given=${search-delete-conditional-single-02-xml-single-given}"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200 (OK), 204 (No Content) or 404 (Not Found)."/>  
                <direction value="response"/>  
                <operator value="in"/>  
                <responseCode value="200,204,404"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-ruleset"> 
                    <extension url="rulesetId"> 
                        <valueId value="ruleset-deletevalid-headers-body"/> 
                    </extension>  
                    <extension url="rule"> 
                        <extension url="ruleId"> 
                            <valueId value="assertContentTypeMimeTypeIfBody"/> 
                        </extension>  
                        <extension url="param"> 
                            <extension url="name"> 
                                <valueString value="headerExpectedValue"/> 
                            </extension>  
                            <extension url="value"> 
                                <valueString value="application/fhir+xml"/> 
                            </extension> 
                        </extension> 
                    </extension> 
                </extension>  
                <description value="Complex ruleset assertion to conditionally validate expected delete ok response HTTP Headers and body."/>  
                <direction value="response"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Read the deleted Patient and verify the response is 410 (Gone) or 404 (Not Found) for servers that do not support versioning. The Accept header XML format is defined for an optionally returned OperationOutcome resource."/>  
                <accept value="xml"/>  
                <encodeRequestUrl value="true"/>  
                <params value="/${delete-conditional-single-02-xml-single-id}"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 404(Not Found) or 410(Gone)."/>  
                <direction value="response"/>  
                <operator value="in"/>  
                <responseCode value="404,410"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="search"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Search for the deleted Patient by the unique identifier and verify that no matching resource instances are found."/>  
                <accept value="xml"/>  
                <encodeRequestUrl value="true"/>  
                <params value="?identifier=${search-delete-conditional-single-02-xml-single-identifier}"/> 
            </operation> 
        </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 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 conforms to the base FHIR specification."/>  
                <direction value="response"/>  
                <validateProfileId value="resource-bundle-profile"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that there are no records returned."/>  
                <direction value="response"/>  
                <operator value="equals"/>  
                <path value="/Bundle/total"/>  
                <value value="0"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that no entries exist in the Bundle"/>  
                <direction value="response"/>  
                <expression value="where(entry.resource).empty()"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </test> 
</TestScript>