Test Script

Name/FHIR4-0-0-Connectathon23/Patient-01-Intro/Base Tests/patient-intro-c23-base-client-id-xml
DescriptionBaseline tests using the XML format to create, update, retrieve history and search a patient without extensions where the client assigns the resource id. The destination server must support conditional create.
Version2Latest2
Content
<?xml version="1.0" encoding="UTF-8"?>

<TestScript xmlns="http://hl7.org/fhir">  
    <id value="patient-intro-c23-base-client-id-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>FHIR Connectathon 23 - Patient - XML - Client Assigned Resource Id</p>
        </div> 
    </text>  
    <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-ruleset"> 
        <extension url="rulesetId"> 
            <valueId value="ruleset-versioning-headers"/> 
        </extension>  
        <extension url="path"> 
            <valueString value="/FHIRCommon/_reference/ruleset/RuleSet-VersioningHeaders-Groovy.xml"/> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertETagIfSupported"/> 
            </extension>  
            <extension url="param"> 
                <extension url="name"> 
                    <valueString value="resource"/> 
                </extension>  
                <extension url="value"> 
                    <valueString value="Patient"/> 
                </extension> 
            </extension> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertLastModifiedIfSupported"/> 
            </extension>  
            <extension url="param"> 
                <extension url="name"> 
                    <valueString value="resource"/> 
                </extension>  
                <extension url="value"> 
                    <valueString value="Patient"/> 
                </extension> 
            </extension> 
        </extension> 
    </extension>  
    <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-ruleset"> 
        <extension url="rulesetId"> 
            <valueId value="ruleset-updateok-headers-body"/> 
        </extension>  
        <extension url="path"> 
            <valueString value="/FHIRCommon/_reference/ruleset/RuleSet-UpdateOkHeadersBody-Groovy.xml"/> 
        </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="assertResourceTypesIfBody"/> 
            </extension>  
            <extension url="param"> 
                <extension url="name"> 
                    <valueString value="resource"/> 
                </extension>  
                <extension url="value"> 
                    <valueString value="Patient,OperationOutcome"/> 
                </extension> 
            </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="operationoutcome-profile"/> 
                </extension> 
            </extension> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertProfileIfResource"/> 
            </extension>  
            <extension url="param"> 
                <extension url="name"> 
                    <valueString value="resource"/> 
                </extension>  
                <extension url="value"> 
                    <valueString value="Patient"/> 
                </extension> 
            </extension>  
            <extension url="param"> 
                <extension url="name"> 
                    <valueString value="validateProfileId"/> 
                </extension>  
                <extension url="value"> 
                    <valueString value="patient-profile"/> 
                </extension> 
            </extension> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertVersionIdIfResourceAndSupported"/> 
            </extension>  
            <extension url="param"> 
                <extension url="name"> 
                    <valueString value="resource"/> 
                </extension>  
                <extension url="value"> 
                    <valueString value="Patient"/> 
                </extension> 
            </extension>  
            <extension url="param"> 
                <extension url="name"> 
                    <valueString value="resourceOperator"/> 
                </extension>  
                <extension url="value"> 
                    <valueString value="equals"/> 
                </extension> 
            </extension> 
        </extension> 
    </extension>  
    <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-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="assertETagIfSupported"/> 
            </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="operationoutcome-profile"/> 
                </extension> 
            </extension> 
        </extension> 
    </extension>  
    <url value="http://wildfhir.aegis.net/fhir4-0-0/TestScript/patient-intro-c23-base-client-id-xml"/>  
    <name value="FHIRC23PatientXMLClientId"/>  
    <title value="FHIR Connectathon 23 - Patient - XML - Client Assigned Resource Id"/>  
    <status value="active"/>  
    <date value="2020-01-23"/>  
    <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="Baseline tests using the XML format to create, update, retrieve history and search a patient without extensions where the client assigns the resource id. The destination server must support conditional create."/>  
    <copyright value="(c) AEGIS.net, Inc. 2019"/>  
    <fixture id="patient-create-PeterChalmers"> 
        <autocreate value="false"/>  
        <autodelete value="false"/>  
        <resource> 
            <reference value="../_reference/resources/patient-create-client-id-PeterChalmers.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="patient-create-PeterChalmers-min"> 
        <autocreate value="false"/>  
        <autodelete value="false"/>  
        <resource> 
            <reference value="../_reference/resources/patient-create-PeterChalmers-min.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="patient-update-PeterChalmers"> 
        <autocreate value="false"/>  
        <autodelete value="false"/>  
        <resource> 
            <reference value="../_reference/resources/patient-update-PeterChalmers.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="patient-update-PeterChalmers-min"> 
        <autocreate value="false"/>  
        <autodelete value="false"/>  
        <resource> 
            <reference value="../_reference/resources/patient-update-PeterChalmers-min.xml"/> 
        </resource> 
    </fixture>  
    <profile id="bundle-profile"> 
        <reference value="http://hl7.org/fhir/StructureDefinition/Bundle"/> 
    </profile>  
    <profile id="operationoutcome-profile"> 
        <reference value="http://hl7.org/fhir/StructureDefinition/OperationOutcome"/> 
    </profile>  
    <profile id="patient-profile"> 
        <reference value="http://hl7.org/fhir/StructureDefinition/Patient"/> 
    </profile>  
    <variable> 
        <name value="createResourceId"/>  
        <path value="Patient/id"/>  
        <sourceId value="patient-read-PeterChalmers"/> 
    </variable>  
    <variable> 
        <name value="createIdentifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="patient-create-PeterChalmers"/> 
    </variable>  
    <variable> 
        <name value="searchFamilyName"/>  
        <path value="Patient/name/family"/>  
        <sourceId value="patient-create-PeterChalmers"/> 
    </variable>  
    <variable> 
        <name value="searchGivenName"/>  
        <path value="Patient/name/given"/>  
        <sourceId value="patient-create-PeterChalmers"/> 
    </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 does not exist on the server."/>  
                <accept value="xml"/>  
                <encodeRequestUrl value="true"/>  
                <params value="?given=${searchGivenName}&amp;family=${searchFamilyName}"/> 
            </operation> 
        </action> 
    </setup>  
    <test id="Step1-RegisterNewPatient"> 
        <name value="RegisterNewPatient"/>  
        <description value="Create a new patient, no extensions where the client assigns the resource id using XML."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="updateCreate"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Create patient with client assigned resource id."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <encodeRequestUrl value="true"/>  
                <params value="/${createIdentifier}"/>  
                <responseId value="create-response"/>  
                <sourceId value="patient-create-PeterChalmers"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK) or 201(Created)."/>  
                <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-ruleset"> 
                    <extension url="rulesetId"> 
                        <valueId value="ruleset-versioning-headers"/> 
                    </extension> 
                </extension>  
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-ruleset"> 
                    <extension url="rulesetId"> 
                        <valueId value="ruleset-updateok-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 create 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 created Patient in order to validate content."/>  
                <accept value="xml"/>  
                <encodeRequestUrl value="true"/>  
                <params value="/${createIdentifier}"/>  
                <responseId value="patient-read-PeterChalmers"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <response value="okay"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned format is XML. Warning only to allow for review."/>  
                <direction value="response"/>  
                <contentType value="xml"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-ruleset"> 
                    <extension url="rulesetId"> 
                        <valueId value="ruleset-versioning-headers"/> 
                    </extension> 
                </extension>  
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Patient."/>  
                <direction value="response"/>  
                <resource value="Patient"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Validate that the returned resource conforms to the base FHIR Patient profile."/>  
                <direction value="response"/>  
                <validateProfileId value="patient-profile"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource contains the expected retained elements and values. Warning only to allow for review."/>  
                <direction value="response"/>  
                <minimumId value="patient-create-PeterChalmers-min"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action> 
    </test>  
    <test id="Step2-UpdatePatient"> 
        <name value="Step2-UpdatePatient"/>  
        <description value="Update the patient's birth date, no extensions."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="update"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Update the created Patient."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <encodeRequestUrl value="true"/>  
                <params value="/${createResourceId}"/>  
                <responseId value="update-birth-response"/>  
                <sourceId value="patient-update-PeterChalmers"/> 
            </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> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-ruleset"> 
                    <extension url="rulesetId"> 
                        <valueId value="ruleset-versioning-headers"/> 
                    </extension> 
                </extension>  
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-ruleset"> 
                    <extension url="rulesetId"> 
                        <valueId value="ruleset-updateok-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 create 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 updated Patient in order to validate content."/>  
                <accept value="xml"/>  
                <encodeRequestUrl value="true"/>  
                <params value="/${createResourceId}"/>  
                <responseId value="resource-read"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <response value="okay"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned format is XML. Warning only to allow for review."/>  
                <direction value="response"/>  
                <contentType value="xml"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-ruleset"> 
                    <extension url="rulesetId"> 
                        <valueId value="ruleset-versioning-headers"/> 
                    </extension> 
                </extension>  
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Patient."/>  
                <direction value="response"/>  
                <resource value="Patient"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Validate that the returned resource conforms to the base FHIR Patient profile."/>  
                <direction value="response"/>  
                <validateProfileId value="patient-profile"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource contains the expected updated and retained elements and values. Warning only to allow for review."/>  
                <direction value="response"/>  
                <minimumId value="patient-update-PeterChalmers-min"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Additional confirmation that birthDate got updated to the expected value."/>  
                <direction value="response"/>  
                <path value="Patient/birthDate"/>  
                <value value="1975-01-02"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </test>  
    <test id="Step3-PatientHistory"> 
        <name value="Step3-PatientHistory"/>  
        <description value="Retrieve the patient's history."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="history"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Retrieve the history for a single, known patient using the known identifier."/>  
                <accept value="xml"/>  
                <encodeRequestUrl value="true"/>  
                <targetId value="resource-read"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <response value="okay"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned format is XML. Warning only to allow for review."/>  
                <direction value="response"/>  
                <contentType value="xml"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Bundle."/>  
                <direction value="response"/>  
                <resource value="Bundle"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Validate that the returned resource conforms to the base FHIR Bundle profile."/>  
                <direction value="response"/>  
                <validateProfileId value="bundle-profile"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the Bundle type is 'history'."/>  
                <direction value="response"/>  
                <operator value="equals"/>  
                <path value="/Bundle/type"/>  
                <value value="history"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that there is at least one patient history resource returned. There should be at least two from the create and update operations if versioning is supported; at least one if versioning is not supported."/>  
                <direction value="response"/>  
                <operator value="greaterThan"/>  
                <path value="/Bundle/total"/>  
                <value value="0"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the Bundle total value matches or is greater than the number of entries in the Bundle."/>  
                <direction value="response"/>  
                <expression value="Bundle.total.toInteger() &gt;= entry.count()"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that bundle contains the most recent updated version of the patient. Warning only to allow for review."/>  
                <direction value="response"/>  
                <minimumId value="patient-update-PeterChalmers-min"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action> 
    </test>  
    <test id="Step4-PatientSearch"> 
        <name value="Step4-PatientSearch"/>  
        <description value="Search for a patient with the name 'James Chalmers'."/>  
        <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 patient James Chalmers. The destination server must support the family and given search parameters."/>  
                <accept value="xml"/>  
                <encodeRequestUrl value="true"/>  
                <params value="?given=${searchGivenName}&amp;family=${searchFamilyName}"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <response value="okay"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned format is XML. Warning only to allow for review."/>  
                <direction value="response"/>  
                <contentType value="xml"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Bundle."/>  
                <direction value="response"/>  
                <resource value="Bundle"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Validate that the returned resource conforms to the base FHIR Bundle profile."/>  
                <direction value="response"/>  
                <validateProfileId value="bundle-profile"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Bundle.type is searchset."/>  
                <direction value="response"/>  
                <path value="/Bundle/type"/>  
                <value value="searchset"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that there is at least one record returned. There could be other patient records returned."/>  
                <direction value="response"/>  
                <operator value="greaterThan"/>  
                <path value="/Bundle/total"/>  
                <value value="0"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the Bundle total value matches or is greater than the number of entries in the Bundle."/>  
                <direction value="response"/>  
                <expression value="Bundle.total.toInteger() &gt;= entry.count()"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that bundle contains the most recent updated version of the patient. Warning only to allow for review."/>  
                <direction value="response"/>  
                <minimumId value="patient-update-PeterChalmers-min"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action> 
    </test>  
    <test id="Step5-PatientDelete"> 
        <name value="Step5-PatientDelete"/>  
        <description value="Delete the patient James Chalmers. Execute a subsequent read with an expected response of gone or not found."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Delete the patient James Chalmers on the destination server in order to leave the server in the same state before this test execution."/>  
                <accept value="xml"/>  
                <encodeRequestUrl value="true"/>  
                <params value="/${createResourceId}"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is either 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 deleted patient resource with an expected response of gone or not found"/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <encodeRequestUrl value="true"/>  
                <params value="/${createResourceId}"/> 
            </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> 
    </test> 
</TestScript>