Test Script

Name/FHIR3-0-1-Advanced/Patient/04-update/fhir-api-stu3-patient-update-04-conditional
DescriptionFHIR API STU3 Advanced Operation Tests - Patient update conditional test suite against a single server using valid resource instances where expected results include successful and failed update operations. The destination server must also support the read, search and delete operations in order to determine the generated resource id and then clean up any created resources. Assertions test all required and optional response HTTP Headers and validate the returned payload.
Version5Latest5
Content
<?xml version="1.0" encoding="UTF-8"?>

<TestScript xmlns="http://hl7.org/fhir">  
    <id value="fhir-api-stu3-patient-update-04-conditional"/>  
    <text> 
        <status value="generated"/>  
        <div xmlns="http://www.w3.org/1999/xhtml">  
            <p>FHIR API STU3 - Patient Update Conditional Resource Suite</p> 
        </div> 
    </text>  
    <url value="http://wildfhir.aegis.net/fhir3-0-1/TestScript/fhir-api-stu3-patient-update-04-conditional"/>  
    <name value="FHIR API STU3 - Patient Update Conditional Resource Suite"/>  
    <status value="active"/>  
    <date value="2017-08-30"/>  
    <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 STU3 Advanced Operation Tests - Patient update conditional test suite against a single server using valid resource instances where expected results include successful and failed update operations. The destination server must also support the read, search and delete operations in order to determine the generated resource id and then clean up any created resources. Assertions test all required and optional response HTTP Headers and validate the returned payload."/>  
    <copyright value="© AEGIS.net, Inc. 2015+"/>  
    <metadata> 
        <capability> 
            <required value="true"/>  
            <description value="Update Conditional, Create, Read, Search and Delete Operation"/>  
            <link value="http://hl7.org/fhir/STU3/http.html#read"/>  
            <link value="http://hl7.org/fhir/STU3/http.html#create"/>  
            <link value="http://hl7.org/fhir/STU3/http.html#update"/>  
            <link value="http://hl7.org/fhir/STU3/http.html#delete"/>  
            <link value="http://hl7.org/fhir/STU3/http.html#search"/>  
            <capabilities> 
                <reference value="./_reference/capabilities/PatientUpdateConditional.xml"/> 
            </capabilities> 
        </capability> 
    </metadata>  
    <fixture id="resource-update-conditional-01-json"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-conditional-01-json-nomatch.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-conditional-02-xml"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-conditional-02-xml-nomatch.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-conditional-03-json"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-conditional-03-json-nomatch.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-conditional-04-xml"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-conditional-04-xml-nomatch.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-conditional-05-json"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-conditional-05-json-nomatch.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-conditional-06-xml"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-conditional-06-xml-nomatch.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-conditional-07-json"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-conditional-07-json-nomatch.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-conditional-08-xml"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-conditional-08-xml-nomatch.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-conditional-01-json-version2"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-conditional-01-json-onematch-version2.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-conditional-02-xml-version2"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-conditional-02-xml-onematch-version2.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-conditional-03-json-version2"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-conditional-03-json-onematch-version2.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-conditional-04-xml-version2"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-conditional-04-xml-onematch-version2.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-conditional-05-json-version2"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-conditional-05-json-onematch-version2.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-conditional-06-xml-version2"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-conditional-06-xml-onematch-version2.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-conditional-07-json-version2"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-conditional-07-json-onematch-version2.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-conditional-08-xml-version2"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-conditional-08-xml-onematch-version2.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-conditional-17-json"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-conditional-17-json-matches.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-conditional-18-xml"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-conditional-18-xml-matches.xml"/> 
        </resource> 
    </fixture>  
    <profile id="resource-profile"> 
        <reference value="http://hl7.org/fhir/StructureDefinition/Patient"/> 
    </profile>  
    <profile id="resource-operationoutcome-profile"> 
        <reference value="http://hl7.org/fhir/StructureDefinition/OperationOutcome"/> 
    </profile>  
    <variable> 
        <name value="update-conditional-01-json-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="update-conditional-01-json-search-response"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-01-json-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-conditional-01-json"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-01-json-family"/>  
        <path value="Patient/name[1]/family"/>  
        <sourceId value="resource-update-conditional-01-json"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-01-json-given"/>  
        <path value="Patient/name[1]/given[1]"/>  
        <sourceId value="resource-update-conditional-01-json"/> 
    </variable>  
    <variable> 
        <name value="update-conditional-02-xml-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="update-conditional-02-xml-search-response"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-02-xml-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-conditional-02-xml"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-02-xml-family"/>  
        <path value="Patient/name[1]/family"/>  
        <sourceId value="resource-update-conditional-02-xml"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-02-xml-given"/>  
        <path value="Patient/name[1]/given[1]"/>  
        <sourceId value="resource-update-conditional-02-xml"/> 
    </variable>  
    <variable> 
        <name value="update-conditional-03-json-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="update-conditional-03-json-search-response"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-03-json-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-conditional-03-json"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-03-json-family"/>  
        <path value="Patient/name[1]/family"/>  
        <sourceId value="resource-update-conditional-03-json"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-03-json-given"/>  
        <path value="Patient/name[1]/given[1]"/>  
        <sourceId value="resource-update-conditional-03-json"/> 
    </variable>  
    <variable> 
        <name value="update-conditional-04-xml-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="update-conditional-04-xml-search-response"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-04-xml-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-conditional-04-xml"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-04-xml-family"/>  
        <path value="Patient/name[1]/family"/>  
        <sourceId value="resource-update-conditional-04-xml"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-04-xml-given"/>  
        <path value="Patient/name[1]/given[1]"/>  
        <sourceId value="resource-update-conditional-04-xml"/> 
    </variable>  
    <variable> 
        <name value="update-conditional-05-json-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="update-conditional-05-json-search-response"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-05-json-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-conditional-05-json"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-05-json-family"/>  
        <path value="Patient/name[1]/family"/>  
        <sourceId value="resource-update-conditional-05-json"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-05-json-given"/>  
        <path value="Patient/name[1]/given[1]"/>  
        <sourceId value="resource-update-conditional-05-json"/> 
    </variable>  
    <variable> 
        <name value="update-conditional-06-xml-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="update-conditional-06-xml-search-response"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-06-xml-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-conditional-06-xml"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-06-xml-family"/>  
        <path value="Patient/name[1]/family"/>  
        <sourceId value="resource-update-conditional-06-xml"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-06-xml-given"/>  
        <path value="Patient/name[1]/given[1]"/>  
        <sourceId value="resource-update-conditional-06-xml"/> 
    </variable>  
    <variable> 
        <name value="update-conditional-07-json-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="update-conditional-07-json-search-response"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-07-json-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-conditional-07-json"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-07-json-family"/>  
        <path value="Patient/name[1]/family"/>  
        <sourceId value="resource-update-conditional-07-json"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-07-json-given"/>  
        <path value="Patient/name[1]/given[1]"/>  
        <sourceId value="resource-update-conditional-07-json"/> 
    </variable>  
    <variable> 
        <name value="update-conditional-08-xml-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="update-conditional-08-xml-search-response"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-08-xml-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-conditional-08-xml"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-08-xml-family"/>  
        <path value="Patient/name[1]/family"/>  
        <sourceId value="resource-update-conditional-08-xml"/> 
    </variable>  
    <variable> 
        <name value="search-update-conditional-08-xml-given"/>  
        <path value="Patient/name[1]/given[1]"/>  
        <sourceId value="resource-update-conditional-08-xml"/> 
    </variable>  
    <rule id="rule-assertContentTypeIfBody"> 
        <resource> 
            <reference value="/FHIRCommon/_reference/rule/AssertHeaderIfBody.groovy"/> 
        </resource>  
        <param> 
            <name value="header"/>  
            <value value="Content-Type"/> 
        </param>  
        <param> 
            <name value="headerOperator"/>  
            <value value="notEmpty"/> 
        </param>  
        <param> 
            <name value="bodyOperator"/>  
            <value value="notEmpty"/> 
        </param> 
    </rule>  
    <ruleset id="ruleset-versioning-headers"> 
        <resource> 
            <reference value="/FHIRCommon/_reference/ruleset/RuleSet-VersioningHeaders-Groovy.xml"/> 
        </resource>  
        <rule> 
            <ruleId value="assertETagIfSupported"/>  
            <param> 
                <name value="resource"/>  
                <value value="Patient"/> 
            </param> 
        </rule>  
        <rule> 
            <ruleId value="assertLastModifiedIfSupported"/>  
            <param> 
                <name value="resource"/>  
                <value value="Patient"/> 
            </param> 
        </rule> 
    </ruleset>  
    <ruleset id="ruleset-createok-headers-body"> 
        <resource> 
            <reference value="/FHIRCommon/_reference/ruleset/RuleSet-CreateOkHeadersBody-Groovy.xml"/> 
        </resource>  
        <rule> 
            <ruleId value="assertContentTypeIfBody"/> 
        </rule>  
        <rule> 
            <ruleId value="assertContentTypeCharsetIfBody"/> 
        </rule>  
        <rule> 
            <ruleId value="assertResourceTypesIfBody"/>  
            <param> 
                <name value="resource"/>  
                <value value="Patient,OperationOutcome"/> 
            </param> 
        </rule>  
        <rule> 
            <ruleId value="assertProfileIfOperationOutcome"/>  
            <param> 
                <name value="validateProfileId"/>  
                <value value="resource-operationoutcome-profile"/> 
            </param> 
        </rule>  
        <rule> 
            <ruleId value="assertProfileIfResource"/>  
            <param> 
                <name value="resource"/>  
                <value value="Patient"/> 
            </param>  
            <param> 
                <name value="validateProfileId"/>  
                <value value="resource-profile"/> 
            </param> 
        </rule> 
    </ruleset>  
    <ruleset id="ruleset-updateok-headers-body"> 
        <resource> 
            <reference value="/FHIRCommon/_reference/ruleset/RuleSet-UpdateOkHeadersBody-Groovy.xml"/> 
        </resource>  
        <rule> 
            <ruleId value="assertContentTypeIfBody"/> 
        </rule>  
        <rule> 
            <ruleId value="assertContentTypeCharsetIfBody"/> 
        </rule>  
        <rule> 
            <ruleId value="assertResourceTypesIfBody"/>  
            <param> 
                <name value="resource"/>  
                <value value="Patient,OperationOutcome"/> 
            </param> 
        </rule>  
        <rule> 
            <ruleId value="assertProfileIfOperationOutcome"/>  
            <param> 
                <name value="validateProfileId"/>  
                <value value="resource-operationoutcome-profile"/> 
            </param> 
        </rule>  
        <rule> 
            <ruleId value="assertProfileIfResource"/>  
            <param> 
                <name value="resource"/>  
                <value value="Patient"/> 
            </param>  
            <param> 
                <name value="validateProfileId"/>  
                <value value="resource-profile"/> 
            </param> 
        </rule>  
        <rule> 
            <ruleId value="assertVersionIdIfResourceAndSupported"/>  
            <param> 
                <name value="resource"/>  
                <value value="Patient"/> 
            </param>  
            <param> 
                <name value="resourceOperator"/>  
                <value value="equals"/> 
            </param> 
        </rule> 
    </ruleset>  
    <ruleset id="ruleset-updatenotok-headers-body"> 
        <resource> 
            <reference value="/FHIRCommon/_reference/ruleset/RuleSet-UpdateNotOkHeadersBody-Groovy.xml"/> 
        </resource>  
        <rule> 
            <ruleId value="assertContentTypeIfBody"/> 
        </rule>  
        <rule> 
            <ruleId value="assertContentTypeCharsetIfBody"/> 
        </rule>  
        <rule> 
            <ruleId value="assertOperationOutcomeIfError"/> 
        </rule>  
        <rule> 
            <ruleId value="assertProfileIfOperationOutcome"/>  
            <param> 
                <name value="validateProfileId"/>  
                <value value="resource-operationoutcome-profile"/> 
            </param> 
        </rule> 
    </ruleset>  
    <setup> 
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/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 1 does not exist on the server."/>  
                <accept value="json"/>  
                <contentType value="none"/>  
                <params value="?identifier=${search-update-conditional-01-json-identifier}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/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 2 does not exist on the server."/>  
                <accept value="xml"/>  
                <contentType value="none"/>  
                <params value="?identifier=${search-update-conditional-02-xml-identifier}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/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 3 does not exist on the server."/>  
                <accept value="json"/>  
                <contentType value="none"/>  
                <params value="?identifier=${search-update-conditional-03-json-identifier}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/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 4 does not exist on the server."/>  
                <accept value="xml"/>  
                <contentType value="none"/>  
                <params value="?identifier=${search-update-conditional-04-xml-identifier}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/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 5 does not exist on the server."/>  
                <accept value="json"/>  
                <contentType value="none"/>  
                <params value="?identifier=${search-update-conditional-05-json-identifier}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/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 6 does not exist on the server."/>  
                <accept value="xml"/>  
                <contentType value="none"/>  
                <params value="?identifier=${search-update-conditional-06-xml-identifier}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/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 7 does not exist on the server."/>  
                <accept value="json"/>  
                <contentType value="none"/>  
                <params value="?identifier=${search-update-conditional-07-json-identifier}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/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 8 does not exist on the server."/>  
                <accept value="xml"/>  
                <contentType value="none"/>  
                <params value="?identifier=${search-update-conditional-08-xml-identifier}"/> 
            </operation> 
        </action> 
    </setup>  
    <test id="01-UpdateConditionalJSONNoMatch"> 
        <name value="UpdateConditionalJSONNoMatch"/>  
        <description value="Test the update conditional operation with JSON content and query parameter criteria that does not match an existing resource. The expected response is 201 (Created) and the content is the created Patient resource in JSON format."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="update"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update conditional operation with JSON content and query parameter criteria that does not match an existing resource. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="?family=LASTDOESNOTEXISTJSON&amp;given=FIRSTDOESNOTEXISTJSON"/>  
                <sourceId value="resource-update-conditional-01-json"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 201(Created)."/>  
                <direction value="response"/>  
                <responseCode value="201"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-versioning-headers"/> 
                </ruleset>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected create ok response HTTP Headers and body."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-createok-headers-body"/>  
                    <rule> 
                        <ruleId value="assertContentTypeMimeTypeIfBody"/>  
                        <param> 
                            <name value="headerExpectedValue"/>  
                            <value value="application/fhir+json"/> 
                        </param> 
                    </rule> 
                </ruleset> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="search"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Search for the created Patient by the unique identifier."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="?identifier=${search-update-conditional-01-json-identifier}"/>  
                <responseId value="update-conditional-01-json-search-response"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </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"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Bundle."/>  
                <resource value="Bundle"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that returned bundle first entry contains the created version of the Patient."/>  
                <minimumId value="resource-update-conditional-01-json"/> 
            </assert> 
        </action> 
    </test>  
    <test id="02-UpdateConditionalXMLNoMatch"> 
        <name value="UpdateConditionalXMLNoMatch"/>  
        <description value="Test the update conditional operation with XML content and query parameter criteria that does not match an existing resource. The expected response is 201 (Created) and the content is the created Patient resource in XML format."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="update"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update conditional operation with XML content and query parameter criteria that does not match an existing resource. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="?family=LASTDOESNOTEXISTXML&amp;given=FIRSTDOESNOTEXISTXML"/>  
                <sourceId value="resource-update-conditional-02-xml"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 201(Created)."/>  
                <direction value="response"/>  
                <responseCode value="201"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-versioning-headers"/> 
                </ruleset>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected create ok response HTTP Headers and body."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-createok-headers-body"/>  
                    <rule> 
                        <ruleId value="assertContentTypeMimeTypeIfBody"/>  
                        <param> 
                            <name value="headerExpectedValue"/>  
                            <value value="application/fhir+xml"/> 
                        </param> 
                    </rule> 
                </ruleset> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="search"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Search for the created Patient by the unique identifier."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="?identifier=${search-update-conditional-02-xml-identifier}"/>  
                <responseId value="update-conditional-02-xml-search-response"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </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"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Bundle."/>  
                <resource value="Bundle"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that returned bundle first entry contains the created version of the Patient."/>  
                <minimumId value="resource-update-conditional-02-xml"/> 
            </assert> 
        </action> 
    </test>  
    <test id="03-UpdateConditionalJSONNoMatchPreferMinimal"> 
        <name value="UpdateConditionalJSONNoMatchPreferMinimal"/>  
        <description value="Test the update conditional operation with JSON content and query parameter criteria that does not match an existing resource and HTTP Prefer Header set to minimal. The expected response is 201 (Created) and the content is empty; i.e. no content."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="update"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update conditional operation with HTTP Accept Header set to JSON format and query parameter criteria that does not match an existing resource and HTTP Prefer Header set to minimal. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="?family=LASTDOESNOTEXISTJSON&amp;given=FIRSTDOESNOTEXISTJSON"/>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=minimal"/> 
                </requestHeader>  
                <sourceId value="resource-update-conditional-03-json"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 201(Created)."/>  
                <direction value="response"/>  
                <responseCode value="201"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex rule assertion to conditionally validate expected HTTP Header Content-Type."/>  
                <direction value="response"/>  
                <rule> 
                    <ruleId value="rule-assertContentTypeIfBody"/> 
                </rule> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-versioning-headers"/> 
                </ruleset>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="search"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Search for the created Patient by the unique identifier."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="?identifier=${search-update-conditional-03-json-identifier}"/>  
                <responseId value="update-conditional-03-json-search-response"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </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"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Bundle."/>  
                <resource value="Bundle"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that returned bundle first entry contains the created version of the Patient."/>  
                <minimumId value="resource-update-conditional-03-json"/> 
            </assert> 
        </action> 
    </test>  
    <test id="04-UpdateConditionalXMLNoMatchPreferMinimal"> 
        <name value="UpdateConditionalXMLNoMatchPreferMinimal"/>  
        <description value="Test the update conditional operation with XML content and query parameter criteria that does not match an existing resource and HTTP Prefer Header set to minimal. The expected response is 201 (Created) and the content is empty; i.e. no content."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="update"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update conditional operation with HTTP Accept Header set to XML format and query paramter criteria that does not match an existing resource and HTTP Prefer Header set to minimal. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="?family=LASTDOESNOTEXISTXML&amp;given=FIRSTDOESNOTEXISTXML"/>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=minimal"/> 
                </requestHeader>  
                <sourceId value="resource-update-conditional-04-xml"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 201(Created)."/>  
                <direction value="response"/>  
                <responseCode value="201"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex rule assertion to conditionally validate expected HTTP Header Content-Type."/>  
                <direction value="response"/>  
                <rule> 
                    <ruleId value="rule-assertContentTypeIfBody"/> 
                </rule> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-versioning-headers"/> 
                </ruleset>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="search"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Search for the created Patient by the unique identifier."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="?identifier=${search-update-conditional-04-xml-identifier}"/>  
                <responseId value="update-conditional-04-xml-search-response"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </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"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Bundle."/>  
                <resource value="Bundle"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that returned bundle first entry contains the created version of the Patient."/>  
                <minimumId value="resource-update-conditional-04-xml"/> 
            </assert> 
        </action> 
    </test>  
    <test id="05-UpdateConditionalJSONNoMatchPreferRepresentation"> 
        <name value="UpdateConditionalJSONNoMatchPreferRepresentation"/>  
        <description value="Test the update conditional operation with JSON content and query parameter criteria that does not match an existing resource and HTTP Prefer Header set to representation. The expected response is 201 (Created) and the content is the created Patient resource in JSON format."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="update"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update conditional operation with JSON content and query parameter criteria that does not match an existing resource and HTTP Prefer Header set to representation. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="?family=LASTDOESNOTEXISTJSON&amp;given=FIRSTDOESNOTEXISTJSON"/>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=representation"/> 
                </requestHeader>  
                <sourceId value="resource-update-conditional-05-json"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 201(Created)."/>  
                <direction value="response"/>  
                <responseCode value="201"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-versioning-headers"/> 
                </ruleset>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected create ok response HTTP Headers and body."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-createok-headers-body"/>  
                    <rule> 
                        <ruleId value="assertContentTypeMimeTypeIfBody"/>  
                        <param> 
                            <name value="headerExpectedValue"/>  
                            <value value="application/fhir+json"/> 
                        </param> 
                    </rule> 
                </ruleset> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="search"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Search for the created Patient by the unique identifier."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="?identifier=${search-update-conditional-05-json-identifier}"/>  
                <responseId value="update-conditional-05-json-search-response"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </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"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Bundle."/>  
                <resource value="Bundle"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that returned bundle first entry contains the created version of the Patient."/>  
                <minimumId value="resource-update-conditional-05-json"/> 
            </assert> 
        </action> 
    </test>  
    <test id="06-UpdateConditionalXMLNoMatchPreferRepresentation"> 
        <name value="UpdateConditionalXMLNoMatchPreferRepresentation"/>  
        <description value="Test the update conditional operation with XML content and query parameter criteria that does not match an existing resource and HTTP Prefer Header set to representation. The expected response is 201 (Created) and the content is the created Patient resource in XML format."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="update"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update conditional operation with XML content and query parameter criteria that does not match an existing resource and HTTP Prefer Header set to representation. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="?family=LASTDOESNOTEXISTXML&amp;given=FIRSTDOESNOTEXISTXML"/>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=representation"/> 
                </requestHeader>  
                <sourceId value="resource-update-conditional-06-xml"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 201(Created)."/>  
                <direction value="response"/>  
                <responseCode value="201"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-versioning-headers"/> 
                </ruleset>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected create ok response HTTP Headers and body."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-createok-headers-body"/>  
                    <rule> 
                        <ruleId value="assertContentTypeMimeTypeIfBody"/>  
                        <param> 
                            <name value="headerExpectedValue"/>  
                            <value value="application/fhir+xml"/> 
                        </param> 
                    </rule> 
                </ruleset> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="search"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Search for the created Patient by the unique identifier."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="?identifier=${search-update-conditional-06-xml-identifier}"/>  
                <responseId value="update-conditional-06-xml-search-response"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </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"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Bundle."/>  
                <resource value="Bundle"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that returned bundle first entry contains the created version of the Patient."/>  
                <minimumId value="resource-update-conditional-06-xml"/> 
            </assert> 
        </action> 
    </test>  
    <test id="07-UpdateConditionalJSONNoMatchPreferOperationOutcome"> 
        <name value="UpdateConditionalJSONNoMatchPreferOperationOutcome"/>  
        <description value="Test the update conditional operation with JSON content and query parameter criteria that does not match an existing resource and HTTP Prefer Header set to OperationOutcome. The expected response is 201 (Created) and the content is an OperationOutcome resource in JSON format indicating a successful create."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="update"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update conditional operation with JSON content and query parameter criteria that does not match an existing resource and HTTP Prefer Header set to OperationOutcome. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="?family=LASTDOESNOTEXISTJSON&amp;given=FIRSTDOESNOTEXISTJSON"/>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=OperationOutcome"/> 
                </requestHeader>  
                <sourceId value="resource-update-conditional-07-json"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 201(Created)."/>  
                <direction value="response"/>  
                <responseCode value="201"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type is present."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="notEmpty"/> 
            </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"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="application/fhir+json"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type contains 'charset=utf-8' (case-insensitive)."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="charset=utf-8"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Location is present."/>  
                <direction value="response"/>  
                <headerField value="Location"/>  
                <operator value="notEmpty"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-versioning-headers"/> 
                </ruleset>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is OperationOutcome."/>  
                <resource value="OperationOutcome"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned OperationOutcome conforms to the base FHIR specification."/>  
                <validateProfileId value="resource-operationoutcome-profile"/> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="search"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Search for the created Patient by the unique identifier."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="?identifier=${search-update-conditional-07-json-identifier}"/>  
                <responseId value="update-conditional-07-json-search-response"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </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"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Bundle."/>  
                <resource value="Bundle"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that returned bundle first entry contains the created version of the Patient."/>  
                <minimumId value="resource-update-conditional-07-json"/> 
            </assert> 
        </action> 
    </test>  
    <test id="08-UpdateConditionalXMLNoMatchPreferOperationOutcome"> 
        <name value="UpdateConditionalXMLNoMatchPreferOperationOutcome"/>  
        <description value="Test the update conditional operation with XML content and query parameter criteria that does not match an existing resource and HTTP Prefer Header set to OperationOutcome. The expected response is 201 (Created) and the content is an OperationOutcome resource in XML format indicating a successful create."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="update"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update conditional operation with XML content and query parameter criteria that does not match an existing resource and HTTP Prefer Header set to OperationOutcome. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="?family=LASTDOESNOTEXISTXML&amp;given=FIRSTDOESNOTEXISTXML"/>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=OperationOutcome"/> 
                </requestHeader>  
                <sourceId value="resource-update-conditional-08-xml"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 201(Created)."/>  
                <direction value="response"/>  
                <responseCode value="201"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type is present."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="notEmpty"/> 
            </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"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="application/fhir+xml"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type contains 'charset=utf-8' (case-insensitive)."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="charset=utf-8"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Location is present."/>  
                <direction value="response"/>  
                <headerField value="Location"/>  
                <operator value="notEmpty"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-versioning-headers"/> 
                </ruleset>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is OperationOutcome."/>  
                <resource value="OperationOutcome"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned OperationOutcome conforms to the base FHIR specification."/>  
                <validateProfileId value="resource-operationoutcome-profile"/> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="search"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Search for the created Patient by the unique identifier."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="?identifier=${search-update-conditional-08-xml-identifier}"/>  
                <responseId value="update-conditional-08-xml-search-response"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </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"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Bundle."/>  
                <resource value="Bundle"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that returned bundle first entry contains the created version of the Patient."/>  
                <minimumId value="resource-update-conditional-08-xml"/> 
            </assert> 
        </action> 
    </test>  
    <test id="09-UpdateConditionalJSONOneMatch"> 
        <name value="UpdateConditionalJSONOneMatch"/>  
        <description value="Test the update conditional operation with JSON content and query parameter criteria that matches the created resource from the first test. The expected HTTP response is 200 (OK) and response content is the updated Patient resource in JSON format."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="update"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update conditional operation with JSON content and query parameter criteria that matches the created resource from the first test. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="?family=${search-update-conditional-01-json-family}&amp;given=${search-update-conditional-01-json-given}"/>  
                <sourceId value="resource-update-conditional-01-json-version2"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-versioning-headers"/> 
                </ruleset>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected update ok response HTTP Headers and body."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-updateok-headers-body"/>  
                    <rule> 
                        <ruleId value="assertContentTypeMimeTypeIfBody"/>  
                        <param> 
                            <name value="headerExpectedValue"/>  
                            <value value="application/fhir+json"/> 
                        </param> 
                    </rule> 
                </ruleset> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Read the updated Patient and verify the contents match the updated version 2."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="/${update-conditional-01-json-id}"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </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"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Patient."/>  
                <resource value="Patient"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Patient conforms to the base FHIR specification."/>  
                <validateProfileId value="resource-profile"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that returned contents contains the updated version 2 of the Patient."/>  
                <minimumId value="resource-update-conditional-01-json-version2"/> 
            </assert> 
        </action> 
    </test>  
    <test id="10-UpdateConditionalXMLOneMatch"> 
        <name value="UpdateConditionalXMLOneMatch"/>  
        <description value="Test the update conditional operation with XML content and query parameter criteria that matches the one existing resource from the second test. The expected HTTP response is 200 (OK) and response content is the updated Patient resource in XML format."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="update"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update conditional operation with XML content and query parameter criteria that matches the one existing resource from the second test. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="?family=${search-update-conditional-02-xml-family}&amp;given=${search-update-conditional-02-xml-given}"/>  
                <sourceId value="resource-update-conditional-02-xml-version2"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-versioning-headers"/> 
                </ruleset>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected update ok response HTTP Headers and body."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-updateok-headers-body"/>  
                    <rule> 
                        <ruleId value="assertContentTypeMimeTypeIfBody"/>  
                        <param> 
                            <name value="headerExpectedValue"/>  
                            <value value="application/fhir+xml"/> 
                        </param> 
                    </rule> 
                </ruleset> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Read the updated Patient and verify the contents match the updated version 2."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="/${update-conditional-02-xml-id}"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </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"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Patient."/>  
                <resource value="Patient"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Patient conforms to the base FHIR specification."/>  
                <validateProfileId value="resource-profile"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that returned contents contains the updated version 2 of the Patient."/>  
                <minimumId value="resource-update-conditional-02-xml-version2"/> 
            </assert> 
        </action> 
    </test>  
    <test id="11-UpdateConditionalJSONOneMatchPreferMinimal"> 
        <name value="UpdateConditionalJSONOneMatchPreferMinimal"/>  
        <description value="Test the update conditional operation with JSON content and query parameter criteria that matches the one existing resource from the third test and HTTP Prefer Header set to minimal. The expected HTTP response is 200 (OK) and content is empty; i.e. no content."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="update"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update conditional operation with HTTP Accept Header set to JSON format and query parameter criteria that matches the one existing resource from the third test and HTTP Prefer Header set to minimal. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="?family=${search-update-conditional-03-json-family}&amp;given=${search-update-conditional-03-json-given}"/>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=minimal"/> 
                </requestHeader>  
                <sourceId value="resource-update-conditional-03-json-version2"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex rule assertion to conditionally validate expected HTTP Header Content-Type."/>  
                <direction value="response"/>  
                <rule> 
                    <ruleId value="rule-assertContentTypeIfBody"/> 
                </rule> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-versioning-headers"/> 
                </ruleset>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Read the updated Patient and verify the contents match the updated version 2."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="/${update-conditional-03-json-id}"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </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"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Patient."/>  
                <resource value="Patient"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Patient conforms to the base FHIR specification."/>  
                <validateProfileId value="resource-profile"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that returned contents contains the updated version 2 of the Patient."/>  
                <minimumId value="resource-update-conditional-03-json-version2"/> 
            </assert> 
        </action> 
    </test>  
    <test id="12-UpdateConditionalXMLOneMatchPreferMinimal"> 
        <name value="UpdateConditionalXMLOneMatchPreferMinimal"/>  
        <description value="Test the update conditional operation with XML content and query parameter criteria that matches the one existing resource from the fourth test and HTTP Prefer Header set to minimal. The expected HTTP response is 200 (OK) and content is empty; i.e. no content."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="update"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update conditional operation with HTTP Accept Header set to XML format and query parameter criteria that matches the one existing resource from the fourth test and HTTP Prefer Header set to minimal. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="?family=${search-update-conditional-04-xml-family}&amp;given=${search-update-conditional-04-xml-given}"/>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=minimal"/> 
                </requestHeader>  
                <sourceId value="resource-update-conditional-04-xml-version2"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex rule assertion to conditionally validate expected HTTP Header Content-Type."/>  
                <direction value="response"/>  
                <rule> 
                    <ruleId value="rule-assertContentTypeIfBody"/> 
                </rule> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-versioning-headers"/> 
                </ruleset>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Read the updated Patient and verify the contents match the updated version 2."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="/${update-conditional-04-xml-id}"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </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"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Patient."/>  
                <resource value="Patient"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Patient conforms to the base FHIR specification."/>  
                <validateProfileId value="resource-profile"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that returned contents contains the updated version 2 of the Patient."/>  
                <minimumId value="resource-update-conditional-04-xml-version2"/> 
            </assert> 
        </action> 
    </test>  
    <test id="13-UpdateConditionalJSONOneMatchPreferRepresentation"> 
        <name value="UpdateConditionalJSONOneMatchPreferRepresentation"/>  
        <description value="Test the update conditional operation with JSON content and query parameter criteria that matches the one existing resource from the fifth test and HTTP Prefer Header set to representation. The expected HTTP response is 200 (OK) and content is the updated Patient resource in JSON format."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="update"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update conditional operation with JSON content and query parameter criteria that matches the one existing resource from the fifth test and HTTP Prefer Header set to representation. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="?family=${search-update-conditional-05-json-family}&amp;given=${search-update-conditional-05-json-given}"/>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=representation"/> 
                </requestHeader>  
                <sourceId value="resource-update-conditional-05-json-version2"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-versioning-headers"/> 
                </ruleset>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected update ok response HTTP Headers and body."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-updateok-headers-body"/>  
                    <rule> 
                        <ruleId value="assertContentTypeMimeTypeIfBody"/>  
                        <param> 
                            <name value="headerExpectedValue"/>  
                            <value value="application/fhir+json"/> 
                        </param> 
                    </rule> 
                </ruleset> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Read the updated Patient and verify the contents match the updated version 2."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="/${update-conditional-05-json-id}"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </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"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Patient."/>  
                <resource value="Patient"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Patient conforms to the base FHIR specification."/>  
                <validateProfileId value="resource-profile"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that returned contents contains the updated version 2 of the Patient."/>  
                <minimumId value="resource-update-conditional-05-json-version2"/> 
            </assert> 
        </action> 
    </test>  
    <test id="14-UpdateConditionalXMLOneMatchPreferRepresentation"> 
        <name value="UpdateConditionalXMLOneMatchPreferRepresentation"/>  
        <description value="Test the update conditional operation with XML content and query parameter criteria that matches the one existing resource from the sixth test and HTTP Prefer Header set to representation. The expected HTTP response is 200 (OK) and content is the updated Patient resource in XML format."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="update"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update conditional operation with XML content and query parameter criteria that matches the one existing resource from the sixth test and HTTP Prefer Header set to representation. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="?family=${search-update-conditional-06-xml-family}&amp;given=${search-update-conditional-06-xml-given}"/>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=representation"/> 
                </requestHeader>  
                <sourceId value="resource-update-conditional-06-xml-version2"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-versioning-headers"/> 
                </ruleset>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected update ok response HTTP Headers and body."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-updateok-headers-body"/>  
                    <rule> 
                        <ruleId value="assertContentTypeMimeTypeIfBody"/>  
                        <param> 
                            <name value="headerExpectedValue"/>  
                            <value value="application/fhir+xml"/> 
                        </param> 
                    </rule> 
                </ruleset> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Read the updated Patient and verify the contents match the updated version 2."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="/${update-conditional-06-xml-id}"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </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"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Patient."/>  
                <resource value="Patient"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Patient conforms to the base FHIR specification."/>  
                <validateProfileId value="resource-profile"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that returned contents contains the updated version 2 of the Patient."/>  
                <minimumId value="resource-update-conditional-06-xml-version2"/> 
            </assert> 
        </action> 
    </test>  
    <test id="15-UpdateConditionalJSONOneMatchPreferOperationOutcome"> 
        <name value="UpdateConditionalJSONOneMatchPreferOperationOutcome"/>  
        <description value="Test the update conditional operation with JSON content and query parameter criteria that matches the one existing resource from the fifth test and HTTP Prefer Header set to OperationOutcome. The expected HTTP response is 200 (OK) and content is an OperationOutcome resource in JSON format indicating a successful update."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="update"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update conditional operation with JSON content and query parameter criteria that matches the one existing resource from the fifth test and HTTP Prefer Header set to OperationOutcome. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="?family=${search-update-conditional-07-json-family}&amp;given=${search-update-conditional-07-json-given}"/>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=OperationOutcome"/> 
                </requestHeader>  
                <sourceId value="resource-update-conditional-07-json-version2"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type is present."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="notEmpty"/> 
            </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"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="application/fhir+json"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type contains 'charset=utf-8' (case-insensitive)."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="charset=utf-8"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-versioning-headers"/> 
                </ruleset>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is OperationOutcome."/>  
                <resource value="OperationOutcome"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned OperationOutcome conforms to the base FHIR specification."/>  
                <validateProfileId value="resource-operationoutcome-profile"/> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Read the updated Patient and verify the contents match the updated version 2."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="/${update-conditional-07-json-id}"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </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"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Patient."/>  
                <resource value="Patient"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Patient conforms to the base FHIR specification."/>  
                <validateProfileId value="resource-profile"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that returned contents contains the updated version 2 of the Patient."/>  
                <minimumId value="resource-update-conditional-07-json-version2"/> 
            </assert> 
        </action> 
    </test>  
    <test id="16-UpdateConditionalXMLOneMatchPreferOperationOutcome"> 
        <name value="UpdateConditionalXMLOneMatchPreferOperationOutcome"/>  
        <description value="Test the update conditional operation with XML content and query parameter criteria that matches the one existing resource from the sixth test and HTTP Prefer Header set to OperationOutcome. The expected HTTP response is 200 (OK) and content is an OperationOutcome resource in XML format indicating a successful update."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="update"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update conditional operation with XML content and query parameter criteria that matches the one existing resource from the sixth test and HTTP Prefer Header set to OperationOutcome. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="?family=${search-update-conditional-08-xml-family}&amp;given=${search-update-conditional-08-xml-given}"/>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=OperationOutcome"/> 
                </requestHeader>  
                <sourceId value="resource-update-conditional-08-xml-version2"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type is present."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="notEmpty"/> 
            </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"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="application/fhir+xml"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type contains 'charset=utf-8' (case-insensitive)."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="charset=utf-8"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-versioning-headers"/> 
                </ruleset>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is OperationOutcome."/>  
                <resource value="OperationOutcome"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned OperationOutcome conforms to the base FHIR specification."/>  
                <validateProfileId value="resource-operationoutcome-profile"/> 
            </assert> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Read the updated Patient and verify the contents match the updated version 2."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="/${update-conditional-08-xml-id}"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </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"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Patient."/>  
                <resource value="Patient"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Patient conforms to the base FHIR specification."/>  
                <validateProfileId value="resource-profile"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that returned contents contains the updated version 2 of the Patient."/>  
                <minimumId value="resource-update-conditional-08-xml-version2"/> 
            </assert> 
        </action> 
    </test>  
    <test id="17-UpdateConditionalJSONMultipleMatch"> 
        <name value="UpdateConditionalJSONMultipleMatch"/>  
        <description value="Test the update conditional operation with JSON content and query parameter criteria that matches multiple existing resources based on the previous successful tests. The expected HTTP response is 412 (Precondition Failed) and optional content of an OperationOutcome resource in JSON format."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="update"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update conditional operation with JSON content and query parameter criteria that matches multiple existing resources based on the previous successful tests. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="?family=Lastname&amp;given=Firstname"/>  
                <sourceId value="resource-update-conditional-17-json"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 412(Precondition Failed)."/>  
                <direction value="response"/>  
                <responseCode value="412"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header ETag is not present."/>  
                <direction value="response"/>  
                <headerField value="ETag"/>  
                <operator value="empty"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Last-Modified is not present."/>  
                <direction value="response"/>  
                <headerField value="Last-Modified"/>  
                <operator value="empty"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Location is not present."/>  
                <direction value="response"/>  
                <headerField value="Location"/>  
                <operator value="empty"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected update not ok response HTTP Headers and body."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-updatenotok-headers-body"/>  
                    <rule> 
                        <ruleId value="assertContentTypeMimeTypeIfBody"/>  
                        <param> 
                            <name value="headerExpectedValue"/>  
                            <value value="application/fhir+json"/> 
                        </param> 
                    </rule> 
                </ruleset> 
            </assert> 
        </action> 
    </test>  
    <test id="18-UpdateConditionalXMLMultipleMatch"> 
        <name value="UpdateConditionalXMLMultipleMatch"/>  
        <description value="Test the update conditional operation with XML content and query parameter criteria that matches multiple existing resources based on the previous successful tests. The expected HTTP response is 412 (Precondition Failed) and optional content of an OperationOutcome resource in XML format."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="update"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update conditional operation with XML content and query parameter criteria that matches multiple existing resources based on the previous successful tests. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="?family=Lastname&amp;given=Firstname"/>  
                <sourceId value="resource-update-conditional-18-xml"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 412(Precondition Failed)."/>  
                <direction value="response"/>  
                <responseCode value="412"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header ETag is not present."/>  
                <direction value="response"/>  
                <headerField value="ETag"/>  
                <operator value="empty"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Last-Modified is not present."/>  
                <direction value="response"/>  
                <headerField value="Last-Modified"/>  
                <operator value="empty"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Location is not present."/>  
                <direction value="response"/>  
                <headerField value="Location"/>  
                <operator value="empty"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Complex ruleset assertion to conditionally validate expected update not ok response HTTP Headers and body."/>  
                <direction value="response"/>  
                <ruleset> 
                    <rulesetId value="ruleset-updatenotok-headers-body"/>  
                    <rule> 
                        <ruleId value="assertContentTypeMimeTypeIfBody"/>  
                        <param> 
                            <name value="headerExpectedValue"/>  
                            <value value="application/fhir+xml"/> 
                        </param> 
                    </rule> 
                </ruleset> 
            </assert> 
        </action> 
    </test>  
    <teardown> 
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-conditional-01-json-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-conditional-02-xml-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-conditional-03-json-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-conditional-04-xml-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-conditional-05-json-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-conditional-06-xml-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-conditional-07-json-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-conditional-08-xml-id}"/> 
            </operation> 
        </action> 
    </teardown> 
</TestScript>