Test Script

Name/FHIR4-0-1-Connectathon24/Terminology-Formal/JSON Format/Lookup/terminology-c24-lookup-sct-02-ok-post-code-simple-json
DescriptionCodeSystem $lookup simple tests against known SNOMED codes where the expected outcome is a successful response with valid name and display value. All $lookup operations are performed using the FHIR Operation Framework HTTP POST method with Parameters of system and code.
Version1Latest1
Content
<?xml version="1.0" encoding="UTF-8"?>

<TestScript xmlns="http://hl7.org/fhir">  
    <id value="terminology-c24-lookup-sct-02-ok-post-code-simple-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>FHIR Connectathon 24 - Terminology Services - Lookup - SNOMED - OK - POST - Code - Simple - JSON</p>
        </div> 
    </text>  
    <url value="http://wildfhir.aegis.net/fhir4-0-0/TestScript/terminology-c24-lookup-sct-02-ok-post-code-simple-json"/>  
    <name value="FHIRC24TerminologyLookupSNOMEDPOSTCodeJSON"/>  
    <title value="FHIR Connectathon 24 - Terminology Services - Lookup - SNOMED - OK - POST - Code - Simple - JSON"/>  
    <status value="active"/>  
    <date value="2020-04-24"/>  
    <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="CodeSystem $lookup simple tests against known SNOMED codes where the expected outcome is a successful response with valid name and display value. All $lookup operations are performed using the FHIR Operation Framework HTTP POST method with Parameters of system and code."/>  
    <copyright value="(c) AEGIS.net, Inc. 2019"/>  
    <fixture id="lookup-snomed-input-01"> 
        <autocreate value="false"/>  
        <autodelete value="false"/>  
        <resource> 
            <reference value="../_reference/input/lookup-snomed-input-code-01.json"/> 
        </resource> 
    </fixture>  
    <fixture id="lookup-snomed-input-02"> 
        <autocreate value="false"/>  
        <autodelete value="false"/>  
        <resource> 
            <reference value="../_reference/input/lookup-snomed-input-code-02.json"/> 
        </resource> 
    </fixture>  
    <profile id="ParametersProfile"> 
        <reference value="http://hl7.org/fhir/StructureDefinition/Parameters"/> 
    </profile>  
    <test id="01-SNOMED-LookupTopicalRoute"> 
        <name value="SNOMED-LookupTopicalRoute"/>  
        <description value="Lookup test for SNOMED system and code using HTTP POST with system and code parameters; 6064005 (Topical route). Expected response is 200 (OK) with a Parameters payload containing the name of the terminology and correct display value."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="lookup"/> 
                </type>  
                <resource value="CodeSystem"/>  
                <description value="CodeSystem $lookup operation for SNOMED system and code for Topical route."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <encodeRequestUrl value="true"/>  
                <params value="/$lookup"/>  
                <sourceId value="lookup-snomed-input-01"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <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 JSON. Warning only to allow for review."/>  
                <direction value="response"/>  
                <contentType value="json"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Parameters."/>  
                <direction value="response"/>  
                <resource value="Parameters"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Parameters resource type conforms the base FHIR specification."/>  
                <direction value="response"/>  
                <validateProfileId value="ParametersProfile"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Parameters resource contains the expected parameter name with valueString containing SNOMED."/>  
                <direction value="response"/>  
                <operator value="contains"/>  
                <path value=".parameter[?(@.name=='name')].valueString"/>  
                <value value="SNOMED"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Parameters resource contains the expected parameter display set to any of the Preferred or Acceptable SNOMED display strings."/>  
                <direction value="response"/>  
                <expression value="Parameters.parameter.where(name = 'display').value.where($this = 'Topical route (qualifier value)' or $this = 'Topical route' or $this = 'Topical use')"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </test>  
    <test id="02-SNOMED-LookupDrugInteraction"> 
        <name value="SNOMED-LookupDrugInteraction"/>  
        <description value="Lookup test for SNOMED system and code using HTTP POST with system and code parameters; 79899007 (Drug interaction). Expected response is 200 (OK) with a Parameters payload containing the name of the terminology and correct display value."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="lookup"/> 
                </type>  
                <resource value="CodeSystem"/>  
                <description value="CodeSystem $lookup operation for SNOMED system and code for Drug interaction."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <encodeRequestUrl value="true"/>  
                <params value="/$lookup"/>  
                <sourceId value="lookup-snomed-input-02"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <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 JSON. Warning only to allow for review."/>  
                <direction value="response"/>  
                <contentType value="json"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned resource type is Parameters."/>  
                <direction value="response"/>  
                <resource value="Parameters"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Parameters resource type conforms the base FHIR specification."/>  
                <direction value="response"/>  
                <validateProfileId value="ParametersProfile"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Parameters resource contains the expected parameter name with valueString of SNOMED."/>  
                <direction value="response"/>  
                <operator value="contains"/>  
                <path value=".parameter[?(@.name=='name')].valueString"/>  
                <value value="SNOMED"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned Parameters resource contains the expected parameter display set to any of the Preferred or Acceptable SNOMED display strings."/>  
                <direction value="response"/>  
                <expression value="Parameters.parameter.where(name = 'display').value.where($this = 'Drug interaction (finding)' or $this = 'Medication interaction' or $this = 'Drug interaction')"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </test> 
</TestScript>