Test Script

Name/FHIRSandbox/DaVinci/FHIR4-0-1-PlanNetProvDir/Plan-Net-1-0-0/02-Adv-Query/dv-pdex-r4-PlanNet-02-Adv-Query-01-General-Search-xml
DescriptionDa Vinci - PDex - FHIR R4 - Scenario 03 PlanNet - Query - Search for all Healthcare Services and validate that they conform to the PlanNet HealthcareService profile.
Version1Latest1
Content
<?xml version="1.0" encoding="UTF-8"?>

<TestScript xmlns="http://hl7.org/fhir">  
    <id value="dv-pdex-r4-PlanNet-02-Adv-Query-01-General-Search-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>dv-pdex-r4-PlanNet-02-Adv-Query-01-General-Search-xml</p> 
        </div> 
    </text>  
    <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule"> 
        <extension url="ruleId"> 
            <valueId value="rule-validate-PDex-PlanNet"/> 
        </extension>  
        <extension url="path"> 
            <valueString value="/FHIRCommon/_reference/rule/AssertValidateXMLExtractProfileId.groovy"/> 
        </extension>  
        <extension url="param"> 
            <extension url="name"> 
                <valueString value="xPath"/> 
            </extension>  
            <extension url="value"> 
                <valueString value="(Bundle/entry/resource/HealthcareService)[1]"/> 
            </extension> 
        </extension>  
        <extension url="param"> 
            <extension url="name"> 
                <valueString value="profileId"/> 
            </extension>  
            <extension url="value"> 
                <valueString value="PDex-PlanNet-HealthcareService-profile"/> 
            </extension> 
        </extension> 
    </extension>  
    <url value="http://wildfhir.aegis.net/fhir4-0-1/TestScript/dv-pdex-r4-PlanNet-02-Adv-Query-01-General-Search-xml"/>  
    <name value="dv-pdex-r4-PlanNet-02-Adv-Query-01-General-Search-xml"/>  
    <title value="dv-pdex-r4-PlanNet-02-Adv-Query-01-General-Search-xml"/>  
    <status value="active"/>  
    <date value="2020-10-14"/>  
    <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 R4 - Scenario 03 PlanNet - Query - Search for all Healthcare Services and validate that they conform to the PlanNet HealthcareService profile."/>  
    <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>  
    <profile id="PDex-PlanNet-HealthcareService-profile"> 
        <reference value="http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/plannet-HealthcareService"/> 
    </profile>  
    <variable> 
        <name value="locationValue"/>  
        <description value="value for location search parameter"/>  
        <hint value="value for location search parameter"/> 
    </variable>  
    <variable> 
        <name value="service-categoryValue"/>  
        <description value="value for service-category search parameter"/>  
        <hint value="value for service-category search parameter"/> 
    </variable>  
    <variable> 
        <name value="PractitionerNetwork"/>  
        <description value="value for network search parameter linked through a PractitionerRole resource"/>  
        <hint value="value for network search parameter linked through a PractitionerRole resource"/> 
    </variable>  
    <variable> 
        <name value="OrganizationNetwork"/>  
        <description value="value for network search parameter linked through a OrganizationAffiliation resource"/>  
        <hint value="value for network search parameter linked through a OrganizationAffiliation resource"/> 
    </variable>  
    <variable> 
        <name value="specialtyValue"/>  
        <description value="value for specialty search parameter"/>  
        <hint value="value for specialty search parameter"/> 
    </variable>  
    <test id="01-General-Search-PractitionerRole"> 
        <name value="General-Search-PractitionerRole"/>  
        <description value="Search for HealthcareServices conforming to the PlanNet-HealthcareService profile."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="search"/> 
                </type>  
                <resource value="HealthcareService"/>  
                <description value="Search for HealthcareServices conforming to the PlanNet-HealthcareService profile."/>  
                <accept value="xml"/>  
                <destination value="1"/>  
                <encodeRequestUrl value="true"/>  
                <origin value="1"/>  
                <params value="?service-category=${service-categoryValue}&amp;specialty=${specialtyValue}&amp;location=${locationValue}&amp;_has:PractitionerRole:service:network=${PractitionerNetwork}"/> 
            </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 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> 
                <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"/>  
                <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 Bundle has more than 0 entries"/>  
                <direction value="response"/>  
                <expression value="Bundle.entry.count()"/>  
                <operator value="greaterThan"/>  
                <value value="0"/>  
                <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="rule-validate-PDex-PlanNet"/> 
                    </extension> 
                </extension>  
                <description value="Validate PDex HealthcareService within the search Bundle."/>  
                <direction value="response"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </test>  
    <test id="02-General-Search-OrganizationAffiliation"> 
        <name value="General-Search-OrganizationAffiliation"/>  
        <description value="Search for HealthcareServices conforming to the PlanNet-HealthcareService profile."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="search"/> 
                </type>  
                <resource value="HealthcareService"/>  
                <description value="Search for HealthcareServices conforming to the PlanNet-HealthcareService profile."/>  
                <accept value="xml"/>  
                <destination value="1"/>  
                <encodeRequestUrl value="true"/>  
                <origin value="1"/>  
                <params value="?service-category=${service-categoryValue}&amp;specialty=${specialtyValue}&amp;location=${locationValue}&amp;_has:OrganizationAffiliation:service:network=${OrganizationNetwork}"/> 
            </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 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> 
                <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"/>  
                <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 Bundle has more than 0 entries"/>  
                <direction value="response"/>  
                <expression value="Bundle.entry.count()"/>  
                <operator value="greaterThan"/>  
                <value value="0"/>  
                <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="rule-validate-PDex-PlanNet"/> 
                    </extension> 
                </extension>  
                <description value="Validate PDex HealthcareService within the search Bundle."/>  
                <direction value="response"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </test> 
</TestScript>