<?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 Mon, Mar 30, 2026 16:23+0000 for FHIR v6.0.0-ballot4 

  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="Subscription" type="Subscription">
    <xs:annotation>
      <xs:documentation xml:lang="en">The subscription resource describes a particular client's request to be notified about a SubscriptionTopic.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="Subscription">
    <xs:annotation>
      <xs:documentation xml:lang="en">The subscription resource describes a particular client's request to be notified about a SubscriptionTopic.</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="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">A formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A natural language name identifying the subscription.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="SubscriptionStatusCodes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The status of the subscription, which marks the server state for managing the subscription.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="topic" minOccurs="1" maxOccurs="1" type="canonical">
            <xs:annotation>
              <xs:documentation xml:lang="en">The reference to the subscription topic to be notified about.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="contact" minOccurs="0" maxOccurs="unbounded" type="ContactPoint">
            <xs:annotation>
              <xs:documentation xml:lang="en">Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="end" minOccurs="0" maxOccurs="1" type="instant">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time for the server to turn the subscription off.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="managingEntity" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Entity with authorization to communicate with the server about this Subscription, such as requesting changes (e.g., updating an endpoint URL).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">A description of why this subscription is defined.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="filterBy" type="Subscription.FilterBy" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The filter properties to be applied to narrow the subscription topic stream.  When multiple filters are applied, evaluates to true if all the conditions applicable to that resource are met; otherwise it returns false (i.e., logical AND).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="channelType" minOccurs="1" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">The type of channel to send notifications on.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="endpoint" minOccurs="0" maxOccurs="1" type="url">
            <xs:annotation>
              <xs:documentation xml:lang="en">Channel-specific URL that describes where notifications are sent.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="parameter" type="Subscription.Parameter" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Channel-dependent information to send as part of the notification (e.g., HTTP Headers).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="heartbeatPeriod" minOccurs="0" maxOccurs="1" type="unsignedInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">If present, a 'heartbeat' notification (keep-alive) is sent via this channel with an interval period equal to this elements integer value in seconds.  If not present, a heartbeat notification is not sent.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="timeout" minOccurs="0" maxOccurs="1" type="unsignedInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">If present, the maximum amount of time a server will allow before failing a notification attempt.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="contentType" minOccurs="0" maxOccurs="1" type="code">
            <xs:annotation>
              <xs:documentation xml:lang="en">The MIME type to send the payload in - e.g., `application/fhir+xml` or `application/fhir+json`. Note that:

* clients may request notifications in a specific FHIR version by using the [FHIR Version Parameter](http.html#version-parameter) - e.g., `application/fhir+json; fhirVersion=4.0`.

* additional MIME types can be allowed by channels - e.g., `text/plain` and `text/html` are defined by the Email channel.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="content" minOccurs="0" maxOccurs="1" type="SubscriptionPayloadContent">
            <xs:annotation>
              <xs:documentation xml:lang="en">How much resource content to deliver in the notification payloads. The choices are an empty payload, only the resource id, or the full resource content.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="maxCount" minOccurs="0" maxOccurs="1" type="positiveInt">
            <xs:annotation>
              <xs:documentation xml:lang="en">If present, the maximum number of events that will be included in a notification bundle. Note that this is not a strict limit on the number of entries in a bundle, as dependent resources can be included.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Subscription.FilterBy">
    <xs:annotation>
      <xs:documentation xml:lang="en">The subscription resource describes a particular client's request to be notified about a SubscriptionTopic.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="resource" minOccurs="0" maxOccurs="1" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">A resource listed in the `SubscriptionTopic` this `Subscription` references (`SubscriptionTopic.canFilterBy.resource`). This element can be used to differentiate filters for topics that include more than one resource type.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="filterParameter" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The filter as defined in the `SubscriptionTopic.canFilterBy.filterParameter` element.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="comparator" minOccurs="0" maxOccurs="1" type="SearchComparator">
            <xs:annotation>
              <xs:documentation xml:lang="en">Comparator applied to this filter parameter.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="modifier" minOccurs="0" maxOccurs="1" type="SearchModifierCode">
            <xs:annotation>
              <xs:documentation xml:lang="en">Modifier applied to this filter parameter.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The literal value or resource path as is legal in search - for example, `Patient/123` or `le1950`.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="event" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">An event filter to be applied to the topic - e.g., if a topic defined multiple event triggers, this can be used to specify a single one.  Multiple values are or-joined, multiple codings within a value are and-joined.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Subscription.Parameter">
    <xs:annotation>
      <xs:documentation xml:lang="en">The subscription resource describes a particular client's request to be notified about a SubscriptionTopic.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="name" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Parameter name for information passed to the channel for notifications, for example in the case of a REST hook wanting to pass through an authorization header, the name would be Authorization.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="value" minOccurs="1" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">Parameter value for information passed to the channel for notifications, for example in the case of a REST hook wanting to pass through an authorization header, the value would be `Bearer 0193...`.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SubscriptionPayloadContentEnum">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="empty">
        <xs:annotation>
          <xs:documentation xml:lang="en">Empty</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="id-only">
        <xs:annotation>
          <xs:documentation xml:lang="en">Id-only</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="full-resource">
        <xs:annotation>
          <xs:documentation xml:lang="en">Full-resource</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SubscriptionPayloadContent">
    <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="SubscriptionPayloadContentEnum" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SubscriptionStatusCodesEnum">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="requested">
        <xs:annotation>
          <xs:documentation xml:lang="en">Requested</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation xml:lang="en">Active</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:enumeration value="off">
        <xs:annotation>
          <xs:documentation xml:lang="en">Off</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="SubscriptionStatusCodes">
    <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="SubscriptionStatusCodesEnum" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SearchModifierCodeEnum">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="missing">
        <xs:annotation>
          <xs:documentation xml:lang="en">Missing</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="exact">
        <xs:annotation>
          <xs:documentation xml:lang="en">Exact</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="contains">
        <xs:annotation>
          <xs:documentation xml:lang="en">Contains</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="not">
        <xs:annotation>
          <xs:documentation xml:lang="en">Not</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="text">
        <xs:annotation>
          <xs:documentation xml:lang="en">Text</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="in">
        <xs:annotation>
          <xs:documentation xml:lang="en">In</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="not-in">
        <xs:annotation>
          <xs:documentation xml:lang="en">Not In</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="below">
        <xs:annotation>
          <xs:documentation xml:lang="en">Below</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="above">
        <xs:annotation>
          <xs:documentation xml:lang="en">Above</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="type">
        <xs:annotation>
          <xs:documentation xml:lang="en">Type</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="identifier">
        <xs:annotation>
          <xs:documentation xml:lang="en">Identifier</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="of-type">
        <xs:annotation>
          <xs:documentation xml:lang="en">Of Type</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="code-text">
        <xs:annotation>
          <xs:documentation xml:lang="en">Code Text</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="text-advanced">
        <xs:annotation>
          <xs:documentation xml:lang="en">Text Advanced</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="iterate">
        <xs:annotation>
          <xs:documentation xml:lang="en">Iterate</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SearchModifierCode">
    <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="SearchModifierCodeEnum" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
