Test Script

Name/FHIRSandbox/DaVinci/FHIR4-0-1-PAS/PAS-1-0-0/01-ClaimScenario/04-GetClaimRespAll/dv-pas-r4-04-getclaimresponseall-json
DescriptionDa Vinci PAS - FHIR R4 - 04 Get ClaimResponse All - JSON - test to query the Server to see if the status of the prior authorization has changed. This is done by performing a query on the server’s “ClaimResponse” endpoint, searching based on a known patient.identifier and uses the JSON syntax.
Version1Latest1
Content
<?xml version="1.0" encoding="UTF-8"?>

<TestScript xmlns="http://hl7.org/fhir">  
    <id value="dv-pas-r4-04-getclaimresponseall-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 - 04 Get ClaimResponse All - JSON</p>
        </div> 
    </text>  
    <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule"> 
        <extension url="ruleId"> 
            <valueId value="rule-validate-pas-claimresponse-bundle-claimresponse"/> 
        </extension>  
        <extension url="path"> 
            <valueString value="/FHIRCommon/_reference/rule/AssertValidateJSONExtractProfileId.groovy"/> 
        </extension>  
        <extension url="param"> 
            <extension url="name"> 
                <valueString value="jsonPath"/> 
            </extension>  
            <extension url="value"> 
                <valueString value="$.entry[0].resource.entry[?(@.resource.resourceType == 'ClaimResponse')].resource"/> 
            </extension> 
        </extension>  
        <extension url="param"> 
            <extension url="name"> 
                <valueString value="profileId"/> 
            </extension>  
            <extension url="value"> 
                <valueString value="PASClaimResponseProfile"/> 
            </extension> 
        </extension> 
    </extension>  
    <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule"> 
        <extension url="ruleId"> 
            <valueId value="rule-validate-pas-claimresponse-bundle"/> 
        </extension>  
        <extension url="path"> 
            <valueString value="/FHIRCommon/_reference/rule/AssertValidateJSONExtractProfileId.groovy"/> 
        </extension>  
        <extension url="param"> 
            <extension url="name"> 
                <valueString value="jsonPath"/> 
            </extension>  
            <extension url="value"> 
                <valueString value="$.entry[?(@.resource.resourceType=='Bundle')].resource"/> 
            </extension> 
        </extension>  
        <extension url="param"> 
            <extension url="name"> 
                <valueString value="profileId"/> 
            </extension>  
            <extension url="value"> 
                <valueString value="PASResponseBundleProfile"/> 
            </extension> 
        </extension> 
    </extension>  
    <url value="http://wildfhir.aegis.net/fhir4-0-0/TestScript/dv-pas-r4-04-getclaimresponseall-json"/>  
    <name value="DaVinciPASR404GetClaimResponseAllJSON"/>  
    <title value="Da Vinci - PAS - FHIR R4 - 04 Get ClaimResponse All - JSON"/>  
    <status value="active"/>  
    <date value="2020-01-31"/>  
    <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 - 04 Get ClaimResponse All - JSON - test to query the Server to see if the status of the prior authorization has changed. This is done by performing a query on the server’s “ClaimResponse” endpoint, searching based on a known patient.identifier and uses the JSON 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="PASRequestBundleProfile"> 
        <reference value="http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-pas-request-bundle"/> 
    </profile>  
    <profile id="PASResponseBundleProfile"> 
        <reference value="http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-pas-response-bundle"/> 
    </profile>  
    <profile id="PASClaimResponseProfile"> 
        <reference value="http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-claimresponse"/> 
    </profile>  
    <variable> 
        <name value="PatientIdentifier"/>  
        <description value="Enter a known Patient identifier on the destination system."/>  
        <hint value="[Patient Identifier]"/> 
    </variable>  
    <test id="01-GetClaimResponseById"> 
        <name value="GetClaimResponseById"/>  
        <description value="Search for a known ClaimResponse in JSON format with a patient.identifier equal to ${PatientIdentifier}. The expected response code is 200 (OK) with a Bundle resource in JSON format of type searchset, which contains PAS compliant Bundles containing all found instances of the ClaimResponse."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="search"/> 
                </type>  
                <resource value="ClaimResponse"/>  
                <description value="Search for all known ClaimResponse by patient.identifier."/>  
                <accept value="json"/>  
                <destination value="1"/>  
                <encodeRequestUrl value="true"/>  
                <origin value="1"/>  
                <params value="?patient.identifier=${PatientIdentifier}"/> 
            </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> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail"> 
                    <valueBoolean value="false"/> 
                </extension>  
                <description value="Confirm that the response payload contains the Bundle resource type."/>  
                <direction value="response"/>  
                <resource value="Bundle"/>  
                <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 type is searchset."/>  
                <direction value="response"/>  
                <operator value="equals"/>  
                <path value=".type"/>  
                <value value="searchset"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Bundle.entry contains at least one Bundle resource."/>  
                <direction value="response"/>  
                <expression value="Bundle.entry.select(resource as Bundle).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-pas-claimresponse-bundle"/> 
                    </extension> 
                </extension>  
                <description value="Confirm that the returned Bundle conforms to the Da Vinci PAS IG."/>  
                <direction value="response"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the contained Bundle.entry contains at least one ClaimResponse resource."/>  
                <direction value="response"/>  
                <expression value="Bundle.entry.select(resource as Bundle).entry.select(resource as ClaimResponse).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-pas-claimresponse-bundle-claimresponse"/> 
                    </extension> 
                </extension>  
                <description value="Validate PAS ClaimResponse within the response PAS Bundle."/>  
                <direction value="response"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </test> 
</TestScript>