<?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 Tue, Jun 16, 2026 19:54+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="DeviceAlert" type="DeviceAlert">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes a noteworthy condition or occurrence determined to exist by a device.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DeviceAlert">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes a noteworthy condition or occurrence determined to exist by a device.</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">Business identifiers assigned to this alert, by the source device, gateway software, manufacturers, or other systems or organizations. These identifiers remain constant as the resource is updated and propagates from server to server.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="procedure" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The procedure (or procedures) during which the alert condition was raised.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="DeviceAlertStatusCodes">
            <xs:annotation>
              <xs:documentation xml:lang="en">The current state of the device alert.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Partitions the device alert into one or more categories that can be used to filter searching, to govern access control and/or to guide system behavior.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">physiological | technical.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="priority" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">The alert priority is usually reported by the source device. A priority of `info` SHOULD indicate that the alert is “for information only” and urgent action is not required. The element MAY be omitted if the priority is unknown.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that indicates the specific condition that triggered the alert.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Who or what the alert is about.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="encounter" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The Encounter during which the alert condition was raised.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="presence" minOccurs="1" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Whether the alert condition is currently active.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">This element is used to record the date or time period when the alert condition did occur or is occurring.</xs:documentation>
            </xs:annotation>
            <xs:element name="occurrenceDateTime" type="dateTime"/>
            <xs:element name="occurrencePeriod" type="Period"/>
          </xs:choice>
          <xs:element name="device" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the device that detected the alert condition. The device could be a top-level Device or component Device (such as an MDS, VMD, or Channel); or might identify the specific DeviceMetric of a Device (e.g., a heart rate reading) that was in an alert condition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="acknowledged" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">An indication of whether (true) or not (false) the alert condition has been acknowledged.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="acknowledgedBy" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">An indication of who or what acknowledged the alert condition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The principal physical location of the subject at the time the alert condition occurred. This could be different from the location of the alerting device at that time, and from the current location of either the subject or the alert condition detecting device.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="derivedFrom" type="DeviceAlert.DerivedFrom" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The value causing the alert condition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="label" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The label might combine information from the alert code, priority, the measurement type, measurement value, body sites and other sources, e.g., “HR &gt; 180”.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="signal" type="DeviceAlert.Signal" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Annunciation or notification of the alert condition.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DeviceAlert.DerivedFrom">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes a noteworthy condition or occurrence determined to exist by a device.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="observation" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates the Observation whose value is causing the alert condition; or, if `component` is present, the Observation with a component causing the alert condition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="component" minOccurs="0" maxOccurs="1" type="Coding">
            <xs:annotation>
              <xs:documentation xml:lang="en">If applicable, the code of the component (of the Observation identified in `derivedFrom.observation`) having a value causing the alert condition. This might be used when the alert is associated with a specific component of an Observation, rather than the overall Observation; for example, a low diastolic blood pressure. Since the component is identified by matching `Observation.component.code`, if more than one component have the same code, the specific component is ambiguous. Repetitions of this element indicate additional components contributing to the alert condition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="limit" minOccurs="0" maxOccurs="1" type="Range">
            <xs:annotation>
              <xs:documentation xml:lang="en">The limits beyond which a value was detected to cause the alert condition. The actual value is the `Observation.value[x]` referenced by `derivedFrom.observation` or, if specified, the `Observation.component.value[x]` of the component (with `Observation.component.code` matching `derivedFrom.component`) of the reference Observation.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DeviceAlert.Signal">
    <xs:annotation>
      <xs:documentation xml:lang="en">Describes a noteworthy condition or occurrence determined to exist by a device.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="activationState" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Paused indicates that annunciation has temporarily been disabled (&quot;snooze&quot;).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="presence" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates whether the signal is currently being annunciated. An on signal is currently being annunciated; a latched signal is currently being being annunciated although the alert condition has ended; an off signal is not currently being annunciated; and an acknowledged signal is not currently being annunciated because the user has acknowledged the signal.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="annunciator" minOccurs="0" maxOccurs="1" type="CodeableReference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Signalling by the source device is local; signalling elsewhere is considered remote. A reference to the &quot;top level&quot; signalling device could also be present.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="manifestation" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">How the signal is being annunciated.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="type" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Details of the signal manifestation, such as a 1 meter visual indicator or a 4 meter visual indicator.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="indication" minOccurs="0" maxOccurs="1" type="Period">
            <xs:annotation>
              <xs:documentation xml:lang="en">The period during which the signal was being annunciated. If there is no indicated period end, the annunciation is on-going.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="DeviceAlertStatusCodesEnum">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="in-progress">
        <xs:annotation>
          <xs:documentation xml:lang="en">In Progress</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="completed">
        <xs:annotation>
          <xs:documentation xml:lang="en">Completed</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:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation xml:lang="en">Unknown</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="DeviceAlertStatusCodes">
    <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="DeviceAlertStatusCodesEnum" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
