Test Script

Name/FHIRSandbox/DaVinci/FHIR4-0-1-PAS/PAS-2-0-1/00-Capabilities/dv-pas-00-capabilities
DescriptionDa Vinci - PAS - FHIR R4 - 00 Capabilities - test a server to verify support for the capabilities interaction using 'HTTP GET metadata' and the return of a valid CapabilityStatement resource supporting the Da Vinci PAS IG version 1.2.0. As json format is required, this tests asks for the json formatted CapabilityStatement and then also verifies the server's support for json format, fhir version 4.0.1, Davinci Prior Authorization operations, and support for at least 1 non-patient US Core resource.
Version1Latest1
Content
<?xml version="1.0" encoding="UTF-8"?>

<TestScript xmlns="http://hl7.org/fhir">  
    <id value="dv-pas-r4-00-capabilities-json"/>  
    <meta> 
        <profile value="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript"/> 
    </meta>  
    <text> 
        <status value="generated"/>  
        <div xmlns="http://www.w3.org/1999/xhtml">
            <p>Da Vinci - PAS - FHIR R4 - 00 Capabilities - JSON</p>
        </div> 
    </text>  
    <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule"> 
        <extension url="ruleId"> 
            <valueId value="assert-json-support"/> 
        </extension>  
        <extension url="path"> 
            <valueString value="/FHIRCommon/_reference/rule/assert-json-support.groovy"/> 
        </extension> 
    </extension>  
    <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule"> 
        <extension url="ruleId"> 
            <valueId value="assert-non-patient-support"/> 
        </extension>  
        <extension url="path"> 
            <valueString value="/FHIRCommon/_reference/rule/assert-non-patient-support.groovy"/> 
        </extension> 
    </extension>  
    <url value="http://wildfhir.aegis.net/FHIRSandbox/DaVinci/fhir4-0-1-PAS/PAS-1-2-0/00-Capabilities/dv-pas-r4-00-capabilities-json"/>  
    <name value="DaVinciPASR400CapabilitiesJSON"/>  
    <title value="Da Vinci - PAS - FHIR R4 - 00 Capabilities - JSON"/>  
    <status value="active"/>  
    <date value="2022-12-27"/>  
    <publisher value="AEGIS.net, Inc."/>  
    <contact> 
        <name value="Touchstone Support"/>  
        <telecom> 
            <system value="email"/>  
            <value value="Touchstone_Support@aegis.net"/>  
            <use value="work"/> 
        </telecom> 
    </contact>  
    <description value="Da Vinci - PAS - FHIR R4 - 00 Capabilities - test a server to verify support for the capabilities interaction using 'HTTP GET metadata' and the return of a valid CapabilityStatement resource supporting the Da Vinci PAS IG version 1.2.0.  As json format is required, this tests asks for the json formatted CapabilityStatement and then also verifies the server's support for json format, fhir version 4.0.1, Davinci Prior Authorization operations, and support for at least 1 non-patient US Core resource."/>  
    <copyright value="This FHIR Test Script is licensed under Creative Commons (CC0) 'No Rights Reserved'. Learn more at https://creativecommons.org/licenses"/>  
    <profile id="capabilities-profile"> 
        <reference value="http://hl7.org/fhir/StructureDefinition/CapabilityStatement"/> 
    </profile>  
    <test id="01-GetCapabilityStatement"> 
        <name value="GetCapabilityStatement"/>  
        <description value="Test the HTTP GET metadata capabilities operation with HTTP Header Accept set to JSON format. The expected response content is a valid CapabilityStatement resource supporting the Da Vinci PAS IG version 1.2.0."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://touchstone.com/fhir/testscript-operation-codes-extended"/>  
                    <code value="metadata"/> 
                </type>  
                <description value="HTTP GET metadata capabilities operation with HTTP Header Accept set to JSON format. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="json"/>  
                <encodeRequestUrl value="true"/>  
                <params value="metadata"/>  
                <requestHeader> 
                    <field value="Authorization"/>  
                    <value value="none"/> 
                </requestHeader> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP status is 200(OK)."/>  
                <direction value="response"/>  
                <responseCode value="200"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail"> 
                    <valueBoolean value="false"/> 
                </extension>  
                <description value="Confirm that the returned HTTP Header Content-Type is present."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail"> 
                    <valueBoolean value="false"/> 
                </extension>  
                <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"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned HTTP Header ETag is present. Warning only as FHIR servers SHOULD return this header."/>  
                <direction value="response"/>  
                <headerField value="ETag"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail"> 
                    <valueBoolean value="false"/> 
                </extension>  
                <description value="Confirm that the returned resource type is CapabilityStatement."/>  
                <direction value="response"/>  
                <resource value="CapabilityStatement"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail"> 
                    <valueBoolean value="false"/> 
                </extension>  
                <description value="Expect fhirVersion is 4.0.1"/>  
                <path value="$.fhirVersion"/>  
                <value value="4.0.1"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail"> 
                    <valueBoolean value="false"/> 
                </extension>  
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-rule"> 
                    <extension url="ruleId"> 
                        <valueId value="assert-json-support"/> 
                    </extension> 
                </extension>  
                <description value="Validate for json support against the Capability profile"/>  
                <direction value="response"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail"> 
                    <valueBoolean value="false"/> 
                </extension>  
                <description value="Confirm that the returned CapabilityStatement conforms to the base FHIR specification."/>  
                <direction value="response"/>  
                <validateProfileId value="capabilities-profile"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail"> 
                    <valueBoolean value="false"/> 
                </extension>  
                <description value="Confirm that the returned CapabilityStatement resource minimally contains the declaration of a RESTful server supporting the Claim resource type."/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.where(mode = 'server').resource.where(type = 'Claim').exists()"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail"> 
                    <valueBoolean value="false"/> 
                </extension>  
                <description value="Confirm that the returned CapabilityStatement resource minimally contains the declaration of a RESTful server supporting the US Core Patient resource and supportedProfile per the US Core Server Capabilities requirements."/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.where(mode = 'server').resource.where(type = 'Patient').where(supportedProfile contains 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient').exists()"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail"> 
                    <valueBoolean value="false"/> 
                </extension>  
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-rule"> 
                    <extension url="ruleId"> 
                        <valueId value="assert-non-patient-support"/> 
                    </extension> 
                </extension>  
                <description value="Verify that at least one non-Patient US Core profile is supported as per the US Core Server Capabilities Requirements."/>  
                <direction value="response"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail"> 
                    <valueBoolean value="false"/> 
                </extension>  
                <description value="Confirm that the returned CapabilityStatement resource minimally contains the declaration of support for the PAS Claim $submit operation."/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.where(mode = 'server').resource.where(type = 'Claim').operation.where(name = 'submit' and definition = 'http://hl7.org/fhir/us/davinci-pas/OperationDefinition/Claim-submit').exists()"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail"> 
                    <valueBoolean value="false"/> 
                </extension>  
                <description value="Confirm that the returned CapabilityStatement resource minimally contains the declaration of support for the PAS Claim $inquiry operation."/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.where(mode = 'server').resource.where(type = 'Claim').operation.where(name = 'inquiry' and definition = 'http://hl7.org/fhir/us/davinci-pas/OperationDefinition/Claim-inquiry').exists()"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </test> 
</TestScript>