Test Script

Name/FHIRSandbox/DaVinci/FHIR4-0-1-PDEX/PDEX-STU2/02-PatientByReference/dv-pdex-STU2-03-coverage-xml
DescriptionDa Vinci - PDex - FHIR STU2 - Scenario 02 Payer Exchange - Query - Search all Coverages for a known Subscriber since a known date as XML formatted data.
Version2Latest2
Content
<?xml version="1.0" encoding="UTF-8"?>

<TestScript xmlns="http://hl7.org/fhir">  
    <id value="dv-pdex-STU2-01-coverage-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 - PDex - FHIR STU2 - Coverage Query - XML</p>
        </div> 
    </text>  
    <url value="http://wildfhir.aegis.net/fhir4-0-0/TestScript/dv-pdex-STU2-01-coverage-xml"/>  
    <name value="DaVinciPDexR401-01CoverageXML"/>  
    <title value="Da Vinci - PDex - FHIR STU2 - Coverage Query - XML"/>  
    <status value="active"/>  
    <date value="2021-12-02"/>  
    <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 - PDex - FHIR STU2 - Scenario 02 Payer Exchange - Query - Search all Coverages for a known Subscriber since a known date as XML formatted data."/>  
    <copyright value="This FHIR Test Script is licensed under Creative Commons (CC0) 'No Rights Reserved'. Learn more at https://creativecommons.org/licenses"/>  
    <origin id="SMART-on-FHIR App"> 
        <index value="1"/>  
        <profile> 
            <system value="http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types"/>  
            <code value="FHIR-Client"/> 
        </profile> 
    </origin>  
    <destination id="Payer FHIR Server"> 
        <index value="1"/>  
        <profile> 
            <system value="http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types"/>  
            <code value="FHIR-Server"/> 
        </profile> 
    </destination>  
    <profile id="bundle-profile"> 
        <reference value="http://hl7.org/fhir/StructureDefinition/Bundle"/> 
    </profile>  
    <variable> 
        <name value="Health_Plan_Member_ID"/>  
        <description value="Enter the patient id search parameter"/>  
        <hint value="[Health_Plan_Member_ID]"/> 
    </variable>  
    <variable> 
        <name value="updatedSince"/>  
        <defaultValue value="2021-01-01"/>  
        <description value="Enter the date since search parameter"/>  
        <hint value="[yyyy-MM-dd]"/> 
    </variable>  
    <test id="01-SearchSubscriberCoverages"> 
        <name value="SearchSubscriberCoverages"/>  
        <description value="Test the search for Subscriber Coverages with XML content matching a known Subscriber(Patient) id and since a specified date. The expected response content is a searchset Bundle resource containing all matching Coverage resource instances in XML format."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://hl7.org/fhir/testscript-operation-codes"/>  
                    <code value="search"/> 
                </type>  
                <resource value="Coverage"/>  
                <description value="Search for Subscriber Coverages and verify the search results."/>  
                <accept value="xml"/>  
                <destination value="1"/>  
                <encodeRequestUrl value="true"/>  
                <origin value="1"/>  
                <params value="?patient=${Health_Plan_Member_ID}&amp;_lastUpdated=gt${updatedSince}"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the client requested an Accept of the FHIR XML mime type 'application/fhir+xml'."/>  
                <direction value="request"/>  
                <headerField value="Accept"/>  
                <operator value="contains"/>  
                <value value="application/fhir+xml"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the client did not request a Content-Type. Warning only to allow for systems that automatically send Content-Type."/>  
                <direction value="request"/>  
                <headerField value="Content-Type"/>  
                <operator value="empty"/>  
                <warningOnly value="true"/> 
            </assert> 
        </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> 
                <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> 
                <description value="Confirm that the returned HTTP Header Content-Type contains the FHIR mime-type 'application/fhir+xml'."/>  
                <direction value="response"/>  
                <contentType value="xml"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Bundle."/>  
                <direction value="response"/>  
                <resource value="Bundle"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Bundle type is searchset."/>  
                <direction value="response"/>  
                <operator value="equals"/>  
                <path value="Bundle/type"/>  
                <value value="searchset"/>  
                <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 Bundle conforms to the base FHIR specification."/>  
                <direction value="response"/>  
                <validateProfileId value="bundle-profile"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned searchset Bundle contains at least 1 entry."/>  
                <direction value="response"/>  
                <expression value="Bundle.entry.count()"/>  
                <operator value="greaterThan"/>  
                <value value="0"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </test> 
</TestScript>