Test Script

Name/FHIR1-6-0-Advanced/Patient/03-create/fhir-api-stu3-patient-create-03-conditional
DescriptionFHIR API STU3 Advanced Operation Tests - Patient create conditional test suite against a single server using valid resource instances where expected results include successful and failed create operations. The destination server must also support the 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.
Version1Latest1
Content
<?xml version="1.0" encoding="UTF-8"?>

<TestScript xmlns="http://hl7.org/fhir">  
    <id value="fhir-api-stu3-patient-create-03-conditional"/>  
    <text> 
        <status value="generated"/>  
        <div xmlns="http://www.w3.org/1999/xhtml">  
            <p>FHIR API STU3 - Patient Create Conditional Resource Suite</p> 
        </div> 
    </text>  
    <url value="http://wildfhir.aegis.net/fhir/TestScript/fhir-api-stu3-patient-create-03-conditional"/>  
    <name value="FHIR API STU3 - Patient Create Conditional Resource Suite"/>  
    <status value="draft"/>  
    <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>  
    <date value="2016-10-26"/>  
    <description value="FHIR API STU3 Advanced Operation Tests - Patient create conditional test suite against a single server using valid resource instances where expected results include successful and failed create operations. The destination server must also support the 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."/>  
    <useContext> 
        <coding> 
            <system value="urn:iso:std:iso:3166"/>  
            <code value="US"/>  
            <display value="United States of America (the)"/> 
        </coding> 
    </useContext>  
    <requirements value="Patient Create Conditional, Search and Delete Operations"/>  
    <copyright value="© AEGIS.net, Inc. 2015+"/>  
    <metadata> 
        <capability> 
            <required value="true"/>  
            <description value="Create Conditional, Search and Delete Operation"/>  
            <link value="http://hl7.org/fhir/http.html#create"/>  
            <link value="http://hl7.org/fhir/http.html#delete"/>  
            <link value="http://hl7.org/fhir/http.html#search"/>  
            <conformance> 
                <reference value="../_reference/conformance/PatientCreateConditional.xml"/> 
            </conformance> 
        </capability> 
    </metadata>  
    <fixture id="resource-create-conditional-01-json"> 
        <resource> 
            <reference value="../_reference/resources/Patient-create-conditional-01-json-nomatch.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-create-conditional-02-xml"> 
        <resource> 
            <reference value="../_reference/resources/Patient-create-conditional-02-xml-nomatch.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-create-conditional-03-json"> 
        <resource> 
            <reference value="../_reference/resources/Patient-create-conditional-03-json-nomatch.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-create-conditional-04-xml"> 
        <resource> 
            <reference value="../_reference/resources/Patient-create-conditional-04-xml-nomatch.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-create-conditional-05-json"> 
        <resource> 
            <reference value="../_reference/resources/Patient-create-conditional-05-json-nomatch.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-create-conditional-06-xml"> 
        <resource> 
            <reference value="../_reference/resources/Patient-create-conditional-06-xml-nomatch.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-create-conditional-07-json"> 
        <resource> 
            <reference value="../_reference/resources/Patient-create-conditional-07-json-nomatch.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-create-conditional-08-xml"> 
        <resource> 
            <reference value="../_reference/resources/Patient-create-conditional-08-xml-nomatch.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-create-conditional-09-json"> 
        <resource> 
            <reference value="../_reference/resources/Patient-create-conditional-09-json-onematch.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-create-conditional-10-xml"> 
        <resource> 
            <reference value="../_reference/resources/Patient-create-conditional-10-xml-onematch.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-create-conditional-11-json"> 
        <resource> 
            <reference value="../_reference/resources/Patient-create-conditional-11-json-matches.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-create-conditional-12-xml"> 
        <resource> 
            <reference value="../_reference/resources/Patient-create-conditional-12-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="create-conditional-01-json-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="create-conditional-01-json-search-response"/> 
    </variable>  
    <variable> 
        <name value="search-create-conditional-01-json-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-create-conditional-01-json"/> 
    </variable>  
    <variable> 
        <name value="search-create-conditional-01-json-family"/>  
        <path value="Patient/name[1]/family[1]"/>  
        <sourceId value="resource-create-conditional-01-json"/> 
    </variable>  
    <variable> 
        <name value="search-create-conditional-01-json-given"/>  
        <path value="Patient/name[1]/given[1]"/>  
        <sourceId value="resource-create-conditional-01-json"/> 
    </variable>  
    <variable> 
        <name value="create-conditional-02-xml-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="create-conditional-02-xml-search-response"/> 
    </variable>  
    <variable> 
        <name value="search-create-conditional-02-xml-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-create-conditional-02-xml"/> 
    </variable>  
    <variable> 
        <name value="search-create-conditional-02-xml-family"/>  
        <path value="Patient/name[1]/family[1]"/>  
        <sourceId value="resource-create-conditional-02-xml"/> 
    </variable>  
    <variable> 
        <name value="search-create-conditional-02-xml-given"/>  
        <path value="Patient/name[1]/given[1]"/>  
        <sourceId value="resource-create-conditional-02-xml"/> 
    </variable>  
    <variable> 
        <name value="create-conditional-03-json-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="create-conditional-03-json-search-response"/> 
    </variable>  
    <variable> 
        <name value="search-create-conditional-03-json-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-create-conditional-03-json"/> 
    </variable>  
    <variable> 
        <name value="create-conditional-04-xml-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="create-conditional-04-xml-search-response"/> 
    </variable>  
    <variable> 
        <name value="search-create-conditional-04-xml-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-create-conditional-04-xml"/> 
    </variable>  
    <variable> 
        <name value="create-conditional-05-json-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="create-conditional-05-json-search-response"/> 
    </variable>  
    <variable> 
        <name value="search-create-conditional-05-json-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-create-conditional-05-json"/> 
    </variable>  
    <variable> 
        <name value="create-conditional-06-xml-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="create-conditional-06-xml-search-response"/> 
    </variable>  
    <variable> 
        <name value="search-create-conditional-06-xml-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-create-conditional-06-xml"/> 
    </variable>  
    <variable> 
        <name value="create-conditional-07-json-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="create-conditional-07-json-search-response"/> 
    </variable>  
    <variable> 
        <name value="search-create-conditional-07-json-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-create-conditional-07-json"/> 
    </variable>  
    <variable> 
        <name value="create-conditional-08-xml-id"/>  
        <path value="Patient/id"/>  
        <sourceId value="create-conditional-08-xml-search-response"/> 
    </variable>  
    <variable> 
        <name value="search-create-conditional-08-xml-identifier"/>  
        <path value="Patient/identifier/value"/>  
        <sourceId value="resource-create-conditional-08-xml"/> 
    </variable>  
    <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-create-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-create-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-create-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-create-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-create-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-create-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-create-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-create-conditional-08-xml-identifier}"/> 
            </operation> 
        </action> 
    </setup>  
    <test id="01-CreateConditionalJSONNoMatch"> 
        <name value="CreateConditionalJSONNoMatch"/>  
        <description value="Test the create conditional operation with JSON content and HTTP If-None-Exist Header criteria that does not match an existing resource. The expected response content is the created Patient resource in JSON format."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="create"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient create conditional operation with JSON content and HTTP If-None-Exist Header 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"/>  
                <requestHeader> 
                    <field value="If-None-Exist"/>  
                    <value value="family=LASTDOESNOTEXISTJSON&amp;given=FIRSTDOESNOTEXISTJSON"/> 
                </requestHeader>  
                <sourceId value="resource-create-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="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'. Warning only due to case-sensitive comparison."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="charset=utf-8"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header ETag is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="ETag"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="Last-Modified"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Location is present. Warning only as this is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Location"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Patient. Warning only as this is optional but servers are encouraged to return created resource."/>  
                <resource value="Patient"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Patient conforms to the base FHIR specification. Warning only as this is optional but servers are encouraged to return created resource."/>  
                <validateProfileId value="resource-profile"/>  
                <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-create-conditional-01-json-identifier}"/>  
                <responseId value="create-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-create-conditional-01-json"/> 
            </assert> 
        </action> 
    </test>  
    <test id="02-CreateConditionalXMLNoMatch"> 
        <name value="CreateConditionalXMLNoMatch"/>  
        <description value="Test the create conditional operation with XML content and HTTP If-None-Exist Header criteria that does not match an existing resource. The expected response content is the created Patient resource in XML format."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="create"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient create conditional operation with XML content and HTTP If-None-Exist Header 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"/>  
                <requestHeader> 
                    <field value="If-None-Exist"/>  
                    <value value="family=LASTDOESNOTEXISTXML&amp;given=FIRSTDOESNOTEXISTXML"/> 
                </requestHeader>  
                <sourceId value="resource-create-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="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'. Warning only due to case-sensitive comparison."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="charset=utf-8"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header ETag is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="ETag"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="Last-Modified"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Location is present. Warning only as this is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Location"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Patient. Warning only as this is optional but servers are encouraged to return created resource."/>  
                <resource value="Patient"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Patient conforms to the base FHIR specification. Warning only as this is optional but servers are encouraged to return created resource."/>  
                <validateProfileId value="resource-profile"/>  
                <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-create-conditional-02-xml-identifier}"/>  
                <responseId value="create-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-create-conditional-02-xml"/> 
            </assert> 
        </action> 
    </test>  
    <test id="03-CreateConditionalJSONNoMatchPreferMinimal"> 
        <name value="CreateConditionalJSONNoMatchPreferMinimal"/>  
        <description value="Test the create conditional operation with JSON content and HTTP If-None-Exist Header criteria that does not match an existing resource and HTTP Prefer Header set to minimal. The expected response content is empty; i.e. no content."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="create"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient create conditional operation with HTTP Accept Header set to JSON format and HTTP If-None-Exist Header 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"/>  
                <requestHeader> 
                    <field value="If-None-Exist"/>  
                    <value value="family=LASTDOESNOTEXISTJSON&amp;given=FIRSTDOESNOTEXISTJSON"/> 
                </requestHeader>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=minimal"/> 
                </requestHeader>  
                <sourceId value="resource-create-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="Confirm that the returned HTTP Header Content-Type is not present. Warning only as the server may set this header by default."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="empty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header ETag is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="ETag"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="Last-Modified"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Location is present. Warning only as this is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Location"/>  
                <operator value="notEmpty"/>  
                <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-create-conditional-03-json-identifier}"/>  
                <responseId value="create-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-create-conditional-03-json"/> 
            </assert> 
        </action> 
    </test>  
    <test id="04-CreateConditionalXMLNoMatchPreferMinimal"> 
        <name value="CreateConditionalXMLNoMatchPreferMinimal"/>  
        <description value="Test the create conditional operation with XML content and HTTP If-None-Exist Header criteria that does not match an existing resource and HTTP Prefer Header set to minimal. The expected response content is empty; i.e. no content."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="create"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient create conditional operation with HTTP Accept Header set to XML format and HTTP If-None-Exist Header 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"/>  
                <requestHeader> 
                    <field value="If-None-Exist"/>  
                    <value value="family=LASTDOESNOTEXISTXML&amp;given=FIRSTDOESNOTEXISTXML"/> 
                </requestHeader>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=minimal"/> 
                </requestHeader>  
                <sourceId value="resource-create-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="Confirm that the returned HTTP Header Content-Type is not present. Warning only as the server may set this header by default."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="empty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header ETag is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="ETag"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="Last-Modified"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Location is present. Warning only as this is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Location"/>  
                <operator value="notEmpty"/>  
                <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-create-conditional-04-xml-identifier}"/>  
                <responseId value="create-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-create-conditional-04-xml"/> 
            </assert> 
        </action> 
    </test>  
    <test id="05-CreateConditionalJSONNoMatchPreferRepresentation"> 
        <name value="CreateConditionalJSONNoMatchPreferRepresentation"/>  
        <description value="Test the create conditional operation with JSON content and HTTP If-None-Exist Header criteria that does not match an existing resource and HTTP Prefer Header set to representation. The expected response content is the create Patient resource in JSON format."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="create"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient create conditional operation with JSON content and HTTP If-None-Exist Header 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"/>  
                <requestHeader> 
                    <field value="If-None-Exist"/>  
                    <value value="family=LASTDOESNOTEXISTXML&amp;given=FIRSTDOESNOTEXISTXML"/> 
                </requestHeader>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=representation"/> 
                </requestHeader>  
                <sourceId value="resource-create-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="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'. Warning only due to case-sensitive comparison."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="charset=utf-8"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header ETag is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="ETag"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="Last-Modified"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Location is present. Warning only as this is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Location"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </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> 
            <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-create-conditional-05-json-identifier}"/>  
                <responseId value="create-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-create-conditional-05-json"/> 
            </assert> 
        </action> 
    </test>  
    <test id="06-CreateConditionalXMLNoMatchPreferRepresentation"> 
        <name value="CreateConditionalXMLNoMatchPreferRepresentation"/>  
        <description value="Test the create conditional operation with XML content and HTTP If-None-Exist Header criteria that does not match an existing resource and HTTP Prefer Header set to representation. The expected response content is the create Patient resource in XML format."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="create"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient create conditional operation with XML content and HTTP If-None-Exist Header 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"/>  
                <requestHeader> 
                    <field value="If-None-Exist"/>  
                    <value value="family=LASTDOESNOTEXISTXML&amp;given=FIRSTDOESNOTEXISTXML"/> 
                </requestHeader>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=representation"/> 
                </requestHeader>  
                <sourceId value="resource-create-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="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'. Warning only due to case-sensitive comparison."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="charset=utf-8"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header ETag is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="ETag"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="Last-Modified"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Location is present. Warning only as this is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Location"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </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> 
            <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-create-conditional-06-xml-identifier}"/>  
                <responseId value="create-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-create-conditional-06-xml"/> 
            </assert> 
        </action> 
    </test>  
    <test id="07-CreateConditionalJSONNoMatchPreferOperationOutcome"> 
        <name value="CreateConditionalJSONNoMatchPreferOperationOutcome"/>  
        <description value="Test the create conditional operation with JSON content and HTTP If-None-Exist Header criteria that does not match an existing resource and HTTP Prefer Header set to OperationOutcome. The expected response 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="create"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient create conditional operation with JSON content and HTTP If-None-Exist Header 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"/>  
                <requestHeader> 
                    <field value="If-None-Exist"/>  
                    <value value="family=LASTDOESNOTEXISTXML&amp;given=FIRSTDOESNOTEXISTXML"/> 
                </requestHeader>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=OperationOutcome"/> 
                </requestHeader>  
                <sourceId value="resource-create-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'. Warning only due to case-sensitive comparison."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="charset=utf-8"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header ETag is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="ETag"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="Last-Modified"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Location is present. Warning only as this is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Location"/>  
                <operator value="notEmpty"/>  
                <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-create-conditional-07-json-identifier}"/>  
                <responseId value="create-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-create-conditional-07-json"/> 
            </assert> 
        </action> 
    </test>  
    <test id="08-CreateConditionalXMLNoMatchPreferOperationOutcome"> 
        <name value="CreateConditionalXMLNoMatchPreferOperationOutcome"/>  
        <description value="Test the create conditional operation with XML content and HTTP If-None-Exist Header criteria that does not match an existing resource and HTTP Prefer Header set to OperationOutcome. The expected response 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="create"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient create conditional operation with XML content and HTTP If-None-Exist Header 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"/>  
                <requestHeader> 
                    <field value="If-None-Exist"/>  
                    <value value="family=LASTDOESNOTEXISTXML&amp;given=FIRSTDOESNOTEXISTXML"/> 
                </requestHeader>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="return=OperationOutcome"/> 
                </requestHeader>  
                <sourceId value="resource-create-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'. Warning only due to case-sensitive comparison."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="charset=utf-8"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header ETag is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="ETag"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="Last-Modified"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Location is present. Warning only as this is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Location"/>  
                <operator value="notEmpty"/>  
                <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-create-conditional-08-xml-identifier}"/>  
                <responseId value="create-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-create-conditional-08-xml"/> 
            </assert> 
        </action> 
    </test>  
    <test id="09-CreateConditionalJSONOneMatch"> 
        <name value="CreateConditionalJSONOneMatch"/>  
        <description value="Test the create conditional operation with JSON content and HTTP If-None-Exist Header criteria that matches the one existing resource from the first test. The expected HTTP response is 200 (OK) and optional content of an OperationOutcome resource in JSON format."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="create"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient create conditional operation with JSON content and HTTP If-None-Exist Header criteria that matches the one existing resource from the first test. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <requestHeader> 
                    <field value="If-None-Exist"/>  
                    <value value="family=${search-create-conditional-01-json-family}&amp;given=${search-create-conditional-01-json-given}"/> 
                </requestHeader>  
                <sourceId value="resource-create-conditional-09-json"/> 
            </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. Warning only as a response content is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type contains the FHIR mime-type 'application/fhir+json'. Warning only as a response content is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="application/fhir+json"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type contains 'charset=utf-8'. Warning only as a response content is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="charset=utf-8"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header ETag is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="ETag"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="Last-Modified"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Location is present. Warning only as this is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Location"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is OperationOutcome. Warning only as this is optional but servers are encouraged to return OperationOutcome with additional information for the client."/>  
                <resource value="OperationOutcome"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action> 
    </test>  
    <test id="10-CreateConditionalXMLOneMatch"> 
        <name value="CreateConditionalXMLOneMatch"/>  
        <description value="Test the create conditional operation with XML content and HTTP If-None-Exist Header criteria that matches the one existing resource from the second test. The expected HTTP response is 200 (OK) and optional content of an OperationOutcome resource in XML format."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="create"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient create conditional operation with XML content and HTTP If-None-Exist Header 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"/>  
                <requestHeader> 
                    <field value="If-None-Exist"/>  
                    <value value="family=${search-create-conditional-02-xml-family}&amp;given=${search-create-conditional-02-xml-given}"/> 
                </requestHeader>  
                <sourceId value="resource-create-conditional-10-xml"/> 
            </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. Warning only as a response content is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type contains the FHIR mime-type 'application/fhir+xml'. Warning only as a response content is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="application/fhir+xml"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type contains 'charset=utf-8'. Warning only as a response content is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="charset=utf-8"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header ETag is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="ETag"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server may not support versioning."/>  
                <direction value="response"/>  
                <headerField value="Last-Modified"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Location is present. Warning only as this is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Location"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is OperationOutcome. Warning only as this is optional but servers are encouraged to return OperationOutcome with additional information for the client."/>  
                <resource value="OperationOutcome"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action> 
    </test>  
    <test id="11-CreateConditionalJSONMultipleMatch"> 
        <name value="CreateConditionalJSONMultipleMatch"/>  
        <description value="Test the create conditional operation with JSON content and HTTP If-None-Exist Header 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="create"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient create conditional operation with JSON content and HTTP If-None-Exist Header 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"/>  
                <requestHeader> 
                    <field value="If-None-Exist"/>  
                    <value value="family=Lastname&amp;given=Firstname"/> 
                </requestHeader>  
                <sourceId value="resource-create-conditional-11-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 Content-Type is present. Warning only as a response content is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type contains the FHIR mime-type 'application/fhir+json'. Warning only as a response content is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="application/fhir+json"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type contains 'charset=utf-8'. Warning only as a response content is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="charset=utf-8"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header ETag is not present. Warning only to allow subsequent asserts to execute."/>  
                <direction value="response"/>  
                <headerField value="ETag"/>  
                <operator value="empty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Last-Modified is not present. Warning only to allow subsequent asserts to execute."/>  
                <direction value="response"/>  
                <headerField value="Last-Modified"/>  
                <operator value="empty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Location is not present. Warning only to allow subsequent asserts to execute."/>  
                <direction value="response"/>  
                <headerField value="Location"/>  
                <operator value="empty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is OperationOutcome. Warning only as this is optional but servers are encouraged to return an OperationOutcome on failure."/>  
                <resource value="OperationOutcome"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action> 
    </test>  
    <test id="12-CreateConditionalXMLMultipleMatch"> 
        <name value="CreateConditionalXMLMultipleMatch"/>  
        <description value="Test the create conditional operation with XML content and HTTP If-None-Exist Header 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="create"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient create conditional operation with XML content and HTTP If-None-Exist Header 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"/>  
                <requestHeader> 
                    <field value="If-None-Exist"/>  
                    <value value="family=Lastname&amp;given=Firstname"/> 
                </requestHeader>  
                <sourceId value="resource-create-conditional-12-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 Content-Type is present. Warning only as a response content is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type contains the FHIR mime-type 'application/fhir+xml'. Warning only as a response content is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="application/fhir+xml"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type contains 'charset=utf-8'. Warning only as a response content is optional but servers are encouraged to return this."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="charset=utf-8"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header ETag is not present. Warning only to allow subsequent asserts to execute."/>  
                <direction value="response"/>  
                <headerField value="ETag"/>  
                <operator value="empty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Last-Modified is not present. Warning only to allow subsequent asserts to execute."/>  
                <direction value="response"/>  
                <headerField value="Last-Modified"/>  
                <operator value="empty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Location is not present. Warning only to allow subsequent asserts to execute."/>  
                <direction value="response"/>  
                <headerField value="Location"/>  
                <operator value="empty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is OperationOutcome. Warning only as this is optional but servers are encouraged to return an OperationOutcome on failure."/>  
                <resource value="OperationOutcome"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action> 
    </test>  
    <teardown> 
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${create-conditional-01-json-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${create-conditional-02-xml-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${create-conditional-03-json-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${create-conditional-04-xml-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${create-conditional-05-json-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${create-conditional-06-xml-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${create-conditional-07-json-id}"/> 
            </operation> 
        </action>  
        <action> 
            <operation> 
                <type> 
                    <code value="delete"/> 
                </type>  
                <resource value="Patient"/>  
                <params value="/${create-conditional-08-xml-id}"/> 
            </operation> 
        </action> 
    </teardown> 
</TestScript>