US Core Testing Guide
3.1.1-1 - ci-build United States of America flag

US Core Testing Guide - Local Development build (v3.1.1-1). See the Directory of published versions

: Tests for CapabilityStatement using the FHIR CapabilityStatement Resource XML - XML Representation

Active as of 2023-08-25

Raw xml | Download



<TestScript xmlns="http://hl7.org/fhir">
  <id value="USCoreCapabilityStatementxml"/>
  <meta>
    <profile
             value="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript"/>
  </meta>
  <text>
    <status value="extensions"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><p><b>Generated Narrative: TestScript</b><a name="USCoreCapabilityStatementxml"> </a></p><div style="display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%"><p style="margin-bottom: 0px">Resource TestScript &quot;USCoreCapabilityStatementxml&quot; </p><p style="margin-bottom: 0px">Profile: <a href="file://D:\GitHub\Touchstone\testing-ig\output/StructureDefinition-testscript.html">AEGIS Touchstone Testing TestScript Profile</a></p></div><blockquote><p><b>AEGIS Touchstone Testing TestScript Rule Extension</b></p><blockquote><p><b>url</b></p><code>ruleId</code></blockquote><p><b>value</b>: rule-verifyTLS</p><blockquote><p><b>url</b></p><code>path</code></blockquote><p><b>value</b>: ./VerifyTLS.groovy</p></blockquote><p><b>url</b>: <code>http://hl7.org/fhir/us/core-tg/TestScript/USCoreCapabilityStatementxml</code></p><p><b>version</b>: 3.1.1-1</p><p><b>name</b>: USCoreCapabilityStatementxml</p><p><b>title</b>: Tests for CapabilityStatement using the FHIR CapabilityStatement Resource XML</p><p><b>status</b>: active</p><p><b>date</b>: 2023-08-25</p><p><b>publisher</b>: HL7 FHIR Infrastructure WG</p><p><b>contact</b>: HL7 FHIR Infrastructure WG: <a href="https://hl7.org/Special/committees/fiwg">https://hl7.org/Special/committees/fiwg</a>, Richard Ettema: <a href="mailto:mailto:richard.ettema@aegis.net">mailto:richard.ettema@aegis.net</a></p><p><b>description</b>: Tests for CapabilityStatement using the FHIR CapabilityStatement Resource using XML format.</p><p><b>jurisdiction</b>: United States of America <span style="background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki"> (<a href="http://terminology.hl7.org/5.0.0/CodeSystem-ISO3166Part1.html">ISO 3166-1 Codes for the representation of names of countries and their subdivisions — Part 1: Country code</a>#US)</span></p><p><b>copyright</b>: (c) Health Level 7 (HL7) International 2023</p><h3>Origins</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Index</b></td><td><b>Profile</b></td></tr><tr><td style="display: none">*</td><td>1</td><td>FHIR Client (Details: http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types code FHIR-Client = 'FHIR Client', stated as 'null')</td></tr></table><h3>Destinations</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Index</b></td><td><b>Profile</b></td></tr><tr><td style="display: none">*</td><td>1</td><td>FHIR Server (Details: http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types code FHIR-Server = 'FHIR Server', stated as 'null')</td></tr></table><p><b>profile</b>: <a href="http://hl7.org/fhir/StructureDefinition/CapabilityStatement">http://hl7.org/fhir/StructureDefinition/CapabilityStatement</a> &quot;CapabilityStatement&quot;</p><blockquote><p><b>test</b></p><blockquote><p><b>id</b></p>01-FHIRServerConformance</blockquote><p><b>name</b>: 01-FHIRServerConformance</p><p><b>description</b>: FHIR Server Supports the Conformance Interactions</p><blockquote><p><b>action</b></p><blockquote><p><b>operation</b></p><p><b>type</b>: Capabilities (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code capabilities = 'Capabilities', stated as 'null')</p><p><b>description</b>: GET on Metadata</p><p><b>accept</b>: xml</p><p><b>contentType</b>: xml</p><p><b>destination</b>: 1</p><p><b>encodeRequestUrl</b>: true</p><p><b>origin</b>: 1</p><p><b>params</b>: /metadata</p><blockquote><p><b>requestHeader</b></p></blockquote></blockquote></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Extension</b></td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Operator</b></td><td><b>ResponseCode</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td/><td>Confirm that the returned response code is 200 OK or 201 Created.</td><td>response</td><td>in</td><td>200,201</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Extension</b></td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Resource</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td/><td>Confirm that the returned response payload is a CapabilityStatement resource.</td><td>response</td><td>CapabilityStatement</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Extension</b></td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Operator</b></td><td><b>RequestURL</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td/><td>Verify the base Url uses https</td><td>response</td><td>contains</td><td>https</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Extension</b></td><td><b>Description</b></td><td><b>Direction</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td>, </td><td>OAuth 2.0 authorize endpoint secured by transport layer security. Apps MUST assure that sensitive information (authentication secrets, authorization codes, tokens) is transmitted ONLY to authenticated servers, over TLS-secured channels.</td><td>response</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Extension</b></td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>Value</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td/><td>Expect fhirVersion is 4.0.1</td><td>response</td><td>CapabilityStatement.fhirVersion</td><td>4.0.1</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Extension</b></td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>Value</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td/><td>Validate for json support against the Capability profile</td><td>response</td><td>CapabilityStatement.format</td><td>json,application/json,application/fhir+json</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class="grid"><tr><td style="display: none">-</td><td><b>Extension</b></td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style="display: none">*</td><td/><td>Verify that at lease one non-patient US Core profile is supported</td><td>response</td><td>CapabilityStatement.rest.resource.where(supportedProfile.startsWith('http://hl7.org/fhir/us/core/StructureDefinition/') and supportedProfile!='http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient').count()&gt;0</td><td>false</td></tr></table></blockquote></blockquote></div>
  </text>
  <extension
             url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule">
    <extension url="ruleId">
      <valueId value="rule-verifyTLS"/>
    </extension>
    <extension url="path">
      <valueString value="./VerifyTLS.groovy"/>
    </extension>
  </extension>
  <url
       value="http://hl7.org/fhir/us/core-tg/TestScript/USCoreCapabilityStatementxml"/>
  <version value="3.1.1-1"/>
  <name value="USCoreCapabilityStatementxml"/>
  <title
         value="Tests for CapabilityStatement using the FHIR CapabilityStatement Resource XML"/>
  <status value="active"/>
  <date value="2023-08-25"/>
  <publisher value="HL7 FHIR Infrastructure WG"/>
  <contact>
    <name value="HL7 FHIR Infrastructure WG"/>
    <telecom>
      <system value="url"/>
      <value value="https://hl7.org/Special/committees/fiwg"/>
    </telecom>
  </contact>
  <contact>
    <name value="Richard Ettema"/>
    <telecom>
      <system value="email"/>
      <value value="mailto:richard.ettema@aegis.net"/>
    </telecom>
  </contact>
  <description
               value="Tests for CapabilityStatement using the FHIR CapabilityStatement Resource using XML format."/>
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166"/>
      <code value="US"/>
    </coding>
  </jurisdiction>
  <copyright value="(c) Health Level 7 (HL7) International 2023"/>
  <origin>
    <index value="1"/>
    <profile>
      <system
              value="http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types"/>
      <code value="FHIR-Client"/>
    </profile>
  </origin>
  <destination>
    <index value="1"/>
    <profile>
      <system
              value="http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types"/>
      <code value="FHIR-Server"/>
    </profile>
  </destination>
  <profile id="CapabilityProfile">
    <reference
               value="http://hl7.org/fhir/StructureDefinition/CapabilityStatement"/>
  </profile>
  <test id="01-FHIRServerConformance">
    <name value="01-FHIRServerConformance"/>
    <description value="FHIR Server Supports the Conformance Interactions"/>
    <action>
      <operation>
        <type>
          <system
                  value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
          <code value="capabilities"/>
        </type>
        <description value="GET on Metadata"/>
        <accept value="xml"/>
        <contentType value="xml"/>
        <destination value="1"/>
        <encodeRequestUrl value="true"/>
        <origin value="1"/>
        <params value="/metadata"/>
        <requestHeader>
          <field value="Authorization"/>
          <value value="none"/>
        </requestHeader>
      </operation>
    </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 response code is 200 OK or 201 Created."/>
        <direction value="response"/>
        <operator value="in"/>
        <responseCode value="200,201"/>
        <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 response payload is a CapabilityStatement resource."/>
        <direction value="response"/>
        <resource value="CapabilityStatement"/>
        <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 the base Url uses https"/>
        <direction value="response"/>
        <operator value="contains"/>
        <requestURL value="https"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <extension
                   url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail">
          <valueBoolean value="false"/>
        </extension>
        <extension
                   url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-rule">
          <extension url="ruleId">
            <valueId value="rule-verifyTLS"/>
          </extension>
          <extension url="param">
            <extension url="name">
              <valueString value="endpointName"/>
            </extension>
            <extension url="value">
              <valueString value="Metadata Endpoint"/>
            </extension>
          </extension>
          <extension url="param">
            <extension url="name">
              <valueString value="endpointURL"/>
            </extension>
            <extension url="value">
              <valueString value="${dest1SystemConfig.baseUrl}/metadata"/>
            </extension>
          </extension>
        </extension>
        <description
                     value="OAuth 2.0 authorize endpoint secured by transport layer security. Apps MUST assure that sensitive information (authentication secrets, authorization codes, tokens) is transmitted ONLY to authenticated servers, over TLS-secured channels."/>
        <direction value="response"/>
        <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="Expect fhirVersion is 4.0.1"/>
        <direction value="response"/>
        <expression value="CapabilityStatement.fhirVersion"/>
        <value value="4.0.1"/>
        <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="Validate for json support against the Capability profile"/>
        <direction value="response"/>
        <expression value="CapabilityStatement.format"/>
        <value value="json,application/json,application/fhir+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 that at lease one non-patient US Core profile is supported"/>
        <direction value="response"/>
        <expression
                    value="CapabilityStatement.rest.resource.where(supportedProfile.startsWith('http://hl7.org/fhir/us/core/StructureDefinition/') and supportedProfile!='http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient').count()&gt;0"/>
        <warningOnly value="false"/>
      </assert>
    </action>
  </test>
</TestScript>