Test Script

Name/CDSHSandbox/DaVinci/CRD-BurdenReduction/04-Order-Sign/dv-crd-r4-order-sign
DescriptionDa Vinci - CRD - CDS Hooks 1.0 - FHIR R4 v4.0.1 - Order Sign for Device Request. Expect HCPCS E0424 Device Request and a card response.
Version1Latest1
Content
<?xml version="1.0" encoding="UTF-8"?>

<TestScript xmlns="http://hl7.org/fhir">  
    <id value="dv-crd-r4-order-sign"/>  
    <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 - CRD - CDS Hooks 1.0 - FHIR R4 v4.0.1 - Order Sign - Expected Device Request</p> 
        </div> 
    </text>  
    <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule"> 
        <extension url="ruleId"> 
            <valueId value="rule-validate-context-medications-bundle"/> 
        </extension>  
        <extension url="path"> 
            <valueString value="/CDSHCommon/_reference/rule/AssertValidateFHIRContent.groovy"/> 
        </extension>  
        <extension url="param"> 
            <extension url="name"> 
                <valueString value="jsonPath"/> 
            </extension>  
            <extension url="value"> 
                <valueString value="context.medications"/> 
            </extension> 
        </extension>  
        <extension url="param"> 
            <extension url="name"> 
                <valueString value="profileId"/> 
            </extension>  
            <extension url="value"> 
                <valueString value="bundle-profile"/> 
            </extension> 
        </extension> 
    </extension>  
    <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule"> 
        <extension url="ruleId"> 
            <valueId value="rule-verify-card-required"/> 
        </extension>  
        <extension url="path"> 
            <valueString value="/CDSHCommon/_reference/rule/AssertCardsAllRequired.groovy"/> 
        </extension> 
    </extension>  
    <url value="http://wildfhir.aegis.net/fhir4-0-0/TestScript/order-sign-working-example"/>  
    <name value="Order Sign Working Example"/>  
    <title value="Da Vinci - CRD - CDS Hooks 1.0 - FHIR R4 v4.0.1 - Order Sign"/>  
    <status value="active"/>  
    <date value="2020-05-19"/>  
    <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 - CRD - CDS Hooks 1.0 - FHIR R4 v4.0.1 - Order Sign for Device Request.  Expect HCPCS E0424 Device Request and a card response."/>  
    <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://touchstone.com/fhir/testscript-profile-origin-types-extended"/>  
            <code value="CDSH-Client"/> 
        </profile> 
    </origin>  
    <destination> 
        <index value="1"/>  
        <profile> 
            <system value="http://touchstone.com/fhir/testscript-profile-destination-types-extended"/>  
            <code value="CDSH-Server"/> 
        </profile> 
    </destination>  
    <fixture id="order-sign-working-example"> 
        <autocreate value="false"/>  
        <autodelete value="false"/>  
        <resource> 
            <reference value="./_reference/resources/order-sign-working-example.json"/> 
        </resource> 
    </fixture>  
    <profile id="bundle-profile"> 
        <reference value="http://hl7.org/fhir/StructureDefinition/Bundle"/> 
    </profile>  
    <test id="Order-Sign-HCPCS-E0424"> 
        <name value="Order-Sign-HCPCS-E0424"/>  
        <description value="Execute Order Sign hook request with HCPCS E0424 Device Request."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://touchstone.com/cds-hooks/testscript-operation-codes"/>  
                    <code value="order-sign"/> 
                </type>  
                <description value="Execute Order Sign hook request with HCPCS E0424 Device Request."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <destination value="1"/>  
                <encodeRequestUrl value="true"/>  
                <origin value="1"/>  
                <sourceId value="order-sign-working-example"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the sent Accept format is of type json."/>  
                <direction value="request"/>  
                <headerField value="Accept"/>  
                <operator value="contains"/>  
                <value value="json"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the sent Content-Type format is of type json."/>  
                <direction value="request"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="json"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that HCPCS code is 'E0424' in context DeviceRequest."/>  
                <direction value="request"/>  
                <path value="context.draftOrders.entry.resource[?(@.resourceType == 'DeviceRequest')].codeCodeableConcept.coding[?(@.system == 'https://bluebutton.cms.gov/resources/codesystem/hcpcs')].code"/>  
                <value value="E0424"/>  
                <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(OK)."/>  
                <direction value="response"/>  
                <response value="okay"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned format is of type json."/>  
                <direction value="response"/>  
                <headerField value="Content-Type"/>  
                <operator value="contains"/>  
                <value value="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="Verify at least one card was returned."/>  
                <direction value="response"/>  
                <operator value="greaterThan"/>  
                <path value="cards.length()"/>  
                <value value="0"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-rule"> 
                    <extension url="ruleId"> 
                        <valueId value="rule-verify-card-required"/> 
                    </extension> 
                </extension>  
                <description value="Verify all services contain the required and conditionally recommended fields."/>  
                <direction value="response"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </test> 
</TestScript>