Test Script

Name/FHIRSandbox/DaVinci/FHIR4-0-1-Formulary/Formulary-STU1-1-0/00-Capability/dv-formulary-r4-00-capability-xml
DescriptionDa Vinci - Formulary - FHIR R4 - STU 1.1 - 00 Capability - test a single server to verify support for the capabilities interaction 'HTTP GET metadata' and the return of a valid CapabilityStatement resource supporting the required Da Vinci Formulary IG operations using XML syntax.
Version1Latest1
Content
<?xml version="1.0" encoding="UTF-8"?>

<TestScript xmlns="http://hl7.org/fhir">  
    <id value="dv-pdex-r4-formulary-stu1.1-00-capability-xml"/>  
    <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 - Formulary - FHIR R4 - STU 1.1 - 00 Capability - XML</p> 
        </div> 
    </text>  
    <url value="https://touchstone.aegis.net/fhir4-0-1/TestScript/dv-pdex-r4-formulary-stu1-1-00-capability-xml"/>  
    <name value="DaVinciFormularySTU1_1_R401CapabilityXML"/>  
    <title value="Da Vinci - Formulary - FHIR R4 - STU 1.1 - 00 Capability - XML"/>  
    <status value="active"/>  
    <date value="2022-12-15"/>  
    <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 - Formulary - FHIR R4 - STU 1.1 - 00 Capability - test a single server to verify support for the capabilities interaction 'HTTP GET metadata' and the return of a valid CapabilityStatement resource supporting the required Da Vinci Formulary IG operations using XML syntax."/>  
    <copyright value="This FHIR Test Script is licensed under Creative Commons (CC0) 'No Rights Reserved'. Learn more at https://creativecommons.org/licenses"/>  
    <origin> 
        <index value="1"/>  
        <profile> 
            <system value="http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types"/>  
            <code value="FHIR-Client"/> 
        </profile> 
    </origin>  
    <destination> 
        <index value="1"/>  
        <profile> 
            <system value="http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types"/>  
            <code value="FHIR-Server"/> 
        </profile> 
    </destination>  
    <profile id="capabilities-profile"> 
        <reference value="http://hl7.org/fhir/StructureDefinition/CapabilityStatement"/> 
    </profile>  
    <test id="01-Capability"> 
        <name value="Capability"/>  
        <description value="Test the HTTP GET metadata capabilities operation with HTTP Header Accept set to XML format. The expected response content is a valid CapabilityStatement resource supporting the required Da Vinci Formulary IG operations using XML syntax."/>  
        <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 XML format. The response asserts for all the optional HTTP Headers will be warning only."/>  
                <accept value="xml"/>  
                <encodeRequestUrl value="true"/>  
                <origin value="1"/>  
                <params value="metadata"/>  
                <requestHeader> 
                    <field value="Authorization"/>  
                    <value value="none"/> 
                </requestHeader> 
            </operation> 
        </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 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+xml'."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="application/fhir+xml"/>  
                <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> 
                <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="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."/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.where(mode = 'server').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="Check that the returned CapabilityStatement resource SHALL contain support for JSON source format."/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.format.where($this.contains('json')).exists()"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Check that the returned CapabilityStatement resource SHOULD contain support for XML source format."/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.format.where($this.contains('xml')).exists()"/>  
                <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="SHALL Support CoveragePlan Profile"/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.resource.exists(type='List').supportedProfile contains 'http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-CoveragePlan'"/>  
                <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="SHALL Support search-type for CoveragePlan"/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.resource.where(type = 'List').interaction.code contains 'search-type'"/>  
                <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="SHALL Support read for CoveragePlan"/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.resource.where(type = 'List').interaction.code contains 'read'"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="SHOULD Support vread for CoveragePlan"/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.resource.where(type = 'List').interaction.code contains 'vread'"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="SHOULD Support history-instance for CoveragePlan"/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.resource.where(type = 'List').interaction.code contains 'history-instance'"/>  
                <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="SHALL Support _id search parameter for CoveragePlan"/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.resource.where(type = 'List').searchParam.where(name = '_id').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="SHALL Support identifier search parameter for CoveragePlan"/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.resource.where(type = 'List').searchParam.where(name = 'identifier').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="SHALL Support item search parameter for CoveragePlan"/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.resource.where(type = 'List').searchParam.where(name = 'item').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="SHALL Support status search parameter for CoveragePlan"/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.resource.where(type = 'List').searchParam.where(name = 'status').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="SHALL Support FormularyDrug Profile"/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.resource.exists(type='MedicationKnowledge' and supportedProfile='http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyDrug')"/>  
                <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="SHALL Support search-type for FormularyDrug"/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.resource.where(type = 'MedicationKnowledge').interaction.code contains 'search-type'"/>  
                <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="SHALL Support read for FormularyDrug"/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.resource.where(type = 'MedicationKnowledge').interaction.code contains 'read'"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="SHOULD Support vread for FormularyDrug"/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.resource.where(type = 'MedicationKnowledge').interaction.code contains 'vread'"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="SHOULD Support history-instance for FormularyDrug"/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.resource.where(type = 'MedicationKnowledge').interaction.code contains 'history-instance'"/>  
                <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="SHALL Support _id search parameter for FormularyDrug"/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.resource.where(type = 'MedicationKnowledge').searchParam.where(name = '_id').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="SHALL Support DrugName search parameter for FormularyDrug"/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.resource.where(type = 'MedicationKnowledge').searchParam.where(name = 'DrugName').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="SHALL Support DrugPlan search parameter for FormularyDrug"/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.resource.where(type = 'MedicationKnowledge').searchParam.where(name = 'DrugPlan').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="SHALL Support DrugTier search parameter for FormularyDrug"/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.resource.where(type = 'MedicationKnowledge').searchParam.where(name = 'DrugTier').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="SHALL Support code search parameter for FormularyDrug"/>  
                <direction value="response"/>  
                <expression value="CapabilityStatement.rest.resource.where(type = 'MedicationKnowledge').searchParam.where(name = 'code').exists()"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </test> 
</TestScript>