Test Script

Name/FHIR1-6-0-Advanced/Patient/02-vread/fhir-api-stu3-patient-vread-02-notfound
DescriptionFHIR API STU3 Advanced Operation Tests - Patient vread test suite against a single server for a known, not found resource instance. All tests perform the read operation for a specified Patient resource id and version id representing an unknown Patient. 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-vread-02-notfound"/>  
    <text> 
        <status value="generated"/>  
        <div xmlns="http://www.w3.org/1999/xhtml">  
            <p>FHIR API STU3 - Patient Version Read Not Found Resource Suite</p> 
        </div> 
    </text>  
    <url value="http://wildfhir.aegis.net/fhir/TestScript/fhir-api-stu3-patient-vread-02-notfound"/>  
    <name value="FHIR API STU3 - Patient Version Read Not Found 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-09-16"/>  
    <description value="FHIR API STU3 Advanced Operation Tests - Patient vread test suite against a single server for a known, not found resource instance. All tests perform the read operation for a specified Patient resource id and version id representing an unknown Patient. 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 Version Read Operation"/>  
    <copyright value="© AEGIS.net, Inc. 2015+"/>  
    <metadata> 
        <capability> 
            <required value="true"/>  
            <description value="Version Read Operation"/>  
            <link value="http://hl7.org/fhir/http.html#vread"/>  
            <conformance> 
                <reference value="../_reference/conformance/PatientVread.xml"/> 
            </conformance> 
        </capability> 
    </metadata>  
    <fixture id="resource-read-json-min"> 
        <resource> 
            <reference value="../_reference/resources/Patient-read-json-min.json"/> 
        </resource> 
    </fixture>  
    <fixture id="resource-read-xml-min"> 
        <resource> 
            <reference value="../_reference/resources/Patient-read-xml-min.xml"/> 
        </resource> 
    </fixture>  
    <profile id="resource-profile"> 
        <reference value="http://hl7.org/fhir/StructureDefinition/Patient"/> 
    </profile>  
    <variable> 
        <name value="NotFoundPatientResourceId"/>  
        <description value="Enter a Patient resource id that does not exist on the destination system."/>  
        <hint value="[Not Found Resource Id]"/> 
    </variable>  
    <variable> 
        <name value="NotFoundPatientVersionId"/>  
        <description value="Enter a Patient version id that does not exist on the destination system."/>  
        <hint value="[Not Found Version Id]"/> 
    </variable>  
    <test id="01-VreadNotFoundJSON"> 
        <name value="VreadNotFoundJSON"/>  
        <description value="Test the vread operation for a known, not found (never existed) Patient resource instance. 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="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient vread operation for a known, not found (never existed) resource instance. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="json"/>  
                <contentType value="none"/>  
                <params value="/${NotFoundPatientResourceId}/_history/${NotFoundPatientVersionId}"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 404(Not Found)."/>  
                <direction value="response"/>  
                <responseCode value="404"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type is present. Warning only as the server may not return any content."/>  
                <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 the server may not return any content."/>  
                <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 the server may not return any content."/>  
                <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 resource type is OperationOutcome. Warning only as a returned OperationOutcome is optional but servers are encouraged to return this."/>  
                <resource value="OperationOutcome"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action> 
    </test>  
    <test id="02-VreadNotFoundXML"> 
        <name value="VreadNotFoundXML"/>  
        <description value="Test the vread operation for a known, not found (never existed) Patient resource instance. 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="read"/> 
                </type>  
                <resource value="Patient"/>  
                <description value="Patient vread operation for a known, not found (never existed) resource instance. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="xml"/>  
                <contentType value="none"/>  
                <params value="/${NotFoundPatientResourceId}/_history/${NotFoundPatientVersionId}"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 404(Not Found)."/>  
                <direction value="response"/>  
                <responseCode value="404"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type is present. Warning only as the server may not return any content."/>  
                <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 the server may not return any content."/>  
                <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 the server may not return any content."/>  
                <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 resource type is OperationOutcome. Warning only as a returned OperationOutcome is optional but servers are encouraged to return this."/>  
                <resource value="OperationOutcome"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action> 
    </test> 
</TestScript>