Test Script

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

<TestScript xmlns="http://hl7.org/fhir">  
    <id value="fhir-api-stu3-patient-update-03-create"/>  
    <text> 
        <status value="generated"/>  
        <div xmlns="http://www.w3.org/1999/xhtml">  
            <p>FHIR API STU3 - Patient Update Create Resource Suite</p> 
        </div> 
    </text>  
    <url value="http://wildfhir.aegis.net/fhir3-0-1/TestScript/fhir-api-stu3-patient-update-03-create"/>  
    <name value="FHIR API STU3 - Patient Update Create 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 create test suite against a single server using valid resource instances where all the expected results are successful. The destination server must also support the read and delete operations in order to verify the updated resource instances and clean up the 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, Create, Search and Delete Operation"/>  
            <link value="http://hl7.org/fhir/STU3/http.html#read"/>  
            <link value="http://hl7.org/fhir/STU3/http.html#update"/>  
            <link value="http://hl7.org/fhir/STU3/http.html#delete"/>  
            <capabilities> 
                <reference value="./_reference/capabilities/PatientUpdateCreate.xml"/> 
            </capabilities> 
        </capability> 
    </metadata>  
    <fixture id="resource-update-create-01-json"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-create-01-json.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-create-02-xml"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-create-02-xml.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-create-03-json"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-create-03-json.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-create-04-xml"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-create-04-xml.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-create-05-json"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-create-05-json.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-create-05-xml"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-create-05-xml.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-create-06-json"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-create-06-json.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-create-06-xml"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-create-06-xml.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-create-07-json"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-create-07-json.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-create-08-xml"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-create-08-xml.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-create-09-json"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-create-09-json.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-create-10-xml"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-create-10-xml.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-create-11-json"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-create-11-json.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-update-create-12-xml"> 
        <resource> 
            <reference value="./_reference/resources/Patient-update-create-12-xml.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-create-01-json-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="resource-update-create-01-json"/> 
    </variable>  
    <variable> 
        <name value="search-update-create-01-json-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-create-01-json"/> 
    </variable>  
    <variable> 
        <name value="update-create-02-xml-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="resource-update-create-02-xml"/> 
    </variable>  
    <variable> 
        <name value="search-update-create-02-xml-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-create-02-xml"/> 
    </variable>  
    <variable> 
        <name value="update-create-03-json-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="resource-update-create-03-json"/> 
    </variable>  
    <variable> 
        <name value="search-update-create-03-json-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-create-03-json"/> 
    </variable>  
    <variable> 
        <name value="update-create-04-xml-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="resource-update-create-04-xml"/> 
    </variable>  
    <variable> 
        <name value="search-update-create-04-xml-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-create-04-xml"/> 
    </variable>  
    <variable> 
        <name value="update-create-05-json-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="resource-update-create-05-json"/> 
    </variable>  
    <variable> 
        <name value="search-update-create-05-json-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-create-05-json"/> 
    </variable>  
    <variable> 
        <name value="update-create-06-xml-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="resource-update-create-06-xml"/> 
    </variable>  
    <variable> 
        <name value="search-update-create-06-xml-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-create-06-xml"/> 
    </variable>  
    <variable> 
        <name value="update-create-07-json-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="resource-update-create-07-json"/> 
    </variable>  
    <variable> 
        <name value="search-update-create-07-json-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-create-07-json"/> 
    </variable>  
    <variable> 
        <name value="update-create-08-xml-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="resource-update-create-08-xml"/> 
    </variable>  
    <variable> 
        <name value="search-update-create-08-xml-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-create-08-xml"/> 
    </variable>  
    <variable> 
        <name value="update-create-09-json-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="resource-update-create-09-json"/> 
    </variable>  
    <variable> 
        <name value="search-update-create-09-json-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-create-09-json"/> 
    </variable>  
    <variable> 
        <name value="update-create-10-xml-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="resource-update-create-10-xml"/> 
    </variable>  
    <variable> 
        <name value="search-update-create-10-xml-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-create-10-xml"/> 
    </variable>  
    <variable> 
        <name value="update-create-11-json-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="resource-update-create-11-json"/> 
    </variable>  
    <variable> 
        <name value="search-update-create-11-json-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-create-11-json"/> 
    </variable>  
    <variable> 
        <name value="update-create-12-xml-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="resource-update-create-12-xml"/> 
    </variable>  
    <variable> 
        <name value="search-update-create-12-xml-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-update-create-12-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>  
    <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-create-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-create-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-create-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-create-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-create-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-create-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-create-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-create-08-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-create-09-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-create-10-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-create-11-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-create-12-xml-identifier}"/> 
            </operation> 
        </action> 
    </setup>  
    <test id="01-UpdateCreateJSON"> 
        <name value="UpdateCreateJSON"/>  
        <description value="Test the update operation with JSON content where the resource instance does not exist. 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="updateCreate"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update operation with JSON content where the resource instance does not exist."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="/${update-create-01-json-id}"/>  
                <sourceId value="resource-update-create-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="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Read the created Patient and verify the contents match the original sent contents."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="/${update-create-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 created the Patient."/>  
                <minimumId value="resource-update-create-01-json"/> 
            </assert> 
        </action> 
    </test>  
    <test id="02-UpdateCreateXML"> 
        <name value="UpdateCreateXML"/>  
        <description value="Test the update operation with XML content where the resource instance does not exist. 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="updateCreate"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update operation with XML content where the resource instance does not exist."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="/${update-create-02-xml-id}"/>  
                <sourceId value="resource-update-create-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="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Read the updated Patient and verify the contents match the original sent contents."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="/${update-create-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 created Patient."/>  
                <minimumId value="resource-update-create-02-xml"/> 
            </assert> 
        </action> 
    </test>  
    <test id="03-UpdateCreateJSONAcceptCharset"> 
        <name value="UpdateCreateJSONAcceptCharset"/>  
        <description value="Test the update operation where the resource instance does not exist. The HTTP Header Accept is set to application/fhir+json and Accept-Charset is set to utf-8 and no request URL parameters defined. 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="updateCreate"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update operation where the resource instance does not exist. The HTTP Header is set to application/fhir+json and Accept-Charset is set to utf-8 and no request URL parameters defined."/>  
                <contentType value="json"/>  
                <params value="/${update-create-03-json-id}"/>  
                <requestHeader> 
                    <field value="Accept"/>  
                    <value value="application/fhir+json"/> 
                </requestHeader>  
                <requestHeader> 
                    <field value="Accept-Charset"/>  
                    <value value="utf-8"/> 
                </requestHeader>  
                <sourceId value="resource-update-create-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 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="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Read the updated Patient and verify the contents match the original sent contents."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="/${update-create-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 created Patient."/>  
                <minimumId value="resource-update-create-03-json"/> 
            </assert> 
        </action> 
    </test>  
    <test id="04-UpdateCreatedXMLAcceptCharset"> 
        <name value="UpdateCreatedXMLAcceptCharset"/>  
        <description value="Test the update operation where the resource instance does not exist. The HTTP Header Accept is set to application/fhir+xml and Accept-Charset is set to utf-8 and no request URL parameters defined. 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="updateCreate"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update operation where the resource instance does not exist. The HTTP Header is set to application/fhir+xml and Accept-Charset is set to utf-8 and no request URL parameters defined."/>  
                <contentType value="xml"/>  
                <params value="/${update-create-04-xml-id}"/>  
                <requestHeader> 
                    <field value="Accept"/>  
                    <value value="application/fhir+xml"/> 
                </requestHeader>  
                <requestHeader> 
                    <field value="Accept-Charset"/>  
                    <value value="utf-8"/> 
                </requestHeader>  
                <sourceId value="resource-update-create-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 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="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Read the updated Patient and verify the contents match the original sent contents."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="/${update-create-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 created Patient."/>  
                <minimumId value="resource-update-create-04-xml"/> 
            </assert> 
        </action> 
    </test>  
    <test id="05-UpdateCreateXMLFormatParamJSONOverride"> 
        <name value="UpdateCreateXMLFormatParamJSONOverride"/>  
        <description value="Test the create operation where the resource instance does not exist. The HTTP Header Accept is set to XML format and the _format request URL parameter is set to JSON. The expected response is 201 (Created) and the content is the created Patient resource in JSON format as the _format parameter overrides the HTTP Header Accept."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="updateCreate"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update operation where the resource instance does not exist. The HTTP Header Accept is set to XML format and the _format request URL parameter is set to JSON."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="/${update-create-05-json-id}?_format=application/fhir+json"/>  
                <sourceId value="resource-update-create-05-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+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 original sent contents."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="/${update-create-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 created Patient."/>  
                <minimumId value="resource-update-create-05-json"/> 
            </assert> 
        </action> 
    </test>  
    <test id="06-UpdateCreateJSONFormatParamXMLOverride"> 
        <name value="UpdateCreateJSONFormatParamXMLOverride"/>  
        <description value="Test the create operation where the resource instance does not exist. The HTTP Header Accept is set to JSON format and the _format request URL parameter is set to XML. The expected response is 201 (Created) and the content is the created Patient resource in XML format as the _format parameter overrides the HTTP Header Accept."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="updateCreate"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update operation where the resource instance does not exist. The HTTP Header Accept is set to JSON format and the _format request URL parameter is set to XML."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="/${update-create-06-xml-id}?_format=application/fhir+xml"/>  
                <sourceId value="resource-update-create-06-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+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 original sent contents."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="/${update-create-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 created Patient."/>  
                <minimumId value="resource-update-create-06-xml"/> 
            </assert> 
        </action> 
    </test>  
    <test id="07-UpdateCreateJSONPreferMinimal"> 
        <name value="UpdateCreateJSONPreferMinimal"/>  
        <description value="Test the update operation where the resource instance does not exist. The HTTP Accept Header is set to JSON format and HTTP Prefer Header is 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="updateCreate"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update operation where the resource instance does not exist. The HTTP Accept Header is set to JSON format and HTTP Prefer Header is set to minimal."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="/${update-create-07-json-id}"/>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=minimal"/> 
                </requestHeader>  
                <sourceId value="resource-update-create-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="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 original sent contents."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="/${update-create-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 created Patient."/>  
                <minimumId value="resource-update-create-07-json"/> 
            </assert> 
        </action> 
    </test>  
    <test id="08-UpdateCreateXMLPreferMinimal"> 
        <name value="UpdateCreateXMLPreferMinimal"/>  
        <description value="Test the update operation where the resource instance does not exist. The HTTP Accept Header is set to XML format and HTTP Prefer Header is 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="updateCreate"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update operation where the resource instance does not exist. The HTTP Accept Header is set to XML format and HTTP Prefer Header is set to minimal."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="/${update-create-08-xml-id}"/>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=minimal"/> 
                </requestHeader>  
                <sourceId value="resource-update-create-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="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 original sent contents."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="/${update-create-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 created Patient."/>  
                <minimumId value="resource-update-create-08-xml"/> 
            </assert> 
        </action> 
    </test>  
    <test id="09-UpdateOKJSONPreferRepresentation"> 
        <name value="UpdateOKJSONPreferRepresentation"/>  
        <description value="Test the update operation where the resource instance does not exist. The HTTP Accept Header is set to JSON format and HTTP Prefer Header is 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="updateCreate"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update operation where the resource instance does not exist. The HTTP Accept Header is set to JSON format and HTTP Prefer Header is set to representation."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="/${update-create-09-json-id}"/>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=representation"/> 
                </requestHeader>  
                <sourceId value="resource-update-create-09-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="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Read the updated Patient and verify the contents match the original sent contents."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="/${update-create-09-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 created Patient."/>  
                <minimumId value="resource-update-create-09-json"/> 
            </assert> 
        </action> 
    </test>  
    <test id="10-UpdateCreateXMLPreferRepresentation"> 
        <name value="UpdateCreateXMLPreferRepresentation"/>  
        <description value="Test the update operation where the resource instance does not exist. The HTTP Accept Header is set to XML format and HTTP Prefer Header is 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="updateCreate"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update operation where the resource instance does not exist. The HTTP Accept Header is set to XML format and HTTP Prefer Header is set to representation."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="/${update-create-10-xml-id}"/>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=representation"/> 
                </requestHeader>  
                <sourceId value="resource-update-create-10-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="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Read the updated Patient and verify the contents match the original sent contents."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="/${update-create-10-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 created Patient."/>  
                <minimumId value="resource-update-create-10-xml"/> 
            </assert> 
        </action> 
    </test>  
    <test id="11-UpdateOKJSONPreferOperationOutcome"> 
        <name value="UpdateOKJSONPreferOperationOutcome"/>  
        <description value="Test the update operation where the resource instance does not exist. The HTTP Accept Header is set to JSON format and HTTP Prefer Header is 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="updateCreate"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update operation where the resource instance does not exist. The HTTP Accept Header is set to JSON format and HTTP Prefer Header is set to OperationOutcome."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="/${update-create-11-json-id}"/>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=OperationOutcome"/> 
                </requestHeader>  
                <sourceId value="resource-update-create-11-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="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Read the updated Patient and verify the contents match the original sent contents."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="/${update-create-11-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 created Patient."/>  
                <minimumId value="resource-update-create-11-json"/> 
            </assert> 
        </action> 
    </test>  
    <test id="12-UpdateCreateXMLPreferOperationOutcome"> 
        <name value="UpdateCreateXMLPreferOperationOutcome"/>  
        <description value="Test the update operation where the resource instance does not exist. The HTTP Accept Header is set to XML format and HTTP Prefer Header is 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="updateCreate"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient update operation where the resource instance does not exist. The HTTP Accept Header is set to XML format and HTTP Prefer Header is set to OperationOutcome."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="/${update-create-12-xml-id}"/>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=OperationOutcome"/> 
                </requestHeader>  
                <sourceId value="resource-update-create-12-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="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Read the updated Patient and verify the contents match the original sent contents."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="/${update-create-12-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 created Patient."/>  
                <minimumId value="resource-update-create-12-xml"/> 
            </assert> 
        </action> 
    </test>  
    <teardown> 
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-create-01-json-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-create-02-xml-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-create-03-json-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-create-04-xml-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-create-05-json-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-create-06-xml-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-create-07-json-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-create-08-xml-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-create-09-json-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-create-10-xml-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-create-11-json-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${update-create-12-xml-id}"/> 
            </operation> 
        </action> 
    </teardown> 
</TestScript>