Test Script

Name/FHIRSandbox/DaVinci/FHIR4-0-1-PCT/02-AEOB-Dynamic/01-PCT-Dynamic-GFE-Instit-Request-json
DescriptionPatient Cost Transparency - Tester Entered Dynamic - GFE $submit operation is POSTed with a Bundle containing a single or multiple GFEs of type Institutional (constructed as Claim resources) plus referenced resources. Expected response is an empty Bundle with a uuid for later use in AEOB inquiry. This test can use Touchstone as the client and the tester can provide the input GFE-Institutional Bundle containing the payload in json format. The test allows for testers to input any GFE-Institutional Bundle values they want by simply pasting the bundle into the variable field in the test. The test validates both the request payload and response.
Version7Latest7
Content
<?xml version="1.0" encoding="UTF-8"?>

<TestScript xmlns="http://hl7.org/fhir">  
    <id value="pct-scenario-aeob-submit-gfe-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>Patient Cost Transparency - GFE Institutional Request - JSON</p> 
        </div> 
    </text>  
    <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-dynamic-fixture"> 
        <extension url="id"> 
            <valueId value="resource-create"/> 
        </extension>  
        <extension url="resourceType"> 
            <valueString value="Bundle"/> 
        </extension>  
        <extension url="contentType"> 
            <valueString value="application/fhir+json"/> 
        </extension>  
        <extension url="description"> 
            <valueString value="Bundle resource containing a PCT GFE for Institutional Claim type and any referenced resources. Expected format is json.  This test can use Touchstone as the client and the tester can provide the input GFE-Institutional Bundle containing the payload.  The test allows for testers to input any GFE-Institutional Bundle values they want by simply pasting the bundle into the variable field in the test.  The test validates both the request payload and response."/> 
        </extension>  
        <extension url="hint"> 
            <valueString value="GFE Institutional Bundle"/> 
        </extension> 
    </extension>  
    <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule"> 
        <extension url="ruleId"> 
            <valueId value="rule-validate-Bundle"/> 
        </extension>  
        <extension url="path"> 
            <valueString value="/FHIRCommon/_reference/rule/AssertValidateJSONExtractProfileId-withFhirPath.groovy"/> 
        </extension>  
        <extension url="param"> 
            <extension url="name"> 
                <valueString value="jsonPath"/> 
            </extension>  
            <extension url="value"> 
                <valueString value="$.entry[0].resource"/> 
            </extension> 
        </extension>  
        <extension url="param"> 
            <extension url="name"> 
                <valueString value="fhirPath"/> 
            </extension>  
            <extension url="value"> 
                <valueString value="Bundle.entry[0].resource.as(Bundle)"/> 
            </extension> 
        </extension>  
        <extension url="param"> 
            <extension url="name"> 
                <valueString value="profileId"/> 
            </extension>  
            <extension url="value"> 
                <valueString value="AEOB-bundle-profile"/> 
            </extension> 
        </extension> 
    </extension>  
    <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule"> 
        <extension url="ruleId"> 
            <valueId value="rule-validate-OperationOutcome"/> 
        </extension>  
        <extension url="path"> 
            <valueString value="/FHIRCommon/_reference/rule/AssertValidateJSONExtractProfileId-withFhirPath.groovy"/> 
        </extension>  
        <extension url="param"> 
            <extension url="name"> 
                <valueString value="jsonPath"/> 
            </extension>  
            <extension url="value"> 
                <valueString value="$.entry[0].resource"/> 
            </extension> 
        </extension>  
        <extension url="param"> 
            <extension url="name"> 
                <valueString value="fhirPath"/> 
            </extension>  
            <extension url="value"> 
                <valueString value="Bundle.entry[0].resource.as(OperationOutcome)"/> 
            </extension> 
        </extension>  
        <extension url="param"> 
            <extension url="name"> 
                <valueString value="profileId"/> 
            </extension>  
            <extension url="value"> 
                <valueString value="PCT-OperationOutcome-profile"/> 
            </extension> 
        </extension> 
    </extension>  
    <url value="http://wildfhir.aegis.net/fhir4-0-1/TestScript/pct-scenario-aeob-submit-gfe-json"/>  
    <name value="PCTGFESUBMITJSON"/>  
    <title value="Patient Cost Transparency - Submit GFE Institutional - JSON"/>  
    <status value="active"/>  
    <date value="2023-01-12"/>  
    <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="Patient Cost Transparency - Tester Entered Dynamic - GFE $submit operation is POSTed with a Bundle containing a single or multiple GFEs of type Institutional (constructed as Claim resources) plus referenced resources. Expected response is an empty Bundle with a uuid for later use in AEOB inquiry.  This test can use Touchstone as the client and the tester can provide the input GFE-Institutional Bundle containing the payload in json format.  The test allows for testers to input any GFE-Institutional Bundle values they want by simply pasting the bundle into the variable field in the test.  The test validates both the request payload and response."/>  
    <copyright value="This FHIR Test Script is licensed under Creative Commons (CC0) 'No Rights Reserved'. Learn more at https://creativecommons.org/licenses"/>  
    <origin id="Provider System (Information Request Sender)"> 
        <index value="1"/>  
        <profile> 
            <system value="http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types"/>  
            <code value="FHIR-Client"/> 
        </profile> 
    </origin>  
    <destination id="Payer System (Information Request Recipient)"> 
        <index value="1"/>  
        <profile> 
            <system value="http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types"/>  
            <code value="FHIR-Server"/> 
        </profile> 
    </destination>  
    <profile id="GFE-bundle-profile"> 
        <reference value="http://hl7.org/fhir/us/davinci-pct/StructureDefinition/davinci-pct-gfe-bundle"/> 
    </profile>  
    <profile id="AEOB-bundle-profile"> 
        <reference value="http://hl7.org/fhir/us/davinci-pct/StructureDefinition/davinci-pct-aeob-bundle"/> 
    </profile>  
    <profile id="PCT-Adv-EOB-profile"> 
        <reference value="http://hl7.org/fhir/us/davinci-pct/StructureDefinition/davinci-pct-aeob"/> 
    </profile>  
    <profile id="PCT-OperationOutcome-profile"> 
        <reference value="http://hl7.org/fhir/us/davinci-pct/StructureDefinition/davinci-pct-aeob-complete"/> 
    </profile>  
    <profile id="PCT-GFE-Claim-profile"> 
        <reference value="http://hl7.org/fhir/us/davinci-pct/StructureDefinition/davinci-pct-gfe-institutional"/> 
    </profile>  
    <profile id="PCT-Organization-profile"> 
        <reference value="http://hl7.org/fhir/us/davinci-pct/StructureDefinition/davinci-pct-organization"/> 
    </profile>  
    <profile id="PCT-Practitioner-profile"> 
        <reference value="http://hl7.org/fhir/us/davinci-pct/StructureDefinition/davinci-pct-practitioner"/> 
    </profile>  
    <profile id="PCT-Coverage-profile"> 
        <reference value="http://hl7.org/fhir/us/davinci-pct/StructureDefinition/davinci-pct-coverage"/> 
    </profile>  
    <variable> 
        <name value="AEOB-URL"/>  
        <headerField value="Content-Location"/>  
        <sourceId value="create-response"/> 
    </variable>  
    <variable> 
        <name value="AEOB-Outcome"/>  
        <path value=".outcome.value"/>  
        <sourceId value="search-response"/> 
    </variable>  
    <test id="01-SubmitGFE"> 
        <name value="SubmitGFE"/>  
        <description value="A requesting system POSTs a GFE $submit with a payload of the GFE resource(s) and supporting resources."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://touchstone.com/fhir/testscript-operation-codes-extended"/>  
                    <code value="submit"/> 
                </type>  
                <description value="GFE Claim Resource"/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <destination value="1"/>  
                <encodeRequestUrl value="true"/>  
                <method value="post"/>  
                <origin value="1"/>  
                <params value="/Claim/$gfe-submit"/>  
                <requestHeader> 
                    <field value="Prefer"/>  
                    <value value="respond-async"/> 
                </requestHeader>  
                <requestHeader> 
                    <field value="Accept"/>  
                    <value value="application/fhir+json"/> 
                </requestHeader>  
                <responseId value="create-response"/>  
                <sourceId value="resource-create"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the client requested an Accept of the FHIR JSON mime type 'application/fhir+json'."/>  
                <direction value="request"/>  
                <headerField value="Accept"/>  
                <operator value="contains"/>  
                <value value="application/fhir+json"/>  
                <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 Bundle conforms to the DV PCT GFE Bundle specification."/>  
                <direction value="request"/>  
                <validateProfileId value="GFE-bundle-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="Verify that the Claim.type code is equal to Institutional"/>  
                <direction value="request"/>  
                <operator value="in"/>  
                <path value="$.entry[?(@.resource.resourceType=='Claim')].resource.type.coding[0].code"/>  
                <value value="institutional"/>  
                <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 status is 200 or 202."/>  
                <direction value="response"/>  
                <operator value="in"/>  
                <responseCode value="200,202"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that Content-location header was specified."/>  
                <direction value="response"/>  
                <headerField value="Content-Location"/>  
                <operator value="notEmpty"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </test>  
    <test id="02-QueryAEOB"> 
        <name value="02-QueryAEOB"/>  
        <description value="Using the Content-Location URL from the initial response, search on the polling URL and confirm a response code of 200/202 and no errors encountered."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="search"/> 
                </type>  
                <resource value="Bundle"/>  
                <description value="Read the Content-Location Header to poll for and fetch the completed AEOB Bundle."/>  
                <accept value="json"/>  
                <destination value="1"/>  
                <encodeRequestUrl value="true"/>  
                <origin value="1"/>  
                <responseId value="search-response"/>  
                <url value="${AEOB-URL}"/> 
            </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 or 202."/>  
                <direction value="response"/>  
                <operator value="in"/>  
                <responseCode value="200,202"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </test> 
</TestScript>