Test Script

Name/FHIR4-0-1-Advanced/USCore-ClinData/01-USCore-Tests/us-core-location-sequence
DescriptionTests for USCDI Location using the US Core resource. Reference http://www.hl7.org/fhir/us/core/general-guidance.html#must-support and http://hl7.org/fhir/us/core/structuredefinition-us-core-location.html
Version4Latest4
Content
<?xml version="1.0" encoding="UTF-8"?>

<TestScript xmlns="http://hl7.org/fhir">  
    <id value="Location-Tests"/>  
    <meta> 
        <profile value="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript"/> 
    </meta>  
    <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule"> 
        <extension url="ruleId"> 
            <valueId value="resolveReferences"/> 
        </extension>  
        <extension url="path"> 
            <valueString value="/FHIRCommon/_reference/rule/resolveReferences.groovy"/> 
        </extension>  
        <extension url="param"> 
            <extension url="name"> 
                <valueString value="baseUrl"/> 
            </extension>  
            <extension url="value"> 
                <valueString value="${dest1SystemConfig.baseUrl}"/> 
            </extension> 
        </extension> 
    </extension>  
    <url value="http://wildfhir.aegis.net/fhir4-0-0/TestScript/Location_Tests"/>  
    <name value="Location_Tests"/>  
    <title value="Location Tests"/>  
    <status value="active"/>  
    <date value="2020-05-15"/>  
    <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="Tests for USCDI Location using the US Core resource. Reference http://www.hl7.org/fhir/us/core/general-guidance.html#must-support and http://hl7.org/fhir/us/core/structuredefinition-us-core-location.html"/>  
    <copyright value="This FHIR Test Script is licensed under Creative Commons (CC0) 'No Rights Reserved'. Learn more at https://creativecommons.org/licenses"/>  
    <destination> 
        <index value="1"/>  
        <profile> 
            <system value="http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types"/>  
            <code value="FHIR-Server"/> 
        </profile> 
    </destination>  
    <profile id="LocationProfile"> 
        <reference value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-location"/> 
    </profile>  
    <variable> 
        <name value="locationId"/>  
        <description value="Location Id"/> 
    </variable>  
    <test id="01-read_interaction"> 
        <name value="read_interaction"/>  
        <description value="Read Location"/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="read"/> 
                </type>  
                <resource value="Location"/>  
                <description value="Read Location"/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <destination value="1"/>  
                <encodeRequestUrl value="true"/>  
                <params value="/${locationId}"/>  
                <responseId value="testOneRead"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Verify a response is returned"/>  
                <direction value="response"/>  
                <operator value="in"/>  
                <responseCode value="200,201"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Verify the response is a Location resource"/>  
                <direction value="response"/>  
                <resource value="Location"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Verify the resource id exists"/>  
                <direction value="response"/>  
                <expression value="Location.id.exists()"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Validate response against the Location profile"/>  
                <direction value="response"/>  
                <validateProfileId value="LocationProfile"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action> 
    </test> 
</TestScript>