Test Script

Name/FHIR1-6-0-Advanced/Patient/03-create/fhir-api-stu3-patient-create-02-notok
DescriptionFHIR API STU3 Advanced Operation Tests - Patient create test suite against a single server using invalid resource instances where all the expected results are not successful. The expected outcome of each test execution is a failed create operation so, there is no need for any clean up of created resources. Testing for 422 (Unprocessable Entity) is out of scope and not included. 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-02-notok"/>  
    <text> 
        <status value="generated"/>  
        <div xmlns="http://www.w3.org/1999/xhtml">  
            <p>FHIR API STU3 - Patient Create Not OK Resource Suite</p> 
        </div> 
    </text>  
    <url value="http://wildfhir.aegis.net/fhir/TestScript/fhir-api-stu3-patient-create-02-notok"/>  
    <name value="FHIR API STU3 - Patient Create Not OK 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="2017-01-17"/>  
    <description value="FHIR API STU3 Advanced Operation Tests - Patient create test suite against a single server using invalid resource instances where all the expected results are not successful. The expected outcome of each test execution is a failed create operation so, there is no need for any clean up of created resources. Testing for 422 (Unprocessable Entity) is out of scope and not included. 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 Operation"/>  
    <copyright value="© AEGIS.net, Inc. 2015+"/>  
    <metadata> 
        <capability> 
            <required value="true"/>  
            <description value="Create Operation"/>  
            <link value="http://hl7.org/fhir/http.html#create"/>  
            <conformance> 
                <reference value="../_reference/conformance/PatientCreateNotOK.xml"/> 
            </conformance> 
        </capability> 
    </metadata>  
    <fixture id="resource-create-notok-01-json-invalid-syntax"> 
        <resource> 
            <reference value="../_reference/resources/Patient-create-notok-01-json-invalid-syntax.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-create-notok-02-xml-invalid-syntax"> 
        <resource> 
            <reference value="../_reference/resources/Patient-create-notok-02-xml-invalid-syntax.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-create-notok-03-json-bad-profile"> 
        <resource> 
            <reference value="../_reference/resources/Patient-create-notok-03-json-bad-profile.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-create-notok-04-xml-bad-profile"> 
        <resource> 
            <reference value="../_reference/resources/Patient-create-notok-04-xml-bad-profile.xml"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-create-notok-05-json-withid-type"> 
        <resource> 
            <reference value="../_reference/resources/Patient-create-notok-05-json-invalid-type.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-create-notok-06-xml-invalid-type"> 
        <resource> 
            <reference value="../_reference/resources/Patient-create-notok-06-xml-invalid-type.xml"/> 
        </resource> 
    </fixture>  
    <test id="01-CreateNotOKJSONInvalidSyntax"> 
        <name value="CreateNotOKJSONInvalidSyntax"/>  
        <description value="Test the create operation with JSON content where the request resource content is invalid based on an invalid birthDate date value. The expected HTTP response is 400 (Bad Request) 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 operation with JSON content where the request resource content is invalid based on invalid birthDate date value. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <sourceId value="resource-create-notok-01-json-invalid-syntax"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 400(Bad Request)."/>  
                <direction value="response"/>  
                <responseCode value="400"/> 
            </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="02-CreateNotOKXMLInvalidSyntax"> 
        <name value="CreateNotOKXMLInvalidSyntax"/>  
        <description value="Test the create operation with XML content where the request resource content is invalid based on invalid birthDate date value. The expected HTTP response is 400 (Bad Request) 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 operation with XML content where the request resource content is invalid based on invalid birthDate date value. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <sourceId value="resource-create-notok-02-xml-invalid-syntax"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 400(Bad Request)."/>  
                <direction value="response"/>  
                <responseCode value="400"/> 
            </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>  
    <test id="03-CreateNotOKJSONBadProfile"> 
        <name value="CreateNotOKJSONBadProfile"/>  
        <description value="Test the create operation with JSON content where the request resource content is invalid based on non-conformance to the base FHIR resource profile. The expected HTTP response is 400 (Bad Request) 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 operation with JSON content where the request resource content is invalid based on non-conformance to the base FHIR resource profile. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <sourceId value="resource-create-notok-03-json-bad-profile"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 400(Bad Request)."/>  
                <direction value="response"/>  
                <responseCode value="400"/> 
            </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="04-CreateNotOKXMLBadProfile"> 
        <name value="CreateNotOKXMLBadProfile"/>  
        <description value="Test the create operation with XML content where the request resource content is invalid based on non-conformance to the base FHIR resource profile. The expected HTTP response is 400 (Bad Request) 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 operation with XML content where the request resource content is invalid based on non-conformance to the base FHIR resource profile. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <sourceId value="resource-create-notok-04-xml-bad-profile"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 400(Bad Request)."/>  
                <direction value="response"/>  
                <responseCode value="400"/> 
            </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>  
    <test id="05-CreateNotOKJSONInvalidType"> 
        <name value="CreateNotOKJSONInvalidType"/>  
        <description value="Test the create operation with JSON content where the request is made to an invalid resource type; a misspelling of Patient as Patent. The expected HTTP response is 404 (Not Found) 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>  
                <description value="Patient create operation with JSON content where the request is made to an invalid resource type. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <params value="Patent"/>  
                <sourceId value="resource-create-notok-05-json-withid-type"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status represents a failure to support the invalid request (4xx)."/>  
                <direction value="response"/>  
                <operator value="greaterThan"/>  
                <responseCode value="399"/> 
            </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="06-CreateNotOKXMLInvalidType"> 
        <name value="CreateNotOKXMLInvalidType"/>  
        <description value="Test the create operation with XML content where the request is made to an invalid resource type; a misspelling of Patient as Patent. The expected HTTP response is 404 (Not Found) 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>  
                <description value="Patient create operation with XML content where the request is made to an invalid resource type. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="xml"/>  
                <contentType value="xml"/>  
                <params value="Patent"/>  
                <sourceId value="resource-create-notok-06-xml-invalid-type"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status represents a failure to support the invalid request (4xx)."/>  
                <direction value="response"/>  
                <operator value="greaterThan"/>  
                <responseCode value="399"/> 
            </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> 
</TestScript>