<?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="NutritionIntake" type="NutritionIntake">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of food or fluid that is being consumed by a patient.   A NutritionIntake may indicate that the patient may be consuming the food or fluid now or has consumed the food or fluid in the past.  The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician.  A common scenario where this information is captured is during the history taking process during a patient visit or stay or through an app that tracks food or fluids consumed.   The consumption information may come from sources such as the patient's memory, from a nutrition label,  or from a clinician documenting observed intake.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="NutritionIntake">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of food or fluid that is being consumed by a patient.   A NutritionIntake may indicate that the patient may be consuming the food or fluid now or has consumed the food or fluid in the past.  The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician.  A common scenario where this information is captured is during the history taking process during a patient visit or stay or through an app that tracks food or fluids consumed.   The consumption information may come from sources such as the patient's memory, from a nutrition label,  or from a clinician documenting observed intake.</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">Identifiers associated with this Nutrition Intake that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="instantiatesCanonical" minOccurs="0" maxOccurs="unbounded" type="canonical">
            <xs:annotation>
              <xs:documentation xml:lang="en">Instantiates FHIR protocol or definition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="instantiatesUri" minOccurs="0" maxOccurs="unbounded" type="uri">
            <xs:annotation>
              <xs:documentation xml:lang="en">Instantiates external protocol or definition.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="basedOn" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A plan, proposal or order that is fulfilled in whole or in part by this event.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="partOf" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A larger event of which this particular event is a component or step.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="status" minOccurs="1" maxOccurs="1" type="EventStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code representing the patient or other source's judgment about the state of the intake that this assertion is about.  Generally, this will be active or completed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="statusReason" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Captures the reason for the current state of the NutritionIntake.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Overall type of nutrition intake.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="subject" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The person, animal or group who is/was consuming the food or fluid.</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 that establishes the context for this NutritionIntake.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">The interval of time during which it is being asserted that the patient is/was consuming the food or fluid.</xs:documentation>
            </xs:annotation>
            <xs:element name="occurrenceDateTime" type="dateTime"/>
            <xs:element name="occurrencePeriod" type="Period"/>
          </xs:choice>
          <xs:element name="recorded" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The date when the Nutrition Intake was asserted by the information source.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">The person or organization that provided the information about the consumption of this food or fluid. Note: Use derivedFrom when a NutritionIntake is derived from other resources.</xs:documentation>
            </xs:annotation>
            <xs:element name="reportedBoolean" type="boolean"/>
            <xs:element name="reportedReference" type="Reference"/>
          </xs:choice>
          <xs:element name="consumedItem" type="NutritionIntake.ConsumedItem" minOccurs="1" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">What food or fluid product or item was consumed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ingredientLabel" type="NutritionIntake.IngredientLabel" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Total nutrient amounts for the whole meal, product, serving, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="performer" type="NutritionIntake.Performer" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Who performed the intake and how they were involved.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="location" minOccurs="0" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Where the intake occurred.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="derivedFrom" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Allows linking the NutritionIntake to the underlying NutritionOrder, or to other information, such as AllergyIntolerance, that supports or is used to derive the NutritionIntake.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="reason" minOccurs="0" maxOccurs="unbounded" type="CodeableReference">
            <xs:annotation>
              <xs:documentation xml:lang="en">A reason, Condition or observation for why the food or fluid is /was consumed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Provides extra information about the Nutrition Intake that is not conveyed by the other attributes.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NutritionIntake.ConsumedItem">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of food or fluid that is being consumed by a patient.   A NutritionIntake may indicate that the patient may be consuming the food or fluid now or has consumed the food or fluid in the past.  The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician.  A common scenario where this information is captured is during the history taking process during a patient visit or stay or through an app that tracks food or fluids consumed.   The consumption information may come from sources such as the patient's memory, from a nutrition label,  or from a clinician documenting observed intake.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="type" minOccurs="1" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicates what a category of item that was consumed: e.g., food, fluid, enteral, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="nutritionProduct" minOccurs="1" maxOccurs="1" type="CodeableReference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Identifies the food or fluid product that was consumed. This is potentially a link to a resource representing the details of the food product (TBD) or a simple attribute carrying a code that identifies the food from a known list of foods.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="schedule" minOccurs="0" maxOccurs="1" type="Timing">
            <xs:annotation>
              <xs:documentation xml:lang="en">Scheduled frequency of consumption.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">Quantity of the specified food.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="rate" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">Rate at which enteral feeding was administered.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notConsumed" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">Indicator when a patient is in a setting where it is helpful to know if food was not consumed, such as it was refused, held (as in tube feedings), or otherwise not provided. If a consumption is being recorded from an app, such as MyFitnessPal, this indicator will likely not be used.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="notConsumedReason" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Document the reason the food or fluid was not consumed, such as refused, held, etc.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NutritionIntake.IngredientLabel">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of food or fluid that is being consumed by a patient.   A NutritionIntake may indicate that the patient may be consuming the food or fluid now or has consumed the food or fluid in the past.  The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician.  A common scenario where this information is captured is during the history taking process during a patient visit or stay or through an app that tracks food or fluids consumed.   The consumption information may come from sources such as the patient's memory, from a nutrition label,  or from a clinician documenting observed intake.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="nutrient" minOccurs="1" maxOccurs="1" type="CodeableReference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Total nutrient consumed. This could be a macronutrient (protein, fat, carbohydrate), or a vitamin and mineral.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="amount" minOccurs="1" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">Total amount of nutrient consumed.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NutritionIntake.Performer">
    <xs:annotation>
      <xs:documentation xml:lang="en">A record of food or fluid that is being consumed by a patient.   A NutritionIntake may indicate that the patient may be consuming the food or fluid now or has consumed the food or fluid in the past.  The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician.  A common scenario where this information is captured is during the history taking process during a patient visit or stay or through an app that tracks food or fluids consumed.   The consumption information may come from sources such as the patient's memory, from a nutrition label,  or from a clinician documenting observed intake.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="function" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Type of performer.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="actor" minOccurs="1" maxOccurs="1" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">Who performed the intake.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
