Test Script

Name/CDSHSandbox/DaVinci/CDSH1-R4-Patient-View/01-Patient-View/dv-pv-r4-patient-view-01-with-encounterId
DescriptionDa Vinci - Patient-View - CDS Hooks 1.0 - FHIR R4 - with encounterId - Execute the patient-view hook service (default format JSON) with a known valid Encounter Id; validate the CDS Hooks server returns a 200(OK) response with a valid card payload.
Version2Latest2
Content
<?xml version="1.0" encoding="UTF-8"?>

<TestScript xmlns="http://hl7.org/fhir">  
    <id value="dv-pv-r4-patient-view-01-with-encounterId"/>  
    <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 - CDS Hooks 1.0 - Patient View 01 - FHIR R4 - with encounterId</p>
        </div> 
    </text>  
    <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/dv-pv-r4-patient-view-01-with-encounterId"/>  
    <name value="DaVinciPatient-ViewR4WithencounterId"/>  
    <title value="Da Vinci - Patient-view - CDS Hooks 1.0 - FHIR R4 - with encounterId"/>  
    <status value="active"/>  
    <date value="2020-01-23"/>  
    <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 - Patient-View - CDS Hooks 1.0 - FHIR R4 - with encounterId - Execute the patient-view hook service (default format JSON) with a known valid Encounter Id; validate the CDS Hooks server returns a 200(OK) response with a valid card payload."/>  
    <copyright value="(c) AEGIS.net, Inc. 2020"/>  
    <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="patient-view-request"> 
        <autocreate value="false"/>  
        <autodelete value="false"/>  
        <resource> 
            <reference value="./_reference/resources/patient-view-01-request-with-encounter-id.json"/> 
        </resource> 
    </fixture>  
    <variable> 
        <name value="userId"/>  
        <description value="Enter a known valid userId"/>  
        <hint value="[userId]"/> 
    </variable>  
    <variable> 
        <name value="patientId"/>  
        <description value="Enter a known valid patientId"/>  
        <hint value="[patientId]"/> 
    </variable>  
    <variable> 
        <name value="encounterId"/>  
        <description value="Enter a known valid encounterId"/>  
        <hint value="[encounterId]"/> 
    </variable>  
    <test id="01-Patient-View-eId"> 
        <name value="01-Patient-View-eId"/>  
        <description value="Execute and verify patient-view hook request and response with a known valid userId, PatientId, and encounterId"/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://touchstone.com/cds-hooks/testscript-operation-codes"/>  
                    <code value="patient-view"/> 
                </type>  
                <description value="Execute the cds-services patient-view hook service."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <destination value="1"/>  
                <encodeRequestUrl value="true"/>  
                <origin value="1"/>  
                <sourceId value="patient-view-request"/> 
            </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> 
                <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"/>  
                <responseCode value="200"/>  
                <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>