Test Script

Name/FHIR1-6-0-Advanced/Capabilities/fhir-api-stu3-conformance-01-metadata
DescriptionFHIR API STU3 Advanced Operation Tests - Conformance Metadata test suite against a single server to verify support for the conformance interaction 'HTTP GET metadata' and the return of a valid Conformance resource.
Version1Latest1
Content
<?xml version="1.0" encoding="UTF-8"?>

<TestScript xmlns="http://hl7.org/fhir">  
    <id value="fhir-api-stu3-patient-conformance-01-metadata"/>  
    <text> 
        <status value="generated"/>  
        <div xmlns="http://www.w3.org/1999/xhtml">  
            <p>FHIR API STU3 - Conformance Metadata Suite</p> 
        </div> 
    </text>  
    <url value="http://wildfhir.aegis.net/fhir/TestScript/fhir-api-stu3-patient-conformance-01-metadata"/>  
    <name value="FHIR API STU3 - Conformance Metadata 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-11-25"/>  
    <description value="FHIR API STU3 Advanced Operation Tests - Conformance Metadata test suite against a single server to verify support for the conformance interaction 'HTTP GET metadata' and the return of a valid Conformance resource."/>  
    <useContext> 
        <coding> 
            <system value="urn:iso:std:iso:3166"/>  
            <code value="US"/>  
            <display value="United States of America (the)"/> 
        </coding> 
    </useContext>  
    <requirements value="Conformance Metadata Operations"/>  
    <copyright value="© AEGIS.net, Inc. 2015+"/>  
    <profile id="conformance-profile"> 
        <reference value="http://hl7.org/fhir/StructureDefinition/Conformance"/> 
    </profile>  
    <test id="01-ConformanceMetadataJSON"> 
        <name value="ConformanceMetadataJSON"/>  
        <description value="Test the HTTP GET metadata conformance operation with HTTP Header Accept set to JSON format and no request URL parameters defined. The expected response content is the found Conformance resource in JSON format."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://touchstone.com/fhir/testscript-operation-codes-extended"/>  
                    <code value="metadata"/> 
                </type>  
                <description value="HTTP GET metadata conformance operation with HTTP Header Accept set to JSON format and no request URL parameters defined. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="json"/>  
                <contentType value="none"/>  
                <params value="metadata"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type is present."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="notEmpty"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type contains the FHIR mime-type 'application/fhir+json'."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="application/fhir+json"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type contains 'charset=utf-8'. 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 resource type is Conformance."/>  
                <resource value="Conformance"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Conformance conforms to the base FHIR specification."/>  
                <validateProfileId value="conformance-profile"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Conformance resource minimally contains the declaration of a RESTful server."/>  
                <operator value="equals"/>  
                <path value=".rest[0].mode"/>  
                <value value="server"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action> 
    </test>  
    <test id="02-ConformanceMetadataXML"> 
        <name value="ConformanceMetadataXML"/>  
        <description value="Test the HTTP GET metadata conformance operation with HTTP Header Accept set to XML format and no request URL parameters defined. The expected response content is the found Conformance resource in XML format."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://touchstone.com/fhir/testscript-operation-codes-extended"/>  
                    <code value="metadata"/> 
                </type>  
                <description value="HTTP GET metadata conformance operation with HTTP Header Accept set to XML format and no request URL parameters defined. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="xml"/>  
                <contentType value="none"/>  
                <params value="metadata"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type is present."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="notEmpty"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type contains the FHIR mime-type 'application/fhir+xml'."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="application/fhir+xml"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header Content-Type contains 'charset=utf-8'. 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 resource type is Conformance."/>  
                <resource value="Conformance"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Conformance conforms to the base FHIR specification."/>  
                <validateProfileId value="conformance-profile"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Conformance resource minimally contains the declaration of a RESTful server."/>  
                <operator value="equals"/>  
                <path value="Conformance/rest/mode"/>  
                <value value="server"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action> 
    </test> 
</TestScript>