<?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="NutritionProduct" type="NutritionProduct">
    <xs:annotation>
      <xs:documentation xml:lang="en">A food or supplement that is consumed by patients.</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="NutritionProduct">
    <xs:annotation>
      <xs:documentation xml:lang="en">A food or supplement that is consumed by patients.</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="status" minOccurs="0" maxOccurs="1" type="NutritionProductStatus">
            <xs:annotation>
              <xs:documentation xml:lang="en">The current state of the product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="code" minOccurs="0" maxOccurs="1" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">A code that specifies the product or a textual description if no code is available. This could be such codes as a USDA Branded Food Products Database number, a USDA Food Data Central (FDC) ID number, Universal Product Code (UPC), a Langual code, or a country specific food database code.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="category" minOccurs="0" maxOccurs="unbounded" type="CodeableConcept">
            <xs:annotation>
              <xs:documentation xml:lang="en">Nutrition products fall into various categories based on their composition (e.g., Fruit and Grain, Vegetables) or form (e.g., Beverages).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="manufacturer" minOccurs="0" maxOccurs="unbounded" type="Reference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The organisation (manufacturer, representative or legal authorization holder) or person that is responsible for nutrition product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="nutrient" type="NutritionProduct.Nutrient" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">The product's nutritional information expressed by the nutrients.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ingredientSummary" minOccurs="0" maxOccurs="1" type="markdown">
            <xs:annotation>
              <xs:documentation xml:lang="en">The textual description of the ingredients in the product.  For example, the following is a concatenated list of the ingredients for a peanut butter would read 'ROASTED PEANUTS, SUGAR, HYDROGENATED VEGETABLE OIL (COTTONSEED, SOYBEAN AND RAPESEED OIL) TO PREVENT SEPARATION, SALT'.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="ingredient" type="NutritionProduct.Ingredient" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Ingredients contained in this product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="energy" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount of energy present in the product expressed in kilocalories or kilojoules.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="characteristic" type="NutritionProduct.Characteristic" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Specifies descriptive properties of the nutrition product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="instance" type="NutritionProduct.Instance" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation xml:lang="en">Conveys instance-level information about this product item. One or several physical, countable instances or occurrences of the product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="note" minOccurs="0" maxOccurs="unbounded" type="Annotation">
            <xs:annotation>
              <xs:documentation xml:lang="en">Comments made about the product.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NutritionProduct.Nutrient">
    <xs:annotation>
      <xs:documentation xml:lang="en">A food or supplement that is consumed by patients.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="item" minOccurs="1" maxOccurs="1" type="CodeableReference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The (relevant) nutrients in the product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount of nutrient expressed in one or more units, either X per pack / per serving / per dose or X amount.</xs:documentation>
            </xs:annotation>
            <xs:element name="amountRatio" type="Ratio"/>
            <xs:element name="amountQuantity" type="Quantity"/>
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NutritionProduct.Ingredient">
    <xs:annotation>
      <xs:documentation xml:lang="en">A food or supplement that is consumed by patients.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="item" minOccurs="1" maxOccurs="1" type="CodeableReference">
            <xs:annotation>
              <xs:documentation xml:lang="en">The ingredient contained in the product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="0" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount of ingredient that is in the product.</xs:documentation>
            </xs:annotation>
            <xs:element name="amountRatio" type="Ratio"/>
            <xs:element name="amountQuantity" type="Quantity"/>
          </xs:choice>
          <xs:element name="allergen" minOccurs="0" maxOccurs="1" type="boolean">
            <xs:annotation>
              <xs:documentation xml:lang="en">A known or suspected allergenic and/or substance that is associated with an intolerance.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NutritionProduct.Characteristic">
    <xs:annotation>
      <xs:documentation xml:lang="en">A food or supplement that is consumed by patients.</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">A code specifying which characteristic of the product is being described (for example, colour, shape).</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="1" >
            <xs:annotation>
              <xs:documentation xml:lang="en">The actual characteristic value corresponding to the type.</xs:documentation>
            </xs:annotation>
            <xs:element name="valueCodeableConcept" type="CodeableConcept"/>
            <xs:element name="valueString" type="string"/>
            <xs:element name="valueQuantity" type="Quantity"/>
            <xs:element name="valueBase64Binary" type="base64Binary"/>
            <xs:element name="valueAttachment" type="Attachment"/>
            <xs:element name="valueBoolean" type="boolean"/>
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="NutritionProduct.Instance">
    <xs:annotation>
      <xs:documentation xml:lang="en">A food or supplement that is consumed by patients.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="BackboneElement">
        <xs:sequence>
          <xs:element name="quantity" minOccurs="0" maxOccurs="1" type="Quantity">
            <xs:annotation>
              <xs:documentation xml:lang="en">The amount of items or instances that the resource considers, for instance when referring to 2 identical units together.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="identifier" minOccurs="0" maxOccurs="unbounded" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identifier for the physical instance, typically a serial number or manufacturer number.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="name" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The name or brand for the specific product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="lotNumber" minOccurs="0" maxOccurs="1" type="string">
            <xs:annotation>
              <xs:documentation xml:lang="en">The identification of the batch or lot of the product.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="expiry" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time after which the product is no longer expected to be in proper condition, or its use is not advised or not allowed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="useBy" minOccurs="0" maxOccurs="1" type="dateTime">
            <xs:annotation>
              <xs:documentation xml:lang="en">The time after which the product is no longer expected to be in proper condition, or its use is not advised or not allowed.</xs:documentation>
           </xs:annotation>
          </xs:element>
          <xs:element name="biologicalSourceEvent" minOccurs="0" maxOccurs="1" type="Identifier">
            <xs:annotation>
              <xs:documentation xml:lang="en">An identifier of the donation, collection, or pooling event from which biological material in this nutrition product was derived.</xs:documentation>
           </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="NutritionProductStatusEnum">
    <xs:restriction base="code-primitive">
      <xs:enumeration value="active">
        <xs:annotation>
          <xs:documentation xml:lang="en">Active</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="inactive">
        <xs:annotation>
          <xs:documentation xml:lang="en">Inactive</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="NutritionProductStatus">
    <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="NutritionProductStatusEnum" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
