<?xml version="1.0" encoding="UTF-8"?>
<!-- 
 * #%L
 * org.hl7.fhir.r5
 * %%
 * Copyright (C) 2014 - 2019 Health Level 7
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

/*
  Copyright (c) 2011+, HL7, Inc.
  All rights reserved.
  
  Redistribution and use in source and binary forms, with or without modification, 
  are permitted provided that the following conditions are met:
  
   * Redistributions of source code must retain the above copyright notice, this 
     list of conditions and the following disclaimer.
   * Redistributions in binary form must reproduce the above copyright notice, 
     this list of conditions and the following disclaimer in the documentation 
     and/or other materials provided with the distribution.
   * Neither the name of HL7 nor the names of its contributors may be used to 
     endorse or promote products derived from this software without specific 
     prior written permission.
  
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
  POSSIBILITY OF SUCH DAMAGE.
  

  Generated on Sun, Mar 26, 2023 15:21+1100 for FHIR v5.0.0 

  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources
  valid. Implementers will still need to be familiar with the content of the specification and with
  any profiles that apply to the resources in order to make a conformant implementation.

-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://hl7.org/fhir" xmlns:xhtml="http://www.w3.org/1999/xhtml" targetNamespace="http://hl7.org/fhir" elementFormDefault="qualified" version="1.0">
  <xs:include schemaLocation="fhir-base.xsd"/>
  <xs:element name="TestReport" type="TestReport">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="TestReport">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="DomainResource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifier for the TestReport assigned for external purposes outside the context of FHIR.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A free text natural language name identifying the executed TestReport.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="TestReportStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The current state of this test report.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="testScript" minOccurs="1" maxOccurs="1" type="canonical">
            <xs:annotation>
              <xs:documentation xml:lang="en">Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="result" minOccurs="1" maxOccurs="1" type="TestReportResult">
            <xs:annotation>
              <xs:documentation xml:lang="en">The overall result from the execution of the TestScript.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="score" minOccurs="0" maxOccurs="1" type="decimal">
            <xs:annotation>
              <xs:documentation xml:lang="en">The final score (percentage of tests passed) resulting from the execution of the TestScript.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="tester" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Name of the tester producing this report (Organization or individual).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="issued" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">When the TestScript was executed and this TestReport was generated.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="participant" type="TestReport.Participant" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A participant in the test execution, either the execution engine, a client, or a server.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="setup" type="TestReport.Setup" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The results of the series of required setup operations before the tests were executed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="test" type="TestReport.Test" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">A test executed from the test script.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="teardown" type="TestReport.Teardown" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise).</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestReport.Participant">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="TestReportParticipantType">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of participant.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="uri" minOccurs="1" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">The uri of the participant. An absolute URL is preferred.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="display" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The display name of the participant.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestReport.Setup">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="action" type="TestReport.Action" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Action would contain either an operation or an assertion.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestReport.Action">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="operation" type="TestReport.Operation" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The operation performed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="assert" type="TestReport.Assert" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The results of the assertion performed on the previous operations.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestReport.Operation">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="result" minOccurs="1" maxOccurs="1" type="TestReportActionResult">
            <xs:annotation>
              <xs:documentation xml:lang="en">The result of this operation.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="message" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">An explanatory message associated with the result.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">A link to further details on the result.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestReport.Assert">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="result" minOccurs="1" maxOccurs="1" type="TestReportActionResult">
            <xs:annotation>
              <xs:documentation xml:lang="en">The result of this assertion.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="message" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">An explanatory message associated with the result.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="detail" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A link to further details on the result.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="requirement" type="TestReport.Requirement" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Links or references providing traceability to the testing requirements for this assert.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestReport.Requirement">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">Link or reference providing traceability to the testing requirement for this test.</xs:documentation>
            </xs:annotation>
            <xs:element name="linkUri" type="uri"/>
            <xs:element name="linkCanonical" type="canonical"/>
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestReport.Test">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name of this test used for tracking/logging purposes by test engines.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="description" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A short description of the test used by test engines for tracking and reporting purposes.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="action" type="TestReport.Action1" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Action would contain either an operation or an assertion.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestReport.Action1">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="operation" type="TestReport.Operation" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">An operation would involve a REST request to a server.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="assert" type="TestReport.Assert" minOccurs="0" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">The results of the assertion performed on the previous operations.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestReport.Teardown">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="action" type="TestReport.Action2" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The teardown action will only contain an operation.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TestReport.Action2">
    <xs:annotation>
      <xs:documentation xml:lang="en">A summary of information based on the results of executing a TestScript.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="operation" type="TestReport.Operation" minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation xml:lang="en">An operation would involve a REST request to a server.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="TestReportStatusEnum">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation xml:lang="en">In Progress</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="waiting">
        <xs:annotation>
          <xs:documentation xml:lang="en">Waiting</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="stopped">
        <xs:annotation>
          <xs:documentation xml:lang="en">Stopped</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="entered-in-error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Entered In Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="TestReportStatus">
    <xs:annotation>
      <xs:documentation xml:lang="en">The current status of the test report.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="TestReportStatusEnum" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="TestReportActionResultEnum">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="pass">
        <xs:annotation>
          <xs:documentation xml:lang="en">Pass</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="skip">
        <xs:annotation>
          <xs:documentation xml:lang="en">Skip</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="fail">
        <xs:annotation>
          <xs:documentation xml:lang="en">Fail</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="warning">
        <xs:annotation>
          <xs:documentation xml:lang="en">Warning</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="error">
        <xs:annotation>
          <xs:documentation xml:lang="en">Error</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="TestReportActionResult">
    <xs:annotation>
      <xs:documentation xml:lang="en">The results of executing an action.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="TestReportActionResultEnum" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="TestReportParticipantTypeEnum">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="test-engine">
        <xs:annotation>
          <xs:documentation xml:lang="en">Test Engine</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="client">
        <xs:annotation>
          <xs:documentation xml:lang="en">Client</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="server">
        <xs:annotation>
          <xs:documentation xml:lang="en">Server</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="TestReportParticipantType">
    <xs:annotation>
      <xs:documentation xml:lang="en"></xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="TestReportParticipantTypeEnum" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="TestReportResultEnum">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="pass">
        <xs:annotation>
          <xs:documentation xml:lang="en">Pass</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="fail">
        <xs:annotation>
          <xs:documentation xml:lang="en">Fail</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="pending">
        <xs:annotation>
          <xs:documentation xml:lang="en">Pending</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="TestReportResult">
    <xs:annotation>
      <xs:documentation xml:lang="en">The reported execution result.</xs:documentation>
      <xs:documentation xml:lang="en">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Element">
        <xs:attribute name="value" type="TestReportResultEnum" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
