001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Tue, Dec 28, 2021 07:16+1100 for FHIR v5.0.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * 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.
052 */
053@ResourceDef(name="NutritionIntake", profile="http://hl7.org/fhir/StructureDefinition/NutritionIntake")
054public class NutritionIntake extends DomainResource {
055
056    @Block()
057    public static class NutritionIntakeConsumedItemComponent extends BackboneElement implements IBaseBackboneElement {
058        /**
059         * Indicates what a category of item that was consumed: eg., food, fluid, enteral, etc.
060         */
061        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
062        @Description(shortDefinition="The type of food or fluid product", formalDefinition="Indicates what a category of item that was consumed: eg., food, fluid, enteral, etc." )
063        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/edible-substance-type")
064        protected CodeableConcept type;
065
066        /**
067         * 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.
068         */
069        @Child(name = "nutritionProduct", type = {CodeableReference.class}, order=2, min=1, max=1, modifier=false, summary=true)
070        @Description(shortDefinition="Code that identifies the food or fluid product that was consumed", formalDefinition="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." )
071        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/food-type")
072        protected CodeableReference nutritionProduct;
073
074        /**
075         * Scheduled frequency of consumption.
076         */
077        @Child(name = "schedule", type = {Timing.class}, order=3, min=0, max=1, modifier=false, summary=false)
078        @Description(shortDefinition="Scheduled frequency of consumption", formalDefinition="Scheduled frequency of consumption." )
079        protected Timing schedule;
080
081        /**
082         * Quantity of the specified food.
083         */
084        @Child(name = "amount", type = {Quantity.class}, order=4, min=0, max=1, modifier=false, summary=true)
085        @Description(shortDefinition="Quantity of the specified food", formalDefinition="Quantity of the specified food." )
086        protected Quantity amount;
087
088        /**
089         * Rate at which enteral feeding was administered.
090         */
091        @Child(name = "rate", type = {Quantity.class}, order=5, min=0, max=1, modifier=false, summary=true)
092        @Description(shortDefinition="Rate at which enteral feeding was administered", formalDefinition="Rate at which enteral feeding was administered." )
093        protected Quantity rate;
094
095        /**
096         * 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.
097         */
098        @Child(name = "notConsumed", type = {BooleanType.class}, order=6, min=0, max=1, modifier=false, summary=false)
099        @Description(shortDefinition="Flag to indicate if the food or fluid item was refused or otherwise not consumed", formalDefinition="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." )
100        protected BooleanType notConsumed;
101
102        /**
103         * Document the reason the food or fluid was not consumed, such as refused, held, etc.
104         */
105        @Child(name = "notConsumedReason", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false)
106        @Description(shortDefinition="Reason food or fluid was not consumed", formalDefinition="Document the reason the food or fluid was not consumed, such as refused, held, etc." )
107        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/not-consumed-reason")
108        protected CodeableConcept notConsumedReason;
109
110        private static final long serialVersionUID = -1625538068L;
111
112    /**
113     * Constructor
114     */
115      public NutritionIntakeConsumedItemComponent() {
116        super();
117      }
118
119    /**
120     * Constructor
121     */
122      public NutritionIntakeConsumedItemComponent(CodeableConcept type, CodeableReference nutritionProduct) {
123        super();
124        this.setType(type);
125        this.setNutritionProduct(nutritionProduct);
126      }
127
128        /**
129         * @return {@link #type} (Indicates what a category of item that was consumed: eg., food, fluid, enteral, etc.)
130         */
131        public CodeableConcept getType() { 
132          if (this.type == null)
133            if (Configuration.errorOnAutoCreate())
134              throw new Error("Attempt to auto-create NutritionIntakeConsumedItemComponent.type");
135            else if (Configuration.doAutoCreate())
136              this.type = new CodeableConcept(); // cc
137          return this.type;
138        }
139
140        public boolean hasType() { 
141          return this.type != null && !this.type.isEmpty();
142        }
143
144        /**
145         * @param value {@link #type} (Indicates what a category of item that was consumed: eg., food, fluid, enteral, etc.)
146         */
147        public NutritionIntakeConsumedItemComponent setType(CodeableConcept value) { 
148          this.type = value;
149          return this;
150        }
151
152        /**
153         * @return {@link #nutritionProduct} (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.)
154         */
155        public CodeableReference getNutritionProduct() { 
156          if (this.nutritionProduct == null)
157            if (Configuration.errorOnAutoCreate())
158              throw new Error("Attempt to auto-create NutritionIntakeConsumedItemComponent.nutritionProduct");
159            else if (Configuration.doAutoCreate())
160              this.nutritionProduct = new CodeableReference(); // cc
161          return this.nutritionProduct;
162        }
163
164        public boolean hasNutritionProduct() { 
165          return this.nutritionProduct != null && !this.nutritionProduct.isEmpty();
166        }
167
168        /**
169         * @param value {@link #nutritionProduct} (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.)
170         */
171        public NutritionIntakeConsumedItemComponent setNutritionProduct(CodeableReference value) { 
172          this.nutritionProduct = value;
173          return this;
174        }
175
176        /**
177         * @return {@link #schedule} (Scheduled frequency of consumption.)
178         */
179        public Timing getSchedule() { 
180          if (this.schedule == null)
181            if (Configuration.errorOnAutoCreate())
182              throw new Error("Attempt to auto-create NutritionIntakeConsumedItemComponent.schedule");
183            else if (Configuration.doAutoCreate())
184              this.schedule = new Timing(); // cc
185          return this.schedule;
186        }
187
188        public boolean hasSchedule() { 
189          return this.schedule != null && !this.schedule.isEmpty();
190        }
191
192        /**
193         * @param value {@link #schedule} (Scheduled frequency of consumption.)
194         */
195        public NutritionIntakeConsumedItemComponent setSchedule(Timing value) { 
196          this.schedule = value;
197          return this;
198        }
199
200        /**
201         * @return {@link #amount} (Quantity of the specified food.)
202         */
203        public Quantity getAmount() { 
204          if (this.amount == null)
205            if (Configuration.errorOnAutoCreate())
206              throw new Error("Attempt to auto-create NutritionIntakeConsumedItemComponent.amount");
207            else if (Configuration.doAutoCreate())
208              this.amount = new Quantity(); // cc
209          return this.amount;
210        }
211
212        public boolean hasAmount() { 
213          return this.amount != null && !this.amount.isEmpty();
214        }
215
216        /**
217         * @param value {@link #amount} (Quantity of the specified food.)
218         */
219        public NutritionIntakeConsumedItemComponent setAmount(Quantity value) { 
220          this.amount = value;
221          return this;
222        }
223
224        /**
225         * @return {@link #rate} (Rate at which enteral feeding was administered.)
226         */
227        public Quantity getRate() { 
228          if (this.rate == null)
229            if (Configuration.errorOnAutoCreate())
230              throw new Error("Attempt to auto-create NutritionIntakeConsumedItemComponent.rate");
231            else if (Configuration.doAutoCreate())
232              this.rate = new Quantity(); // cc
233          return this.rate;
234        }
235
236        public boolean hasRate() { 
237          return this.rate != null && !this.rate.isEmpty();
238        }
239
240        /**
241         * @param value {@link #rate} (Rate at which enteral feeding was administered.)
242         */
243        public NutritionIntakeConsumedItemComponent setRate(Quantity value) { 
244          this.rate = value;
245          return this;
246        }
247
248        /**
249         * @return {@link #notConsumed} (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.). This is the underlying object with id, value and extensions. The accessor "getNotConsumed" gives direct access to the value
250         */
251        public BooleanType getNotConsumedElement() { 
252          if (this.notConsumed == null)
253            if (Configuration.errorOnAutoCreate())
254              throw new Error("Attempt to auto-create NutritionIntakeConsumedItemComponent.notConsumed");
255            else if (Configuration.doAutoCreate())
256              this.notConsumed = new BooleanType(); // bb
257          return this.notConsumed;
258        }
259
260        public boolean hasNotConsumedElement() { 
261          return this.notConsumed != null && !this.notConsumed.isEmpty();
262        }
263
264        public boolean hasNotConsumed() { 
265          return this.notConsumed != null && !this.notConsumed.isEmpty();
266        }
267
268        /**
269         * @param value {@link #notConsumed} (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.). This is the underlying object with id, value and extensions. The accessor "getNotConsumed" gives direct access to the value
270         */
271        public NutritionIntakeConsumedItemComponent setNotConsumedElement(BooleanType value) { 
272          this.notConsumed = value;
273          return this;
274        }
275
276        /**
277         * @return 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.
278         */
279        public boolean getNotConsumed() { 
280          return this.notConsumed == null || this.notConsumed.isEmpty() ? false : this.notConsumed.getValue();
281        }
282
283        /**
284         * @param value 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.
285         */
286        public NutritionIntakeConsumedItemComponent setNotConsumed(boolean value) { 
287            if (this.notConsumed == null)
288              this.notConsumed = new BooleanType();
289            this.notConsumed.setValue(value);
290          return this;
291        }
292
293        /**
294         * @return {@link #notConsumedReason} (Document the reason the food or fluid was not consumed, such as refused, held, etc.)
295         */
296        public CodeableConcept getNotConsumedReason() { 
297          if (this.notConsumedReason == null)
298            if (Configuration.errorOnAutoCreate())
299              throw new Error("Attempt to auto-create NutritionIntakeConsumedItemComponent.notConsumedReason");
300            else if (Configuration.doAutoCreate())
301              this.notConsumedReason = new CodeableConcept(); // cc
302          return this.notConsumedReason;
303        }
304
305        public boolean hasNotConsumedReason() { 
306          return this.notConsumedReason != null && !this.notConsumedReason.isEmpty();
307        }
308
309        /**
310         * @param value {@link #notConsumedReason} (Document the reason the food or fluid was not consumed, such as refused, held, etc.)
311         */
312        public NutritionIntakeConsumedItemComponent setNotConsumedReason(CodeableConcept value) { 
313          this.notConsumedReason = value;
314          return this;
315        }
316
317        protected void listChildren(List<Property> children) {
318          super.listChildren(children);
319          children.add(new Property("type", "CodeableConcept", "Indicates what a category of item that was consumed: eg., food, fluid, enteral, etc.", 0, 1, type));
320          children.add(new Property("nutritionProduct", "CodeableReference(NutritionProduct)", "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.", 0, 1, nutritionProduct));
321          children.add(new Property("schedule", "Timing", "Scheduled frequency of consumption.", 0, 1, schedule));
322          children.add(new Property("amount", "Quantity", "Quantity of the specified food.", 0, 1, amount));
323          children.add(new Property("rate", "Quantity", "Rate at which enteral feeding was administered.", 0, 1, rate));
324          children.add(new Property("notConsumed", "boolean", "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.", 0, 1, notConsumed));
325          children.add(new Property("notConsumedReason", "CodeableConcept", "Document the reason the food or fluid was not consumed, such as refused, held, etc.", 0, 1, notConsumedReason));
326        }
327
328        @Override
329        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
330          switch (_hash) {
331          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Indicates what a category of item that was consumed: eg., food, fluid, enteral, etc.", 0, 1, type);
332          case -1684132297: /*nutritionProduct*/  return new Property("nutritionProduct", "CodeableReference(NutritionProduct)", "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.", 0, 1, nutritionProduct);
333          case -697920873: /*schedule*/  return new Property("schedule", "Timing", "Scheduled frequency of consumption.", 0, 1, schedule);
334          case -1413853096: /*amount*/  return new Property("amount", "Quantity", "Quantity of the specified food.", 0, 1, amount);
335          case 3493088: /*rate*/  return new Property("rate", "Quantity", "Rate at which enteral feeding was administered.", 0, 1, rate);
336          case -148762661: /*notConsumed*/  return new Property("notConsumed", "boolean", "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.", 0, 1, notConsumed);
337          case -440795649: /*notConsumedReason*/  return new Property("notConsumedReason", "CodeableConcept", "Document the reason the food or fluid was not consumed, such as refused, held, etc.", 0, 1, notConsumedReason);
338          default: return super.getNamedProperty(_hash, _name, _checkValid);
339          }
340
341        }
342
343      @Override
344      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
345        switch (hash) {
346        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
347        case -1684132297: /*nutritionProduct*/ return this.nutritionProduct == null ? new Base[0] : new Base[] {this.nutritionProduct}; // CodeableReference
348        case -697920873: /*schedule*/ return this.schedule == null ? new Base[0] : new Base[] {this.schedule}; // Timing
349        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Quantity
350        case 3493088: /*rate*/ return this.rate == null ? new Base[0] : new Base[] {this.rate}; // Quantity
351        case -148762661: /*notConsumed*/ return this.notConsumed == null ? new Base[0] : new Base[] {this.notConsumed}; // BooleanType
352        case -440795649: /*notConsumedReason*/ return this.notConsumedReason == null ? new Base[0] : new Base[] {this.notConsumedReason}; // CodeableConcept
353        default: return super.getProperty(hash, name, checkValid);
354        }
355
356      }
357
358      @Override
359      public Base setProperty(int hash, String name, Base value) throws FHIRException {
360        switch (hash) {
361        case 3575610: // type
362          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
363          return value;
364        case -1684132297: // nutritionProduct
365          this.nutritionProduct = TypeConvertor.castToCodeableReference(value); // CodeableReference
366          return value;
367        case -697920873: // schedule
368          this.schedule = TypeConvertor.castToTiming(value); // Timing
369          return value;
370        case -1413853096: // amount
371          this.amount = TypeConvertor.castToQuantity(value); // Quantity
372          return value;
373        case 3493088: // rate
374          this.rate = TypeConvertor.castToQuantity(value); // Quantity
375          return value;
376        case -148762661: // notConsumed
377          this.notConsumed = TypeConvertor.castToBoolean(value); // BooleanType
378          return value;
379        case -440795649: // notConsumedReason
380          this.notConsumedReason = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
381          return value;
382        default: return super.setProperty(hash, name, value);
383        }
384
385      }
386
387      @Override
388      public Base setProperty(String name, Base value) throws FHIRException {
389        if (name.equals("type")) {
390          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
391        } else if (name.equals("nutritionProduct")) {
392          this.nutritionProduct = TypeConvertor.castToCodeableReference(value); // CodeableReference
393        } else if (name.equals("schedule")) {
394          this.schedule = TypeConvertor.castToTiming(value); // Timing
395        } else if (name.equals("amount")) {
396          this.amount = TypeConvertor.castToQuantity(value); // Quantity
397        } else if (name.equals("rate")) {
398          this.rate = TypeConvertor.castToQuantity(value); // Quantity
399        } else if (name.equals("notConsumed")) {
400          this.notConsumed = TypeConvertor.castToBoolean(value); // BooleanType
401        } else if (name.equals("notConsumedReason")) {
402          this.notConsumedReason = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
403        } else
404          return super.setProperty(name, value);
405        return value;
406      }
407
408      @Override
409      public Base makeProperty(int hash, String name) throws FHIRException {
410        switch (hash) {
411        case 3575610:  return getType();
412        case -1684132297:  return getNutritionProduct();
413        case -697920873:  return getSchedule();
414        case -1413853096:  return getAmount();
415        case 3493088:  return getRate();
416        case -148762661:  return getNotConsumedElement();
417        case -440795649:  return getNotConsumedReason();
418        default: return super.makeProperty(hash, name);
419        }
420
421      }
422
423      @Override
424      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
425        switch (hash) {
426        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
427        case -1684132297: /*nutritionProduct*/ return new String[] {"CodeableReference"};
428        case -697920873: /*schedule*/ return new String[] {"Timing"};
429        case -1413853096: /*amount*/ return new String[] {"Quantity"};
430        case 3493088: /*rate*/ return new String[] {"Quantity"};
431        case -148762661: /*notConsumed*/ return new String[] {"boolean"};
432        case -440795649: /*notConsumedReason*/ return new String[] {"CodeableConcept"};
433        default: return super.getTypesForProperty(hash, name);
434        }
435
436      }
437
438      @Override
439      public Base addChild(String name) throws FHIRException {
440        if (name.equals("type")) {
441          this.type = new CodeableConcept();
442          return this.type;
443        }
444        else if (name.equals("nutritionProduct")) {
445          this.nutritionProduct = new CodeableReference();
446          return this.nutritionProduct;
447        }
448        else if (name.equals("schedule")) {
449          this.schedule = new Timing();
450          return this.schedule;
451        }
452        else if (name.equals("amount")) {
453          this.amount = new Quantity();
454          return this.amount;
455        }
456        else if (name.equals("rate")) {
457          this.rate = new Quantity();
458          return this.rate;
459        }
460        else if (name.equals("notConsumed")) {
461          throw new FHIRException("Cannot call addChild on a primitive type NutritionIntake.consumedItem.notConsumed");
462        }
463        else if (name.equals("notConsumedReason")) {
464          this.notConsumedReason = new CodeableConcept();
465          return this.notConsumedReason;
466        }
467        else
468          return super.addChild(name);
469      }
470
471      public NutritionIntakeConsumedItemComponent copy() {
472        NutritionIntakeConsumedItemComponent dst = new NutritionIntakeConsumedItemComponent();
473        copyValues(dst);
474        return dst;
475      }
476
477      public void copyValues(NutritionIntakeConsumedItemComponent dst) {
478        super.copyValues(dst);
479        dst.type = type == null ? null : type.copy();
480        dst.nutritionProduct = nutritionProduct == null ? null : nutritionProduct.copy();
481        dst.schedule = schedule == null ? null : schedule.copy();
482        dst.amount = amount == null ? null : amount.copy();
483        dst.rate = rate == null ? null : rate.copy();
484        dst.notConsumed = notConsumed == null ? null : notConsumed.copy();
485        dst.notConsumedReason = notConsumedReason == null ? null : notConsumedReason.copy();
486      }
487
488      @Override
489      public boolean equalsDeep(Base other_) {
490        if (!super.equalsDeep(other_))
491          return false;
492        if (!(other_ instanceof NutritionIntakeConsumedItemComponent))
493          return false;
494        NutritionIntakeConsumedItemComponent o = (NutritionIntakeConsumedItemComponent) other_;
495        return compareDeep(type, o.type, true) && compareDeep(nutritionProduct, o.nutritionProduct, true)
496           && compareDeep(schedule, o.schedule, true) && compareDeep(amount, o.amount, true) && compareDeep(rate, o.rate, true)
497           && compareDeep(notConsumed, o.notConsumed, true) && compareDeep(notConsumedReason, o.notConsumedReason, true)
498          ;
499      }
500
501      @Override
502      public boolean equalsShallow(Base other_) {
503        if (!super.equalsShallow(other_))
504          return false;
505        if (!(other_ instanceof NutritionIntakeConsumedItemComponent))
506          return false;
507        NutritionIntakeConsumedItemComponent o = (NutritionIntakeConsumedItemComponent) other_;
508        return compareValues(notConsumed, o.notConsumed, true);
509      }
510
511      public boolean isEmpty() {
512        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, nutritionProduct, schedule
513          , amount, rate, notConsumed, notConsumedReason);
514      }
515
516  public String fhirType() {
517    return "NutritionIntake.consumedItem";
518
519  }
520
521  }
522
523    @Block()
524    public static class NutritionIntakeIngredientLabelComponent extends BackboneElement implements IBaseBackboneElement {
525        /**
526         * Total nutrient consumed. This could be a macronutrient (protein, fat, carbohydrate), or a vitamin and mineral.
527         */
528        @Child(name = "nutrient", type = {CodeableReference.class}, order=1, min=1, max=1, modifier=false, summary=false)
529        @Description(shortDefinition="Total nutrient consumed", formalDefinition="Total nutrient consumed. This could be a macronutrient (protein, fat, carbohydrate), or a vitamin and mineral." )
530        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/nutrient-code")
531        protected CodeableReference nutrient;
532
533        /**
534         * Total amount of nutrient consumed.
535         */
536        @Child(name = "amount", type = {Quantity.class}, order=2, min=1, max=1, modifier=false, summary=false)
537        @Description(shortDefinition="Total amount of nutrient consumed", formalDefinition="Total amount of nutrient consumed." )
538        protected Quantity amount;
539
540        private static final long serialVersionUID = -193123424L;
541
542    /**
543     * Constructor
544     */
545      public NutritionIntakeIngredientLabelComponent() {
546        super();
547      }
548
549    /**
550     * Constructor
551     */
552      public NutritionIntakeIngredientLabelComponent(CodeableReference nutrient, Quantity amount) {
553        super();
554        this.setNutrient(nutrient);
555        this.setAmount(amount);
556      }
557
558        /**
559         * @return {@link #nutrient} (Total nutrient consumed. This could be a macronutrient (protein, fat, carbohydrate), or a vitamin and mineral.)
560         */
561        public CodeableReference getNutrient() { 
562          if (this.nutrient == null)
563            if (Configuration.errorOnAutoCreate())
564              throw new Error("Attempt to auto-create NutritionIntakeIngredientLabelComponent.nutrient");
565            else if (Configuration.doAutoCreate())
566              this.nutrient = new CodeableReference(); // cc
567          return this.nutrient;
568        }
569
570        public boolean hasNutrient() { 
571          return this.nutrient != null && !this.nutrient.isEmpty();
572        }
573
574        /**
575         * @param value {@link #nutrient} (Total nutrient consumed. This could be a macronutrient (protein, fat, carbohydrate), or a vitamin and mineral.)
576         */
577        public NutritionIntakeIngredientLabelComponent setNutrient(CodeableReference value) { 
578          this.nutrient = value;
579          return this;
580        }
581
582        /**
583         * @return {@link #amount} (Total amount of nutrient consumed.)
584         */
585        public Quantity getAmount() { 
586          if (this.amount == null)
587            if (Configuration.errorOnAutoCreate())
588              throw new Error("Attempt to auto-create NutritionIntakeIngredientLabelComponent.amount");
589            else if (Configuration.doAutoCreate())
590              this.amount = new Quantity(); // cc
591          return this.amount;
592        }
593
594        public boolean hasAmount() { 
595          return this.amount != null && !this.amount.isEmpty();
596        }
597
598        /**
599         * @param value {@link #amount} (Total amount of nutrient consumed.)
600         */
601        public NutritionIntakeIngredientLabelComponent setAmount(Quantity value) { 
602          this.amount = value;
603          return this;
604        }
605
606        protected void listChildren(List<Property> children) {
607          super.listChildren(children);
608          children.add(new Property("nutrient", "CodeableReference(Substance)", "Total nutrient consumed. This could be a macronutrient (protein, fat, carbohydrate), or a vitamin and mineral.", 0, 1, nutrient));
609          children.add(new Property("amount", "Quantity", "Total amount of nutrient consumed.", 0, 1, amount));
610        }
611
612        @Override
613        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
614          switch (_hash) {
615          case -1671151641: /*nutrient*/  return new Property("nutrient", "CodeableReference(Substance)", "Total nutrient consumed. This could be a macronutrient (protein, fat, carbohydrate), or a vitamin and mineral.", 0, 1, nutrient);
616          case -1413853096: /*amount*/  return new Property("amount", "Quantity", "Total amount of nutrient consumed.", 0, 1, amount);
617          default: return super.getNamedProperty(_hash, _name, _checkValid);
618          }
619
620        }
621
622      @Override
623      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
624        switch (hash) {
625        case -1671151641: /*nutrient*/ return this.nutrient == null ? new Base[0] : new Base[] {this.nutrient}; // CodeableReference
626        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Quantity
627        default: return super.getProperty(hash, name, checkValid);
628        }
629
630      }
631
632      @Override
633      public Base setProperty(int hash, String name, Base value) throws FHIRException {
634        switch (hash) {
635        case -1671151641: // nutrient
636          this.nutrient = TypeConvertor.castToCodeableReference(value); // CodeableReference
637          return value;
638        case -1413853096: // amount
639          this.amount = TypeConvertor.castToQuantity(value); // Quantity
640          return value;
641        default: return super.setProperty(hash, name, value);
642        }
643
644      }
645
646      @Override
647      public Base setProperty(String name, Base value) throws FHIRException {
648        if (name.equals("nutrient")) {
649          this.nutrient = TypeConvertor.castToCodeableReference(value); // CodeableReference
650        } else if (name.equals("amount")) {
651          this.amount = TypeConvertor.castToQuantity(value); // Quantity
652        } else
653          return super.setProperty(name, value);
654        return value;
655      }
656
657      @Override
658      public Base makeProperty(int hash, String name) throws FHIRException {
659        switch (hash) {
660        case -1671151641:  return getNutrient();
661        case -1413853096:  return getAmount();
662        default: return super.makeProperty(hash, name);
663        }
664
665      }
666
667      @Override
668      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
669        switch (hash) {
670        case -1671151641: /*nutrient*/ return new String[] {"CodeableReference"};
671        case -1413853096: /*amount*/ return new String[] {"Quantity"};
672        default: return super.getTypesForProperty(hash, name);
673        }
674
675      }
676
677      @Override
678      public Base addChild(String name) throws FHIRException {
679        if (name.equals("nutrient")) {
680          this.nutrient = new CodeableReference();
681          return this.nutrient;
682        }
683        else if (name.equals("amount")) {
684          this.amount = new Quantity();
685          return this.amount;
686        }
687        else
688          return super.addChild(name);
689      }
690
691      public NutritionIntakeIngredientLabelComponent copy() {
692        NutritionIntakeIngredientLabelComponent dst = new NutritionIntakeIngredientLabelComponent();
693        copyValues(dst);
694        return dst;
695      }
696
697      public void copyValues(NutritionIntakeIngredientLabelComponent dst) {
698        super.copyValues(dst);
699        dst.nutrient = nutrient == null ? null : nutrient.copy();
700        dst.amount = amount == null ? null : amount.copy();
701      }
702
703      @Override
704      public boolean equalsDeep(Base other_) {
705        if (!super.equalsDeep(other_))
706          return false;
707        if (!(other_ instanceof NutritionIntakeIngredientLabelComponent))
708          return false;
709        NutritionIntakeIngredientLabelComponent o = (NutritionIntakeIngredientLabelComponent) other_;
710        return compareDeep(nutrient, o.nutrient, true) && compareDeep(amount, o.amount, true);
711      }
712
713      @Override
714      public boolean equalsShallow(Base other_) {
715        if (!super.equalsShallow(other_))
716          return false;
717        if (!(other_ instanceof NutritionIntakeIngredientLabelComponent))
718          return false;
719        NutritionIntakeIngredientLabelComponent o = (NutritionIntakeIngredientLabelComponent) other_;
720        return true;
721      }
722
723      public boolean isEmpty() {
724        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(nutrient, amount);
725      }
726
727  public String fhirType() {
728    return "NutritionIntake.ingredientLabel";
729
730  }
731
732  }
733
734    @Block()
735    public static class NutritionIntakePerformerComponent extends BackboneElement implements IBaseBackboneElement {
736        /**
737         * Type of performer.
738         */
739        @Child(name = "function", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
740        @Description(shortDefinition="Type of performer", formalDefinition="Type of performer." )
741        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/performer-role")
742        protected CodeableConcept function;
743
744        /**
745         * Who performed the intake.
746         */
747        @Child(name = "actor", type = {Practitioner.class, PractitionerRole.class, Organization.class, CareTeam.class, Patient.class, Device.class, RelatedPerson.class}, order=2, min=1, max=1, modifier=false, summary=false)
748        @Description(shortDefinition="Who performed the intake", formalDefinition="Who performed the intake." )
749        protected Reference actor;
750
751        private static final long serialVersionUID = -576943815L;
752
753    /**
754     * Constructor
755     */
756      public NutritionIntakePerformerComponent() {
757        super();
758      }
759
760    /**
761     * Constructor
762     */
763      public NutritionIntakePerformerComponent(Reference actor) {
764        super();
765        this.setActor(actor);
766      }
767
768        /**
769         * @return {@link #function} (Type of performer.)
770         */
771        public CodeableConcept getFunction() { 
772          if (this.function == null)
773            if (Configuration.errorOnAutoCreate())
774              throw new Error("Attempt to auto-create NutritionIntakePerformerComponent.function");
775            else if (Configuration.doAutoCreate())
776              this.function = new CodeableConcept(); // cc
777          return this.function;
778        }
779
780        public boolean hasFunction() { 
781          return this.function != null && !this.function.isEmpty();
782        }
783
784        /**
785         * @param value {@link #function} (Type of performer.)
786         */
787        public NutritionIntakePerformerComponent setFunction(CodeableConcept value) { 
788          this.function = value;
789          return this;
790        }
791
792        /**
793         * @return {@link #actor} (Who performed the intake.)
794         */
795        public Reference getActor() { 
796          if (this.actor == null)
797            if (Configuration.errorOnAutoCreate())
798              throw new Error("Attempt to auto-create NutritionIntakePerformerComponent.actor");
799            else if (Configuration.doAutoCreate())
800              this.actor = new Reference(); // cc
801          return this.actor;
802        }
803
804        public boolean hasActor() { 
805          return this.actor != null && !this.actor.isEmpty();
806        }
807
808        /**
809         * @param value {@link #actor} (Who performed the intake.)
810         */
811        public NutritionIntakePerformerComponent setActor(Reference value) { 
812          this.actor = value;
813          return this;
814        }
815
816        protected void listChildren(List<Property> children) {
817          super.listChildren(children);
818          children.add(new Property("function", "CodeableConcept", "Type of performer.", 0, 1, function));
819          children.add(new Property("actor", "Reference(Practitioner|PractitionerRole|Organization|CareTeam|Patient|Device|RelatedPerson)", "Who performed the intake.", 0, 1, actor));
820        }
821
822        @Override
823        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
824          switch (_hash) {
825          case 1380938712: /*function*/  return new Property("function", "CodeableConcept", "Type of performer.", 0, 1, function);
826          case 92645877: /*actor*/  return new Property("actor", "Reference(Practitioner|PractitionerRole|Organization|CareTeam|Patient|Device|RelatedPerson)", "Who performed the intake.", 0, 1, actor);
827          default: return super.getNamedProperty(_hash, _name, _checkValid);
828          }
829
830        }
831
832      @Override
833      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
834        switch (hash) {
835        case 1380938712: /*function*/ return this.function == null ? new Base[0] : new Base[] {this.function}; // CodeableConcept
836        case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference
837        default: return super.getProperty(hash, name, checkValid);
838        }
839
840      }
841
842      @Override
843      public Base setProperty(int hash, String name, Base value) throws FHIRException {
844        switch (hash) {
845        case 1380938712: // function
846          this.function = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
847          return value;
848        case 92645877: // actor
849          this.actor = TypeConvertor.castToReference(value); // Reference
850          return value;
851        default: return super.setProperty(hash, name, value);
852        }
853
854      }
855
856      @Override
857      public Base setProperty(String name, Base value) throws FHIRException {
858        if (name.equals("function")) {
859          this.function = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
860        } else if (name.equals("actor")) {
861          this.actor = TypeConvertor.castToReference(value); // Reference
862        } else
863          return super.setProperty(name, value);
864        return value;
865      }
866
867      @Override
868      public Base makeProperty(int hash, String name) throws FHIRException {
869        switch (hash) {
870        case 1380938712:  return getFunction();
871        case 92645877:  return getActor();
872        default: return super.makeProperty(hash, name);
873        }
874
875      }
876
877      @Override
878      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
879        switch (hash) {
880        case 1380938712: /*function*/ return new String[] {"CodeableConcept"};
881        case 92645877: /*actor*/ return new String[] {"Reference"};
882        default: return super.getTypesForProperty(hash, name);
883        }
884
885      }
886
887      @Override
888      public Base addChild(String name) throws FHIRException {
889        if (name.equals("function")) {
890          this.function = new CodeableConcept();
891          return this.function;
892        }
893        else if (name.equals("actor")) {
894          this.actor = new Reference();
895          return this.actor;
896        }
897        else
898          return super.addChild(name);
899      }
900
901      public NutritionIntakePerformerComponent copy() {
902        NutritionIntakePerformerComponent dst = new NutritionIntakePerformerComponent();
903        copyValues(dst);
904        return dst;
905      }
906
907      public void copyValues(NutritionIntakePerformerComponent dst) {
908        super.copyValues(dst);
909        dst.function = function == null ? null : function.copy();
910        dst.actor = actor == null ? null : actor.copy();
911      }
912
913      @Override
914      public boolean equalsDeep(Base other_) {
915        if (!super.equalsDeep(other_))
916          return false;
917        if (!(other_ instanceof NutritionIntakePerformerComponent))
918          return false;
919        NutritionIntakePerformerComponent o = (NutritionIntakePerformerComponent) other_;
920        return compareDeep(function, o.function, true) && compareDeep(actor, o.actor, true);
921      }
922
923      @Override
924      public boolean equalsShallow(Base other_) {
925        if (!super.equalsShallow(other_))
926          return false;
927        if (!(other_ instanceof NutritionIntakePerformerComponent))
928          return false;
929        NutritionIntakePerformerComponent o = (NutritionIntakePerformerComponent) other_;
930        return true;
931      }
932
933      public boolean isEmpty() {
934        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(function, actor);
935      }
936
937  public String fhirType() {
938    return "NutritionIntake.performer";
939
940  }
941
942  }
943
944    /**
945     * 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.
946     */
947    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
948    @Description(shortDefinition="External identifier", formalDefinition="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." )
949    protected List<Identifier> identifier;
950
951    /**
952     * Instantiates FHIR protocol or definition.
953     */
954    @Child(name = "instantiatesCanonical", type = {CanonicalType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
955    @Description(shortDefinition="Instantiates FHIR protocol or definition", formalDefinition="Instantiates FHIR protocol or definition." )
956    protected List<CanonicalType> instantiatesCanonical;
957
958    /**
959     * Instantiates external protocol or definition.
960     */
961    @Child(name = "instantiatesUri", type = {UriType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
962    @Description(shortDefinition="Instantiates external protocol or definition", formalDefinition="Instantiates external protocol or definition." )
963    protected List<UriType> instantiatesUri;
964
965    /**
966     * A plan, proposal or order that is fulfilled in whole or in part by this event.
967     */
968    @Child(name = "basedOn", type = {NutritionOrder.class, CarePlan.class, ServiceRequest.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
969    @Description(shortDefinition="Fulfils plan, proposal or order", formalDefinition="A plan, proposal or order that is fulfilled in whole or in part by this event." )
970    protected List<Reference> basedOn;
971
972    /**
973     * A larger event of which this particular event is a component or step.
974     */
975    @Child(name = "partOf", type = {NutritionIntake.class, Procedure.class, Observation.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
976    @Description(shortDefinition="Part of referenced event", formalDefinition="A larger event of which this particular event is a component or step." )
977    protected List<Reference> partOf;
978
979    /**
980     * 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.
981     */
982    @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1, modifier=true, summary=true)
983    @Description(shortDefinition="preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown", formalDefinition="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." )
984    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/event-status")
985    protected Enumeration<EventStatus> status;
986
987    /**
988     * Captures the reason for the current state of the NutritionIntake.
989     */
990    @Child(name = "statusReason", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
991    @Description(shortDefinition="Reason for current status", formalDefinition="Captures the reason for the current state of the NutritionIntake." )
992    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/reason-medication-status-codes")
993    protected List<CodeableConcept> statusReason;
994
995    /**
996     * Type of nutrition intake setting/reporting.
997     */
998    @Child(name = "code", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true)
999    @Description(shortDefinition="Type of nutrition intake setting/reporting", formalDefinition="Type of nutrition intake setting/reporting." )
1000    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/diet-type")
1001    protected CodeableConcept code;
1002
1003    /**
1004     * The person, animal or group who is/was consuming the food or fluid.
1005     */
1006    @Child(name = "subject", type = {Patient.class, Group.class}, order=8, min=1, max=1, modifier=false, summary=true)
1007    @Description(shortDefinition="Who is/was consuming the food or fluid", formalDefinition="The person, animal or group who is/was consuming the food or fluid." )
1008    protected Reference subject;
1009
1010    /**
1011     * The encounter that establishes the context for this NutritionIntake.
1012     */
1013    @Child(name = "encounter", type = {Encounter.class}, order=9, min=0, max=1, modifier=false, summary=true)
1014    @Description(shortDefinition="Encounter associated with NutritionIntake", formalDefinition="The encounter that establishes the context for this NutritionIntake." )
1015    protected Reference encounter;
1016
1017    /**
1018     * The interval of time during which it is being asserted that the patient is/was consuming the food or fluid.
1019     */
1020    @Child(name = "occurrence", type = {DateTimeType.class, Period.class}, order=10, min=0, max=1, modifier=false, summary=true)
1021    @Description(shortDefinition="The date/time or interval when the food or fluid is/was consumed", formalDefinition="The interval of time during which it is being asserted that the patient is/was consuming the food or fluid." )
1022    protected DataType occurrence;
1023
1024    /**
1025     * The date when the Nutrition Intake was asserted by the information source.
1026     */
1027    @Child(name = "recorded", type = {DateTimeType.class}, order=11, min=0, max=1, modifier=false, summary=true)
1028    @Description(shortDefinition="When the intake was recorded", formalDefinition="The date when the Nutrition Intake was asserted by the information source." )
1029    protected DateTimeType recorded;
1030
1031    /**
1032     * 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.
1033     */
1034    @Child(name = "reported", type = {BooleanType.class, Patient.class, RelatedPerson.class, Practitioner.class, PractitionerRole.class, Organization.class}, order=12, min=0, max=1, modifier=false, summary=false)
1035    @Description(shortDefinition="Person or organization that provided the information about the consumption of this food or fluid", formalDefinition="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." )
1036    protected DataType reported;
1037
1038    /**
1039     * What food or fluid product or item was consumed.
1040     */
1041    @Child(name = "consumedItem", type = {}, order=13, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1042    @Description(shortDefinition="What food or fluid product or item was consumed", formalDefinition="What food or fluid product or item was consumed." )
1043    protected List<NutritionIntakeConsumedItemComponent> consumedItem;
1044
1045    /**
1046     * Total nutrient amounts for the whole meal, product, serving, etc.
1047     */
1048    @Child(name = "ingredientLabel", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1049    @Description(shortDefinition="Total nutrient for the whole meal, product, serving", formalDefinition="Total nutrient amounts for the whole meal, product, serving, etc." )
1050    protected List<NutritionIntakeIngredientLabelComponent> ingredientLabel;
1051
1052    /**
1053     * Who performed the intake and how they were involved.
1054     */
1055    @Child(name = "performer", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1056    @Description(shortDefinition="Who was performed in the intake", formalDefinition="Who performed the intake and how they were involved." )
1057    protected List<NutritionIntakePerformerComponent> performer;
1058
1059    /**
1060     * Where the intake occurred.
1061     */
1062    @Child(name = "location", type = {Location.class}, order=16, min=0, max=1, modifier=false, summary=false)
1063    @Description(shortDefinition="Where the intake occurred", formalDefinition="Where the intake occurred." )
1064    protected Reference location;
1065
1066    /**
1067     * Allows linking the NutritionIntake to the underlying NutritionOrder, or to other information, such as AllergyIntolerance, that supports or is used to derive the NutritionIntake.
1068     */
1069    @Child(name = "derivedFrom", type = {Reference.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1070    @Description(shortDefinition="Additional supporting information", formalDefinition="Allows linking the NutritionIntake to the underlying NutritionOrder, or to other information, such as AllergyIntolerance, that supports or is used to derive the NutritionIntake." )
1071    protected List<Reference> derivedFrom;
1072
1073    /**
1074     * A reason, Condition or observation for why the food or fluid is /was consumed.
1075     */
1076    @Child(name = "reason", type = {CodeableReference.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1077    @Description(shortDefinition="Reason for why the food or fluid is /was consumed", formalDefinition="A reason, Condition or observation for why the food or fluid is /was consumed." )
1078    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-code")
1079    protected List<CodeableReference> reason;
1080
1081    /**
1082     * Provides extra information about the Nutrition Intake that is not conveyed by the other attributes.
1083     */
1084    @Child(name = "note", type = {Annotation.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1085    @Description(shortDefinition="Further information about the consumption", formalDefinition="Provides extra information about the Nutrition Intake that is not conveyed by the other attributes." )
1086    protected List<Annotation> note;
1087
1088    private static final long serialVersionUID = 890692162L;
1089
1090  /**
1091   * Constructor
1092   */
1093    public NutritionIntake() {
1094      super();
1095    }
1096
1097  /**
1098   * Constructor
1099   */
1100    public NutritionIntake(EventStatus status, Reference subject, NutritionIntakeConsumedItemComponent consumedItem) {
1101      super();
1102      this.setStatus(status);
1103      this.setSubject(subject);
1104      this.addConsumedItem(consumedItem);
1105    }
1106
1107    /**
1108     * @return {@link #identifier} (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.)
1109     */
1110    public List<Identifier> getIdentifier() { 
1111      if (this.identifier == null)
1112        this.identifier = new ArrayList<Identifier>();
1113      return this.identifier;
1114    }
1115
1116    /**
1117     * @return Returns a reference to <code>this</code> for easy method chaining
1118     */
1119    public NutritionIntake setIdentifier(List<Identifier> theIdentifier) { 
1120      this.identifier = theIdentifier;
1121      return this;
1122    }
1123
1124    public boolean hasIdentifier() { 
1125      if (this.identifier == null)
1126        return false;
1127      for (Identifier item : this.identifier)
1128        if (!item.isEmpty())
1129          return true;
1130      return false;
1131    }
1132
1133    public Identifier addIdentifier() { //3
1134      Identifier t = new Identifier();
1135      if (this.identifier == null)
1136        this.identifier = new ArrayList<Identifier>();
1137      this.identifier.add(t);
1138      return t;
1139    }
1140
1141    public NutritionIntake addIdentifier(Identifier t) { //3
1142      if (t == null)
1143        return this;
1144      if (this.identifier == null)
1145        this.identifier = new ArrayList<Identifier>();
1146      this.identifier.add(t);
1147      return this;
1148    }
1149
1150    /**
1151     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1152     */
1153    public Identifier getIdentifierFirstRep() { 
1154      if (getIdentifier().isEmpty()) {
1155        addIdentifier();
1156      }
1157      return getIdentifier().get(0);
1158    }
1159
1160    /**
1161     * @return {@link #instantiatesCanonical} (Instantiates FHIR protocol or definition.)
1162     */
1163    public List<CanonicalType> getInstantiatesCanonical() { 
1164      if (this.instantiatesCanonical == null)
1165        this.instantiatesCanonical = new ArrayList<CanonicalType>();
1166      return this.instantiatesCanonical;
1167    }
1168
1169    /**
1170     * @return Returns a reference to <code>this</code> for easy method chaining
1171     */
1172    public NutritionIntake setInstantiatesCanonical(List<CanonicalType> theInstantiatesCanonical) { 
1173      this.instantiatesCanonical = theInstantiatesCanonical;
1174      return this;
1175    }
1176
1177    public boolean hasInstantiatesCanonical() { 
1178      if (this.instantiatesCanonical == null)
1179        return false;
1180      for (CanonicalType item : this.instantiatesCanonical)
1181        if (!item.isEmpty())
1182          return true;
1183      return false;
1184    }
1185
1186    /**
1187     * @return {@link #instantiatesCanonical} (Instantiates FHIR protocol or definition.)
1188     */
1189    public CanonicalType addInstantiatesCanonicalElement() {//2 
1190      CanonicalType t = new CanonicalType();
1191      if (this.instantiatesCanonical == null)
1192        this.instantiatesCanonical = new ArrayList<CanonicalType>();
1193      this.instantiatesCanonical.add(t);
1194      return t;
1195    }
1196
1197    /**
1198     * @param value {@link #instantiatesCanonical} (Instantiates FHIR protocol or definition.)
1199     */
1200    public NutritionIntake addInstantiatesCanonical(String value) { //1
1201      CanonicalType t = new CanonicalType();
1202      t.setValue(value);
1203      if (this.instantiatesCanonical == null)
1204        this.instantiatesCanonical = new ArrayList<CanonicalType>();
1205      this.instantiatesCanonical.add(t);
1206      return this;
1207    }
1208
1209    /**
1210     * @param value {@link #instantiatesCanonical} (Instantiates FHIR protocol or definition.)
1211     */
1212    public boolean hasInstantiatesCanonical(String value) { 
1213      if (this.instantiatesCanonical == null)
1214        return false;
1215      for (CanonicalType v : this.instantiatesCanonical)
1216        if (v.getValue().equals(value)) // canonical
1217          return true;
1218      return false;
1219    }
1220
1221    /**
1222     * @return {@link #instantiatesUri} (Instantiates external protocol or definition.)
1223     */
1224    public List<UriType> getInstantiatesUri() { 
1225      if (this.instantiatesUri == null)
1226        this.instantiatesUri = new ArrayList<UriType>();
1227      return this.instantiatesUri;
1228    }
1229
1230    /**
1231     * @return Returns a reference to <code>this</code> for easy method chaining
1232     */
1233    public NutritionIntake setInstantiatesUri(List<UriType> theInstantiatesUri) { 
1234      this.instantiatesUri = theInstantiatesUri;
1235      return this;
1236    }
1237
1238    public boolean hasInstantiatesUri() { 
1239      if (this.instantiatesUri == null)
1240        return false;
1241      for (UriType item : this.instantiatesUri)
1242        if (!item.isEmpty())
1243          return true;
1244      return false;
1245    }
1246
1247    /**
1248     * @return {@link #instantiatesUri} (Instantiates external protocol or definition.)
1249     */
1250    public UriType addInstantiatesUriElement() {//2 
1251      UriType t = new UriType();
1252      if (this.instantiatesUri == null)
1253        this.instantiatesUri = new ArrayList<UriType>();
1254      this.instantiatesUri.add(t);
1255      return t;
1256    }
1257
1258    /**
1259     * @param value {@link #instantiatesUri} (Instantiates external protocol or definition.)
1260     */
1261    public NutritionIntake addInstantiatesUri(String value) { //1
1262      UriType t = new UriType();
1263      t.setValue(value);
1264      if (this.instantiatesUri == null)
1265        this.instantiatesUri = new ArrayList<UriType>();
1266      this.instantiatesUri.add(t);
1267      return this;
1268    }
1269
1270    /**
1271     * @param value {@link #instantiatesUri} (Instantiates external protocol or definition.)
1272     */
1273    public boolean hasInstantiatesUri(String value) { 
1274      if (this.instantiatesUri == null)
1275        return false;
1276      for (UriType v : this.instantiatesUri)
1277        if (v.getValue().equals(value)) // uri
1278          return true;
1279      return false;
1280    }
1281
1282    /**
1283     * @return {@link #basedOn} (A plan, proposal or order that is fulfilled in whole or in part by this event.)
1284     */
1285    public List<Reference> getBasedOn() { 
1286      if (this.basedOn == null)
1287        this.basedOn = new ArrayList<Reference>();
1288      return this.basedOn;
1289    }
1290
1291    /**
1292     * @return Returns a reference to <code>this</code> for easy method chaining
1293     */
1294    public NutritionIntake setBasedOn(List<Reference> theBasedOn) { 
1295      this.basedOn = theBasedOn;
1296      return this;
1297    }
1298
1299    public boolean hasBasedOn() { 
1300      if (this.basedOn == null)
1301        return false;
1302      for (Reference item : this.basedOn)
1303        if (!item.isEmpty())
1304          return true;
1305      return false;
1306    }
1307
1308    public Reference addBasedOn() { //3
1309      Reference t = new Reference();
1310      if (this.basedOn == null)
1311        this.basedOn = new ArrayList<Reference>();
1312      this.basedOn.add(t);
1313      return t;
1314    }
1315
1316    public NutritionIntake addBasedOn(Reference t) { //3
1317      if (t == null)
1318        return this;
1319      if (this.basedOn == null)
1320        this.basedOn = new ArrayList<Reference>();
1321      this.basedOn.add(t);
1322      return this;
1323    }
1324
1325    /**
1326     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist {3}
1327     */
1328    public Reference getBasedOnFirstRep() { 
1329      if (getBasedOn().isEmpty()) {
1330        addBasedOn();
1331      }
1332      return getBasedOn().get(0);
1333    }
1334
1335    /**
1336     * @return {@link #partOf} (A larger event of which this particular event is a component or step.)
1337     */
1338    public List<Reference> getPartOf() { 
1339      if (this.partOf == null)
1340        this.partOf = new ArrayList<Reference>();
1341      return this.partOf;
1342    }
1343
1344    /**
1345     * @return Returns a reference to <code>this</code> for easy method chaining
1346     */
1347    public NutritionIntake setPartOf(List<Reference> thePartOf) { 
1348      this.partOf = thePartOf;
1349      return this;
1350    }
1351
1352    public boolean hasPartOf() { 
1353      if (this.partOf == null)
1354        return false;
1355      for (Reference item : this.partOf)
1356        if (!item.isEmpty())
1357          return true;
1358      return false;
1359    }
1360
1361    public Reference addPartOf() { //3
1362      Reference t = new Reference();
1363      if (this.partOf == null)
1364        this.partOf = new ArrayList<Reference>();
1365      this.partOf.add(t);
1366      return t;
1367    }
1368
1369    public NutritionIntake addPartOf(Reference t) { //3
1370      if (t == null)
1371        return this;
1372      if (this.partOf == null)
1373        this.partOf = new ArrayList<Reference>();
1374      this.partOf.add(t);
1375      return this;
1376    }
1377
1378    /**
1379     * @return The first repetition of repeating field {@link #partOf}, creating it if it does not already exist {3}
1380     */
1381    public Reference getPartOfFirstRep() { 
1382      if (getPartOf().isEmpty()) {
1383        addPartOf();
1384      }
1385      return getPartOf().get(0);
1386    }
1387
1388    /**
1389     * @return {@link #status} (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.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1390     */
1391    public Enumeration<EventStatus> getStatusElement() { 
1392      if (this.status == null)
1393        if (Configuration.errorOnAutoCreate())
1394          throw new Error("Attempt to auto-create NutritionIntake.status");
1395        else if (Configuration.doAutoCreate())
1396          this.status = new Enumeration<EventStatus>(new EventStatusEnumFactory()); // bb
1397      return this.status;
1398    }
1399
1400    public boolean hasStatusElement() { 
1401      return this.status != null && !this.status.isEmpty();
1402    }
1403
1404    public boolean hasStatus() { 
1405      return this.status != null && !this.status.isEmpty();
1406    }
1407
1408    /**
1409     * @param value {@link #status} (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.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1410     */
1411    public NutritionIntake setStatusElement(Enumeration<EventStatus> value) { 
1412      this.status = value;
1413      return this;
1414    }
1415
1416    /**
1417     * @return 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.
1418     */
1419    public EventStatus getStatus() { 
1420      return this.status == null ? null : this.status.getValue();
1421    }
1422
1423    /**
1424     * @param value 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.
1425     */
1426    public NutritionIntake setStatus(EventStatus value) { 
1427        if (this.status == null)
1428          this.status = new Enumeration<EventStatus>(new EventStatusEnumFactory());
1429        this.status.setValue(value);
1430      return this;
1431    }
1432
1433    /**
1434     * @return {@link #statusReason} (Captures the reason for the current state of the NutritionIntake.)
1435     */
1436    public List<CodeableConcept> getStatusReason() { 
1437      if (this.statusReason == null)
1438        this.statusReason = new ArrayList<CodeableConcept>();
1439      return this.statusReason;
1440    }
1441
1442    /**
1443     * @return Returns a reference to <code>this</code> for easy method chaining
1444     */
1445    public NutritionIntake setStatusReason(List<CodeableConcept> theStatusReason) { 
1446      this.statusReason = theStatusReason;
1447      return this;
1448    }
1449
1450    public boolean hasStatusReason() { 
1451      if (this.statusReason == null)
1452        return false;
1453      for (CodeableConcept item : this.statusReason)
1454        if (!item.isEmpty())
1455          return true;
1456      return false;
1457    }
1458
1459    public CodeableConcept addStatusReason() { //3
1460      CodeableConcept t = new CodeableConcept();
1461      if (this.statusReason == null)
1462        this.statusReason = new ArrayList<CodeableConcept>();
1463      this.statusReason.add(t);
1464      return t;
1465    }
1466
1467    public NutritionIntake addStatusReason(CodeableConcept t) { //3
1468      if (t == null)
1469        return this;
1470      if (this.statusReason == null)
1471        this.statusReason = new ArrayList<CodeableConcept>();
1472      this.statusReason.add(t);
1473      return this;
1474    }
1475
1476    /**
1477     * @return The first repetition of repeating field {@link #statusReason}, creating it if it does not already exist {3}
1478     */
1479    public CodeableConcept getStatusReasonFirstRep() { 
1480      if (getStatusReason().isEmpty()) {
1481        addStatusReason();
1482      }
1483      return getStatusReason().get(0);
1484    }
1485
1486    /**
1487     * @return {@link #code} (Type of nutrition intake setting/reporting.)
1488     */
1489    public CodeableConcept getCode() { 
1490      if (this.code == null)
1491        if (Configuration.errorOnAutoCreate())
1492          throw new Error("Attempt to auto-create NutritionIntake.code");
1493        else if (Configuration.doAutoCreate())
1494          this.code = new CodeableConcept(); // cc
1495      return this.code;
1496    }
1497
1498    public boolean hasCode() { 
1499      return this.code != null && !this.code.isEmpty();
1500    }
1501
1502    /**
1503     * @param value {@link #code} (Type of nutrition intake setting/reporting.)
1504     */
1505    public NutritionIntake setCode(CodeableConcept value) { 
1506      this.code = value;
1507      return this;
1508    }
1509
1510    /**
1511     * @return {@link #subject} (The person, animal or group who is/was consuming the food or fluid.)
1512     */
1513    public Reference getSubject() { 
1514      if (this.subject == null)
1515        if (Configuration.errorOnAutoCreate())
1516          throw new Error("Attempt to auto-create NutritionIntake.subject");
1517        else if (Configuration.doAutoCreate())
1518          this.subject = new Reference(); // cc
1519      return this.subject;
1520    }
1521
1522    public boolean hasSubject() { 
1523      return this.subject != null && !this.subject.isEmpty();
1524    }
1525
1526    /**
1527     * @param value {@link #subject} (The person, animal or group who is/was consuming the food or fluid.)
1528     */
1529    public NutritionIntake setSubject(Reference value) { 
1530      this.subject = value;
1531      return this;
1532    }
1533
1534    /**
1535     * @return {@link #encounter} (The encounter that establishes the context for this NutritionIntake.)
1536     */
1537    public Reference getEncounter() { 
1538      if (this.encounter == null)
1539        if (Configuration.errorOnAutoCreate())
1540          throw new Error("Attempt to auto-create NutritionIntake.encounter");
1541        else if (Configuration.doAutoCreate())
1542          this.encounter = new Reference(); // cc
1543      return this.encounter;
1544    }
1545
1546    public boolean hasEncounter() { 
1547      return this.encounter != null && !this.encounter.isEmpty();
1548    }
1549
1550    /**
1551     * @param value {@link #encounter} (The encounter that establishes the context for this NutritionIntake.)
1552     */
1553    public NutritionIntake setEncounter(Reference value) { 
1554      this.encounter = value;
1555      return this;
1556    }
1557
1558    /**
1559     * @return {@link #occurrence} (The interval of time during which it is being asserted that the patient is/was consuming the food or fluid.)
1560     */
1561    public DataType getOccurrence() { 
1562      return this.occurrence;
1563    }
1564
1565    /**
1566     * @return {@link #occurrence} (The interval of time during which it is being asserted that the patient is/was consuming the food or fluid.)
1567     */
1568    public DateTimeType getOccurrenceDateTimeType() throws FHIRException { 
1569      if (this.occurrence == null)
1570        this.occurrence = new DateTimeType();
1571      if (!(this.occurrence instanceof DateTimeType))
1572        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.occurrence.getClass().getName()+" was encountered");
1573      return (DateTimeType) this.occurrence;
1574    }
1575
1576    public boolean hasOccurrenceDateTimeType() { 
1577      return this != null && this.occurrence instanceof DateTimeType;
1578    }
1579
1580    /**
1581     * @return {@link #occurrence} (The interval of time during which it is being asserted that the patient is/was consuming the food or fluid.)
1582     */
1583    public Period getOccurrencePeriod() throws FHIRException { 
1584      if (this.occurrence == null)
1585        this.occurrence = new Period();
1586      if (!(this.occurrence instanceof Period))
1587        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.occurrence.getClass().getName()+" was encountered");
1588      return (Period) this.occurrence;
1589    }
1590
1591    public boolean hasOccurrencePeriod() { 
1592      return this != null && this.occurrence instanceof Period;
1593    }
1594
1595    public boolean hasOccurrence() { 
1596      return this.occurrence != null && !this.occurrence.isEmpty();
1597    }
1598
1599    /**
1600     * @param value {@link #occurrence} (The interval of time during which it is being asserted that the patient is/was consuming the food or fluid.)
1601     */
1602    public NutritionIntake setOccurrence(DataType value) { 
1603      if (value != null && !(value instanceof DateTimeType || value instanceof Period))
1604        throw new Error("Not the right type for NutritionIntake.occurrence[x]: "+value.fhirType());
1605      this.occurrence = value;
1606      return this;
1607    }
1608
1609    /**
1610     * @return {@link #recorded} (The date when the Nutrition Intake was asserted by the information source.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value
1611     */
1612    public DateTimeType getRecordedElement() { 
1613      if (this.recorded == null)
1614        if (Configuration.errorOnAutoCreate())
1615          throw new Error("Attempt to auto-create NutritionIntake.recorded");
1616        else if (Configuration.doAutoCreate())
1617          this.recorded = new DateTimeType(); // bb
1618      return this.recorded;
1619    }
1620
1621    public boolean hasRecordedElement() { 
1622      return this.recorded != null && !this.recorded.isEmpty();
1623    }
1624
1625    public boolean hasRecorded() { 
1626      return this.recorded != null && !this.recorded.isEmpty();
1627    }
1628
1629    /**
1630     * @param value {@link #recorded} (The date when the Nutrition Intake was asserted by the information source.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value
1631     */
1632    public NutritionIntake setRecordedElement(DateTimeType value) { 
1633      this.recorded = value;
1634      return this;
1635    }
1636
1637    /**
1638     * @return The date when the Nutrition Intake was asserted by the information source.
1639     */
1640    public Date getRecorded() { 
1641      return this.recorded == null ? null : this.recorded.getValue();
1642    }
1643
1644    /**
1645     * @param value The date when the Nutrition Intake was asserted by the information source.
1646     */
1647    public NutritionIntake setRecorded(Date value) { 
1648      if (value == null)
1649        this.recorded = null;
1650      else {
1651        if (this.recorded == null)
1652          this.recorded = new DateTimeType();
1653        this.recorded.setValue(value);
1654      }
1655      return this;
1656    }
1657
1658    /**
1659     * @return {@link #reported} (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.)
1660     */
1661    public DataType getReported() { 
1662      return this.reported;
1663    }
1664
1665    /**
1666     * @return {@link #reported} (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.)
1667     */
1668    public BooleanType getReportedBooleanType() throws FHIRException { 
1669      if (this.reported == null)
1670        this.reported = new BooleanType();
1671      if (!(this.reported instanceof BooleanType))
1672        throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.reported.getClass().getName()+" was encountered");
1673      return (BooleanType) this.reported;
1674    }
1675
1676    public boolean hasReportedBooleanType() { 
1677      return this != null && this.reported instanceof BooleanType;
1678    }
1679
1680    /**
1681     * @return {@link #reported} (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.)
1682     */
1683    public Reference getReportedReference() throws FHIRException { 
1684      if (this.reported == null)
1685        this.reported = new Reference();
1686      if (!(this.reported instanceof Reference))
1687        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.reported.getClass().getName()+" was encountered");
1688      return (Reference) this.reported;
1689    }
1690
1691    public boolean hasReportedReference() { 
1692      return this != null && this.reported instanceof Reference;
1693    }
1694
1695    public boolean hasReported() { 
1696      return this.reported != null && !this.reported.isEmpty();
1697    }
1698
1699    /**
1700     * @param value {@link #reported} (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.)
1701     */
1702    public NutritionIntake setReported(DataType value) { 
1703      if (value != null && !(value instanceof BooleanType || value instanceof Reference))
1704        throw new Error("Not the right type for NutritionIntake.reported[x]: "+value.fhirType());
1705      this.reported = value;
1706      return this;
1707    }
1708
1709    /**
1710     * @return {@link #consumedItem} (What food or fluid product or item was consumed.)
1711     */
1712    public List<NutritionIntakeConsumedItemComponent> getConsumedItem() { 
1713      if (this.consumedItem == null)
1714        this.consumedItem = new ArrayList<NutritionIntakeConsumedItemComponent>();
1715      return this.consumedItem;
1716    }
1717
1718    /**
1719     * @return Returns a reference to <code>this</code> for easy method chaining
1720     */
1721    public NutritionIntake setConsumedItem(List<NutritionIntakeConsumedItemComponent> theConsumedItem) { 
1722      this.consumedItem = theConsumedItem;
1723      return this;
1724    }
1725
1726    public boolean hasConsumedItem() { 
1727      if (this.consumedItem == null)
1728        return false;
1729      for (NutritionIntakeConsumedItemComponent item : this.consumedItem)
1730        if (!item.isEmpty())
1731          return true;
1732      return false;
1733    }
1734
1735    public NutritionIntakeConsumedItemComponent addConsumedItem() { //3
1736      NutritionIntakeConsumedItemComponent t = new NutritionIntakeConsumedItemComponent();
1737      if (this.consumedItem == null)
1738        this.consumedItem = new ArrayList<NutritionIntakeConsumedItemComponent>();
1739      this.consumedItem.add(t);
1740      return t;
1741    }
1742
1743    public NutritionIntake addConsumedItem(NutritionIntakeConsumedItemComponent t) { //3
1744      if (t == null)
1745        return this;
1746      if (this.consumedItem == null)
1747        this.consumedItem = new ArrayList<NutritionIntakeConsumedItemComponent>();
1748      this.consumedItem.add(t);
1749      return this;
1750    }
1751
1752    /**
1753     * @return The first repetition of repeating field {@link #consumedItem}, creating it if it does not already exist {3}
1754     */
1755    public NutritionIntakeConsumedItemComponent getConsumedItemFirstRep() { 
1756      if (getConsumedItem().isEmpty()) {
1757        addConsumedItem();
1758      }
1759      return getConsumedItem().get(0);
1760    }
1761
1762    /**
1763     * @return {@link #ingredientLabel} (Total nutrient amounts for the whole meal, product, serving, etc.)
1764     */
1765    public List<NutritionIntakeIngredientLabelComponent> getIngredientLabel() { 
1766      if (this.ingredientLabel == null)
1767        this.ingredientLabel = new ArrayList<NutritionIntakeIngredientLabelComponent>();
1768      return this.ingredientLabel;
1769    }
1770
1771    /**
1772     * @return Returns a reference to <code>this</code> for easy method chaining
1773     */
1774    public NutritionIntake setIngredientLabel(List<NutritionIntakeIngredientLabelComponent> theIngredientLabel) { 
1775      this.ingredientLabel = theIngredientLabel;
1776      return this;
1777    }
1778
1779    public boolean hasIngredientLabel() { 
1780      if (this.ingredientLabel == null)
1781        return false;
1782      for (NutritionIntakeIngredientLabelComponent item : this.ingredientLabel)
1783        if (!item.isEmpty())
1784          return true;
1785      return false;
1786    }
1787
1788    public NutritionIntakeIngredientLabelComponent addIngredientLabel() { //3
1789      NutritionIntakeIngredientLabelComponent t = new NutritionIntakeIngredientLabelComponent();
1790      if (this.ingredientLabel == null)
1791        this.ingredientLabel = new ArrayList<NutritionIntakeIngredientLabelComponent>();
1792      this.ingredientLabel.add(t);
1793      return t;
1794    }
1795
1796    public NutritionIntake addIngredientLabel(NutritionIntakeIngredientLabelComponent t) { //3
1797      if (t == null)
1798        return this;
1799      if (this.ingredientLabel == null)
1800        this.ingredientLabel = new ArrayList<NutritionIntakeIngredientLabelComponent>();
1801      this.ingredientLabel.add(t);
1802      return this;
1803    }
1804
1805    /**
1806     * @return The first repetition of repeating field {@link #ingredientLabel}, creating it if it does not already exist {3}
1807     */
1808    public NutritionIntakeIngredientLabelComponent getIngredientLabelFirstRep() { 
1809      if (getIngredientLabel().isEmpty()) {
1810        addIngredientLabel();
1811      }
1812      return getIngredientLabel().get(0);
1813    }
1814
1815    /**
1816     * @return {@link #performer} (Who performed the intake and how they were involved.)
1817     */
1818    public List<NutritionIntakePerformerComponent> getPerformer() { 
1819      if (this.performer == null)
1820        this.performer = new ArrayList<NutritionIntakePerformerComponent>();
1821      return this.performer;
1822    }
1823
1824    /**
1825     * @return Returns a reference to <code>this</code> for easy method chaining
1826     */
1827    public NutritionIntake setPerformer(List<NutritionIntakePerformerComponent> thePerformer) { 
1828      this.performer = thePerformer;
1829      return this;
1830    }
1831
1832    public boolean hasPerformer() { 
1833      if (this.performer == null)
1834        return false;
1835      for (NutritionIntakePerformerComponent item : this.performer)
1836        if (!item.isEmpty())
1837          return true;
1838      return false;
1839    }
1840
1841    public NutritionIntakePerformerComponent addPerformer() { //3
1842      NutritionIntakePerformerComponent t = new NutritionIntakePerformerComponent();
1843      if (this.performer == null)
1844        this.performer = new ArrayList<NutritionIntakePerformerComponent>();
1845      this.performer.add(t);
1846      return t;
1847    }
1848
1849    public NutritionIntake addPerformer(NutritionIntakePerformerComponent t) { //3
1850      if (t == null)
1851        return this;
1852      if (this.performer == null)
1853        this.performer = new ArrayList<NutritionIntakePerformerComponent>();
1854      this.performer.add(t);
1855      return this;
1856    }
1857
1858    /**
1859     * @return The first repetition of repeating field {@link #performer}, creating it if it does not already exist {3}
1860     */
1861    public NutritionIntakePerformerComponent getPerformerFirstRep() { 
1862      if (getPerformer().isEmpty()) {
1863        addPerformer();
1864      }
1865      return getPerformer().get(0);
1866    }
1867
1868    /**
1869     * @return {@link #location} (Where the intake occurred.)
1870     */
1871    public Reference getLocation() { 
1872      if (this.location == null)
1873        if (Configuration.errorOnAutoCreate())
1874          throw new Error("Attempt to auto-create NutritionIntake.location");
1875        else if (Configuration.doAutoCreate())
1876          this.location = new Reference(); // cc
1877      return this.location;
1878    }
1879
1880    public boolean hasLocation() { 
1881      return this.location != null && !this.location.isEmpty();
1882    }
1883
1884    /**
1885     * @param value {@link #location} (Where the intake occurred.)
1886     */
1887    public NutritionIntake setLocation(Reference value) { 
1888      this.location = value;
1889      return this;
1890    }
1891
1892    /**
1893     * @return {@link #derivedFrom} (Allows linking the NutritionIntake to the underlying NutritionOrder, or to other information, such as AllergyIntolerance, that supports or is used to derive the NutritionIntake.)
1894     */
1895    public List<Reference> getDerivedFrom() { 
1896      if (this.derivedFrom == null)
1897        this.derivedFrom = new ArrayList<Reference>();
1898      return this.derivedFrom;
1899    }
1900
1901    /**
1902     * @return Returns a reference to <code>this</code> for easy method chaining
1903     */
1904    public NutritionIntake setDerivedFrom(List<Reference> theDerivedFrom) { 
1905      this.derivedFrom = theDerivedFrom;
1906      return this;
1907    }
1908
1909    public boolean hasDerivedFrom() { 
1910      if (this.derivedFrom == null)
1911        return false;
1912      for (Reference item : this.derivedFrom)
1913        if (!item.isEmpty())
1914          return true;
1915      return false;
1916    }
1917
1918    public Reference addDerivedFrom() { //3
1919      Reference t = new Reference();
1920      if (this.derivedFrom == null)
1921        this.derivedFrom = new ArrayList<Reference>();
1922      this.derivedFrom.add(t);
1923      return t;
1924    }
1925
1926    public NutritionIntake addDerivedFrom(Reference t) { //3
1927      if (t == null)
1928        return this;
1929      if (this.derivedFrom == null)
1930        this.derivedFrom = new ArrayList<Reference>();
1931      this.derivedFrom.add(t);
1932      return this;
1933    }
1934
1935    /**
1936     * @return The first repetition of repeating field {@link #derivedFrom}, creating it if it does not already exist {3}
1937     */
1938    public Reference getDerivedFromFirstRep() { 
1939      if (getDerivedFrom().isEmpty()) {
1940        addDerivedFrom();
1941      }
1942      return getDerivedFrom().get(0);
1943    }
1944
1945    /**
1946     * @return {@link #reason} (A reason, Condition or observation for why the food or fluid is /was consumed.)
1947     */
1948    public List<CodeableReference> getReason() { 
1949      if (this.reason == null)
1950        this.reason = new ArrayList<CodeableReference>();
1951      return this.reason;
1952    }
1953
1954    /**
1955     * @return Returns a reference to <code>this</code> for easy method chaining
1956     */
1957    public NutritionIntake setReason(List<CodeableReference> theReason) { 
1958      this.reason = theReason;
1959      return this;
1960    }
1961
1962    public boolean hasReason() { 
1963      if (this.reason == null)
1964        return false;
1965      for (CodeableReference item : this.reason)
1966        if (!item.isEmpty())
1967          return true;
1968      return false;
1969    }
1970
1971    public CodeableReference addReason() { //3
1972      CodeableReference t = new CodeableReference();
1973      if (this.reason == null)
1974        this.reason = new ArrayList<CodeableReference>();
1975      this.reason.add(t);
1976      return t;
1977    }
1978
1979    public NutritionIntake addReason(CodeableReference t) { //3
1980      if (t == null)
1981        return this;
1982      if (this.reason == null)
1983        this.reason = new ArrayList<CodeableReference>();
1984      this.reason.add(t);
1985      return this;
1986    }
1987
1988    /**
1989     * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist {3}
1990     */
1991    public CodeableReference getReasonFirstRep() { 
1992      if (getReason().isEmpty()) {
1993        addReason();
1994      }
1995      return getReason().get(0);
1996    }
1997
1998    /**
1999     * @return {@link #note} (Provides extra information about the Nutrition Intake that is not conveyed by the other attributes.)
2000     */
2001    public List<Annotation> getNote() { 
2002      if (this.note == null)
2003        this.note = new ArrayList<Annotation>();
2004      return this.note;
2005    }
2006
2007    /**
2008     * @return Returns a reference to <code>this</code> for easy method chaining
2009     */
2010    public NutritionIntake setNote(List<Annotation> theNote) { 
2011      this.note = theNote;
2012      return this;
2013    }
2014
2015    public boolean hasNote() { 
2016      if (this.note == null)
2017        return false;
2018      for (Annotation item : this.note)
2019        if (!item.isEmpty())
2020          return true;
2021      return false;
2022    }
2023
2024    public Annotation addNote() { //3
2025      Annotation t = new Annotation();
2026      if (this.note == null)
2027        this.note = new ArrayList<Annotation>();
2028      this.note.add(t);
2029      return t;
2030    }
2031
2032    public NutritionIntake addNote(Annotation t) { //3
2033      if (t == null)
2034        return this;
2035      if (this.note == null)
2036        this.note = new ArrayList<Annotation>();
2037      this.note.add(t);
2038      return this;
2039    }
2040
2041    /**
2042     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
2043     */
2044    public Annotation getNoteFirstRep() { 
2045      if (getNote().isEmpty()) {
2046        addNote();
2047      }
2048      return getNote().get(0);
2049    }
2050
2051      protected void listChildren(List<Property> children) {
2052        super.listChildren(children);
2053        children.add(new Property("identifier", "Identifier", "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.", 0, java.lang.Integer.MAX_VALUE, identifier));
2054        children.add(new Property("instantiatesCanonical", "canonical(ActivityDefinition|ArtifactAssessment|EventDefinition|EvidenceVariable|Measure|OperationDefinition|PlanDefinition|Questionnaire|SubscriptionTopic)", "Instantiates FHIR protocol or definition.", 0, java.lang.Integer.MAX_VALUE, instantiatesCanonical));
2055        children.add(new Property("instantiatesUri", "uri", "Instantiates external protocol or definition.", 0, java.lang.Integer.MAX_VALUE, instantiatesUri));
2056        children.add(new Property("basedOn", "Reference(NutritionOrder|CarePlan|ServiceRequest)", "A plan, proposal or order that is fulfilled in whole or in part by this event.", 0, java.lang.Integer.MAX_VALUE, basedOn));
2057        children.add(new Property("partOf", "Reference(NutritionIntake|Procedure|Observation)", "A larger event of which this particular event is a component or step.", 0, java.lang.Integer.MAX_VALUE, partOf));
2058        children.add(new Property("status", "code", "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.", 0, 1, status));
2059        children.add(new Property("statusReason", "CodeableConcept", "Captures the reason for the current state of the NutritionIntake.", 0, java.lang.Integer.MAX_VALUE, statusReason));
2060        children.add(new Property("code", "CodeableConcept", "Type of nutrition intake setting/reporting.", 0, 1, code));
2061        children.add(new Property("subject", "Reference(Patient|Group)", "The person, animal or group who is/was consuming the food or fluid.", 0, 1, subject));
2062        children.add(new Property("encounter", "Reference(Encounter)", "The encounter that establishes the context for this NutritionIntake.", 0, 1, encounter));
2063        children.add(new Property("occurrence[x]", "dateTime|Period", "The interval of time during which it is being asserted that the patient is/was consuming the food or fluid.", 0, 1, occurrence));
2064        children.add(new Property("recorded", "dateTime", "The date when the Nutrition Intake was asserted by the information source.", 0, 1, recorded));
2065        children.add(new Property("reported[x]", "boolean|Reference(Patient|RelatedPerson|Practitioner|PractitionerRole|Organization)", "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.", 0, 1, reported));
2066        children.add(new Property("consumedItem", "", "What food or fluid product or item was consumed.", 0, java.lang.Integer.MAX_VALUE, consumedItem));
2067        children.add(new Property("ingredientLabel", "", "Total nutrient amounts for the whole meal, product, serving, etc.", 0, java.lang.Integer.MAX_VALUE, ingredientLabel));
2068        children.add(new Property("performer", "", "Who performed the intake and how they were involved.", 0, java.lang.Integer.MAX_VALUE, performer));
2069        children.add(new Property("location", "Reference(Location)", "Where the intake occurred.", 0, 1, location));
2070        children.add(new Property("derivedFrom", "Reference(Any)", "Allows linking the NutritionIntake to the underlying NutritionOrder, or to other information, such as AllergyIntolerance, that supports or is used to derive the NutritionIntake.", 0, java.lang.Integer.MAX_VALUE, derivedFrom));
2071        children.add(new Property("reason", "CodeableReference(Condition|Observation|DiagnosticReport|DocumentReference)", "A reason, Condition or observation for why the food or fluid is /was consumed.", 0, java.lang.Integer.MAX_VALUE, reason));
2072        children.add(new Property("note", "Annotation", "Provides extra information about the Nutrition Intake that is not conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note));
2073      }
2074
2075      @Override
2076      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2077        switch (_hash) {
2078        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "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.", 0, java.lang.Integer.MAX_VALUE, identifier);
2079        case 8911915: /*instantiatesCanonical*/  return new Property("instantiatesCanonical", "canonical(ActivityDefinition|ArtifactAssessment|EventDefinition|EvidenceVariable|Measure|OperationDefinition|PlanDefinition|Questionnaire|SubscriptionTopic)", "Instantiates FHIR protocol or definition.", 0, java.lang.Integer.MAX_VALUE, instantiatesCanonical);
2080        case -1926393373: /*instantiatesUri*/  return new Property("instantiatesUri", "uri", "Instantiates external protocol or definition.", 0, java.lang.Integer.MAX_VALUE, instantiatesUri);
2081        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(NutritionOrder|CarePlan|ServiceRequest)", "A plan, proposal or order that is fulfilled in whole or in part by this event.", 0, java.lang.Integer.MAX_VALUE, basedOn);
2082        case -995410646: /*partOf*/  return new Property("partOf", "Reference(NutritionIntake|Procedure|Observation)", "A larger event of which this particular event is a component or step.", 0, java.lang.Integer.MAX_VALUE, partOf);
2083        case -892481550: /*status*/  return new Property("status", "code", "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.", 0, 1, status);
2084        case 2051346646: /*statusReason*/  return new Property("statusReason", "CodeableConcept", "Captures the reason for the current state of the NutritionIntake.", 0, java.lang.Integer.MAX_VALUE, statusReason);
2085        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "Type of nutrition intake setting/reporting.", 0, 1, code);
2086        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group)", "The person, animal or group who is/was consuming the food or fluid.", 0, 1, subject);
2087        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "The encounter that establishes the context for this NutritionIntake.", 0, 1, encounter);
2088        case -2022646513: /*occurrence[x]*/  return new Property("occurrence[x]", "dateTime|Period", "The interval of time during which it is being asserted that the patient is/was consuming the food or fluid.", 0, 1, occurrence);
2089        case 1687874001: /*occurrence*/  return new Property("occurrence[x]", "dateTime|Period", "The interval of time during which it is being asserted that the patient is/was consuming the food or fluid.", 0, 1, occurrence);
2090        case -298443636: /*occurrenceDateTime*/  return new Property("occurrence[x]", "dateTime", "The interval of time during which it is being asserted that the patient is/was consuming the food or fluid.", 0, 1, occurrence);
2091        case 1397156594: /*occurrencePeriod*/  return new Property("occurrence[x]", "Period", "The interval of time during which it is being asserted that the patient is/was consuming the food or fluid.", 0, 1, occurrence);
2092        case -799233872: /*recorded*/  return new Property("recorded", "dateTime", "The date when the Nutrition Intake was asserted by the information source.", 0, 1, recorded);
2093        case -241505587: /*reported[x]*/  return new Property("reported[x]", "boolean|Reference(Patient|RelatedPerson|Practitioner|PractitionerRole|Organization)", "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.", 0, 1, reported);
2094        case -427039533: /*reported*/  return new Property("reported[x]", "boolean|Reference(Patient|RelatedPerson|Practitioner|PractitionerRole|Organization)", "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.", 0, 1, reported);
2095        case 1219992533: /*reportedBoolean*/  return new Property("reported[x]", "boolean", "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.", 0, 1, reported);
2096        case 1198143416: /*reportedReference*/  return new Property("reported[x]", "Reference(Patient|RelatedPerson|Practitioner|PractitionerRole|Organization)", "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.", 0, 1, reported);
2097        case -854114533: /*consumedItem*/  return new Property("consumedItem", "", "What food or fluid product or item was consumed.", 0, java.lang.Integer.MAX_VALUE, consumedItem);
2098        case -936536157: /*ingredientLabel*/  return new Property("ingredientLabel", "", "Total nutrient amounts for the whole meal, product, serving, etc.", 0, java.lang.Integer.MAX_VALUE, ingredientLabel);
2099        case 481140686: /*performer*/  return new Property("performer", "", "Who performed the intake and how they were involved.", 0, java.lang.Integer.MAX_VALUE, performer);
2100        case 1901043637: /*location*/  return new Property("location", "Reference(Location)", "Where the intake occurred.", 0, 1, location);
2101        case 1077922663: /*derivedFrom*/  return new Property("derivedFrom", "Reference(Any)", "Allows linking the NutritionIntake to the underlying NutritionOrder, or to other information, such as AllergyIntolerance, that supports or is used to derive the NutritionIntake.", 0, java.lang.Integer.MAX_VALUE, derivedFrom);
2102        case -934964668: /*reason*/  return new Property("reason", "CodeableReference(Condition|Observation|DiagnosticReport|DocumentReference)", "A reason, Condition or observation for why the food or fluid is /was consumed.", 0, java.lang.Integer.MAX_VALUE, reason);
2103        case 3387378: /*note*/  return new Property("note", "Annotation", "Provides extra information about the Nutrition Intake that is not conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note);
2104        default: return super.getNamedProperty(_hash, _name, _checkValid);
2105        }
2106
2107      }
2108
2109      @Override
2110      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2111        switch (hash) {
2112        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2113        case 8911915: /*instantiatesCanonical*/ return this.instantiatesCanonical == null ? new Base[0] : this.instantiatesCanonical.toArray(new Base[this.instantiatesCanonical.size()]); // CanonicalType
2114        case -1926393373: /*instantiatesUri*/ return this.instantiatesUri == null ? new Base[0] : this.instantiatesUri.toArray(new Base[this.instantiatesUri.size()]); // UriType
2115        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
2116        case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference
2117        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<EventStatus>
2118        case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : this.statusReason.toArray(new Base[this.statusReason.size()]); // CodeableConcept
2119        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
2120        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
2121        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
2122        case 1687874001: /*occurrence*/ return this.occurrence == null ? new Base[0] : new Base[] {this.occurrence}; // DataType
2123        case -799233872: /*recorded*/ return this.recorded == null ? new Base[0] : new Base[] {this.recorded}; // DateTimeType
2124        case -427039533: /*reported*/ return this.reported == null ? new Base[0] : new Base[] {this.reported}; // DataType
2125        case -854114533: /*consumedItem*/ return this.consumedItem == null ? new Base[0] : this.consumedItem.toArray(new Base[this.consumedItem.size()]); // NutritionIntakeConsumedItemComponent
2126        case -936536157: /*ingredientLabel*/ return this.ingredientLabel == null ? new Base[0] : this.ingredientLabel.toArray(new Base[this.ingredientLabel.size()]); // NutritionIntakeIngredientLabelComponent
2127        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // NutritionIntakePerformerComponent
2128        case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference
2129        case 1077922663: /*derivedFrom*/ return this.derivedFrom == null ? new Base[0] : this.derivedFrom.toArray(new Base[this.derivedFrom.size()]); // Reference
2130        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableReference
2131        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
2132        default: return super.getProperty(hash, name, checkValid);
2133        }
2134
2135      }
2136
2137      @Override
2138      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2139        switch (hash) {
2140        case -1618432855: // identifier
2141          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2142          return value;
2143        case 8911915: // instantiatesCanonical
2144          this.getInstantiatesCanonical().add(TypeConvertor.castToCanonical(value)); // CanonicalType
2145          return value;
2146        case -1926393373: // instantiatesUri
2147          this.getInstantiatesUri().add(TypeConvertor.castToUri(value)); // UriType
2148          return value;
2149        case -332612366: // basedOn
2150          this.getBasedOn().add(TypeConvertor.castToReference(value)); // Reference
2151          return value;
2152        case -995410646: // partOf
2153          this.getPartOf().add(TypeConvertor.castToReference(value)); // Reference
2154          return value;
2155        case -892481550: // status
2156          value = new EventStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
2157          this.status = (Enumeration) value; // Enumeration<EventStatus>
2158          return value;
2159        case 2051346646: // statusReason
2160          this.getStatusReason().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2161          return value;
2162        case 3059181: // code
2163          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2164          return value;
2165        case -1867885268: // subject
2166          this.subject = TypeConvertor.castToReference(value); // Reference
2167          return value;
2168        case 1524132147: // encounter
2169          this.encounter = TypeConvertor.castToReference(value); // Reference
2170          return value;
2171        case 1687874001: // occurrence
2172          this.occurrence = TypeConvertor.castToType(value); // DataType
2173          return value;
2174        case -799233872: // recorded
2175          this.recorded = TypeConvertor.castToDateTime(value); // DateTimeType
2176          return value;
2177        case -427039533: // reported
2178          this.reported = TypeConvertor.castToType(value); // DataType
2179          return value;
2180        case -854114533: // consumedItem
2181          this.getConsumedItem().add((NutritionIntakeConsumedItemComponent) value); // NutritionIntakeConsumedItemComponent
2182          return value;
2183        case -936536157: // ingredientLabel
2184          this.getIngredientLabel().add((NutritionIntakeIngredientLabelComponent) value); // NutritionIntakeIngredientLabelComponent
2185          return value;
2186        case 481140686: // performer
2187          this.getPerformer().add((NutritionIntakePerformerComponent) value); // NutritionIntakePerformerComponent
2188          return value;
2189        case 1901043637: // location
2190          this.location = TypeConvertor.castToReference(value); // Reference
2191          return value;
2192        case 1077922663: // derivedFrom
2193          this.getDerivedFrom().add(TypeConvertor.castToReference(value)); // Reference
2194          return value;
2195        case -934964668: // reason
2196          this.getReason().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
2197          return value;
2198        case 3387378: // note
2199          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
2200          return value;
2201        default: return super.setProperty(hash, name, value);
2202        }
2203
2204      }
2205
2206      @Override
2207      public Base setProperty(String name, Base value) throws FHIRException {
2208        if (name.equals("identifier")) {
2209          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2210        } else if (name.equals("instantiatesCanonical")) {
2211          this.getInstantiatesCanonical().add(TypeConvertor.castToCanonical(value));
2212        } else if (name.equals("instantiatesUri")) {
2213          this.getInstantiatesUri().add(TypeConvertor.castToUri(value));
2214        } else if (name.equals("basedOn")) {
2215          this.getBasedOn().add(TypeConvertor.castToReference(value));
2216        } else if (name.equals("partOf")) {
2217          this.getPartOf().add(TypeConvertor.castToReference(value));
2218        } else if (name.equals("status")) {
2219          value = new EventStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
2220          this.status = (Enumeration) value; // Enumeration<EventStatus>
2221        } else if (name.equals("statusReason")) {
2222          this.getStatusReason().add(TypeConvertor.castToCodeableConcept(value));
2223        } else if (name.equals("code")) {
2224          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2225        } else if (name.equals("subject")) {
2226          this.subject = TypeConvertor.castToReference(value); // Reference
2227        } else if (name.equals("encounter")) {
2228          this.encounter = TypeConvertor.castToReference(value); // Reference
2229        } else if (name.equals("occurrence[x]")) {
2230          this.occurrence = TypeConvertor.castToType(value); // DataType
2231        } else if (name.equals("recorded")) {
2232          this.recorded = TypeConvertor.castToDateTime(value); // DateTimeType
2233        } else if (name.equals("reported[x]")) {
2234          this.reported = TypeConvertor.castToType(value); // DataType
2235        } else if (name.equals("consumedItem")) {
2236          this.getConsumedItem().add((NutritionIntakeConsumedItemComponent) value);
2237        } else if (name.equals("ingredientLabel")) {
2238          this.getIngredientLabel().add((NutritionIntakeIngredientLabelComponent) value);
2239        } else if (name.equals("performer")) {
2240          this.getPerformer().add((NutritionIntakePerformerComponent) value);
2241        } else if (name.equals("location")) {
2242          this.location = TypeConvertor.castToReference(value); // Reference
2243        } else if (name.equals("derivedFrom")) {
2244          this.getDerivedFrom().add(TypeConvertor.castToReference(value));
2245        } else if (name.equals("reason")) {
2246          this.getReason().add(TypeConvertor.castToCodeableReference(value));
2247        } else if (name.equals("note")) {
2248          this.getNote().add(TypeConvertor.castToAnnotation(value));
2249        } else
2250          return super.setProperty(name, value);
2251        return value;
2252      }
2253
2254      @Override
2255      public Base makeProperty(int hash, String name) throws FHIRException {
2256        switch (hash) {
2257        case -1618432855:  return addIdentifier(); 
2258        case 8911915:  return addInstantiatesCanonicalElement();
2259        case -1926393373:  return addInstantiatesUriElement();
2260        case -332612366:  return addBasedOn(); 
2261        case -995410646:  return addPartOf(); 
2262        case -892481550:  return getStatusElement();
2263        case 2051346646:  return addStatusReason(); 
2264        case 3059181:  return getCode();
2265        case -1867885268:  return getSubject();
2266        case 1524132147:  return getEncounter();
2267        case -2022646513:  return getOccurrence();
2268        case 1687874001:  return getOccurrence();
2269        case -799233872:  return getRecordedElement();
2270        case -241505587:  return getReported();
2271        case -427039533:  return getReported();
2272        case -854114533:  return addConsumedItem(); 
2273        case -936536157:  return addIngredientLabel(); 
2274        case 481140686:  return addPerformer(); 
2275        case 1901043637:  return getLocation();
2276        case 1077922663:  return addDerivedFrom(); 
2277        case -934964668:  return addReason(); 
2278        case 3387378:  return addNote(); 
2279        default: return super.makeProperty(hash, name);
2280        }
2281
2282      }
2283
2284      @Override
2285      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2286        switch (hash) {
2287        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2288        case 8911915: /*instantiatesCanonical*/ return new String[] {"canonical"};
2289        case -1926393373: /*instantiatesUri*/ return new String[] {"uri"};
2290        case -332612366: /*basedOn*/ return new String[] {"Reference"};
2291        case -995410646: /*partOf*/ return new String[] {"Reference"};
2292        case -892481550: /*status*/ return new String[] {"code"};
2293        case 2051346646: /*statusReason*/ return new String[] {"CodeableConcept"};
2294        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
2295        case -1867885268: /*subject*/ return new String[] {"Reference"};
2296        case 1524132147: /*encounter*/ return new String[] {"Reference"};
2297        case 1687874001: /*occurrence*/ return new String[] {"dateTime", "Period"};
2298        case -799233872: /*recorded*/ return new String[] {"dateTime"};
2299        case -427039533: /*reported*/ return new String[] {"boolean", "Reference"};
2300        case -854114533: /*consumedItem*/ return new String[] {};
2301        case -936536157: /*ingredientLabel*/ return new String[] {};
2302        case 481140686: /*performer*/ return new String[] {};
2303        case 1901043637: /*location*/ return new String[] {"Reference"};
2304        case 1077922663: /*derivedFrom*/ return new String[] {"Reference"};
2305        case -934964668: /*reason*/ return new String[] {"CodeableReference"};
2306        case 3387378: /*note*/ return new String[] {"Annotation"};
2307        default: return super.getTypesForProperty(hash, name);
2308        }
2309
2310      }
2311
2312      @Override
2313      public Base addChild(String name) throws FHIRException {
2314        if (name.equals("identifier")) {
2315          return addIdentifier();
2316        }
2317        else if (name.equals("instantiatesCanonical")) {
2318          throw new FHIRException("Cannot call addChild on a primitive type NutritionIntake.instantiatesCanonical");
2319        }
2320        else if (name.equals("instantiatesUri")) {
2321          throw new FHIRException("Cannot call addChild on a primitive type NutritionIntake.instantiatesUri");
2322        }
2323        else if (name.equals("basedOn")) {
2324          return addBasedOn();
2325        }
2326        else if (name.equals("partOf")) {
2327          return addPartOf();
2328        }
2329        else if (name.equals("status")) {
2330          throw new FHIRException("Cannot call addChild on a primitive type NutritionIntake.status");
2331        }
2332        else if (name.equals("statusReason")) {
2333          return addStatusReason();
2334        }
2335        else if (name.equals("code")) {
2336          this.code = new CodeableConcept();
2337          return this.code;
2338        }
2339        else if (name.equals("subject")) {
2340          this.subject = new Reference();
2341          return this.subject;
2342        }
2343        else if (name.equals("encounter")) {
2344          this.encounter = new Reference();
2345          return this.encounter;
2346        }
2347        else if (name.equals("occurrenceDateTime")) {
2348          this.occurrence = new DateTimeType();
2349          return this.occurrence;
2350        }
2351        else if (name.equals("occurrencePeriod")) {
2352          this.occurrence = new Period();
2353          return this.occurrence;
2354        }
2355        else if (name.equals("recorded")) {
2356          throw new FHIRException("Cannot call addChild on a primitive type NutritionIntake.recorded");
2357        }
2358        else if (name.equals("reportedBoolean")) {
2359          this.reported = new BooleanType();
2360          return this.reported;
2361        }
2362        else if (name.equals("reportedReference")) {
2363          this.reported = new Reference();
2364          return this.reported;
2365        }
2366        else if (name.equals("consumedItem")) {
2367          return addConsumedItem();
2368        }
2369        else if (name.equals("ingredientLabel")) {
2370          return addIngredientLabel();
2371        }
2372        else if (name.equals("performer")) {
2373          return addPerformer();
2374        }
2375        else if (name.equals("location")) {
2376          this.location = new Reference();
2377          return this.location;
2378        }
2379        else if (name.equals("derivedFrom")) {
2380          return addDerivedFrom();
2381        }
2382        else if (name.equals("reason")) {
2383          return addReason();
2384        }
2385        else if (name.equals("note")) {
2386          return addNote();
2387        }
2388        else
2389          return super.addChild(name);
2390      }
2391
2392  public String fhirType() {
2393    return "NutritionIntake";
2394
2395  }
2396
2397      public NutritionIntake copy() {
2398        NutritionIntake dst = new NutritionIntake();
2399        copyValues(dst);
2400        return dst;
2401      }
2402
2403      public void copyValues(NutritionIntake dst) {
2404        super.copyValues(dst);
2405        if (identifier != null) {
2406          dst.identifier = new ArrayList<Identifier>();
2407          for (Identifier i : identifier)
2408            dst.identifier.add(i.copy());
2409        };
2410        if (instantiatesCanonical != null) {
2411          dst.instantiatesCanonical = new ArrayList<CanonicalType>();
2412          for (CanonicalType i : instantiatesCanonical)
2413            dst.instantiatesCanonical.add(i.copy());
2414        };
2415        if (instantiatesUri != null) {
2416          dst.instantiatesUri = new ArrayList<UriType>();
2417          for (UriType i : instantiatesUri)
2418            dst.instantiatesUri.add(i.copy());
2419        };
2420        if (basedOn != null) {
2421          dst.basedOn = new ArrayList<Reference>();
2422          for (Reference i : basedOn)
2423            dst.basedOn.add(i.copy());
2424        };
2425        if (partOf != null) {
2426          dst.partOf = new ArrayList<Reference>();
2427          for (Reference i : partOf)
2428            dst.partOf.add(i.copy());
2429        };
2430        dst.status = status == null ? null : status.copy();
2431        if (statusReason != null) {
2432          dst.statusReason = new ArrayList<CodeableConcept>();
2433          for (CodeableConcept i : statusReason)
2434            dst.statusReason.add(i.copy());
2435        };
2436        dst.code = code == null ? null : code.copy();
2437        dst.subject = subject == null ? null : subject.copy();
2438        dst.encounter = encounter == null ? null : encounter.copy();
2439        dst.occurrence = occurrence == null ? null : occurrence.copy();
2440        dst.recorded = recorded == null ? null : recorded.copy();
2441        dst.reported = reported == null ? null : reported.copy();
2442        if (consumedItem != null) {
2443          dst.consumedItem = new ArrayList<NutritionIntakeConsumedItemComponent>();
2444          for (NutritionIntakeConsumedItemComponent i : consumedItem)
2445            dst.consumedItem.add(i.copy());
2446        };
2447        if (ingredientLabel != null) {
2448          dst.ingredientLabel = new ArrayList<NutritionIntakeIngredientLabelComponent>();
2449          for (NutritionIntakeIngredientLabelComponent i : ingredientLabel)
2450            dst.ingredientLabel.add(i.copy());
2451        };
2452        if (performer != null) {
2453          dst.performer = new ArrayList<NutritionIntakePerformerComponent>();
2454          for (NutritionIntakePerformerComponent i : performer)
2455            dst.performer.add(i.copy());
2456        };
2457        dst.location = location == null ? null : location.copy();
2458        if (derivedFrom != null) {
2459          dst.derivedFrom = new ArrayList<Reference>();
2460          for (Reference i : derivedFrom)
2461            dst.derivedFrom.add(i.copy());
2462        };
2463        if (reason != null) {
2464          dst.reason = new ArrayList<CodeableReference>();
2465          for (CodeableReference i : reason)
2466            dst.reason.add(i.copy());
2467        };
2468        if (note != null) {
2469          dst.note = new ArrayList<Annotation>();
2470          for (Annotation i : note)
2471            dst.note.add(i.copy());
2472        };
2473      }
2474
2475      protected NutritionIntake typedCopy() {
2476        return copy();
2477      }
2478
2479      @Override
2480      public boolean equalsDeep(Base other_) {
2481        if (!super.equalsDeep(other_))
2482          return false;
2483        if (!(other_ instanceof NutritionIntake))
2484          return false;
2485        NutritionIntake o = (NutritionIntake) other_;
2486        return compareDeep(identifier, o.identifier, true) && compareDeep(instantiatesCanonical, o.instantiatesCanonical, true)
2487           && compareDeep(instantiatesUri, o.instantiatesUri, true) && compareDeep(basedOn, o.basedOn, true)
2488           && compareDeep(partOf, o.partOf, true) && compareDeep(status, o.status, true) && compareDeep(statusReason, o.statusReason, true)
2489           && compareDeep(code, o.code, true) && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true)
2490           && compareDeep(occurrence, o.occurrence, true) && compareDeep(recorded, o.recorded, true) && compareDeep(reported, o.reported, true)
2491           && compareDeep(consumedItem, o.consumedItem, true) && compareDeep(ingredientLabel, o.ingredientLabel, true)
2492           && compareDeep(performer, o.performer, true) && compareDeep(location, o.location, true) && compareDeep(derivedFrom, o.derivedFrom, true)
2493           && compareDeep(reason, o.reason, true) && compareDeep(note, o.note, true);
2494      }
2495
2496      @Override
2497      public boolean equalsShallow(Base other_) {
2498        if (!super.equalsShallow(other_))
2499          return false;
2500        if (!(other_ instanceof NutritionIntake))
2501          return false;
2502        NutritionIntake o = (NutritionIntake) other_;
2503        return compareValues(instantiatesCanonical, o.instantiatesCanonical, true) && compareValues(instantiatesUri, o.instantiatesUri, true)
2504           && compareValues(status, o.status, true) && compareValues(recorded, o.recorded, true);
2505      }
2506
2507      public boolean isEmpty() {
2508        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, instantiatesCanonical
2509          , instantiatesUri, basedOn, partOf, status, statusReason, code, subject, encounter
2510          , occurrence, recorded, reported, consumedItem, ingredientLabel, performer, location
2511          , derivedFrom, reason, note);
2512      }
2513
2514  @Override
2515  public ResourceType getResourceType() {
2516    return ResourceType.NutritionIntake;
2517   }
2518
2519 /**
2520   * Search parameter: <b>code</b>
2521   * <p>
2522   * Description: <b>Returns statements of this code of NutritionIntake</b><br>
2523   * Type: <b>token</b><br>
2524   * Path: <b>NutritionIntake.code</b><br>
2525   * </p>
2526   */
2527  @SearchParamDefinition(name="code", path="NutritionIntake.code", description="Returns statements of this code of NutritionIntake", type="token" )
2528  public static final String SP_CODE = "code";
2529 /**
2530   * <b>Fluent Client</b> search parameter constant for <b>code</b>
2531   * <p>
2532   * Description: <b>Returns statements of this code of NutritionIntake</b><br>
2533   * Type: <b>token</b><br>
2534   * Path: <b>NutritionIntake.code</b><br>
2535   * </p>
2536   */
2537  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
2538
2539 /**
2540   * Search parameter: <b>date</b>
2541   * <p>
2542   * Description: <b>Date when patient was taking (or not taking) the medication</b><br>
2543   * Type: <b>date</b><br>
2544   * Path: <b>NutritionIntake.occurrence</b><br>
2545   * </p>
2546   */
2547  @SearchParamDefinition(name="date", path="NutritionIntake.occurrence", description="Date when patient was taking (or not taking) the medication", type="date" )
2548  public static final String SP_DATE = "date";
2549 /**
2550   * <b>Fluent Client</b> search parameter constant for <b>date</b>
2551   * <p>
2552   * Description: <b>Date when patient was taking (or not taking) the medication</b><br>
2553   * Type: <b>date</b><br>
2554   * Path: <b>NutritionIntake.occurrence</b><br>
2555   * </p>
2556   */
2557  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
2558
2559 /**
2560   * Search parameter: <b>encounter</b>
2561   * <p>
2562   * Description: <b>Returns statements for a specific encounter</b><br>
2563   * Type: <b>reference</b><br>
2564   * Path: <b>NutritionIntake.encounter</b><br>
2565   * </p>
2566   */
2567  @SearchParamDefinition(name="encounter", path="NutritionIntake.encounter", description="Returns statements for a specific encounter", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Encounter") }, target={Encounter.class } )
2568  public static final String SP_ENCOUNTER = "encounter";
2569 /**
2570   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
2571   * <p>
2572   * Description: <b>Returns statements for a specific encounter</b><br>
2573   * Type: <b>reference</b><br>
2574   * Path: <b>NutritionIntake.encounter</b><br>
2575   * </p>
2576   */
2577  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
2578
2579/**
2580   * Constant for fluent queries to be used to add include statements. Specifies
2581   * the path value of "<b>NutritionIntake:encounter</b>".
2582   */
2583  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("NutritionIntake:encounter").toLocked();
2584
2585 /**
2586   * Search parameter: <b>identifier</b>
2587   * <p>
2588   * Description: <b>Return statements with this external identifier</b><br>
2589   * Type: <b>token</b><br>
2590   * Path: <b>NutritionIntake.identifier</b><br>
2591   * </p>
2592   */
2593  @SearchParamDefinition(name="identifier", path="NutritionIntake.identifier", description="Return statements with this external identifier", type="token" )
2594  public static final String SP_IDENTIFIER = "identifier";
2595 /**
2596   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2597   * <p>
2598   * Description: <b>Return statements with this external identifier</b><br>
2599   * Type: <b>token</b><br>
2600   * Path: <b>NutritionIntake.identifier</b><br>
2601   * </p>
2602   */
2603  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2604
2605 /**
2606   * Search parameter: <b>nutrition</b>
2607   * <p>
2608   * Description: <b>Return statements of this medication reference</b><br>
2609   * Type: <b>token</b><br>
2610   * Path: <b>NutritionIntake.consumedItem.nutritionProduct</b><br>
2611   * </p>
2612   */
2613  @SearchParamDefinition(name="nutrition", path="NutritionIntake.consumedItem.nutritionProduct", description="Return statements of this medication reference", type="token" )
2614  public static final String SP_NUTRITION = "nutrition";
2615 /**
2616   * <b>Fluent Client</b> search parameter constant for <b>nutrition</b>
2617   * <p>
2618   * Description: <b>Return statements of this medication reference</b><br>
2619   * Type: <b>token</b><br>
2620   * Path: <b>NutritionIntake.consumedItem.nutritionProduct</b><br>
2621   * </p>
2622   */
2623  public static final ca.uhn.fhir.rest.gclient.TokenClientParam NUTRITION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_NUTRITION);
2624
2625 /**
2626   * Search parameter: <b>part-of</b>
2627   * <p>
2628   * Description: <b>Returns statements that are part of another event.</b><br>
2629   * Type: <b>reference</b><br>
2630   * Path: <b>NutritionIntake.partOf</b><br>
2631   * </p>
2632   */
2633  @SearchParamDefinition(name="part-of", path="NutritionIntake.partOf", description="Returns statements that are part of another event.", type="reference", target={NutritionIntake.class, Observation.class, Procedure.class } )
2634  public static final String SP_PART_OF = "part-of";
2635 /**
2636   * <b>Fluent Client</b> search parameter constant for <b>part-of</b>
2637   * <p>
2638   * Description: <b>Returns statements that are part of another event.</b><br>
2639   * Type: <b>reference</b><br>
2640   * Path: <b>NutritionIntake.partOf</b><br>
2641   * </p>
2642   */
2643  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PART_OF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PART_OF);
2644
2645/**
2646   * Constant for fluent queries to be used to add include statements. Specifies
2647   * the path value of "<b>NutritionIntake:part-of</b>".
2648   */
2649  public static final ca.uhn.fhir.model.api.Include INCLUDE_PART_OF = new ca.uhn.fhir.model.api.Include("NutritionIntake:part-of").toLocked();
2650
2651 /**
2652   * Search parameter: <b>patient</b>
2653   * <p>
2654   * Description: <b>Returns statements for a specific patient.</b><br>
2655   * Type: <b>reference</b><br>
2656   * Path: <b>NutritionIntake.subject.where(resolve() is Patient)</b><br>
2657   * </p>
2658   */
2659  @SearchParamDefinition(name="patient", path="NutritionIntake.subject.where(resolve() is Patient)", description="Returns statements for a specific patient.", type="reference", target={Group.class, Patient.class } )
2660  public static final String SP_PATIENT = "patient";
2661 /**
2662   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2663   * <p>
2664   * Description: <b>Returns statements for a specific patient.</b><br>
2665   * Type: <b>reference</b><br>
2666   * Path: <b>NutritionIntake.subject.where(resolve() is Patient)</b><br>
2667   * </p>
2668   */
2669  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2670
2671/**
2672   * Constant for fluent queries to be used to add include statements. Specifies
2673   * the path value of "<b>NutritionIntake:patient</b>".
2674   */
2675  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("NutritionIntake:patient").toLocked();
2676
2677 /**
2678   * Search parameter: <b>source</b>
2679   * <p>
2680   * Description: <b>Who or where the information in the statement came from</b><br>
2681   * Type: <b>reference</b><br>
2682   * Path: <b>(NutritionIntake.reported as Reference)</b><br>
2683   * </p>
2684   */
2685  @SearchParamDefinition(name="source", path="(NutritionIntake.reported as Reference)", description="Who or where the information in the statement came from", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for RelatedPerson") }, target={Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
2686  public static final String SP_SOURCE = "source";
2687 /**
2688   * <b>Fluent Client</b> search parameter constant for <b>source</b>
2689   * <p>
2690   * Description: <b>Who or where the information in the statement came from</b><br>
2691   * Type: <b>reference</b><br>
2692   * Path: <b>(NutritionIntake.reported as Reference)</b><br>
2693   * </p>
2694   */
2695  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE);
2696
2697/**
2698   * Constant for fluent queries to be used to add include statements. Specifies
2699   * the path value of "<b>NutritionIntake:source</b>".
2700   */
2701  public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("NutritionIntake:source").toLocked();
2702
2703 /**
2704   * Search parameter: <b>status</b>
2705   * <p>
2706   * Description: <b>Return statements that match the given status</b><br>
2707   * Type: <b>token</b><br>
2708   * Path: <b>NutritionIntake.status</b><br>
2709   * </p>
2710   */
2711  @SearchParamDefinition(name="status", path="NutritionIntake.status", description="Return statements that match the given status", type="token" )
2712  public static final String SP_STATUS = "status";
2713 /**
2714   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2715   * <p>
2716   * Description: <b>Return statements that match the given status</b><br>
2717   * Type: <b>token</b><br>
2718   * Path: <b>NutritionIntake.status</b><br>
2719   * </p>
2720   */
2721  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2722
2723 /**
2724   * Search parameter: <b>subject</b>
2725   * <p>
2726   * Description: <b>The identity of a patient, animal or group to list statements for</b><br>
2727   * Type: <b>reference</b><br>
2728   * Path: <b>NutritionIntake.subject</b><br>
2729   * </p>
2730   */
2731  @SearchParamDefinition(name="subject", path="NutritionIntake.subject", description="The identity of a patient, animal or group to list statements for", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Group.class, Patient.class } )
2732  public static final String SP_SUBJECT = "subject";
2733 /**
2734   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2735   * <p>
2736   * Description: <b>The identity of a patient, animal or group to list statements for</b><br>
2737   * Type: <b>reference</b><br>
2738   * Path: <b>NutritionIntake.subject</b><br>
2739   * </p>
2740   */
2741  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
2742
2743/**
2744   * Constant for fluent queries to be used to add include statements. Specifies
2745   * the path value of "<b>NutritionIntake:subject</b>".
2746   */
2747  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("NutritionIntake:subject").toLocked();
2748
2749
2750}
2751