<?xml version="1.0" encoding="UTF-8"?>
<!-- 
  Copyright (c) 2011-2013, 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, Sep 30, 2014 18:08+1000 for FHIR v0.0.82 
-->
<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="0.0.82">
  <xs:include schemaLocation="fhir-base.xsd"/>
  <xs:element name="AllergyIntolerance" type="AllergyIntolerance">
    <xs:annotation>
      <xs:documentation>Indicates the patient has a susceptibility to an adverse reaction upon exposure to a specified substance.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="AllergyIntolerance">
    <xs:annotation>
      <xs:documentation>Indicates the patient has a susceptibility to an adverse reaction upon exposure to a specified substance.</xs:documentation>
      <xs:documentation>If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Resource">
        <xs:sequence>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation>This records identifiers associated with this allergy/intolerance concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="criticality" minOccurs="0" maxOccurs="1" type="Criticality">
            <xs:annotation>
              <xs:documentation>Criticality of the sensitivity.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="sensitivityType" minOccurs="1" maxOccurs="1" type="SensitivityType">
            <xs:annotation>
              <xs:documentation>Type of the sensitivity.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="recordedDate" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation>Date when the sensitivity was recorded.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="SensitivityStatus">
            <xs:annotation>
              <xs:documentation>Status of the sensitivity.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>The patient who has the allergy or intolerance.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="recorder" minOccurs="0" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Indicates who has responsibility for the record.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="substance" minOccurs="1" maxOccurs="1" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>The substance that causes the sensitivity.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reaction" minOccurs="0" maxOccurs="unbounded" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Reactions associated with the sensitivity.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="sensitivityTest" minOccurs="0" maxOccurs="unbounded" type="ResourceReference">
            <xs:annotation>
              <xs:documentation>Observations that confirm or refute the sensitivity.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SensitivityStatus-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="suspected">
        <xs:annotation>
          <xs:documentation>A suspected sensitivity to a substance.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="confirmed">
        <xs:annotation>
          <xs:documentation>The sensitivity has been confirmed and is active.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="refuted">
        <xs:annotation>
          <xs:documentation>The sensitivity has been shown to never have existed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="resolved">
        <xs:annotation>
          <xs:documentation>The sensitivity used to exist but no longer does.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SensitivityStatus">
    <xs:annotation>
      <xs:documentation>The status of the adverse sensitivity</xs:documentation>
      <xs:documentation>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="SensitivityStatus-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="Criticality-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="fatal">
        <xs:annotation>
          <xs:documentation>Likely to result in death if re-exposed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="high">
        <xs:annotation>
          <xs:documentation>Likely to result in reactions that will need to be treated if re-exposed.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="medium">
        <xs:annotation>
          <xs:documentation>Likely to result in reactions that will inconvenience the subject.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="low">
        <xs:annotation>
          <xs:documentation>Not likely to result in any inconveniences for the subject.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="Criticality">
    <xs:annotation>
      <xs:documentation>The criticality of an adverse sensitivity</xs:documentation>
      <xs:documentation>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="Criticality-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SensitivityType-list">
    <xs:restriction base="xs:string">
      <xs:enumeration value="allergy">
        <xs:annotation>
          <xs:documentation>Allergic Reaction.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="intolerance">
        <xs:annotation>
          <xs:documentation>Non-Allergic Reaction.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unknown">
        <xs:annotation>
          <xs:documentation>Unknown type.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="SensitivityType">
    <xs:annotation>
      <xs:documentation>The type of an adverse sensitivity</xs:documentation>
      <xs:documentation>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="SensitivityType-list" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
