CH ELM (R4)
1.16.0 - ci-build Switzerland flag

CH ELM (R4), published by Federal Office of Public Health FOPH. This guide is not an authorized publication; it is the continuous build for version 1.16.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/ahdis/ch-elm/ and changes regularly. See the Directory of published versions

: Test98 - Verify that error for invalid hiv code is raised

Active as of 2026-10-22

Raw xml | Download


<TestScript xmlns="http://hl7.org/fhir">
  <id value="Test98-HivInvalidCode"/>
  <language value="en"/>
  <url value="http://fhir.ch/ig/ch-elm/TestScript/Test98-HivInvalidCode"/>
  <version value="1.16.0"/>
  <name value="Test98HivInvalidCode"/>
  <status value="active"/>
  <date value="2026-10-22T06:32:21+00:00"/>
  <publisher value="Federal Office of Public Health FOPH"/>
  <contact>
    <name value="Federal Office of Public Health FOPH"/>
    <telecom>
      <system value="url"/>
      <value
             value="https://www.bag.admin.ch/bag/en/home/das-bag/kontakt-standort.html"/>
    </telecom>
  </contact>
  <description
               value="Test98: Verify that error for invalid hiv code is raised"/>
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166"/>
      <code value="CH"/>
    </coding>
  </jurisdiction>
  <copyright value="CC0-1.0"/>
  <fixture id="inputdata">
    <autocreate value="false"/>
    <autodelete value="false"/>
    <resource>🔗 
      <reference value="Binary/Test98-Bundle-HivInvalidCode"/>
    </resource>
  </fixture>
  <test>
    <name value="Test98"/>
    <description
                 value="Test98: Verify that error for invalid hiv code is raised"/>
    <action>
      <operation>
        <type>
          <system
                  value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
          <code value="validate"/>
        </type>
        <description value="validate"/>
        <contentType value="application/fhir+json"/>
        <encodeRequestUrl value="true"/>
        <params
                value="profile=http://fhir.ch/ig/ch-elm/StructureDefinition/ch-elm-document-strict"/>
        <sourceId value="inputdata"/>
      </operation>
    </action>
    <action>
      <assert>
        <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 resource is an OperationOutcome."/>
        <expression value="is(FHIR.OperationOutcome)"/>
        <value value="true"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <description value="Confirm that we have errors."/>
        <expression
                    value="issue.where(severity='error' or severity='fatal').count()&gt;0"/>
        <value value="true"/>
        <warningOnly value="false"/>
      </assert>
    </action>
    <action>
      <assert>
        <description value="Check Constraint failed: ch-elm-hiv-check"/>
        <expression
                    value="issue.where(diagnostics.matches('Constraint failed: ch-elm-hiv-check')).count() &gt; 0"/>
        <value value="true"/>
        <warningOnly value="false"/>
      </assert>
    </action>
  </test>
</TestScript>