Test Script

Name/FHIR4-0-1-Connectathon24/Terminology-Formal/JSON Format/Validate-CodeSystem/terminology-c24-validate-cs-loinc-06-notok-post-coding-json
DescriptionCodeSystem $validate-code tests against known LOINC codes where the expected outcome is a failure response and either a valid Parameters payload with a result value false and a message value, or an OperationOutcome. All $validate-code operations are performed using the FHIR Operation Framework HTTP POST method with Parameters of url and coding.
Version1Latest1
Content
<?xml version="1.0" encoding="UTF-8"?>

<TestScript xmlns="http://hl7.org/fhir">  
    <id value="terminology-c24-validate-cs-loinc-06-notok-post-coding-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 - CodeSystem Validate Code - LOINC - NOT OK - POST - Coding - JSON</p>
        </div> 
    </text>  
    <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-ruleset"> 
        <extension url="rulesetId"> 
            <valueId value="ruleset-validatenotok-responsecode-body"/> 
        </extension>  
        <extension url="path"> 
            <valueString value="../_reference/ruleset/RuleSet-ValidateNotOkResponseCodeBody-Groovy.xml"/> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertResourceTypesIfBody"/> 
            </extension>  
            <extension url="param"> 
                <extension url="name"> 
                    <valueString value="resource"/> 
                </extension>  
                <extension url="value"> 
                    <valueString value="OperationOutcome,Parameters"/> 
                </extension> 
            </extension> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertOperationOutcomeIfError"/> 
            </extension> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertProfileIfOperationOutcome"/> 
            </extension>  
            <extension url="param"> 
                <extension url="name"> 
                    <valueString value="validateProfileId"/> 
                </extension>  
                <extension url="value"> 
                    <valueString value="OperationOutcomeProfile"/> 
                </extension> 
            </extension> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertPathIfOperationOutcome"/> 
            </extension> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertParametersIfSuccess"/> 
            </extension> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertProfileIfParameters"/> 
            </extension>  
            <extension url="param"> 
                <extension url="name"> 
                    <valueString value="validateProfileId"/> 
                </extension>  
                <extension url="value"> 
                    <valueString value="ParametersProfile"/> 
                </extension> 
            </extension> 
        </extension>  
        <extension url="rule"> 
            <extension url="ruleId"> 
                <valueId value="assertPathIfParameters"/> 
            </extension> 
        </extension> 
    </extension>  
    <url value="http://wildfhir.aegis.net/fhir4-0-0/TestScript/terminology-c24-validate-cs-loinc-06-notok-post-coding-json"/>  
    <name value="FHIRC24TerminologyCSValidateLOINCNotOKPOSTCodingJSON"/>  
    <title value="FHIR Connectathon 24 - Terminology Services - CodeSystem Validate Code - LOINC - NOT OK - POST - Coding - 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 $validate-code tests against known LOINC codes where the expected outcome is a failure response and either a valid Parameters payload with a result value false and a message value, or an OperationOutcome. All $validate-code operations are performed using the FHIR Operation Framework HTTP POST method with Parameters of url and coding."/>  
    <copyright value="(c) AEGIS.net, Inc. 2019"/>  
    <fixture id="validate-code-loinc-input-notok-01"> 
        <autocreate value="false"/>  
        <autodelete value="false"/>  
        <resource> 
            <reference value="../_reference/input/validate-code-loinc-input-notok-coding-01.json"/> 
        </resource> 
    </fixture>  
    <fixture id="validate-code-loinc-input-notok-02"> 
        <autocreate value="false"/>  
        <autodelete value="false"/>  
        <resource> 
            <reference value="../_reference/input/validate-code-loinc-input-notok-coding-02.json"/> 
        </resource> 
    </fixture>  
    <fixture id="validate-code-loinc-input-notok-03"> 
        <autocreate value="false"/>  
        <autodelete value="false"/>  
        <resource> 
            <reference value="../_reference/input/validate-code-loinc-input-notok-coding-03.json"/> 
        </resource> 
    </fixture>  
    <profile id="ParametersProfile"> 
        <reference value="http://hl7.org/fhir/StructureDefinition/Parameters"/> 
    </profile>  
    <profile id="OperationOutcomeProfile"> 
        <reference value="http://hl7.org/fhir/StructureDefinition/OperationOutcome"/> 
    </profile>  
    <test id="01-LOINC-ValidateSystolic-InvalidDisplay"> 
        <name value="LOINC-ValidateSystolic-InvalidDisplay"/>  
        <description value="Validate code test for LOINC code system using HTTP POST with url and coding parameters; where code='11378-7' and invalid display='Systolic blood pressure at First encounterX'. Expected response is 200 (OK) with a Parameters payload containing the result value false and a message value; optional response is 4xx/5xx with an OperationOutcome payload containing at least one error issue."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="validate-code"/> 
                </type>  
                <resource value="CodeSystem"/>  
                <description value="Test $validate-code operation on the LOINC code system for a valid code and invalid display."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <encodeRequestUrl value="true"/>  
                <params value="/$validate-code"/>  
                <sourceId value="validate-code-loinc-input-notok-01"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned format is JSON. Warning only to allow for review."/>  
                <contentType value="json"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-ruleset"> 
                    <extension url="rulesetId"> 
                        <valueId value="ruleset-validatenotok-responsecode-body"/> 
                    </extension> 
                </extension>  
                <description value="Complex ruleset assertion to conditionally validate expected validate-code not ok response code and body."/>  
                <direction value="response"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </test>  
    <test id="02-LOINC-ValidateSystolic-InvalidCode"> 
        <name value="LOINC-ValidateSystolic-InvalidCode"/>  
        <description value="Validate code test for LOINC code system using HTTP POST with url and coding parameters; where invalid code='11378-7X'. Expected response is 200 (OK) with a Parameters payload containing the result value false and a message value; optional response is 4xx/5xx with an OperationOutcome payload containing at least one error issue."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="validate-code"/> 
                </type>  
                <resource value="CodeSystem"/>  
                <description value="Test $validate-code operation on the LOINC code system for an valid code."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <encodeRequestUrl value="true"/>  
                <params value="/$validate-code"/>  
                <sourceId value="validate-code-loinc-input-notok-02"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned format is JSON. Warning only to allow for review."/>  
                <contentType value="json"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-ruleset"> 
                    <extension url="rulesetId"> 
                        <valueId value="ruleset-validatenotok-responsecode-body"/> 
                    </extension> 
                </extension>  
                <description value="Complex ruleset assertion to conditionally validate expected validate-code not ok response code and body."/>  
                <direction value="response"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </test>  
    <test id="03-LOINC-ValidateSystolic-InvalidSystem"> 
        <name value="LOINC-ValidateSystolic-InvalidSystem"/>  
        <description value="Validate code test for LOINC code system using HTTP POST with url and coding parameters; where invalid system='http://loinc.orgX' and code='11378-7'. Expected response is 200 (OK) with a Parameters payload containing the result value false and a message value; optional response is 4xx/5xx with an OperationOutcome payload containing at least one error issue."/>  
        <action> 
            <operation> 
                <type> 
                    <system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>  
                    <code value="validate-code"/> 
                </type>  
                <resource value="CodeSystem"/>  
                <description value="Test $validate-code operation on the LOINC code system for an valid code."/>  
                <accept value="json"/>  
                <contentType value="json"/>  
                <encodeRequestUrl value="true"/>  
                <params value="/$validate-code"/>  
                <sourceId value="validate-code-loinc-input-notok-03"/> 
            </operation> 
        </action>  
        <action> 
            <assert> 
                <description value="Confirm that the returned format is JSON. Warning only to allow for review."/>  
                <contentType value="json"/>  
                <warningOnly value="true"/> 
            </assert> 
        </action>  
        <action> 
            <assert> 
                <extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-ruleset"> 
                    <extension url="rulesetId"> 
                        <valueId value="ruleset-validatenotok-responsecode-body"/> 
                    </extension> 
                </extension>  
                <description value="Complex ruleset assertion to conditionally validate expected validate-code not ok response code and body."/>  
                <direction value="response"/>  
                <warningOnly value="false"/> 
            </assert> 
        </action> 
    </test> 
</TestScript>