001package org.hl7.fhir.dstu3.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x
035import java.util.ArrayList;
036import java.util.Date;
037import java.util.List;
038
039import org.hl7.fhir.exceptions.FHIRException;
040import org.hl7.fhir.exceptions.FHIRFormatError;
041import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
042import org.hl7.fhir.utilities.Utilities;
043
044import ca.uhn.fhir.model.api.annotation.Block;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.Description;
047import ca.uhn.fhir.model.api.annotation.ResourceDef;
048import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
049/**
050 * A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.
051 */
052@ResourceDef(name="NutritionOrder", profile="http://hl7.org/fhir/Profile/NutritionOrder")
053public class NutritionOrder extends DomainResource {
054
055    public enum NutritionOrderStatus {
056        /**
057         * The request has been proposed.
058         */
059        PROPOSED, 
060        /**
061         * The request is in preliminary form prior to being sent.
062         */
063        DRAFT, 
064        /**
065         * The request has been planned.
066         */
067        PLANNED, 
068        /**
069         * The request has been placed.
070         */
071        REQUESTED, 
072        /**
073         * The request is 'actionable', but not all actions that are implied by it have occurred yet.
074         */
075        ACTIVE, 
076        /**
077         * Actions implied by the request have been temporarily halted, but are expected to continue later. May also be called "suspended".
078         */
079        ONHOLD, 
080        /**
081         * All actions that are implied by the order have occurred and no continuation is planned (this will rarely be made explicit).
082         */
083        COMPLETED, 
084        /**
085         * The request has been withdrawn and is no longer actionable.
086         */
087        CANCELLED, 
088        /**
089         * The request was entered in error and voided.
090         */
091        ENTEREDINERROR, 
092        /**
093         * added to help the parsers with the generic types
094         */
095        NULL;
096        public static NutritionOrderStatus fromCode(String codeString) throws FHIRException {
097            if (codeString == null || "".equals(codeString))
098                return null;
099        if ("proposed".equals(codeString))
100          return PROPOSED;
101        if ("draft".equals(codeString))
102          return DRAFT;
103        if ("planned".equals(codeString))
104          return PLANNED;
105        if ("requested".equals(codeString))
106          return REQUESTED;
107        if ("active".equals(codeString))
108          return ACTIVE;
109        if ("on-hold".equals(codeString))
110          return ONHOLD;
111        if ("completed".equals(codeString))
112          return COMPLETED;
113        if ("cancelled".equals(codeString))
114          return CANCELLED;
115        if ("entered-in-error".equals(codeString))
116          return ENTEREDINERROR;
117        if (Configuration.isAcceptInvalidEnums())
118          return null;
119        else
120          throw new FHIRException("Unknown NutritionOrderStatus code '"+codeString+"'");
121        }
122        public String toCode() {
123          switch (this) {
124            case PROPOSED: return "proposed";
125            case DRAFT: return "draft";
126            case PLANNED: return "planned";
127            case REQUESTED: return "requested";
128            case ACTIVE: return "active";
129            case ONHOLD: return "on-hold";
130            case COMPLETED: return "completed";
131            case CANCELLED: return "cancelled";
132            case ENTEREDINERROR: return "entered-in-error";
133            case NULL: return null;
134            default: return "?";
135          }
136        }
137        public String getSystem() {
138          switch (this) {
139            case PROPOSED: return "http://hl7.org/fhir/nutrition-request-status";
140            case DRAFT: return "http://hl7.org/fhir/nutrition-request-status";
141            case PLANNED: return "http://hl7.org/fhir/nutrition-request-status";
142            case REQUESTED: return "http://hl7.org/fhir/nutrition-request-status";
143            case ACTIVE: return "http://hl7.org/fhir/nutrition-request-status";
144            case ONHOLD: return "http://hl7.org/fhir/nutrition-request-status";
145            case COMPLETED: return "http://hl7.org/fhir/nutrition-request-status";
146            case CANCELLED: return "http://hl7.org/fhir/nutrition-request-status";
147            case ENTEREDINERROR: return "http://hl7.org/fhir/nutrition-request-status";
148            case NULL: return null;
149            default: return "?";
150          }
151        }
152        public String getDefinition() {
153          switch (this) {
154            case PROPOSED: return "The request has been proposed.";
155            case DRAFT: return "The request is in preliminary form prior to being sent.";
156            case PLANNED: return "The request has been planned.";
157            case REQUESTED: return "The request has been placed.";
158            case ACTIVE: return "The request is 'actionable', but not all actions that are implied by it have occurred yet.";
159            case ONHOLD: return "Actions implied by the request have been temporarily halted, but are expected to continue later. May also be called \"suspended\".";
160            case COMPLETED: return "All actions that are implied by the order have occurred and no continuation is planned (this will rarely be made explicit).";
161            case CANCELLED: return "The request has been withdrawn and is no longer actionable.";
162            case ENTEREDINERROR: return "The request was entered in error and voided.";
163            case NULL: return null;
164            default: return "?";
165          }
166        }
167        public String getDisplay() {
168          switch (this) {
169            case PROPOSED: return "Proposed";
170            case DRAFT: return "Draft";
171            case PLANNED: return "Planned";
172            case REQUESTED: return "Requested";
173            case ACTIVE: return "Active";
174            case ONHOLD: return "On-Hold";
175            case COMPLETED: return "Completed";
176            case CANCELLED: return "Cancelled";
177            case ENTEREDINERROR: return "Entered in Error";
178            case NULL: return null;
179            default: return "?";
180          }
181        }
182    }
183
184  public static class NutritionOrderStatusEnumFactory implements EnumFactory<NutritionOrderStatus> {
185    public NutritionOrderStatus fromCode(String codeString) throws IllegalArgumentException {
186      if (codeString == null || "".equals(codeString))
187            if (codeString == null || "".equals(codeString))
188                return null;
189        if ("proposed".equals(codeString))
190          return NutritionOrderStatus.PROPOSED;
191        if ("draft".equals(codeString))
192          return NutritionOrderStatus.DRAFT;
193        if ("planned".equals(codeString))
194          return NutritionOrderStatus.PLANNED;
195        if ("requested".equals(codeString))
196          return NutritionOrderStatus.REQUESTED;
197        if ("active".equals(codeString))
198          return NutritionOrderStatus.ACTIVE;
199        if ("on-hold".equals(codeString))
200          return NutritionOrderStatus.ONHOLD;
201        if ("completed".equals(codeString))
202          return NutritionOrderStatus.COMPLETED;
203        if ("cancelled".equals(codeString))
204          return NutritionOrderStatus.CANCELLED;
205        if ("entered-in-error".equals(codeString))
206          return NutritionOrderStatus.ENTEREDINERROR;
207        throw new IllegalArgumentException("Unknown NutritionOrderStatus code '"+codeString+"'");
208        }
209        public Enumeration<NutritionOrderStatus> fromType(Base code) throws FHIRException {
210          if (code == null)
211            return null;
212          if (code.isEmpty())
213            return new Enumeration<NutritionOrderStatus>(this);
214          String codeString = ((PrimitiveType) code).asStringValue();
215          if (codeString == null || "".equals(codeString))
216            return null;
217        if ("proposed".equals(codeString))
218          return new Enumeration<NutritionOrderStatus>(this, NutritionOrderStatus.PROPOSED);
219        if ("draft".equals(codeString))
220          return new Enumeration<NutritionOrderStatus>(this, NutritionOrderStatus.DRAFT);
221        if ("planned".equals(codeString))
222          return new Enumeration<NutritionOrderStatus>(this, NutritionOrderStatus.PLANNED);
223        if ("requested".equals(codeString))
224          return new Enumeration<NutritionOrderStatus>(this, NutritionOrderStatus.REQUESTED);
225        if ("active".equals(codeString))
226          return new Enumeration<NutritionOrderStatus>(this, NutritionOrderStatus.ACTIVE);
227        if ("on-hold".equals(codeString))
228          return new Enumeration<NutritionOrderStatus>(this, NutritionOrderStatus.ONHOLD);
229        if ("completed".equals(codeString))
230          return new Enumeration<NutritionOrderStatus>(this, NutritionOrderStatus.COMPLETED);
231        if ("cancelled".equals(codeString))
232          return new Enumeration<NutritionOrderStatus>(this, NutritionOrderStatus.CANCELLED);
233        if ("entered-in-error".equals(codeString))
234          return new Enumeration<NutritionOrderStatus>(this, NutritionOrderStatus.ENTEREDINERROR);
235        throw new FHIRException("Unknown NutritionOrderStatus code '"+codeString+"'");
236        }
237    public String toCode(NutritionOrderStatus code) {
238      if (code == NutritionOrderStatus.PROPOSED)
239        return "proposed";
240      if (code == NutritionOrderStatus.DRAFT)
241        return "draft";
242      if (code == NutritionOrderStatus.PLANNED)
243        return "planned";
244      if (code == NutritionOrderStatus.REQUESTED)
245        return "requested";
246      if (code == NutritionOrderStatus.ACTIVE)
247        return "active";
248      if (code == NutritionOrderStatus.ONHOLD)
249        return "on-hold";
250      if (code == NutritionOrderStatus.COMPLETED)
251        return "completed";
252      if (code == NutritionOrderStatus.CANCELLED)
253        return "cancelled";
254      if (code == NutritionOrderStatus.ENTEREDINERROR)
255        return "entered-in-error";
256      return "?";
257      }
258    public String toSystem(NutritionOrderStatus code) {
259      return code.getSystem();
260      }
261    }
262
263    @Block()
264    public static class NutritionOrderOralDietComponent extends BackboneElement implements IBaseBackboneElement {
265        /**
266         * The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet.
267         */
268        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
269        @Description(shortDefinition="Type of oral diet or diet restrictions that describe what can be consumed orally", formalDefinition="The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet." )
270        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/diet-type")
271        protected List<CodeableConcept> type;
272
273        /**
274         * The time period and frequency at which the diet should be given.  The diet should be given for the combination of all schedules if more than one schedule is present.
275         */
276        @Child(name = "schedule", type = {Timing.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
277        @Description(shortDefinition="Scheduled frequency of diet", formalDefinition="The time period and frequency at which the diet should be given.  The diet should be given for the combination of all schedules if more than one schedule is present." )
278        protected List<Timing> schedule;
279
280        /**
281         * Class that defines the quantity and type of nutrient modifications (for example carbohydrate, fiber or sodium) required for the oral diet.
282         */
283        @Child(name = "nutrient", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
284        @Description(shortDefinition="Required  nutrient modifications", formalDefinition="Class that defines the quantity and type of nutrient modifications (for example carbohydrate, fiber or sodium) required for the oral diet." )
285        protected List<NutritionOrderOralDietNutrientComponent> nutrient;
286
287        /**
288         * Class that describes any texture modifications required for the patient to safely consume various types of solid foods.
289         */
290        @Child(name = "texture", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
291        @Description(shortDefinition="Required  texture modifications", formalDefinition="Class that describes any texture modifications required for the patient to safely consume various types of solid foods." )
292        protected List<NutritionOrderOralDietTextureComponent> texture;
293
294        /**
295         * The required consistency (e.g. honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.
296         */
297        @Child(name = "fluidConsistencyType", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
298        @Description(shortDefinition="The required consistency of fluids and liquids provided to the patient", formalDefinition="The required consistency (e.g. honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient." )
299        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/consistency-type")
300        protected List<CodeableConcept> fluidConsistencyType;
301
302        /**
303         * Free text or additional instructions or information pertaining to the oral diet.
304         */
305        @Child(name = "instruction", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true)
306        @Description(shortDefinition="Instructions or additional information about the oral diet", formalDefinition="Free text or additional instructions or information pertaining to the oral diet." )
307        protected StringType instruction;
308
309        private static final long serialVersionUID = 973058412L;
310
311    /**
312     * Constructor
313     */
314      public NutritionOrderOralDietComponent() {
315        super();
316      }
317
318        /**
319         * @return {@link #type} (The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet.)
320         */
321        public List<CodeableConcept> getType() { 
322          if (this.type == null)
323            this.type = new ArrayList<CodeableConcept>();
324          return this.type;
325        }
326
327        /**
328         * @return Returns a reference to <code>this</code> for easy method chaining
329         */
330        public NutritionOrderOralDietComponent setType(List<CodeableConcept> theType) { 
331          this.type = theType;
332          return this;
333        }
334
335        public boolean hasType() { 
336          if (this.type == null)
337            return false;
338          for (CodeableConcept item : this.type)
339            if (!item.isEmpty())
340              return true;
341          return false;
342        }
343
344        public CodeableConcept addType() { //3
345          CodeableConcept t = new CodeableConcept();
346          if (this.type == null)
347            this.type = new ArrayList<CodeableConcept>();
348          this.type.add(t);
349          return t;
350        }
351
352        public NutritionOrderOralDietComponent addType(CodeableConcept t) { //3
353          if (t == null)
354            return this;
355          if (this.type == null)
356            this.type = new ArrayList<CodeableConcept>();
357          this.type.add(t);
358          return this;
359        }
360
361        /**
362         * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist
363         */
364        public CodeableConcept getTypeFirstRep() { 
365          if (getType().isEmpty()) {
366            addType();
367          }
368          return getType().get(0);
369        }
370
371        /**
372         * @return {@link #schedule} (The time period and frequency at which the diet should be given.  The diet should be given for the combination of all schedules if more than one schedule is present.)
373         */
374        public List<Timing> getSchedule() { 
375          if (this.schedule == null)
376            this.schedule = new ArrayList<Timing>();
377          return this.schedule;
378        }
379
380        /**
381         * @return Returns a reference to <code>this</code> for easy method chaining
382         */
383        public NutritionOrderOralDietComponent setSchedule(List<Timing> theSchedule) { 
384          this.schedule = theSchedule;
385          return this;
386        }
387
388        public boolean hasSchedule() { 
389          if (this.schedule == null)
390            return false;
391          for (Timing item : this.schedule)
392            if (!item.isEmpty())
393              return true;
394          return false;
395        }
396
397        public Timing addSchedule() { //3
398          Timing t = new Timing();
399          if (this.schedule == null)
400            this.schedule = new ArrayList<Timing>();
401          this.schedule.add(t);
402          return t;
403        }
404
405        public NutritionOrderOralDietComponent addSchedule(Timing t) { //3
406          if (t == null)
407            return this;
408          if (this.schedule == null)
409            this.schedule = new ArrayList<Timing>();
410          this.schedule.add(t);
411          return this;
412        }
413
414        /**
415         * @return The first repetition of repeating field {@link #schedule}, creating it if it does not already exist
416         */
417        public Timing getScheduleFirstRep() { 
418          if (getSchedule().isEmpty()) {
419            addSchedule();
420          }
421          return getSchedule().get(0);
422        }
423
424        /**
425         * @return {@link #nutrient} (Class that defines the quantity and type of nutrient modifications (for example carbohydrate, fiber or sodium) required for the oral diet.)
426         */
427        public List<NutritionOrderOralDietNutrientComponent> getNutrient() { 
428          if (this.nutrient == null)
429            this.nutrient = new ArrayList<NutritionOrderOralDietNutrientComponent>();
430          return this.nutrient;
431        }
432
433        /**
434         * @return Returns a reference to <code>this</code> for easy method chaining
435         */
436        public NutritionOrderOralDietComponent setNutrient(List<NutritionOrderOralDietNutrientComponent> theNutrient) { 
437          this.nutrient = theNutrient;
438          return this;
439        }
440
441        public boolean hasNutrient() { 
442          if (this.nutrient == null)
443            return false;
444          for (NutritionOrderOralDietNutrientComponent item : this.nutrient)
445            if (!item.isEmpty())
446              return true;
447          return false;
448        }
449
450        public NutritionOrderOralDietNutrientComponent addNutrient() { //3
451          NutritionOrderOralDietNutrientComponent t = new NutritionOrderOralDietNutrientComponent();
452          if (this.nutrient == null)
453            this.nutrient = new ArrayList<NutritionOrderOralDietNutrientComponent>();
454          this.nutrient.add(t);
455          return t;
456        }
457
458        public NutritionOrderOralDietComponent addNutrient(NutritionOrderOralDietNutrientComponent t) { //3
459          if (t == null)
460            return this;
461          if (this.nutrient == null)
462            this.nutrient = new ArrayList<NutritionOrderOralDietNutrientComponent>();
463          this.nutrient.add(t);
464          return this;
465        }
466
467        /**
468         * @return The first repetition of repeating field {@link #nutrient}, creating it if it does not already exist
469         */
470        public NutritionOrderOralDietNutrientComponent getNutrientFirstRep() { 
471          if (getNutrient().isEmpty()) {
472            addNutrient();
473          }
474          return getNutrient().get(0);
475        }
476
477        /**
478         * @return {@link #texture} (Class that describes any texture modifications required for the patient to safely consume various types of solid foods.)
479         */
480        public List<NutritionOrderOralDietTextureComponent> getTexture() { 
481          if (this.texture == null)
482            this.texture = new ArrayList<NutritionOrderOralDietTextureComponent>();
483          return this.texture;
484        }
485
486        /**
487         * @return Returns a reference to <code>this</code> for easy method chaining
488         */
489        public NutritionOrderOralDietComponent setTexture(List<NutritionOrderOralDietTextureComponent> theTexture) { 
490          this.texture = theTexture;
491          return this;
492        }
493
494        public boolean hasTexture() { 
495          if (this.texture == null)
496            return false;
497          for (NutritionOrderOralDietTextureComponent item : this.texture)
498            if (!item.isEmpty())
499              return true;
500          return false;
501        }
502
503        public NutritionOrderOralDietTextureComponent addTexture() { //3
504          NutritionOrderOralDietTextureComponent t = new NutritionOrderOralDietTextureComponent();
505          if (this.texture == null)
506            this.texture = new ArrayList<NutritionOrderOralDietTextureComponent>();
507          this.texture.add(t);
508          return t;
509        }
510
511        public NutritionOrderOralDietComponent addTexture(NutritionOrderOralDietTextureComponent t) { //3
512          if (t == null)
513            return this;
514          if (this.texture == null)
515            this.texture = new ArrayList<NutritionOrderOralDietTextureComponent>();
516          this.texture.add(t);
517          return this;
518        }
519
520        /**
521         * @return The first repetition of repeating field {@link #texture}, creating it if it does not already exist
522         */
523        public NutritionOrderOralDietTextureComponent getTextureFirstRep() { 
524          if (getTexture().isEmpty()) {
525            addTexture();
526          }
527          return getTexture().get(0);
528        }
529
530        /**
531         * @return {@link #fluidConsistencyType} (The required consistency (e.g. honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.)
532         */
533        public List<CodeableConcept> getFluidConsistencyType() { 
534          if (this.fluidConsistencyType == null)
535            this.fluidConsistencyType = new ArrayList<CodeableConcept>();
536          return this.fluidConsistencyType;
537        }
538
539        /**
540         * @return Returns a reference to <code>this</code> for easy method chaining
541         */
542        public NutritionOrderOralDietComponent setFluidConsistencyType(List<CodeableConcept> theFluidConsistencyType) { 
543          this.fluidConsistencyType = theFluidConsistencyType;
544          return this;
545        }
546
547        public boolean hasFluidConsistencyType() { 
548          if (this.fluidConsistencyType == null)
549            return false;
550          for (CodeableConcept item : this.fluidConsistencyType)
551            if (!item.isEmpty())
552              return true;
553          return false;
554        }
555
556        public CodeableConcept addFluidConsistencyType() { //3
557          CodeableConcept t = new CodeableConcept();
558          if (this.fluidConsistencyType == null)
559            this.fluidConsistencyType = new ArrayList<CodeableConcept>();
560          this.fluidConsistencyType.add(t);
561          return t;
562        }
563
564        public NutritionOrderOralDietComponent addFluidConsistencyType(CodeableConcept t) { //3
565          if (t == null)
566            return this;
567          if (this.fluidConsistencyType == null)
568            this.fluidConsistencyType = new ArrayList<CodeableConcept>();
569          this.fluidConsistencyType.add(t);
570          return this;
571        }
572
573        /**
574         * @return The first repetition of repeating field {@link #fluidConsistencyType}, creating it if it does not already exist
575         */
576        public CodeableConcept getFluidConsistencyTypeFirstRep() { 
577          if (getFluidConsistencyType().isEmpty()) {
578            addFluidConsistencyType();
579          }
580          return getFluidConsistencyType().get(0);
581        }
582
583        /**
584         * @return {@link #instruction} (Free text or additional instructions or information pertaining to the oral diet.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value
585         */
586        public StringType getInstructionElement() { 
587          if (this.instruction == null)
588            if (Configuration.errorOnAutoCreate())
589              throw new Error("Attempt to auto-create NutritionOrderOralDietComponent.instruction");
590            else if (Configuration.doAutoCreate())
591              this.instruction = new StringType(); // bb
592          return this.instruction;
593        }
594
595        public boolean hasInstructionElement() { 
596          return this.instruction != null && !this.instruction.isEmpty();
597        }
598
599        public boolean hasInstruction() { 
600          return this.instruction != null && !this.instruction.isEmpty();
601        }
602
603        /**
604         * @param value {@link #instruction} (Free text or additional instructions or information pertaining to the oral diet.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value
605         */
606        public NutritionOrderOralDietComponent setInstructionElement(StringType value) { 
607          this.instruction = value;
608          return this;
609        }
610
611        /**
612         * @return Free text or additional instructions or information pertaining to the oral diet.
613         */
614        public String getInstruction() { 
615          return this.instruction == null ? null : this.instruction.getValue();
616        }
617
618        /**
619         * @param value Free text or additional instructions or information pertaining to the oral diet.
620         */
621        public NutritionOrderOralDietComponent setInstruction(String value) { 
622          if (Utilities.noString(value))
623            this.instruction = null;
624          else {
625            if (this.instruction == null)
626              this.instruction = new StringType();
627            this.instruction.setValue(value);
628          }
629          return this;
630        }
631
632        protected void listChildren(List<Property> children) {
633          super.listChildren(children);
634          children.add(new Property("type", "CodeableConcept", "The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet.", 0, java.lang.Integer.MAX_VALUE, type));
635          children.add(new Property("schedule", "Timing", "The time period and frequency at which the diet should be given.  The diet should be given for the combination of all schedules if more than one schedule is present.", 0, java.lang.Integer.MAX_VALUE, schedule));
636          children.add(new Property("nutrient", "", "Class that defines the quantity and type of nutrient modifications (for example carbohydrate, fiber or sodium) required for the oral diet.", 0, java.lang.Integer.MAX_VALUE, nutrient));
637          children.add(new Property("texture", "", "Class that describes any texture modifications required for the patient to safely consume various types of solid foods.", 0, java.lang.Integer.MAX_VALUE, texture));
638          children.add(new Property("fluidConsistencyType", "CodeableConcept", "The required consistency (e.g. honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.", 0, java.lang.Integer.MAX_VALUE, fluidConsistencyType));
639          children.add(new Property("instruction", "string", "Free text or additional instructions or information pertaining to the oral diet.", 0, 1, instruction));
640        }
641
642        @Override
643        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
644          switch (_hash) {
645          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet.", 0, java.lang.Integer.MAX_VALUE, type);
646          case -697920873: /*schedule*/  return new Property("schedule", "Timing", "The time period and frequency at which the diet should be given.  The diet should be given for the combination of all schedules if more than one schedule is present.", 0, java.lang.Integer.MAX_VALUE, schedule);
647          case -1671151641: /*nutrient*/  return new Property("nutrient", "", "Class that defines the quantity and type of nutrient modifications (for example carbohydrate, fiber or sodium) required for the oral diet.", 0, java.lang.Integer.MAX_VALUE, nutrient);
648          case -1417816805: /*texture*/  return new Property("texture", "", "Class that describes any texture modifications required for the patient to safely consume various types of solid foods.", 0, java.lang.Integer.MAX_VALUE, texture);
649          case -525105592: /*fluidConsistencyType*/  return new Property("fluidConsistencyType", "CodeableConcept", "The required consistency (e.g. honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.", 0, java.lang.Integer.MAX_VALUE, fluidConsistencyType);
650          case 301526158: /*instruction*/  return new Property("instruction", "string", "Free text or additional instructions or information pertaining to the oral diet.", 0, 1, instruction);
651          default: return super.getNamedProperty(_hash, _name, _checkValid);
652          }
653
654        }
655
656      @Override
657      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
658        switch (hash) {
659        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
660        case -697920873: /*schedule*/ return this.schedule == null ? new Base[0] : this.schedule.toArray(new Base[this.schedule.size()]); // Timing
661        case -1671151641: /*nutrient*/ return this.nutrient == null ? new Base[0] : this.nutrient.toArray(new Base[this.nutrient.size()]); // NutritionOrderOralDietNutrientComponent
662        case -1417816805: /*texture*/ return this.texture == null ? new Base[0] : this.texture.toArray(new Base[this.texture.size()]); // NutritionOrderOralDietTextureComponent
663        case -525105592: /*fluidConsistencyType*/ return this.fluidConsistencyType == null ? new Base[0] : this.fluidConsistencyType.toArray(new Base[this.fluidConsistencyType.size()]); // CodeableConcept
664        case 301526158: /*instruction*/ return this.instruction == null ? new Base[0] : new Base[] {this.instruction}; // StringType
665        default: return super.getProperty(hash, name, checkValid);
666        }
667
668      }
669
670      @Override
671      public Base setProperty(int hash, String name, Base value) throws FHIRException {
672        switch (hash) {
673        case 3575610: // type
674          this.getType().add(castToCodeableConcept(value)); // CodeableConcept
675          return value;
676        case -697920873: // schedule
677          this.getSchedule().add(castToTiming(value)); // Timing
678          return value;
679        case -1671151641: // nutrient
680          this.getNutrient().add((NutritionOrderOralDietNutrientComponent) value); // NutritionOrderOralDietNutrientComponent
681          return value;
682        case -1417816805: // texture
683          this.getTexture().add((NutritionOrderOralDietTextureComponent) value); // NutritionOrderOralDietTextureComponent
684          return value;
685        case -525105592: // fluidConsistencyType
686          this.getFluidConsistencyType().add(castToCodeableConcept(value)); // CodeableConcept
687          return value;
688        case 301526158: // instruction
689          this.instruction = castToString(value); // StringType
690          return value;
691        default: return super.setProperty(hash, name, value);
692        }
693
694      }
695
696      @Override
697      public Base setProperty(String name, Base value) throws FHIRException {
698        if (name.equals("type")) {
699          this.getType().add(castToCodeableConcept(value));
700        } else if (name.equals("schedule")) {
701          this.getSchedule().add(castToTiming(value));
702        } else if (name.equals("nutrient")) {
703          this.getNutrient().add((NutritionOrderOralDietNutrientComponent) value);
704        } else if (name.equals("texture")) {
705          this.getTexture().add((NutritionOrderOralDietTextureComponent) value);
706        } else if (name.equals("fluidConsistencyType")) {
707          this.getFluidConsistencyType().add(castToCodeableConcept(value));
708        } else if (name.equals("instruction")) {
709          this.instruction = castToString(value); // StringType
710        } else
711          return super.setProperty(name, value);
712        return value;
713      }
714
715      @Override
716      public Base makeProperty(int hash, String name) throws FHIRException {
717        switch (hash) {
718        case 3575610:  return addType(); 
719        case -697920873:  return addSchedule(); 
720        case -1671151641:  return addNutrient(); 
721        case -1417816805:  return addTexture(); 
722        case -525105592:  return addFluidConsistencyType(); 
723        case 301526158:  return getInstructionElement();
724        default: return super.makeProperty(hash, name);
725        }
726
727      }
728
729      @Override
730      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
731        switch (hash) {
732        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
733        case -697920873: /*schedule*/ return new String[] {"Timing"};
734        case -1671151641: /*nutrient*/ return new String[] {};
735        case -1417816805: /*texture*/ return new String[] {};
736        case -525105592: /*fluidConsistencyType*/ return new String[] {"CodeableConcept"};
737        case 301526158: /*instruction*/ return new String[] {"string"};
738        default: return super.getTypesForProperty(hash, name);
739        }
740
741      }
742
743      @Override
744      public Base addChild(String name) throws FHIRException {
745        if (name.equals("type")) {
746          return addType();
747        }
748        else if (name.equals("schedule")) {
749          return addSchedule();
750        }
751        else if (name.equals("nutrient")) {
752          return addNutrient();
753        }
754        else if (name.equals("texture")) {
755          return addTexture();
756        }
757        else if (name.equals("fluidConsistencyType")) {
758          return addFluidConsistencyType();
759        }
760        else if (name.equals("instruction")) {
761          throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.instruction");
762        }
763        else
764          return super.addChild(name);
765      }
766
767      public NutritionOrderOralDietComponent copy() {
768        NutritionOrderOralDietComponent dst = new NutritionOrderOralDietComponent();
769        copyValues(dst);
770        if (type != null) {
771          dst.type = new ArrayList<CodeableConcept>();
772          for (CodeableConcept i : type)
773            dst.type.add(i.copy());
774        };
775        if (schedule != null) {
776          dst.schedule = new ArrayList<Timing>();
777          for (Timing i : schedule)
778            dst.schedule.add(i.copy());
779        };
780        if (nutrient != null) {
781          dst.nutrient = new ArrayList<NutritionOrderOralDietNutrientComponent>();
782          for (NutritionOrderOralDietNutrientComponent i : nutrient)
783            dst.nutrient.add(i.copy());
784        };
785        if (texture != null) {
786          dst.texture = new ArrayList<NutritionOrderOralDietTextureComponent>();
787          for (NutritionOrderOralDietTextureComponent i : texture)
788            dst.texture.add(i.copy());
789        };
790        if (fluidConsistencyType != null) {
791          dst.fluidConsistencyType = new ArrayList<CodeableConcept>();
792          for (CodeableConcept i : fluidConsistencyType)
793            dst.fluidConsistencyType.add(i.copy());
794        };
795        dst.instruction = instruction == null ? null : instruction.copy();
796        return dst;
797      }
798
799      @Override
800      public boolean equalsDeep(Base other_) {
801        if (!super.equalsDeep(other_))
802          return false;
803        if (!(other_ instanceof NutritionOrderOralDietComponent))
804          return false;
805        NutritionOrderOralDietComponent o = (NutritionOrderOralDietComponent) other_;
806        return compareDeep(type, o.type, true) && compareDeep(schedule, o.schedule, true) && compareDeep(nutrient, o.nutrient, true)
807           && compareDeep(texture, o.texture, true) && compareDeep(fluidConsistencyType, o.fluidConsistencyType, true)
808           && compareDeep(instruction, o.instruction, true);
809      }
810
811      @Override
812      public boolean equalsShallow(Base other_) {
813        if (!super.equalsShallow(other_))
814          return false;
815        if (!(other_ instanceof NutritionOrderOralDietComponent))
816          return false;
817        NutritionOrderOralDietComponent o = (NutritionOrderOralDietComponent) other_;
818        return compareValues(instruction, o.instruction, true);
819      }
820
821      public boolean isEmpty() {
822        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, schedule, nutrient
823          , texture, fluidConsistencyType, instruction);
824      }
825
826  public String fhirType() {
827    return "NutritionOrder.oralDiet";
828
829  }
830
831  }
832
833    @Block()
834    public static class NutritionOrderOralDietNutrientComponent extends BackboneElement implements IBaseBackboneElement {
835        /**
836         * The nutrient that is being modified such as carbohydrate or sodium.
837         */
838        @Child(name = "modifier", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
839        @Description(shortDefinition="Type of nutrient that is being modified", formalDefinition="The nutrient that is being modified such as carbohydrate or sodium." )
840        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/nutrient-code")
841        protected CodeableConcept modifier;
842
843        /**
844         * The quantity of the specified nutrient to include in diet.
845         */
846        @Child(name = "amount", type = {SimpleQuantity.class}, order=2, min=0, max=1, modifier=false, summary=false)
847        @Description(shortDefinition="Quantity of the specified nutrient", formalDefinition="The quantity of the specified nutrient to include in diet." )
848        protected SimpleQuantity amount;
849
850        private static final long serialVersionUID = 465107295L;
851
852    /**
853     * Constructor
854     */
855      public NutritionOrderOralDietNutrientComponent() {
856        super();
857      }
858
859        /**
860         * @return {@link #modifier} (The nutrient that is being modified such as carbohydrate or sodium.)
861         */
862        public CodeableConcept getModifier() { 
863          if (this.modifier == null)
864            if (Configuration.errorOnAutoCreate())
865              throw new Error("Attempt to auto-create NutritionOrderOralDietNutrientComponent.modifier");
866            else if (Configuration.doAutoCreate())
867              this.modifier = new CodeableConcept(); // cc
868          return this.modifier;
869        }
870
871        public boolean hasModifier() { 
872          return this.modifier != null && !this.modifier.isEmpty();
873        }
874
875        /**
876         * @param value {@link #modifier} (The nutrient that is being modified such as carbohydrate or sodium.)
877         */
878        public NutritionOrderOralDietNutrientComponent setModifier(CodeableConcept value)  { 
879          this.modifier = value;
880          return this;
881        }
882
883        /**
884         * @return {@link #amount} (The quantity of the specified nutrient to include in diet.)
885         */
886        public SimpleQuantity getAmount() { 
887          if (this.amount == null)
888            if (Configuration.errorOnAutoCreate())
889              throw new Error("Attempt to auto-create NutritionOrderOralDietNutrientComponent.amount");
890            else if (Configuration.doAutoCreate())
891              this.amount = new SimpleQuantity(); // cc
892          return this.amount;
893        }
894
895        public boolean hasAmount() { 
896          return this.amount != null && !this.amount.isEmpty();
897        }
898
899        /**
900         * @param value {@link #amount} (The quantity of the specified nutrient to include in diet.)
901         */
902        public NutritionOrderOralDietNutrientComponent setAmount(SimpleQuantity value)  { 
903          this.amount = value;
904          return this;
905        }
906
907        protected void listChildren(List<Property> children) {
908          super.listChildren(children);
909          children.add(new Property("modifier", "CodeableConcept", "The nutrient that is being modified such as carbohydrate or sodium.", 0, 1, modifier));
910          children.add(new Property("amount", "SimpleQuantity", "The quantity of the specified nutrient to include in diet.", 0, 1, amount));
911        }
912
913        @Override
914        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
915          switch (_hash) {
916          case -615513385: /*modifier*/  return new Property("modifier", "CodeableConcept", "The nutrient that is being modified such as carbohydrate or sodium.", 0, 1, modifier);
917          case -1413853096: /*amount*/  return new Property("amount", "SimpleQuantity", "The quantity of the specified nutrient to include in diet.", 0, 1, amount);
918          default: return super.getNamedProperty(_hash, _name, _checkValid);
919          }
920
921        }
922
923      @Override
924      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
925        switch (hash) {
926        case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : new Base[] {this.modifier}; // CodeableConcept
927        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // SimpleQuantity
928        default: return super.getProperty(hash, name, checkValid);
929        }
930
931      }
932
933      @Override
934      public Base setProperty(int hash, String name, Base value) throws FHIRException {
935        switch (hash) {
936        case -615513385: // modifier
937          this.modifier = castToCodeableConcept(value); // CodeableConcept
938          return value;
939        case -1413853096: // amount
940          this.amount = castToSimpleQuantity(value); // SimpleQuantity
941          return value;
942        default: return super.setProperty(hash, name, value);
943        }
944
945      }
946
947      @Override
948      public Base setProperty(String name, Base value) throws FHIRException {
949        if (name.equals("modifier")) {
950          this.modifier = castToCodeableConcept(value); // CodeableConcept
951        } else if (name.equals("amount")) {
952          this.amount = castToSimpleQuantity(value); // SimpleQuantity
953        } else
954          return super.setProperty(name, value);
955        return value;
956      }
957
958      @Override
959      public Base makeProperty(int hash, String name) throws FHIRException {
960        switch (hash) {
961        case -615513385:  return getModifier(); 
962        case -1413853096:  return getAmount(); 
963        default: return super.makeProperty(hash, name);
964        }
965
966      }
967
968      @Override
969      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
970        switch (hash) {
971        case -615513385: /*modifier*/ return new String[] {"CodeableConcept"};
972        case -1413853096: /*amount*/ return new String[] {"SimpleQuantity"};
973        default: return super.getTypesForProperty(hash, name);
974        }
975
976      }
977
978      @Override
979      public Base addChild(String name) throws FHIRException {
980        if (name.equals("modifier")) {
981          this.modifier = new CodeableConcept();
982          return this.modifier;
983        }
984        else if (name.equals("amount")) {
985          this.amount = new SimpleQuantity();
986          return this.amount;
987        }
988        else
989          return super.addChild(name);
990      }
991
992      public NutritionOrderOralDietNutrientComponent copy() {
993        NutritionOrderOralDietNutrientComponent dst = new NutritionOrderOralDietNutrientComponent();
994        copyValues(dst);
995        dst.modifier = modifier == null ? null : modifier.copy();
996        dst.amount = amount == null ? null : amount.copy();
997        return dst;
998      }
999
1000      @Override
1001      public boolean equalsDeep(Base other_) {
1002        if (!super.equalsDeep(other_))
1003          return false;
1004        if (!(other_ instanceof NutritionOrderOralDietNutrientComponent))
1005          return false;
1006        NutritionOrderOralDietNutrientComponent o = (NutritionOrderOralDietNutrientComponent) other_;
1007        return compareDeep(modifier, o.modifier, true) && compareDeep(amount, o.amount, true);
1008      }
1009
1010      @Override
1011      public boolean equalsShallow(Base other_) {
1012        if (!super.equalsShallow(other_))
1013          return false;
1014        if (!(other_ instanceof NutritionOrderOralDietNutrientComponent))
1015          return false;
1016        NutritionOrderOralDietNutrientComponent o = (NutritionOrderOralDietNutrientComponent) other_;
1017        return true;
1018      }
1019
1020      public boolean isEmpty() {
1021        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(modifier, amount);
1022      }
1023
1024  public String fhirType() {
1025    return "NutritionOrder.oralDiet.nutrient";
1026
1027  }
1028
1029  }
1030
1031    @Block()
1032    public static class NutritionOrderOralDietTextureComponent extends BackboneElement implements IBaseBackboneElement {
1033        /**
1034         * Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.
1035         */
1036        @Child(name = "modifier", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
1037        @Description(shortDefinition="Code to indicate how to alter the texture of the foods, e.g. pureed", formalDefinition="Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed." )
1038        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/texture-code")
1039        protected CodeableConcept modifier;
1040
1041        /**
1042         * The food type(s) (e.g. meats, all foods)  that the texture modification applies to.  This could be all foods types.
1043         */
1044        @Child(name = "foodType", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
1045        @Description(shortDefinition="Concepts that are used to identify an entity that is ingested for nutritional purposes", formalDefinition="The food type(s) (e.g. meats, all foods)  that the texture modification applies to.  This could be all foods types." )
1046        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/modified-foodtype")
1047        protected CodeableConcept foodType;
1048
1049        private static final long serialVersionUID = -56402817L;
1050
1051    /**
1052     * Constructor
1053     */
1054      public NutritionOrderOralDietTextureComponent() {
1055        super();
1056      }
1057
1058        /**
1059         * @return {@link #modifier} (Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.)
1060         */
1061        public CodeableConcept getModifier() { 
1062          if (this.modifier == null)
1063            if (Configuration.errorOnAutoCreate())
1064              throw new Error("Attempt to auto-create NutritionOrderOralDietTextureComponent.modifier");
1065            else if (Configuration.doAutoCreate())
1066              this.modifier = new CodeableConcept(); // cc
1067          return this.modifier;
1068        }
1069
1070        public boolean hasModifier() { 
1071          return this.modifier != null && !this.modifier.isEmpty();
1072        }
1073
1074        /**
1075         * @param value {@link #modifier} (Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.)
1076         */
1077        public NutritionOrderOralDietTextureComponent setModifier(CodeableConcept value)  { 
1078          this.modifier = value;
1079          return this;
1080        }
1081
1082        /**
1083         * @return {@link #foodType} (The food type(s) (e.g. meats, all foods)  that the texture modification applies to.  This could be all foods types.)
1084         */
1085        public CodeableConcept getFoodType() { 
1086          if (this.foodType == null)
1087            if (Configuration.errorOnAutoCreate())
1088              throw new Error("Attempt to auto-create NutritionOrderOralDietTextureComponent.foodType");
1089            else if (Configuration.doAutoCreate())
1090              this.foodType = new CodeableConcept(); // cc
1091          return this.foodType;
1092        }
1093
1094        public boolean hasFoodType() { 
1095          return this.foodType != null && !this.foodType.isEmpty();
1096        }
1097
1098        /**
1099         * @param value {@link #foodType} (The food type(s) (e.g. meats, all foods)  that the texture modification applies to.  This could be all foods types.)
1100         */
1101        public NutritionOrderOralDietTextureComponent setFoodType(CodeableConcept value)  { 
1102          this.foodType = value;
1103          return this;
1104        }
1105
1106        protected void listChildren(List<Property> children) {
1107          super.listChildren(children);
1108          children.add(new Property("modifier", "CodeableConcept", "Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.", 0, 1, modifier));
1109          children.add(new Property("foodType", "CodeableConcept", "The food type(s) (e.g. meats, all foods)  that the texture modification applies to.  This could be all foods types.", 0, 1, foodType));
1110        }
1111
1112        @Override
1113        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1114          switch (_hash) {
1115          case -615513385: /*modifier*/  return new Property("modifier", "CodeableConcept", "Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.", 0, 1, modifier);
1116          case 379498680: /*foodType*/  return new Property("foodType", "CodeableConcept", "The food type(s) (e.g. meats, all foods)  that the texture modification applies to.  This could be all foods types.", 0, 1, foodType);
1117          default: return super.getNamedProperty(_hash, _name, _checkValid);
1118          }
1119
1120        }
1121
1122      @Override
1123      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1124        switch (hash) {
1125        case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : new Base[] {this.modifier}; // CodeableConcept
1126        case 379498680: /*foodType*/ return this.foodType == null ? new Base[0] : new Base[] {this.foodType}; // CodeableConcept
1127        default: return super.getProperty(hash, name, checkValid);
1128        }
1129
1130      }
1131
1132      @Override
1133      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1134        switch (hash) {
1135        case -615513385: // modifier
1136          this.modifier = castToCodeableConcept(value); // CodeableConcept
1137          return value;
1138        case 379498680: // foodType
1139          this.foodType = castToCodeableConcept(value); // CodeableConcept
1140          return value;
1141        default: return super.setProperty(hash, name, value);
1142        }
1143
1144      }
1145
1146      @Override
1147      public Base setProperty(String name, Base value) throws FHIRException {
1148        if (name.equals("modifier")) {
1149          this.modifier = castToCodeableConcept(value); // CodeableConcept
1150        } else if (name.equals("foodType")) {
1151          this.foodType = castToCodeableConcept(value); // CodeableConcept
1152        } else
1153          return super.setProperty(name, value);
1154        return value;
1155      }
1156
1157      @Override
1158      public Base makeProperty(int hash, String name) throws FHIRException {
1159        switch (hash) {
1160        case -615513385:  return getModifier(); 
1161        case 379498680:  return getFoodType(); 
1162        default: return super.makeProperty(hash, name);
1163        }
1164
1165      }
1166
1167      @Override
1168      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1169        switch (hash) {
1170        case -615513385: /*modifier*/ return new String[] {"CodeableConcept"};
1171        case 379498680: /*foodType*/ return new String[] {"CodeableConcept"};
1172        default: return super.getTypesForProperty(hash, name);
1173        }
1174
1175      }
1176
1177      @Override
1178      public Base addChild(String name) throws FHIRException {
1179        if (name.equals("modifier")) {
1180          this.modifier = new CodeableConcept();
1181          return this.modifier;
1182        }
1183        else if (name.equals("foodType")) {
1184          this.foodType = new CodeableConcept();
1185          return this.foodType;
1186        }
1187        else
1188          return super.addChild(name);
1189      }
1190
1191      public NutritionOrderOralDietTextureComponent copy() {
1192        NutritionOrderOralDietTextureComponent dst = new NutritionOrderOralDietTextureComponent();
1193        copyValues(dst);
1194        dst.modifier = modifier == null ? null : modifier.copy();
1195        dst.foodType = foodType == null ? null : foodType.copy();
1196        return dst;
1197      }
1198
1199      @Override
1200      public boolean equalsDeep(Base other_) {
1201        if (!super.equalsDeep(other_))
1202          return false;
1203        if (!(other_ instanceof NutritionOrderOralDietTextureComponent))
1204          return false;
1205        NutritionOrderOralDietTextureComponent o = (NutritionOrderOralDietTextureComponent) other_;
1206        return compareDeep(modifier, o.modifier, true) && compareDeep(foodType, o.foodType, true);
1207      }
1208
1209      @Override
1210      public boolean equalsShallow(Base other_) {
1211        if (!super.equalsShallow(other_))
1212          return false;
1213        if (!(other_ instanceof NutritionOrderOralDietTextureComponent))
1214          return false;
1215        NutritionOrderOralDietTextureComponent o = (NutritionOrderOralDietTextureComponent) other_;
1216        return true;
1217      }
1218
1219      public boolean isEmpty() {
1220        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(modifier, foodType);
1221      }
1222
1223  public String fhirType() {
1224    return "NutritionOrder.oralDiet.texture";
1225
1226  }
1227
1228  }
1229
1230    @Block()
1231    public static class NutritionOrderSupplementComponent extends BackboneElement implements IBaseBackboneElement {
1232        /**
1233         * The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.
1234         */
1235        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
1236        @Description(shortDefinition="Type of supplement product requested", formalDefinition="The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement." )
1237        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/supplement-type")
1238        protected CodeableConcept type;
1239
1240        /**
1241         * The product or brand name of the nutritional supplement such as "Acme Protein Shake".
1242         */
1243        @Child(name = "productName", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1244        @Description(shortDefinition="Product or brand name of the nutritional supplement", formalDefinition="The product or brand name of the nutritional supplement such as \"Acme Protein Shake\"." )
1245        protected StringType productName;
1246
1247        /**
1248         * The time period and frequency at which the supplement(s) should be given.  The supplement should be given for the combination of all schedules if more than one schedule is present.
1249         */
1250        @Child(name = "schedule", type = {Timing.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1251        @Description(shortDefinition="Scheduled frequency of supplement", formalDefinition="The time period and frequency at which the supplement(s) should be given.  The supplement should be given for the combination of all schedules if more than one schedule is present." )
1252        protected List<Timing> schedule;
1253
1254        /**
1255         * The amount of the nutritional supplement to be given.
1256         */
1257        @Child(name = "quantity", type = {SimpleQuantity.class}, order=4, min=0, max=1, modifier=false, summary=false)
1258        @Description(shortDefinition="Amount of the nutritional supplement", formalDefinition="The amount of the nutritional supplement to be given." )
1259        protected SimpleQuantity quantity;
1260
1261        /**
1262         * Free text or additional instructions or information pertaining to the oral supplement.
1263         */
1264        @Child(name = "instruction", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
1265        @Description(shortDefinition="Instructions or additional information about the oral supplement", formalDefinition="Free text or additional instructions or information pertaining to the oral supplement." )
1266        protected StringType instruction;
1267
1268        private static final long serialVersionUID = 297545236L;
1269
1270    /**
1271     * Constructor
1272     */
1273      public NutritionOrderSupplementComponent() {
1274        super();
1275      }
1276
1277        /**
1278         * @return {@link #type} (The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.)
1279         */
1280        public CodeableConcept getType() { 
1281          if (this.type == null)
1282            if (Configuration.errorOnAutoCreate())
1283              throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.type");
1284            else if (Configuration.doAutoCreate())
1285              this.type = new CodeableConcept(); // cc
1286          return this.type;
1287        }
1288
1289        public boolean hasType() { 
1290          return this.type != null && !this.type.isEmpty();
1291        }
1292
1293        /**
1294         * @param value {@link #type} (The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.)
1295         */
1296        public NutritionOrderSupplementComponent setType(CodeableConcept value)  { 
1297          this.type = value;
1298          return this;
1299        }
1300
1301        /**
1302         * @return {@link #productName} (The product or brand name of the nutritional supplement such as "Acme Protein Shake".). This is the underlying object with id, value and extensions. The accessor "getProductName" gives direct access to the value
1303         */
1304        public StringType getProductNameElement() { 
1305          if (this.productName == null)
1306            if (Configuration.errorOnAutoCreate())
1307              throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.productName");
1308            else if (Configuration.doAutoCreate())
1309              this.productName = new StringType(); // bb
1310          return this.productName;
1311        }
1312
1313        public boolean hasProductNameElement() { 
1314          return this.productName != null && !this.productName.isEmpty();
1315        }
1316
1317        public boolean hasProductName() { 
1318          return this.productName != null && !this.productName.isEmpty();
1319        }
1320
1321        /**
1322         * @param value {@link #productName} (The product or brand name of the nutritional supplement such as "Acme Protein Shake".). This is the underlying object with id, value and extensions. The accessor "getProductName" gives direct access to the value
1323         */
1324        public NutritionOrderSupplementComponent setProductNameElement(StringType value) { 
1325          this.productName = value;
1326          return this;
1327        }
1328
1329        /**
1330         * @return The product or brand name of the nutritional supplement such as "Acme Protein Shake".
1331         */
1332        public String getProductName() { 
1333          return this.productName == null ? null : this.productName.getValue();
1334        }
1335
1336        /**
1337         * @param value The product or brand name of the nutritional supplement such as "Acme Protein Shake".
1338         */
1339        public NutritionOrderSupplementComponent setProductName(String value) { 
1340          if (Utilities.noString(value))
1341            this.productName = null;
1342          else {
1343            if (this.productName == null)
1344              this.productName = new StringType();
1345            this.productName.setValue(value);
1346          }
1347          return this;
1348        }
1349
1350        /**
1351         * @return {@link #schedule} (The time period and frequency at which the supplement(s) should be given.  The supplement should be given for the combination of all schedules if more than one schedule is present.)
1352         */
1353        public List<Timing> getSchedule() { 
1354          if (this.schedule == null)
1355            this.schedule = new ArrayList<Timing>();
1356          return this.schedule;
1357        }
1358
1359        /**
1360         * @return Returns a reference to <code>this</code> for easy method chaining
1361         */
1362        public NutritionOrderSupplementComponent setSchedule(List<Timing> theSchedule) { 
1363          this.schedule = theSchedule;
1364          return this;
1365        }
1366
1367        public boolean hasSchedule() { 
1368          if (this.schedule == null)
1369            return false;
1370          for (Timing item : this.schedule)
1371            if (!item.isEmpty())
1372              return true;
1373          return false;
1374        }
1375
1376        public Timing addSchedule() { //3
1377          Timing t = new Timing();
1378          if (this.schedule == null)
1379            this.schedule = new ArrayList<Timing>();
1380          this.schedule.add(t);
1381          return t;
1382        }
1383
1384        public NutritionOrderSupplementComponent addSchedule(Timing t) { //3
1385          if (t == null)
1386            return this;
1387          if (this.schedule == null)
1388            this.schedule = new ArrayList<Timing>();
1389          this.schedule.add(t);
1390          return this;
1391        }
1392
1393        /**
1394         * @return The first repetition of repeating field {@link #schedule}, creating it if it does not already exist
1395         */
1396        public Timing getScheduleFirstRep() { 
1397          if (getSchedule().isEmpty()) {
1398            addSchedule();
1399          }
1400          return getSchedule().get(0);
1401        }
1402
1403        /**
1404         * @return {@link #quantity} (The amount of the nutritional supplement to be given.)
1405         */
1406        public SimpleQuantity getQuantity() { 
1407          if (this.quantity == null)
1408            if (Configuration.errorOnAutoCreate())
1409              throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.quantity");
1410            else if (Configuration.doAutoCreate())
1411              this.quantity = new SimpleQuantity(); // cc
1412          return this.quantity;
1413        }
1414
1415        public boolean hasQuantity() { 
1416          return this.quantity != null && !this.quantity.isEmpty();
1417        }
1418
1419        /**
1420         * @param value {@link #quantity} (The amount of the nutritional supplement to be given.)
1421         */
1422        public NutritionOrderSupplementComponent setQuantity(SimpleQuantity value)  { 
1423          this.quantity = value;
1424          return this;
1425        }
1426
1427        /**
1428         * @return {@link #instruction} (Free text or additional instructions or information pertaining to the oral supplement.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value
1429         */
1430        public StringType getInstructionElement() { 
1431          if (this.instruction == null)
1432            if (Configuration.errorOnAutoCreate())
1433              throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.instruction");
1434            else if (Configuration.doAutoCreate())
1435              this.instruction = new StringType(); // bb
1436          return this.instruction;
1437        }
1438
1439        public boolean hasInstructionElement() { 
1440          return this.instruction != null && !this.instruction.isEmpty();
1441        }
1442
1443        public boolean hasInstruction() { 
1444          return this.instruction != null && !this.instruction.isEmpty();
1445        }
1446
1447        /**
1448         * @param value {@link #instruction} (Free text or additional instructions or information pertaining to the oral supplement.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value
1449         */
1450        public NutritionOrderSupplementComponent setInstructionElement(StringType value) { 
1451          this.instruction = value;
1452          return this;
1453        }
1454
1455        /**
1456         * @return Free text or additional instructions or information pertaining to the oral supplement.
1457         */
1458        public String getInstruction() { 
1459          return this.instruction == null ? null : this.instruction.getValue();
1460        }
1461
1462        /**
1463         * @param value Free text or additional instructions or information pertaining to the oral supplement.
1464         */
1465        public NutritionOrderSupplementComponent setInstruction(String value) { 
1466          if (Utilities.noString(value))
1467            this.instruction = null;
1468          else {
1469            if (this.instruction == null)
1470              this.instruction = new StringType();
1471            this.instruction.setValue(value);
1472          }
1473          return this;
1474        }
1475
1476        protected void listChildren(List<Property> children) {
1477          super.listChildren(children);
1478          children.add(new Property("type", "CodeableConcept", "The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.", 0, 1, type));
1479          children.add(new Property("productName", "string", "The product or brand name of the nutritional supplement such as \"Acme Protein Shake\".", 0, 1, productName));
1480          children.add(new Property("schedule", "Timing", "The time period and frequency at which the supplement(s) should be given.  The supplement should be given for the combination of all schedules if more than one schedule is present.", 0, java.lang.Integer.MAX_VALUE, schedule));
1481          children.add(new Property("quantity", "SimpleQuantity", "The amount of the nutritional supplement to be given.", 0, 1, quantity));
1482          children.add(new Property("instruction", "string", "Free text or additional instructions or information pertaining to the oral supplement.", 0, 1, instruction));
1483        }
1484
1485        @Override
1486        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1487          switch (_hash) {
1488          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.", 0, 1, type);
1489          case -1491817446: /*productName*/  return new Property("productName", "string", "The product or brand name of the nutritional supplement such as \"Acme Protein Shake\".", 0, 1, productName);
1490          case -697920873: /*schedule*/  return new Property("schedule", "Timing", "The time period and frequency at which the supplement(s) should be given.  The supplement should be given for the combination of all schedules if more than one schedule is present.", 0, java.lang.Integer.MAX_VALUE, schedule);
1491          case -1285004149: /*quantity*/  return new Property("quantity", "SimpleQuantity", "The amount of the nutritional supplement to be given.", 0, 1, quantity);
1492          case 301526158: /*instruction*/  return new Property("instruction", "string", "Free text or additional instructions or information pertaining to the oral supplement.", 0, 1, instruction);
1493          default: return super.getNamedProperty(_hash, _name, _checkValid);
1494          }
1495
1496        }
1497
1498      @Override
1499      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1500        switch (hash) {
1501        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1502        case -1491817446: /*productName*/ return this.productName == null ? new Base[0] : new Base[] {this.productName}; // StringType
1503        case -697920873: /*schedule*/ return this.schedule == null ? new Base[0] : this.schedule.toArray(new Base[this.schedule.size()]); // Timing
1504        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity
1505        case 301526158: /*instruction*/ return this.instruction == null ? new Base[0] : new Base[] {this.instruction}; // StringType
1506        default: return super.getProperty(hash, name, checkValid);
1507        }
1508
1509      }
1510
1511      @Override
1512      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1513        switch (hash) {
1514        case 3575610: // type
1515          this.type = castToCodeableConcept(value); // CodeableConcept
1516          return value;
1517        case -1491817446: // productName
1518          this.productName = castToString(value); // StringType
1519          return value;
1520        case -697920873: // schedule
1521          this.getSchedule().add(castToTiming(value)); // Timing
1522          return value;
1523        case -1285004149: // quantity
1524          this.quantity = castToSimpleQuantity(value); // SimpleQuantity
1525          return value;
1526        case 301526158: // instruction
1527          this.instruction = castToString(value); // StringType
1528          return value;
1529        default: return super.setProperty(hash, name, value);
1530        }
1531
1532      }
1533
1534      @Override
1535      public Base setProperty(String name, Base value) throws FHIRException {
1536        if (name.equals("type")) {
1537          this.type = castToCodeableConcept(value); // CodeableConcept
1538        } else if (name.equals("productName")) {
1539          this.productName = castToString(value); // StringType
1540        } else if (name.equals("schedule")) {
1541          this.getSchedule().add(castToTiming(value));
1542        } else if (name.equals("quantity")) {
1543          this.quantity = castToSimpleQuantity(value); // SimpleQuantity
1544        } else if (name.equals("instruction")) {
1545          this.instruction = castToString(value); // StringType
1546        } else
1547          return super.setProperty(name, value);
1548        return value;
1549      }
1550
1551      @Override
1552      public Base makeProperty(int hash, String name) throws FHIRException {
1553        switch (hash) {
1554        case 3575610:  return getType(); 
1555        case -1491817446:  return getProductNameElement();
1556        case -697920873:  return addSchedule(); 
1557        case -1285004149:  return getQuantity(); 
1558        case 301526158:  return getInstructionElement();
1559        default: return super.makeProperty(hash, name);
1560        }
1561
1562      }
1563
1564      @Override
1565      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1566        switch (hash) {
1567        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1568        case -1491817446: /*productName*/ return new String[] {"string"};
1569        case -697920873: /*schedule*/ return new String[] {"Timing"};
1570        case -1285004149: /*quantity*/ return new String[] {"SimpleQuantity"};
1571        case 301526158: /*instruction*/ return new String[] {"string"};
1572        default: return super.getTypesForProperty(hash, name);
1573        }
1574
1575      }
1576
1577      @Override
1578      public Base addChild(String name) throws FHIRException {
1579        if (name.equals("type")) {
1580          this.type = new CodeableConcept();
1581          return this.type;
1582        }
1583        else if (name.equals("productName")) {
1584          throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.productName");
1585        }
1586        else if (name.equals("schedule")) {
1587          return addSchedule();
1588        }
1589        else if (name.equals("quantity")) {
1590          this.quantity = new SimpleQuantity();
1591          return this.quantity;
1592        }
1593        else if (name.equals("instruction")) {
1594          throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.instruction");
1595        }
1596        else
1597          return super.addChild(name);
1598      }
1599
1600      public NutritionOrderSupplementComponent copy() {
1601        NutritionOrderSupplementComponent dst = new NutritionOrderSupplementComponent();
1602        copyValues(dst);
1603        dst.type = type == null ? null : type.copy();
1604        dst.productName = productName == null ? null : productName.copy();
1605        if (schedule != null) {
1606          dst.schedule = new ArrayList<Timing>();
1607          for (Timing i : schedule)
1608            dst.schedule.add(i.copy());
1609        };
1610        dst.quantity = quantity == null ? null : quantity.copy();
1611        dst.instruction = instruction == null ? null : instruction.copy();
1612        return dst;
1613      }
1614
1615      @Override
1616      public boolean equalsDeep(Base other_) {
1617        if (!super.equalsDeep(other_))
1618          return false;
1619        if (!(other_ instanceof NutritionOrderSupplementComponent))
1620          return false;
1621        NutritionOrderSupplementComponent o = (NutritionOrderSupplementComponent) other_;
1622        return compareDeep(type, o.type, true) && compareDeep(productName, o.productName, true) && compareDeep(schedule, o.schedule, true)
1623           && compareDeep(quantity, o.quantity, true) && compareDeep(instruction, o.instruction, true);
1624      }
1625
1626      @Override
1627      public boolean equalsShallow(Base other_) {
1628        if (!super.equalsShallow(other_))
1629          return false;
1630        if (!(other_ instanceof NutritionOrderSupplementComponent))
1631          return false;
1632        NutritionOrderSupplementComponent o = (NutritionOrderSupplementComponent) other_;
1633        return compareValues(productName, o.productName, true) && compareValues(instruction, o.instruction, true)
1634          ;
1635      }
1636
1637      public boolean isEmpty() {
1638        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, productName, schedule
1639          , quantity, instruction);
1640      }
1641
1642  public String fhirType() {
1643    return "NutritionOrder.supplement";
1644
1645  }
1646
1647  }
1648
1649    @Block()
1650    public static class NutritionOrderEnteralFormulaComponent extends BackboneElement implements IBaseBackboneElement {
1651        /**
1652         * The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula.
1653         */
1654        @Child(name = "baseFormulaType", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
1655        @Description(shortDefinition="Type of enteral or infant formula", formalDefinition="The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula." )
1656        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/entformula-type")
1657        protected CodeableConcept baseFormulaType;
1658
1659        /**
1660         * The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula".
1661         */
1662        @Child(name = "baseFormulaProductName", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1663        @Description(shortDefinition="Product or brand name of the enteral or infant formula", formalDefinition="The product or brand name of the enteral or infant formula product such as \"ACME Adult Standard Formula\"." )
1664        protected StringType baseFormulaProductName;
1665
1666        /**
1667         * Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.
1668         */
1669        @Child(name = "additiveType", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
1670        @Description(shortDefinition="Type of modular component to add to the feeding", formalDefinition="Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula." )
1671        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/entformula-additive")
1672        protected CodeableConcept additiveType;
1673
1674        /**
1675         * The product or brand name of the type of modular component to be added to the formula.
1676         */
1677        @Child(name = "additiveProductName", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
1678        @Description(shortDefinition="Product or brand name of the modular additive", formalDefinition="The product or brand name of the type of modular component to be added to the formula." )
1679        protected StringType additiveProductName;
1680
1681        /**
1682         * The amount of energy (calories) that the formula should provide per specified volume, typically per mL or fluid oz.  For example, an infant may require a formula that provides 24 calories per fluid ounce or an adult may require an enteral formula that provides 1.5 calorie/mL.
1683         */
1684        @Child(name = "caloricDensity", type = {SimpleQuantity.class}, order=5, min=0, max=1, modifier=false, summary=false)
1685        @Description(shortDefinition="Amount of energy per specified volume that is required", formalDefinition="The amount of energy (calories) that the formula should provide per specified volume, typically per mL or fluid oz.  For example, an infant may require a formula that provides 24 calories per fluid ounce or an adult may require an enteral formula that provides 1.5 calorie/mL." )
1686        protected SimpleQuantity caloricDensity;
1687
1688        /**
1689         * The route or physiological path of administration into the patient's gastrointestinal  tract for purposes of providing the formula feeding, e.g. nasogastric tube.
1690         */
1691        @Child(name = "routeofAdministration", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=false)
1692        @Description(shortDefinition="How the formula should enter the patient's gastrointestinal tract", formalDefinition="The route or physiological path of administration into the patient's gastrointestinal  tract for purposes of providing the formula feeding, e.g. nasogastric tube." )
1693        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/enteral-route")
1694        protected CodeableConcept routeofAdministration;
1695
1696        /**
1697         * Formula administration instructions as structured data.  This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding.  An example of this would be an instruction to increase the rate of continuous feeding every 2 hours.
1698         */
1699        @Child(name = "administration", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1700        @Description(shortDefinition="Formula feeding instruction as structured data", formalDefinition="Formula administration instructions as structured data.  This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding.  An example of this would be an instruction to increase the rate of continuous feeding every 2 hours." )
1701        protected List<NutritionOrderEnteralFormulaAdministrationComponent> administration;
1702
1703        /**
1704         * The maximum total quantity of formula that may be administered to a subject over the period of time, e.g. 1440 mL over 24 hours.
1705         */
1706        @Child(name = "maxVolumeToDeliver", type = {SimpleQuantity.class}, order=8, min=0, max=1, modifier=false, summary=false)
1707        @Description(shortDefinition="Upper limit on formula volume per unit of time", formalDefinition="The maximum total quantity of formula that may be administered to a subject over the period of time, e.g. 1440 mL over 24 hours." )
1708        protected SimpleQuantity maxVolumeToDeliver;
1709
1710        /**
1711         * Free text formula administration, feeding instructions or additional instructions or information.
1712         */
1713        @Child(name = "administrationInstruction", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true)
1714        @Description(shortDefinition="Formula feeding instructions expressed as text", formalDefinition="Free text formula administration, feeding instructions or additional instructions or information." )
1715        protected StringType administrationInstruction;
1716
1717        private static final long serialVersionUID = 292116061L;
1718
1719    /**
1720     * Constructor
1721     */
1722      public NutritionOrderEnteralFormulaComponent() {
1723        super();
1724      }
1725
1726        /**
1727         * @return {@link #baseFormulaType} (The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula.)
1728         */
1729        public CodeableConcept getBaseFormulaType() { 
1730          if (this.baseFormulaType == null)
1731            if (Configuration.errorOnAutoCreate())
1732              throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.baseFormulaType");
1733            else if (Configuration.doAutoCreate())
1734              this.baseFormulaType = new CodeableConcept(); // cc
1735          return this.baseFormulaType;
1736        }
1737
1738        public boolean hasBaseFormulaType() { 
1739          return this.baseFormulaType != null && !this.baseFormulaType.isEmpty();
1740        }
1741
1742        /**
1743         * @param value {@link #baseFormulaType} (The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula.)
1744         */
1745        public NutritionOrderEnteralFormulaComponent setBaseFormulaType(CodeableConcept value)  { 
1746          this.baseFormulaType = value;
1747          return this;
1748        }
1749
1750        /**
1751         * @return {@link #baseFormulaProductName} (The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula".). This is the underlying object with id, value and extensions. The accessor "getBaseFormulaProductName" gives direct access to the value
1752         */
1753        public StringType getBaseFormulaProductNameElement() { 
1754          if (this.baseFormulaProductName == null)
1755            if (Configuration.errorOnAutoCreate())
1756              throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.baseFormulaProductName");
1757            else if (Configuration.doAutoCreate())
1758              this.baseFormulaProductName = new StringType(); // bb
1759          return this.baseFormulaProductName;
1760        }
1761
1762        public boolean hasBaseFormulaProductNameElement() { 
1763          return this.baseFormulaProductName != null && !this.baseFormulaProductName.isEmpty();
1764        }
1765
1766        public boolean hasBaseFormulaProductName() { 
1767          return this.baseFormulaProductName != null && !this.baseFormulaProductName.isEmpty();
1768        }
1769
1770        /**
1771         * @param value {@link #baseFormulaProductName} (The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula".). This is the underlying object with id, value and extensions. The accessor "getBaseFormulaProductName" gives direct access to the value
1772         */
1773        public NutritionOrderEnteralFormulaComponent setBaseFormulaProductNameElement(StringType value) { 
1774          this.baseFormulaProductName = value;
1775          return this;
1776        }
1777
1778        /**
1779         * @return The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula".
1780         */
1781        public String getBaseFormulaProductName() { 
1782          return this.baseFormulaProductName == null ? null : this.baseFormulaProductName.getValue();
1783        }
1784
1785        /**
1786         * @param value The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula".
1787         */
1788        public NutritionOrderEnteralFormulaComponent setBaseFormulaProductName(String value) { 
1789          if (Utilities.noString(value))
1790            this.baseFormulaProductName = null;
1791          else {
1792            if (this.baseFormulaProductName == null)
1793              this.baseFormulaProductName = new StringType();
1794            this.baseFormulaProductName.setValue(value);
1795          }
1796          return this;
1797        }
1798
1799        /**
1800         * @return {@link #additiveType} (Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.)
1801         */
1802        public CodeableConcept getAdditiveType() { 
1803          if (this.additiveType == null)
1804            if (Configuration.errorOnAutoCreate())
1805              throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.additiveType");
1806            else if (Configuration.doAutoCreate())
1807              this.additiveType = new CodeableConcept(); // cc
1808          return this.additiveType;
1809        }
1810
1811        public boolean hasAdditiveType() { 
1812          return this.additiveType != null && !this.additiveType.isEmpty();
1813        }
1814
1815        /**
1816         * @param value {@link #additiveType} (Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.)
1817         */
1818        public NutritionOrderEnteralFormulaComponent setAdditiveType(CodeableConcept value)  { 
1819          this.additiveType = value;
1820          return this;
1821        }
1822
1823        /**
1824         * @return {@link #additiveProductName} (The product or brand name of the type of modular component to be added to the formula.). This is the underlying object with id, value and extensions. The accessor "getAdditiveProductName" gives direct access to the value
1825         */
1826        public StringType getAdditiveProductNameElement() { 
1827          if (this.additiveProductName == null)
1828            if (Configuration.errorOnAutoCreate())
1829              throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.additiveProductName");
1830            else if (Configuration.doAutoCreate())
1831              this.additiveProductName = new StringType(); // bb
1832          return this.additiveProductName;
1833        }
1834
1835        public boolean hasAdditiveProductNameElement() { 
1836          return this.additiveProductName != null && !this.additiveProductName.isEmpty();
1837        }
1838
1839        public boolean hasAdditiveProductName() { 
1840          return this.additiveProductName != null && !this.additiveProductName.isEmpty();
1841        }
1842
1843        /**
1844         * @param value {@link #additiveProductName} (The product or brand name of the type of modular component to be added to the formula.). This is the underlying object with id, value and extensions. The accessor "getAdditiveProductName" gives direct access to the value
1845         */
1846        public NutritionOrderEnteralFormulaComponent setAdditiveProductNameElement(StringType value) { 
1847          this.additiveProductName = value;
1848          return this;
1849        }
1850
1851        /**
1852         * @return The product or brand name of the type of modular component to be added to the formula.
1853         */
1854        public String getAdditiveProductName() { 
1855          return this.additiveProductName == null ? null : this.additiveProductName.getValue();
1856        }
1857
1858        /**
1859         * @param value The product or brand name of the type of modular component to be added to the formula.
1860         */
1861        public NutritionOrderEnteralFormulaComponent setAdditiveProductName(String value) { 
1862          if (Utilities.noString(value))
1863            this.additiveProductName = null;
1864          else {
1865            if (this.additiveProductName == null)
1866              this.additiveProductName = new StringType();
1867            this.additiveProductName.setValue(value);
1868          }
1869          return this;
1870        }
1871
1872        /**
1873         * @return {@link #caloricDensity} (The amount of energy (calories) that the formula should provide per specified volume, typically per mL or fluid oz.  For example, an infant may require a formula that provides 24 calories per fluid ounce or an adult may require an enteral formula that provides 1.5 calorie/mL.)
1874         */
1875        public SimpleQuantity getCaloricDensity() { 
1876          if (this.caloricDensity == null)
1877            if (Configuration.errorOnAutoCreate())
1878              throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.caloricDensity");
1879            else if (Configuration.doAutoCreate())
1880              this.caloricDensity = new SimpleQuantity(); // cc
1881          return this.caloricDensity;
1882        }
1883
1884        public boolean hasCaloricDensity() { 
1885          return this.caloricDensity != null && !this.caloricDensity.isEmpty();
1886        }
1887
1888        /**
1889         * @param value {@link #caloricDensity} (The amount of energy (calories) that the formula should provide per specified volume, typically per mL or fluid oz.  For example, an infant may require a formula that provides 24 calories per fluid ounce or an adult may require an enteral formula that provides 1.5 calorie/mL.)
1890         */
1891        public NutritionOrderEnteralFormulaComponent setCaloricDensity(SimpleQuantity value)  { 
1892          this.caloricDensity = value;
1893          return this;
1894        }
1895
1896        /**
1897         * @return {@link #routeofAdministration} (The route or physiological path of administration into the patient's gastrointestinal  tract for purposes of providing the formula feeding, e.g. nasogastric tube.)
1898         */
1899        public CodeableConcept getRouteofAdministration() { 
1900          if (this.routeofAdministration == null)
1901            if (Configuration.errorOnAutoCreate())
1902              throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.routeofAdministration");
1903            else if (Configuration.doAutoCreate())
1904              this.routeofAdministration = new CodeableConcept(); // cc
1905          return this.routeofAdministration;
1906        }
1907
1908        public boolean hasRouteofAdministration() { 
1909          return this.routeofAdministration != null && !this.routeofAdministration.isEmpty();
1910        }
1911
1912        /**
1913         * @param value {@link #routeofAdministration} (The route or physiological path of administration into the patient's gastrointestinal  tract for purposes of providing the formula feeding, e.g. nasogastric tube.)
1914         */
1915        public NutritionOrderEnteralFormulaComponent setRouteofAdministration(CodeableConcept value)  { 
1916          this.routeofAdministration = value;
1917          return this;
1918        }
1919
1920        /**
1921         * @return {@link #administration} (Formula administration instructions as structured data.  This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding.  An example of this would be an instruction to increase the rate of continuous feeding every 2 hours.)
1922         */
1923        public List<NutritionOrderEnteralFormulaAdministrationComponent> getAdministration() { 
1924          if (this.administration == null)
1925            this.administration = new ArrayList<NutritionOrderEnteralFormulaAdministrationComponent>();
1926          return this.administration;
1927        }
1928
1929        /**
1930         * @return Returns a reference to <code>this</code> for easy method chaining
1931         */
1932        public NutritionOrderEnteralFormulaComponent setAdministration(List<NutritionOrderEnteralFormulaAdministrationComponent> theAdministration) { 
1933          this.administration = theAdministration;
1934          return this;
1935        }
1936
1937        public boolean hasAdministration() { 
1938          if (this.administration == null)
1939            return false;
1940          for (NutritionOrderEnteralFormulaAdministrationComponent item : this.administration)
1941            if (!item.isEmpty())
1942              return true;
1943          return false;
1944        }
1945
1946        public NutritionOrderEnteralFormulaAdministrationComponent addAdministration() { //3
1947          NutritionOrderEnteralFormulaAdministrationComponent t = new NutritionOrderEnteralFormulaAdministrationComponent();
1948          if (this.administration == null)
1949            this.administration = new ArrayList<NutritionOrderEnteralFormulaAdministrationComponent>();
1950          this.administration.add(t);
1951          return t;
1952        }
1953
1954        public NutritionOrderEnteralFormulaComponent addAdministration(NutritionOrderEnteralFormulaAdministrationComponent t) { //3
1955          if (t == null)
1956            return this;
1957          if (this.administration == null)
1958            this.administration = new ArrayList<NutritionOrderEnteralFormulaAdministrationComponent>();
1959          this.administration.add(t);
1960          return this;
1961        }
1962
1963        /**
1964         * @return The first repetition of repeating field {@link #administration}, creating it if it does not already exist
1965         */
1966        public NutritionOrderEnteralFormulaAdministrationComponent getAdministrationFirstRep() { 
1967          if (getAdministration().isEmpty()) {
1968            addAdministration();
1969          }
1970          return getAdministration().get(0);
1971        }
1972
1973        /**
1974         * @return {@link #maxVolumeToDeliver} (The maximum total quantity of formula that may be administered to a subject over the period of time, e.g. 1440 mL over 24 hours.)
1975         */
1976        public SimpleQuantity getMaxVolumeToDeliver() { 
1977          if (this.maxVolumeToDeliver == null)
1978            if (Configuration.errorOnAutoCreate())
1979              throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.maxVolumeToDeliver");
1980            else if (Configuration.doAutoCreate())
1981              this.maxVolumeToDeliver = new SimpleQuantity(); // cc
1982          return this.maxVolumeToDeliver;
1983        }
1984
1985        public boolean hasMaxVolumeToDeliver() { 
1986          return this.maxVolumeToDeliver != null && !this.maxVolumeToDeliver.isEmpty();
1987        }
1988
1989        /**
1990         * @param value {@link #maxVolumeToDeliver} (The maximum total quantity of formula that may be administered to a subject over the period of time, e.g. 1440 mL over 24 hours.)
1991         */
1992        public NutritionOrderEnteralFormulaComponent setMaxVolumeToDeliver(SimpleQuantity value)  { 
1993          this.maxVolumeToDeliver = value;
1994          return this;
1995        }
1996
1997        /**
1998         * @return {@link #administrationInstruction} (Free text formula administration, feeding instructions or additional instructions or information.). This is the underlying object with id, value and extensions. The accessor "getAdministrationInstruction" gives direct access to the value
1999         */
2000        public StringType getAdministrationInstructionElement() { 
2001          if (this.administrationInstruction == null)
2002            if (Configuration.errorOnAutoCreate())
2003              throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.administrationInstruction");
2004            else if (Configuration.doAutoCreate())
2005              this.administrationInstruction = new StringType(); // bb
2006          return this.administrationInstruction;
2007        }
2008
2009        public boolean hasAdministrationInstructionElement() { 
2010          return this.administrationInstruction != null && !this.administrationInstruction.isEmpty();
2011        }
2012
2013        public boolean hasAdministrationInstruction() { 
2014          return this.administrationInstruction != null && !this.administrationInstruction.isEmpty();
2015        }
2016
2017        /**
2018         * @param value {@link #administrationInstruction} (Free text formula administration, feeding instructions or additional instructions or information.). This is the underlying object with id, value and extensions. The accessor "getAdministrationInstruction" gives direct access to the value
2019         */
2020        public NutritionOrderEnteralFormulaComponent setAdministrationInstructionElement(StringType value) { 
2021          this.administrationInstruction = value;
2022          return this;
2023        }
2024
2025        /**
2026         * @return Free text formula administration, feeding instructions or additional instructions or information.
2027         */
2028        public String getAdministrationInstruction() { 
2029          return this.administrationInstruction == null ? null : this.administrationInstruction.getValue();
2030        }
2031
2032        /**
2033         * @param value Free text formula administration, feeding instructions or additional instructions or information.
2034         */
2035        public NutritionOrderEnteralFormulaComponent setAdministrationInstruction(String value) { 
2036          if (Utilities.noString(value))
2037            this.administrationInstruction = null;
2038          else {
2039            if (this.administrationInstruction == null)
2040              this.administrationInstruction = new StringType();
2041            this.administrationInstruction.setValue(value);
2042          }
2043          return this;
2044        }
2045
2046        protected void listChildren(List<Property> children) {
2047          super.listChildren(children);
2048          children.add(new Property("baseFormulaType", "CodeableConcept", "The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula.", 0, 1, baseFormulaType));
2049          children.add(new Property("baseFormulaProductName", "string", "The product or brand name of the enteral or infant formula product such as \"ACME Adult Standard Formula\".", 0, 1, baseFormulaProductName));
2050          children.add(new Property("additiveType", "CodeableConcept", "Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.", 0, 1, additiveType));
2051          children.add(new Property("additiveProductName", "string", "The product or brand name of the type of modular component to be added to the formula.", 0, 1, additiveProductName));
2052          children.add(new Property("caloricDensity", "SimpleQuantity", "The amount of energy (calories) that the formula should provide per specified volume, typically per mL or fluid oz.  For example, an infant may require a formula that provides 24 calories per fluid ounce or an adult may require an enteral formula that provides 1.5 calorie/mL.", 0, 1, caloricDensity));
2053          children.add(new Property("routeofAdministration", "CodeableConcept", "The route or physiological path of administration into the patient's gastrointestinal  tract for purposes of providing the formula feeding, e.g. nasogastric tube.", 0, 1, routeofAdministration));
2054          children.add(new Property("administration", "", "Formula administration instructions as structured data.  This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding.  An example of this would be an instruction to increase the rate of continuous feeding every 2 hours.", 0, java.lang.Integer.MAX_VALUE, administration));
2055          children.add(new Property("maxVolumeToDeliver", "SimpleQuantity", "The maximum total quantity of formula that may be administered to a subject over the period of time, e.g. 1440 mL over 24 hours.", 0, 1, maxVolumeToDeliver));
2056          children.add(new Property("administrationInstruction", "string", "Free text formula administration, feeding instructions or additional instructions or information.", 0, 1, administrationInstruction));
2057        }
2058
2059        @Override
2060        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2061          switch (_hash) {
2062          case -138930641: /*baseFormulaType*/  return new Property("baseFormulaType", "CodeableConcept", "The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula.", 0, 1, baseFormulaType);
2063          case -1267705979: /*baseFormulaProductName*/  return new Property("baseFormulaProductName", "string", "The product or brand name of the enteral or infant formula product such as \"ACME Adult Standard Formula\".", 0, 1, baseFormulaProductName);
2064          case -470746842: /*additiveType*/  return new Property("additiveType", "CodeableConcept", "Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.", 0, 1, additiveType);
2065          case 488079534: /*additiveProductName*/  return new Property("additiveProductName", "string", "The product or brand name of the type of modular component to be added to the formula.", 0, 1, additiveProductName);
2066          case 186983261: /*caloricDensity*/  return new Property("caloricDensity", "SimpleQuantity", "The amount of energy (calories) that the formula should provide per specified volume, typically per mL or fluid oz.  For example, an infant may require a formula that provides 24 calories per fluid ounce or an adult may require an enteral formula that provides 1.5 calorie/mL.", 0, 1, caloricDensity);
2067          case -1710107042: /*routeofAdministration*/  return new Property("routeofAdministration", "CodeableConcept", "The route or physiological path of administration into the patient's gastrointestinal  tract for purposes of providing the formula feeding, e.g. nasogastric tube.", 0, 1, routeofAdministration);
2068          case 1255702622: /*administration*/  return new Property("administration", "", "Formula administration instructions as structured data.  This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding.  An example of this would be an instruction to increase the rate of continuous feeding every 2 hours.", 0, java.lang.Integer.MAX_VALUE, administration);
2069          case 2017924652: /*maxVolumeToDeliver*/  return new Property("maxVolumeToDeliver", "SimpleQuantity", "The maximum total quantity of formula that may be administered to a subject over the period of time, e.g. 1440 mL over 24 hours.", 0, 1, maxVolumeToDeliver);
2070          case 427085136: /*administrationInstruction*/  return new Property("administrationInstruction", "string", "Free text formula administration, feeding instructions or additional instructions or information.", 0, 1, administrationInstruction);
2071          default: return super.getNamedProperty(_hash, _name, _checkValid);
2072          }
2073
2074        }
2075
2076      @Override
2077      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2078        switch (hash) {
2079        case -138930641: /*baseFormulaType*/ return this.baseFormulaType == null ? new Base[0] : new Base[] {this.baseFormulaType}; // CodeableConcept
2080        case -1267705979: /*baseFormulaProductName*/ return this.baseFormulaProductName == null ? new Base[0] : new Base[] {this.baseFormulaProductName}; // StringType
2081        case -470746842: /*additiveType*/ return this.additiveType == null ? new Base[0] : new Base[] {this.additiveType}; // CodeableConcept
2082        case 488079534: /*additiveProductName*/ return this.additiveProductName == null ? new Base[0] : new Base[] {this.additiveProductName}; // StringType
2083        case 186983261: /*caloricDensity*/ return this.caloricDensity == null ? new Base[0] : new Base[] {this.caloricDensity}; // SimpleQuantity
2084        case -1710107042: /*routeofAdministration*/ return this.routeofAdministration == null ? new Base[0] : new Base[] {this.routeofAdministration}; // CodeableConcept
2085        case 1255702622: /*administration*/ return this.administration == null ? new Base[0] : this.administration.toArray(new Base[this.administration.size()]); // NutritionOrderEnteralFormulaAdministrationComponent
2086        case 2017924652: /*maxVolumeToDeliver*/ return this.maxVolumeToDeliver == null ? new Base[0] : new Base[] {this.maxVolumeToDeliver}; // SimpleQuantity
2087        case 427085136: /*administrationInstruction*/ return this.administrationInstruction == null ? new Base[0] : new Base[] {this.administrationInstruction}; // StringType
2088        default: return super.getProperty(hash, name, checkValid);
2089        }
2090
2091      }
2092
2093      @Override
2094      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2095        switch (hash) {
2096        case -138930641: // baseFormulaType
2097          this.baseFormulaType = castToCodeableConcept(value); // CodeableConcept
2098          return value;
2099        case -1267705979: // baseFormulaProductName
2100          this.baseFormulaProductName = castToString(value); // StringType
2101          return value;
2102        case -470746842: // additiveType
2103          this.additiveType = castToCodeableConcept(value); // CodeableConcept
2104          return value;
2105        case 488079534: // additiveProductName
2106          this.additiveProductName = castToString(value); // StringType
2107          return value;
2108        case 186983261: // caloricDensity
2109          this.caloricDensity = castToSimpleQuantity(value); // SimpleQuantity
2110          return value;
2111        case -1710107042: // routeofAdministration
2112          this.routeofAdministration = castToCodeableConcept(value); // CodeableConcept
2113          return value;
2114        case 1255702622: // administration
2115          this.getAdministration().add((NutritionOrderEnteralFormulaAdministrationComponent) value); // NutritionOrderEnteralFormulaAdministrationComponent
2116          return value;
2117        case 2017924652: // maxVolumeToDeliver
2118          this.maxVolumeToDeliver = castToSimpleQuantity(value); // SimpleQuantity
2119          return value;
2120        case 427085136: // administrationInstruction
2121          this.administrationInstruction = castToString(value); // StringType
2122          return value;
2123        default: return super.setProperty(hash, name, value);
2124        }
2125
2126      }
2127
2128      @Override
2129      public Base setProperty(String name, Base value) throws FHIRException {
2130        if (name.equals("baseFormulaType")) {
2131          this.baseFormulaType = castToCodeableConcept(value); // CodeableConcept
2132        } else if (name.equals("baseFormulaProductName")) {
2133          this.baseFormulaProductName = castToString(value); // StringType
2134        } else if (name.equals("additiveType")) {
2135          this.additiveType = castToCodeableConcept(value); // CodeableConcept
2136        } else if (name.equals("additiveProductName")) {
2137          this.additiveProductName = castToString(value); // StringType
2138        } else if (name.equals("caloricDensity")) {
2139          this.caloricDensity = castToSimpleQuantity(value); // SimpleQuantity
2140        } else if (name.equals("routeofAdministration")) {
2141          this.routeofAdministration = castToCodeableConcept(value); // CodeableConcept
2142        } else if (name.equals("administration")) {
2143          this.getAdministration().add((NutritionOrderEnteralFormulaAdministrationComponent) value);
2144        } else if (name.equals("maxVolumeToDeliver")) {
2145          this.maxVolumeToDeliver = castToSimpleQuantity(value); // SimpleQuantity
2146        } else if (name.equals("administrationInstruction")) {
2147          this.administrationInstruction = castToString(value); // StringType
2148        } else
2149          return super.setProperty(name, value);
2150        return value;
2151      }
2152
2153      @Override
2154      public Base makeProperty(int hash, String name) throws FHIRException {
2155        switch (hash) {
2156        case -138930641:  return getBaseFormulaType(); 
2157        case -1267705979:  return getBaseFormulaProductNameElement();
2158        case -470746842:  return getAdditiveType(); 
2159        case 488079534:  return getAdditiveProductNameElement();
2160        case 186983261:  return getCaloricDensity(); 
2161        case -1710107042:  return getRouteofAdministration(); 
2162        case 1255702622:  return addAdministration(); 
2163        case 2017924652:  return getMaxVolumeToDeliver(); 
2164        case 427085136:  return getAdministrationInstructionElement();
2165        default: return super.makeProperty(hash, name);
2166        }
2167
2168      }
2169
2170      @Override
2171      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2172        switch (hash) {
2173        case -138930641: /*baseFormulaType*/ return new String[] {"CodeableConcept"};
2174        case -1267705979: /*baseFormulaProductName*/ return new String[] {"string"};
2175        case -470746842: /*additiveType*/ return new String[] {"CodeableConcept"};
2176        case 488079534: /*additiveProductName*/ return new String[] {"string"};
2177        case 186983261: /*caloricDensity*/ return new String[] {"SimpleQuantity"};
2178        case -1710107042: /*routeofAdministration*/ return new String[] {"CodeableConcept"};
2179        case 1255702622: /*administration*/ return new String[] {};
2180        case 2017924652: /*maxVolumeToDeliver*/ return new String[] {"SimpleQuantity"};
2181        case 427085136: /*administrationInstruction*/ return new String[] {"string"};
2182        default: return super.getTypesForProperty(hash, name);
2183        }
2184
2185      }
2186
2187      @Override
2188      public Base addChild(String name) throws FHIRException {
2189        if (name.equals("baseFormulaType")) {
2190          this.baseFormulaType = new CodeableConcept();
2191          return this.baseFormulaType;
2192        }
2193        else if (name.equals("baseFormulaProductName")) {
2194          throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.baseFormulaProductName");
2195        }
2196        else if (name.equals("additiveType")) {
2197          this.additiveType = new CodeableConcept();
2198          return this.additiveType;
2199        }
2200        else if (name.equals("additiveProductName")) {
2201          throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.additiveProductName");
2202        }
2203        else if (name.equals("caloricDensity")) {
2204          this.caloricDensity = new SimpleQuantity();
2205          return this.caloricDensity;
2206        }
2207        else if (name.equals("routeofAdministration")) {
2208          this.routeofAdministration = new CodeableConcept();
2209          return this.routeofAdministration;
2210        }
2211        else if (name.equals("administration")) {
2212          return addAdministration();
2213        }
2214        else if (name.equals("maxVolumeToDeliver")) {
2215          this.maxVolumeToDeliver = new SimpleQuantity();
2216          return this.maxVolumeToDeliver;
2217        }
2218        else if (name.equals("administrationInstruction")) {
2219          throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.administrationInstruction");
2220        }
2221        else
2222          return super.addChild(name);
2223      }
2224
2225      public NutritionOrderEnteralFormulaComponent copy() {
2226        NutritionOrderEnteralFormulaComponent dst = new NutritionOrderEnteralFormulaComponent();
2227        copyValues(dst);
2228        dst.baseFormulaType = baseFormulaType == null ? null : baseFormulaType.copy();
2229        dst.baseFormulaProductName = baseFormulaProductName == null ? null : baseFormulaProductName.copy();
2230        dst.additiveType = additiveType == null ? null : additiveType.copy();
2231        dst.additiveProductName = additiveProductName == null ? null : additiveProductName.copy();
2232        dst.caloricDensity = caloricDensity == null ? null : caloricDensity.copy();
2233        dst.routeofAdministration = routeofAdministration == null ? null : routeofAdministration.copy();
2234        if (administration != null) {
2235          dst.administration = new ArrayList<NutritionOrderEnteralFormulaAdministrationComponent>();
2236          for (NutritionOrderEnteralFormulaAdministrationComponent i : administration)
2237            dst.administration.add(i.copy());
2238        };
2239        dst.maxVolumeToDeliver = maxVolumeToDeliver == null ? null : maxVolumeToDeliver.copy();
2240        dst.administrationInstruction = administrationInstruction == null ? null : administrationInstruction.copy();
2241        return dst;
2242      }
2243
2244      @Override
2245      public boolean equalsDeep(Base other_) {
2246        if (!super.equalsDeep(other_))
2247          return false;
2248        if (!(other_ instanceof NutritionOrderEnteralFormulaComponent))
2249          return false;
2250        NutritionOrderEnteralFormulaComponent o = (NutritionOrderEnteralFormulaComponent) other_;
2251        return compareDeep(baseFormulaType, o.baseFormulaType, true) && compareDeep(baseFormulaProductName, o.baseFormulaProductName, true)
2252           && compareDeep(additiveType, o.additiveType, true) && compareDeep(additiveProductName, o.additiveProductName, true)
2253           && compareDeep(caloricDensity, o.caloricDensity, true) && compareDeep(routeofAdministration, o.routeofAdministration, true)
2254           && compareDeep(administration, o.administration, true) && compareDeep(maxVolumeToDeliver, o.maxVolumeToDeliver, true)
2255           && compareDeep(administrationInstruction, o.administrationInstruction, true);
2256      }
2257
2258      @Override
2259      public boolean equalsShallow(Base other_) {
2260        if (!super.equalsShallow(other_))
2261          return false;
2262        if (!(other_ instanceof NutritionOrderEnteralFormulaComponent))
2263          return false;
2264        NutritionOrderEnteralFormulaComponent o = (NutritionOrderEnteralFormulaComponent) other_;
2265        return compareValues(baseFormulaProductName, o.baseFormulaProductName, true) && compareValues(additiveProductName, o.additiveProductName, true)
2266           && compareValues(administrationInstruction, o.administrationInstruction, true);
2267      }
2268
2269      public boolean isEmpty() {
2270        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(baseFormulaType, baseFormulaProductName
2271          , additiveType, additiveProductName, caloricDensity, routeofAdministration, administration
2272          , maxVolumeToDeliver, administrationInstruction);
2273      }
2274
2275  public String fhirType() {
2276    return "NutritionOrder.enteralFormula";
2277
2278  }
2279
2280  }
2281
2282    @Block()
2283    public static class NutritionOrderEnteralFormulaAdministrationComponent extends BackboneElement implements IBaseBackboneElement {
2284        /**
2285         * The time period and frequency at which the enteral formula should be delivered to the patient.
2286         */
2287        @Child(name = "schedule", type = {Timing.class}, order=1, min=0, max=1, modifier=false, summary=false)
2288        @Description(shortDefinition="Scheduled frequency of enteral feeding", formalDefinition="The time period and frequency at which the enteral formula should be delivered to the patient." )
2289        protected Timing schedule;
2290
2291        /**
2292         * The volume of formula to provide to the patient per the specified administration schedule.
2293         */
2294        @Child(name = "quantity", type = {SimpleQuantity.class}, order=2, min=0, max=1, modifier=false, summary=false)
2295        @Description(shortDefinition="The volume of formula to provide", formalDefinition="The volume of formula to provide to the patient per the specified administration schedule." )
2296        protected SimpleQuantity quantity;
2297
2298        /**
2299         * The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.
2300         */
2301        @Child(name = "rate", type = {SimpleQuantity.class, Ratio.class}, order=3, min=0, max=1, modifier=false, summary=false)
2302        @Description(shortDefinition="Speed with which the formula is provided per period of time", formalDefinition="The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule." )
2303        protected Type rate;
2304
2305        private static final long serialVersionUID = 1895031997L;
2306
2307    /**
2308     * Constructor
2309     */
2310      public NutritionOrderEnteralFormulaAdministrationComponent() {
2311        super();
2312      }
2313
2314        /**
2315         * @return {@link #schedule} (The time period and frequency at which the enteral formula should be delivered to the patient.)
2316         */
2317        public Timing getSchedule() { 
2318          if (this.schedule == null)
2319            if (Configuration.errorOnAutoCreate())
2320              throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaAdministrationComponent.schedule");
2321            else if (Configuration.doAutoCreate())
2322              this.schedule = new Timing(); // cc
2323          return this.schedule;
2324        }
2325
2326        public boolean hasSchedule() { 
2327          return this.schedule != null && !this.schedule.isEmpty();
2328        }
2329
2330        /**
2331         * @param value {@link #schedule} (The time period and frequency at which the enteral formula should be delivered to the patient.)
2332         */
2333        public NutritionOrderEnteralFormulaAdministrationComponent setSchedule(Timing value)  { 
2334          this.schedule = value;
2335          return this;
2336        }
2337
2338        /**
2339         * @return {@link #quantity} (The volume of formula to provide to the patient per the specified administration schedule.)
2340         */
2341        public SimpleQuantity getQuantity() { 
2342          if (this.quantity == null)
2343            if (Configuration.errorOnAutoCreate())
2344              throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaAdministrationComponent.quantity");
2345            else if (Configuration.doAutoCreate())
2346              this.quantity = new SimpleQuantity(); // cc
2347          return this.quantity;
2348        }
2349
2350        public boolean hasQuantity() { 
2351          return this.quantity != null && !this.quantity.isEmpty();
2352        }
2353
2354        /**
2355         * @param value {@link #quantity} (The volume of formula to provide to the patient per the specified administration schedule.)
2356         */
2357        public NutritionOrderEnteralFormulaAdministrationComponent setQuantity(SimpleQuantity value)  { 
2358          this.quantity = value;
2359          return this;
2360        }
2361
2362        /**
2363         * @return {@link #rate} (The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.)
2364         */
2365        public Type getRate() { 
2366          return this.rate;
2367        }
2368
2369        /**
2370         * @return {@link #rate} (The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.)
2371         */
2372        public SimpleQuantity getRateSimpleQuantity() throws FHIRException { 
2373          if (this.rate == null)
2374            return null;
2375          if (!(this.rate instanceof SimpleQuantity))
2376            throw new FHIRException("Type mismatch: the type SimpleQuantity was expected, but "+this.rate.getClass().getName()+" was encountered");
2377          return (SimpleQuantity) this.rate;
2378        }
2379
2380        public boolean hasRateSimpleQuantity() { 
2381          return this != null && this.rate instanceof SimpleQuantity;
2382        }
2383
2384        /**
2385         * @return {@link #rate} (The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.)
2386         */
2387        public Ratio getRateRatio() throws FHIRException { 
2388          if (this.rate == null)
2389            return null;
2390          if (!(this.rate instanceof Ratio))
2391            throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.rate.getClass().getName()+" was encountered");
2392          return (Ratio) this.rate;
2393        }
2394
2395        public boolean hasRateRatio() { 
2396          return this != null && this.rate instanceof Ratio;
2397        }
2398
2399        public boolean hasRate() { 
2400          return this.rate != null && !this.rate.isEmpty();
2401        }
2402
2403        /**
2404         * @param value {@link #rate} (The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.)
2405         */
2406        public NutritionOrderEnteralFormulaAdministrationComponent setRate(Type value) throws FHIRFormatError { 
2407          if (value != null && !(value instanceof Quantity || value instanceof Ratio))
2408            throw new FHIRFormatError("Not the right type for NutritionOrder.enteralFormula.administration.rate[x]: "+value.fhirType());
2409          this.rate = value;
2410          return this;
2411        }
2412
2413        protected void listChildren(List<Property> children) {
2414          super.listChildren(children);
2415          children.add(new Property("schedule", "Timing", "The time period and frequency at which the enteral formula should be delivered to the patient.", 0, 1, schedule));
2416          children.add(new Property("quantity", "SimpleQuantity", "The volume of formula to provide to the patient per the specified administration schedule.", 0, 1, quantity));
2417          children.add(new Property("rate[x]", "SimpleQuantity|Ratio", "The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.", 0, 1, rate));
2418        }
2419
2420        @Override
2421        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2422          switch (_hash) {
2423          case -697920873: /*schedule*/  return new Property("schedule", "Timing", "The time period and frequency at which the enteral formula should be delivered to the patient.", 0, 1, schedule);
2424          case -1285004149: /*quantity*/  return new Property("quantity", "SimpleQuantity", "The volume of formula to provide to the patient per the specified administration schedule.", 0, 1, quantity);
2425          case 983460768: /*rate[x]*/  return new Property("rate[x]", "SimpleQuantity|Ratio", "The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.", 0, 1, rate);
2426          case 3493088: /*rate*/  return new Property("rate[x]", "SimpleQuantity|Ratio", "The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.", 0, 1, rate);
2427          case -2121057955: /*rateSimpleQuantity*/  return new Property("rate[x]", "SimpleQuantity|Ratio", "The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.", 0, 1, rate);
2428          case 204021515: /*rateRatio*/  return new Property("rate[x]", "SimpleQuantity|Ratio", "The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.", 0, 1, rate);
2429          default: return super.getNamedProperty(_hash, _name, _checkValid);
2430          }
2431
2432        }
2433
2434      @Override
2435      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2436        switch (hash) {
2437        case -697920873: /*schedule*/ return this.schedule == null ? new Base[0] : new Base[] {this.schedule}; // Timing
2438        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity
2439        case 3493088: /*rate*/ return this.rate == null ? new Base[0] : new Base[] {this.rate}; // Type
2440        default: return super.getProperty(hash, name, checkValid);
2441        }
2442
2443      }
2444
2445      @Override
2446      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2447        switch (hash) {
2448        case -697920873: // schedule
2449          this.schedule = castToTiming(value); // Timing
2450          return value;
2451        case -1285004149: // quantity
2452          this.quantity = castToSimpleQuantity(value); // SimpleQuantity
2453          return value;
2454        case 3493088: // rate
2455          this.rate = castToType(value); // Type
2456          return value;
2457        default: return super.setProperty(hash, name, value);
2458        }
2459
2460      }
2461
2462      @Override
2463      public Base setProperty(String name, Base value) throws FHIRException {
2464        if (name.equals("schedule")) {
2465          this.schedule = castToTiming(value); // Timing
2466        } else if (name.equals("quantity")) {
2467          this.quantity = castToSimpleQuantity(value); // SimpleQuantity
2468        } else if (name.equals("rate[x]")) {
2469          this.rate = castToType(value); // Type
2470        } else
2471          return super.setProperty(name, value);
2472        return value;
2473      }
2474
2475      @Override
2476      public Base makeProperty(int hash, String name) throws FHIRException {
2477        switch (hash) {
2478        case -697920873:  return getSchedule(); 
2479        case -1285004149:  return getQuantity(); 
2480        case 983460768:  return getRate(); 
2481        case 3493088:  return getRate(); 
2482        default: return super.makeProperty(hash, name);
2483        }
2484
2485      }
2486
2487      @Override
2488      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2489        switch (hash) {
2490        case -697920873: /*schedule*/ return new String[] {"Timing"};
2491        case -1285004149: /*quantity*/ return new String[] {"SimpleQuantity"};
2492        case 3493088: /*rate*/ return new String[] {"SimpleQuantity", "Ratio"};
2493        default: return super.getTypesForProperty(hash, name);
2494        }
2495
2496      }
2497
2498      @Override
2499      public Base addChild(String name) throws FHIRException {
2500        if (name.equals("schedule")) {
2501          this.schedule = new Timing();
2502          return this.schedule;
2503        }
2504        else if (name.equals("quantity")) {
2505          this.quantity = new SimpleQuantity();
2506          return this.quantity;
2507        }
2508        else if (name.equals("rateSimpleQuantity")) {
2509          this.rate = new SimpleQuantity();
2510          return this.rate;
2511        }
2512        else if (name.equals("rateRatio")) {
2513          this.rate = new Ratio();
2514          return this.rate;
2515        }
2516        else
2517          return super.addChild(name);
2518      }
2519
2520      public NutritionOrderEnteralFormulaAdministrationComponent copy() {
2521        NutritionOrderEnteralFormulaAdministrationComponent dst = new NutritionOrderEnteralFormulaAdministrationComponent();
2522        copyValues(dst);
2523        dst.schedule = schedule == null ? null : schedule.copy();
2524        dst.quantity = quantity == null ? null : quantity.copy();
2525        dst.rate = rate == null ? null : rate.copy();
2526        return dst;
2527      }
2528
2529      @Override
2530      public boolean equalsDeep(Base other_) {
2531        if (!super.equalsDeep(other_))
2532          return false;
2533        if (!(other_ instanceof NutritionOrderEnteralFormulaAdministrationComponent))
2534          return false;
2535        NutritionOrderEnteralFormulaAdministrationComponent o = (NutritionOrderEnteralFormulaAdministrationComponent) other_;
2536        return compareDeep(schedule, o.schedule, true) && compareDeep(quantity, o.quantity, true) && compareDeep(rate, o.rate, true)
2537          ;
2538      }
2539
2540      @Override
2541      public boolean equalsShallow(Base other_) {
2542        if (!super.equalsShallow(other_))
2543          return false;
2544        if (!(other_ instanceof NutritionOrderEnteralFormulaAdministrationComponent))
2545          return false;
2546        NutritionOrderEnteralFormulaAdministrationComponent o = (NutritionOrderEnteralFormulaAdministrationComponent) other_;
2547        return true;
2548      }
2549
2550      public boolean isEmpty() {
2551        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(schedule, quantity, rate
2552          );
2553      }
2554
2555  public String fhirType() {
2556    return "NutritionOrder.enteralFormula.administration";
2557
2558  }
2559
2560  }
2561
2562    /**
2563     * Identifiers assigned to this order by the order sender or by the order receiver.
2564     */
2565    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2566    @Description(shortDefinition="Identifiers assigned to this order", formalDefinition="Identifiers assigned to this order by the order sender or by the order receiver." )
2567    protected List<Identifier> identifier;
2568
2569    /**
2570     * The workflow status of the nutrition order/request.
2571     */
2572    @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true)
2573    @Description(shortDefinition="proposed | draft | planned | requested | active | on-hold | completed | cancelled | entered-in-error", formalDefinition="The workflow status of the nutrition order/request." )
2574    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/nutrition-request-status")
2575    protected Enumeration<NutritionOrderStatus> status;
2576
2577    /**
2578     * The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.
2579     */
2580    @Child(name = "patient", type = {Patient.class}, order=2, min=1, max=1, modifier=false, summary=true)
2581    @Description(shortDefinition="The person who requires the diet, formula or nutritional supplement", formalDefinition="The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding." )
2582    protected Reference patient;
2583
2584    /**
2585     * The actual object that is the target of the reference (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.)
2586     */
2587    protected Patient patientTarget;
2588
2589    /**
2590     * An encounter that provides additional information about the healthcare context in which this request is made.
2591     */
2592    @Child(name = "encounter", type = {Encounter.class}, order=3, min=0, max=1, modifier=false, summary=false)
2593    @Description(shortDefinition="The encounter associated with this nutrition order", formalDefinition="An encounter that provides additional information about the healthcare context in which this request is made." )
2594    protected Reference encounter;
2595
2596    /**
2597     * The actual object that is the target of the reference (An encounter that provides additional information about the healthcare context in which this request is made.)
2598     */
2599    protected Encounter encounterTarget;
2600
2601    /**
2602     * The date and time that this nutrition order was requested.
2603     */
2604    @Child(name = "dateTime", type = {DateTimeType.class}, order=4, min=1, max=1, modifier=false, summary=true)
2605    @Description(shortDefinition="Date and time the nutrition order was requested", formalDefinition="The date and time that this nutrition order was requested." )
2606    protected DateTimeType dateTime;
2607
2608    /**
2609     * The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.
2610     */
2611    @Child(name = "orderer", type = {Practitioner.class}, order=5, min=0, max=1, modifier=false, summary=true)
2612    @Description(shortDefinition="Who ordered the diet, formula or nutritional supplement", formalDefinition="The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings." )
2613    protected Reference orderer;
2614
2615    /**
2616     * The actual object that is the target of the reference (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.)
2617     */
2618    protected Practitioner ordererTarget;
2619
2620    /**
2621     * A link to a record of allergies or intolerances  which should be included in the nutrition order.
2622     */
2623    @Child(name = "allergyIntolerance", type = {AllergyIntolerance.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2624    @Description(shortDefinition="List of the patient's food and nutrition-related allergies and intolerances", formalDefinition="A link to a record of allergies or intolerances  which should be included in the nutrition order." )
2625    protected List<Reference> allergyIntolerance;
2626    /**
2627     * The actual objects that are the target of the reference (A link to a record of allergies or intolerances  which should be included in the nutrition order.)
2628     */
2629    protected List<AllergyIntolerance> allergyIntoleranceTarget;
2630
2631
2632    /**
2633     * This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.
2634     */
2635    @Child(name = "foodPreferenceModifier", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2636    @Description(shortDefinition="Order-specific modifier about the type of food that should be given", formalDefinition="This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings." )
2637    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/encounter-diet")
2638    protected List<CodeableConcept> foodPreferenceModifier;
2639
2640    /**
2641     * This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or  Gluten-Free.  While it should not be necessary to repeat allergy or intolerance information captured in the referenced AllergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient?s diet for any reason.  This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.
2642     */
2643    @Child(name = "excludeFoodModifier", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2644    @Description(shortDefinition="Order-specific modifier about the type of food that should not be given", formalDefinition="This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or  Gluten-Free.  While it should not be necessary to repeat allergy or intolerance information captured in the referenced AllergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient?s diet for any reason.  This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings." )
2645    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/food-type")
2646    protected List<CodeableConcept> excludeFoodModifier;
2647
2648    /**
2649     * Diet given orally in contrast to enteral (tube) feeding.
2650     */
2651    @Child(name = "oralDiet", type = {}, order=9, min=0, max=1, modifier=false, summary=false)
2652    @Description(shortDefinition="Oral diet components", formalDefinition="Diet given orally in contrast to enteral (tube) feeding." )
2653    protected NutritionOrderOralDietComponent oralDiet;
2654
2655    /**
2656     * Oral nutritional products given in order to add further nutritional value to the patient's diet.
2657     */
2658    @Child(name = "supplement", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2659    @Description(shortDefinition="Supplement components", formalDefinition="Oral nutritional products given in order to add further nutritional value to the patient's diet." )
2660    protected List<NutritionOrderSupplementComponent> supplement;
2661
2662    /**
2663     * Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.
2664     */
2665    @Child(name = "enteralFormula", type = {}, order=11, min=0, max=1, modifier=false, summary=false)
2666    @Description(shortDefinition="Enteral formula components", formalDefinition="Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity." )
2667    protected NutritionOrderEnteralFormulaComponent enteralFormula;
2668
2669    private static final long serialVersionUID = 1429947433L;
2670
2671  /**
2672   * Constructor
2673   */
2674    public NutritionOrder() {
2675      super();
2676    }
2677
2678  /**
2679   * Constructor
2680   */
2681    public NutritionOrder(Reference patient, DateTimeType dateTime) {
2682      super();
2683      this.patient = patient;
2684      this.dateTime = dateTime;
2685    }
2686
2687    /**
2688     * @return {@link #identifier} (Identifiers assigned to this order by the order sender or by the order receiver.)
2689     */
2690    public List<Identifier> getIdentifier() { 
2691      if (this.identifier == null)
2692        this.identifier = new ArrayList<Identifier>();
2693      return this.identifier;
2694    }
2695
2696    /**
2697     * @return Returns a reference to <code>this</code> for easy method chaining
2698     */
2699    public NutritionOrder setIdentifier(List<Identifier> theIdentifier) { 
2700      this.identifier = theIdentifier;
2701      return this;
2702    }
2703
2704    public boolean hasIdentifier() { 
2705      if (this.identifier == null)
2706        return false;
2707      for (Identifier item : this.identifier)
2708        if (!item.isEmpty())
2709          return true;
2710      return false;
2711    }
2712
2713    public Identifier addIdentifier() { //3
2714      Identifier t = new Identifier();
2715      if (this.identifier == null)
2716        this.identifier = new ArrayList<Identifier>();
2717      this.identifier.add(t);
2718      return t;
2719    }
2720
2721    public NutritionOrder addIdentifier(Identifier t) { //3
2722      if (t == null)
2723        return this;
2724      if (this.identifier == null)
2725        this.identifier = new ArrayList<Identifier>();
2726      this.identifier.add(t);
2727      return this;
2728    }
2729
2730    /**
2731     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
2732     */
2733    public Identifier getIdentifierFirstRep() { 
2734      if (getIdentifier().isEmpty()) {
2735        addIdentifier();
2736      }
2737      return getIdentifier().get(0);
2738    }
2739
2740    /**
2741     * @return {@link #status} (The workflow status of the nutrition order/request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2742     */
2743    public Enumeration<NutritionOrderStatus> getStatusElement() { 
2744      if (this.status == null)
2745        if (Configuration.errorOnAutoCreate())
2746          throw new Error("Attempt to auto-create NutritionOrder.status");
2747        else if (Configuration.doAutoCreate())
2748          this.status = new Enumeration<NutritionOrderStatus>(new NutritionOrderStatusEnumFactory()); // bb
2749      return this.status;
2750    }
2751
2752    public boolean hasStatusElement() { 
2753      return this.status != null && !this.status.isEmpty();
2754    }
2755
2756    public boolean hasStatus() { 
2757      return this.status != null && !this.status.isEmpty();
2758    }
2759
2760    /**
2761     * @param value {@link #status} (The workflow status of the nutrition order/request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2762     */
2763    public NutritionOrder setStatusElement(Enumeration<NutritionOrderStatus> value) { 
2764      this.status = value;
2765      return this;
2766    }
2767
2768    /**
2769     * @return The workflow status of the nutrition order/request.
2770     */
2771    public NutritionOrderStatus getStatus() { 
2772      return this.status == null ? null : this.status.getValue();
2773    }
2774
2775    /**
2776     * @param value The workflow status of the nutrition order/request.
2777     */
2778    public NutritionOrder setStatus(NutritionOrderStatus value) { 
2779      if (value == null)
2780        this.status = null;
2781      else {
2782        if (this.status == null)
2783          this.status = new Enumeration<NutritionOrderStatus>(new NutritionOrderStatusEnumFactory());
2784        this.status.setValue(value);
2785      }
2786      return this;
2787    }
2788
2789    /**
2790     * @return {@link #patient} (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.)
2791     */
2792    public Reference getPatient() { 
2793      if (this.patient == null)
2794        if (Configuration.errorOnAutoCreate())
2795          throw new Error("Attempt to auto-create NutritionOrder.patient");
2796        else if (Configuration.doAutoCreate())
2797          this.patient = new Reference(); // cc
2798      return this.patient;
2799    }
2800
2801    public boolean hasPatient() { 
2802      return this.patient != null && !this.patient.isEmpty();
2803    }
2804
2805    /**
2806     * @param value {@link #patient} (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.)
2807     */
2808    public NutritionOrder setPatient(Reference value)  { 
2809      this.patient = value;
2810      return this;
2811    }
2812
2813    /**
2814     * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.)
2815     */
2816    public Patient getPatientTarget() { 
2817      if (this.patientTarget == null)
2818        if (Configuration.errorOnAutoCreate())
2819          throw new Error("Attempt to auto-create NutritionOrder.patient");
2820        else if (Configuration.doAutoCreate())
2821          this.patientTarget = new Patient(); // aa
2822      return this.patientTarget;
2823    }
2824
2825    /**
2826     * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.)
2827     */
2828    public NutritionOrder setPatientTarget(Patient value) { 
2829      this.patientTarget = value;
2830      return this;
2831    }
2832
2833    /**
2834     * @return {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.)
2835     */
2836    public Reference getEncounter() { 
2837      if (this.encounter == null)
2838        if (Configuration.errorOnAutoCreate())
2839          throw new Error("Attempt to auto-create NutritionOrder.encounter");
2840        else if (Configuration.doAutoCreate())
2841          this.encounter = new Reference(); // cc
2842      return this.encounter;
2843    }
2844
2845    public boolean hasEncounter() { 
2846      return this.encounter != null && !this.encounter.isEmpty();
2847    }
2848
2849    /**
2850     * @param value {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.)
2851     */
2852    public NutritionOrder setEncounter(Reference value)  { 
2853      this.encounter = value;
2854      return this;
2855    }
2856
2857    /**
2858     * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An encounter that provides additional information about the healthcare context in which this request is made.)
2859     */
2860    public Encounter getEncounterTarget() { 
2861      if (this.encounterTarget == null)
2862        if (Configuration.errorOnAutoCreate())
2863          throw new Error("Attempt to auto-create NutritionOrder.encounter");
2864        else if (Configuration.doAutoCreate())
2865          this.encounterTarget = new Encounter(); // aa
2866      return this.encounterTarget;
2867    }
2868
2869    /**
2870     * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An encounter that provides additional information about the healthcare context in which this request is made.)
2871     */
2872    public NutritionOrder setEncounterTarget(Encounter value) { 
2873      this.encounterTarget = value;
2874      return this;
2875    }
2876
2877    /**
2878     * @return {@link #dateTime} (The date and time that this nutrition order was requested.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value
2879     */
2880    public DateTimeType getDateTimeElement() { 
2881      if (this.dateTime == null)
2882        if (Configuration.errorOnAutoCreate())
2883          throw new Error("Attempt to auto-create NutritionOrder.dateTime");
2884        else if (Configuration.doAutoCreate())
2885          this.dateTime = new DateTimeType(); // bb
2886      return this.dateTime;
2887    }
2888
2889    public boolean hasDateTimeElement() { 
2890      return this.dateTime != null && !this.dateTime.isEmpty();
2891    }
2892
2893    public boolean hasDateTime() { 
2894      return this.dateTime != null && !this.dateTime.isEmpty();
2895    }
2896
2897    /**
2898     * @param value {@link #dateTime} (The date and time that this nutrition order was requested.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value
2899     */
2900    public NutritionOrder setDateTimeElement(DateTimeType value) { 
2901      this.dateTime = value;
2902      return this;
2903    }
2904
2905    /**
2906     * @return The date and time that this nutrition order was requested.
2907     */
2908    public Date getDateTime() { 
2909      return this.dateTime == null ? null : this.dateTime.getValue();
2910    }
2911
2912    /**
2913     * @param value The date and time that this nutrition order was requested.
2914     */
2915    public NutritionOrder setDateTime(Date value) { 
2916        if (this.dateTime == null)
2917          this.dateTime = new DateTimeType();
2918        this.dateTime.setValue(value);
2919      return this;
2920    }
2921
2922    /**
2923     * @return {@link #orderer} (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.)
2924     */
2925    public Reference getOrderer() { 
2926      if (this.orderer == null)
2927        if (Configuration.errorOnAutoCreate())
2928          throw new Error("Attempt to auto-create NutritionOrder.orderer");
2929        else if (Configuration.doAutoCreate())
2930          this.orderer = new Reference(); // cc
2931      return this.orderer;
2932    }
2933
2934    public boolean hasOrderer() { 
2935      return this.orderer != null && !this.orderer.isEmpty();
2936    }
2937
2938    /**
2939     * @param value {@link #orderer} (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.)
2940     */
2941    public NutritionOrder setOrderer(Reference value)  { 
2942      this.orderer = value;
2943      return this;
2944    }
2945
2946    /**
2947     * @return {@link #orderer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.)
2948     */
2949    public Practitioner getOrdererTarget() { 
2950      if (this.ordererTarget == null)
2951        if (Configuration.errorOnAutoCreate())
2952          throw new Error("Attempt to auto-create NutritionOrder.orderer");
2953        else if (Configuration.doAutoCreate())
2954          this.ordererTarget = new Practitioner(); // aa
2955      return this.ordererTarget;
2956    }
2957
2958    /**
2959     * @param value {@link #orderer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.)
2960     */
2961    public NutritionOrder setOrdererTarget(Practitioner value) { 
2962      this.ordererTarget = value;
2963      return this;
2964    }
2965
2966    /**
2967     * @return {@link #allergyIntolerance} (A link to a record of allergies or intolerances  which should be included in the nutrition order.)
2968     */
2969    public List<Reference> getAllergyIntolerance() { 
2970      if (this.allergyIntolerance == null)
2971        this.allergyIntolerance = new ArrayList<Reference>();
2972      return this.allergyIntolerance;
2973    }
2974
2975    /**
2976     * @return Returns a reference to <code>this</code> for easy method chaining
2977     */
2978    public NutritionOrder setAllergyIntolerance(List<Reference> theAllergyIntolerance) { 
2979      this.allergyIntolerance = theAllergyIntolerance;
2980      return this;
2981    }
2982
2983    public boolean hasAllergyIntolerance() { 
2984      if (this.allergyIntolerance == null)
2985        return false;
2986      for (Reference item : this.allergyIntolerance)
2987        if (!item.isEmpty())
2988          return true;
2989      return false;
2990    }
2991
2992    public Reference addAllergyIntolerance() { //3
2993      Reference t = new Reference();
2994      if (this.allergyIntolerance == null)
2995        this.allergyIntolerance = new ArrayList<Reference>();
2996      this.allergyIntolerance.add(t);
2997      return t;
2998    }
2999
3000    public NutritionOrder addAllergyIntolerance(Reference t) { //3
3001      if (t == null)
3002        return this;
3003      if (this.allergyIntolerance == null)
3004        this.allergyIntolerance = new ArrayList<Reference>();
3005      this.allergyIntolerance.add(t);
3006      return this;
3007    }
3008
3009    /**
3010     * @return The first repetition of repeating field {@link #allergyIntolerance}, creating it if it does not already exist
3011     */
3012    public Reference getAllergyIntoleranceFirstRep() { 
3013      if (getAllergyIntolerance().isEmpty()) {
3014        addAllergyIntolerance();
3015      }
3016      return getAllergyIntolerance().get(0);
3017    }
3018
3019    /**
3020     * @deprecated Use Reference#setResource(IBaseResource) instead
3021     */
3022    @Deprecated
3023    public List<AllergyIntolerance> getAllergyIntoleranceTarget() { 
3024      if (this.allergyIntoleranceTarget == null)
3025        this.allergyIntoleranceTarget = new ArrayList<AllergyIntolerance>();
3026      return this.allergyIntoleranceTarget;
3027    }
3028
3029    /**
3030     * @deprecated Use Reference#setResource(IBaseResource) instead
3031     */
3032    @Deprecated
3033    public AllergyIntolerance addAllergyIntoleranceTarget() { 
3034      AllergyIntolerance r = new AllergyIntolerance();
3035      if (this.allergyIntoleranceTarget == null)
3036        this.allergyIntoleranceTarget = new ArrayList<AllergyIntolerance>();
3037      this.allergyIntoleranceTarget.add(r);
3038      return r;
3039    }
3040
3041    /**
3042     * @return {@link #foodPreferenceModifier} (This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.)
3043     */
3044    public List<CodeableConcept> getFoodPreferenceModifier() { 
3045      if (this.foodPreferenceModifier == null)
3046        this.foodPreferenceModifier = new ArrayList<CodeableConcept>();
3047      return this.foodPreferenceModifier;
3048    }
3049
3050    /**
3051     * @return Returns a reference to <code>this</code> for easy method chaining
3052     */
3053    public NutritionOrder setFoodPreferenceModifier(List<CodeableConcept> theFoodPreferenceModifier) { 
3054      this.foodPreferenceModifier = theFoodPreferenceModifier;
3055      return this;
3056    }
3057
3058    public boolean hasFoodPreferenceModifier() { 
3059      if (this.foodPreferenceModifier == null)
3060        return false;
3061      for (CodeableConcept item : this.foodPreferenceModifier)
3062        if (!item.isEmpty())
3063          return true;
3064      return false;
3065    }
3066
3067    public CodeableConcept addFoodPreferenceModifier() { //3
3068      CodeableConcept t = new CodeableConcept();
3069      if (this.foodPreferenceModifier == null)
3070        this.foodPreferenceModifier = new ArrayList<CodeableConcept>();
3071      this.foodPreferenceModifier.add(t);
3072      return t;
3073    }
3074
3075    public NutritionOrder addFoodPreferenceModifier(CodeableConcept t) { //3
3076      if (t == null)
3077        return this;
3078      if (this.foodPreferenceModifier == null)
3079        this.foodPreferenceModifier = new ArrayList<CodeableConcept>();
3080      this.foodPreferenceModifier.add(t);
3081      return this;
3082    }
3083
3084    /**
3085     * @return The first repetition of repeating field {@link #foodPreferenceModifier}, creating it if it does not already exist
3086     */
3087    public CodeableConcept getFoodPreferenceModifierFirstRep() { 
3088      if (getFoodPreferenceModifier().isEmpty()) {
3089        addFoodPreferenceModifier();
3090      }
3091      return getFoodPreferenceModifier().get(0);
3092    }
3093
3094    /**
3095     * @return {@link #excludeFoodModifier} (This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or  Gluten-Free.  While it should not be necessary to repeat allergy or intolerance information captured in the referenced AllergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient?s diet for any reason.  This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.)
3096     */
3097    public List<CodeableConcept> getExcludeFoodModifier() { 
3098      if (this.excludeFoodModifier == null)
3099        this.excludeFoodModifier = new ArrayList<CodeableConcept>();
3100      return this.excludeFoodModifier;
3101    }
3102
3103    /**
3104     * @return Returns a reference to <code>this</code> for easy method chaining
3105     */
3106    public NutritionOrder setExcludeFoodModifier(List<CodeableConcept> theExcludeFoodModifier) { 
3107      this.excludeFoodModifier = theExcludeFoodModifier;
3108      return this;
3109    }
3110
3111    public boolean hasExcludeFoodModifier() { 
3112      if (this.excludeFoodModifier == null)
3113        return false;
3114      for (CodeableConcept item : this.excludeFoodModifier)
3115        if (!item.isEmpty())
3116          return true;
3117      return false;
3118    }
3119
3120    public CodeableConcept addExcludeFoodModifier() { //3
3121      CodeableConcept t = new CodeableConcept();
3122      if (this.excludeFoodModifier == null)
3123        this.excludeFoodModifier = new ArrayList<CodeableConcept>();
3124      this.excludeFoodModifier.add(t);
3125      return t;
3126    }
3127
3128    public NutritionOrder addExcludeFoodModifier(CodeableConcept t) { //3
3129      if (t == null)
3130        return this;
3131      if (this.excludeFoodModifier == null)
3132        this.excludeFoodModifier = new ArrayList<CodeableConcept>();
3133      this.excludeFoodModifier.add(t);
3134      return this;
3135    }
3136
3137    /**
3138     * @return The first repetition of repeating field {@link #excludeFoodModifier}, creating it if it does not already exist
3139     */
3140    public CodeableConcept getExcludeFoodModifierFirstRep() { 
3141      if (getExcludeFoodModifier().isEmpty()) {
3142        addExcludeFoodModifier();
3143      }
3144      return getExcludeFoodModifier().get(0);
3145    }
3146
3147    /**
3148     * @return {@link #oralDiet} (Diet given orally in contrast to enteral (tube) feeding.)
3149     */
3150    public NutritionOrderOralDietComponent getOralDiet() { 
3151      if (this.oralDiet == null)
3152        if (Configuration.errorOnAutoCreate())
3153          throw new Error("Attempt to auto-create NutritionOrder.oralDiet");
3154        else if (Configuration.doAutoCreate())
3155          this.oralDiet = new NutritionOrderOralDietComponent(); // cc
3156      return this.oralDiet;
3157    }
3158
3159    public boolean hasOralDiet() { 
3160      return this.oralDiet != null && !this.oralDiet.isEmpty();
3161    }
3162
3163    /**
3164     * @param value {@link #oralDiet} (Diet given orally in contrast to enteral (tube) feeding.)
3165     */
3166    public NutritionOrder setOralDiet(NutritionOrderOralDietComponent value)  { 
3167      this.oralDiet = value;
3168      return this;
3169    }
3170
3171    /**
3172     * @return {@link #supplement} (Oral nutritional products given in order to add further nutritional value to the patient's diet.)
3173     */
3174    public List<NutritionOrderSupplementComponent> getSupplement() { 
3175      if (this.supplement == null)
3176        this.supplement = new ArrayList<NutritionOrderSupplementComponent>();
3177      return this.supplement;
3178    }
3179
3180    /**
3181     * @return Returns a reference to <code>this</code> for easy method chaining
3182     */
3183    public NutritionOrder setSupplement(List<NutritionOrderSupplementComponent> theSupplement) { 
3184      this.supplement = theSupplement;
3185      return this;
3186    }
3187
3188    public boolean hasSupplement() { 
3189      if (this.supplement == null)
3190        return false;
3191      for (NutritionOrderSupplementComponent item : this.supplement)
3192        if (!item.isEmpty())
3193          return true;
3194      return false;
3195    }
3196
3197    public NutritionOrderSupplementComponent addSupplement() { //3
3198      NutritionOrderSupplementComponent t = new NutritionOrderSupplementComponent();
3199      if (this.supplement == null)
3200        this.supplement = new ArrayList<NutritionOrderSupplementComponent>();
3201      this.supplement.add(t);
3202      return t;
3203    }
3204
3205    public NutritionOrder addSupplement(NutritionOrderSupplementComponent t) { //3
3206      if (t == null)
3207        return this;
3208      if (this.supplement == null)
3209        this.supplement = new ArrayList<NutritionOrderSupplementComponent>();
3210      this.supplement.add(t);
3211      return this;
3212    }
3213
3214    /**
3215     * @return The first repetition of repeating field {@link #supplement}, creating it if it does not already exist
3216     */
3217    public NutritionOrderSupplementComponent getSupplementFirstRep() { 
3218      if (getSupplement().isEmpty()) {
3219        addSupplement();
3220      }
3221      return getSupplement().get(0);
3222    }
3223
3224    /**
3225     * @return {@link #enteralFormula} (Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.)
3226     */
3227    public NutritionOrderEnteralFormulaComponent getEnteralFormula() { 
3228      if (this.enteralFormula == null)
3229        if (Configuration.errorOnAutoCreate())
3230          throw new Error("Attempt to auto-create NutritionOrder.enteralFormula");
3231        else if (Configuration.doAutoCreate())
3232          this.enteralFormula = new NutritionOrderEnteralFormulaComponent(); // cc
3233      return this.enteralFormula;
3234    }
3235
3236    public boolean hasEnteralFormula() { 
3237      return this.enteralFormula != null && !this.enteralFormula.isEmpty();
3238    }
3239
3240    /**
3241     * @param value {@link #enteralFormula} (Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.)
3242     */
3243    public NutritionOrder setEnteralFormula(NutritionOrderEnteralFormulaComponent value)  { 
3244      this.enteralFormula = value;
3245      return this;
3246    }
3247
3248      protected void listChildren(List<Property> children) {
3249        super.listChildren(children);
3250        children.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the order sender or by the order receiver.", 0, java.lang.Integer.MAX_VALUE, identifier));
3251        children.add(new Property("status", "code", "The workflow status of the nutrition order/request.", 0, 1, status));
3252        children.add(new Property("patient", "Reference(Patient)", "The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.", 0, 1, patient));
3253        children.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional information about the healthcare context in which this request is made.", 0, 1, encounter));
3254        children.add(new Property("dateTime", "dateTime", "The date and time that this nutrition order was requested.", 0, 1, dateTime));
3255        children.add(new Property("orderer", "Reference(Practitioner)", "The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.", 0, 1, orderer));
3256        children.add(new Property("allergyIntolerance", "Reference(AllergyIntolerance)", "A link to a record of allergies or intolerances  which should be included in the nutrition order.", 0, java.lang.Integer.MAX_VALUE, allergyIntolerance));
3257        children.add(new Property("foodPreferenceModifier", "CodeableConcept", "This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.", 0, java.lang.Integer.MAX_VALUE, foodPreferenceModifier));
3258        children.add(new Property("excludeFoodModifier", "CodeableConcept", "This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or  Gluten-Free.  While it should not be necessary to repeat allergy or intolerance information captured in the referenced AllergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient?s diet for any reason.  This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.", 0, java.lang.Integer.MAX_VALUE, excludeFoodModifier));
3259        children.add(new Property("oralDiet", "", "Diet given orally in contrast to enteral (tube) feeding.", 0, 1, oralDiet));
3260        children.add(new Property("supplement", "", "Oral nutritional products given in order to add further nutritional value to the patient's diet.", 0, java.lang.Integer.MAX_VALUE, supplement));
3261        children.add(new Property("enteralFormula", "", "Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.", 0, 1, enteralFormula));
3262      }
3263
3264      @Override
3265      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3266        switch (_hash) {
3267        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifiers assigned to this order by the order sender or by the order receiver.", 0, java.lang.Integer.MAX_VALUE, identifier);
3268        case -892481550: /*status*/  return new Property("status", "code", "The workflow status of the nutrition order/request.", 0, 1, status);
3269        case -791418107: /*patient*/  return new Property("patient", "Reference(Patient)", "The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.", 0, 1, patient);
3270        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "An encounter that provides additional information about the healthcare context in which this request is made.", 0, 1, encounter);
3271        case 1792749467: /*dateTime*/  return new Property("dateTime", "dateTime", "The date and time that this nutrition order was requested.", 0, 1, dateTime);
3272        case -1207109509: /*orderer*/  return new Property("orderer", "Reference(Practitioner)", "The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.", 0, 1, orderer);
3273        case -120164120: /*allergyIntolerance*/  return new Property("allergyIntolerance", "Reference(AllergyIntolerance)", "A link to a record of allergies or intolerances  which should be included in the nutrition order.", 0, java.lang.Integer.MAX_VALUE, allergyIntolerance);
3274        case 659473872: /*foodPreferenceModifier*/  return new Property("foodPreferenceModifier", "CodeableConcept", "This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.", 0, java.lang.Integer.MAX_VALUE, foodPreferenceModifier);
3275        case 1760260175: /*excludeFoodModifier*/  return new Property("excludeFoodModifier", "CodeableConcept", "This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or  Gluten-Free.  While it should not be necessary to repeat allergy or intolerance information captured in the referenced AllergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient?s diet for any reason.  This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.", 0, java.lang.Integer.MAX_VALUE, excludeFoodModifier);
3276        case 1153521250: /*oralDiet*/  return new Property("oralDiet", "", "Diet given orally in contrast to enteral (tube) feeding.", 0, 1, oralDiet);
3277        case -711993159: /*supplement*/  return new Property("supplement", "", "Oral nutritional products given in order to add further nutritional value to the patient's diet.", 0, java.lang.Integer.MAX_VALUE, supplement);
3278        case -671083805: /*enteralFormula*/  return new Property("enteralFormula", "", "Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.", 0, 1, enteralFormula);
3279        default: return super.getNamedProperty(_hash, _name, _checkValid);
3280        }
3281
3282      }
3283
3284      @Override
3285      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3286        switch (hash) {
3287        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3288        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<NutritionOrderStatus>
3289        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
3290        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
3291        case 1792749467: /*dateTime*/ return this.dateTime == null ? new Base[0] : new Base[] {this.dateTime}; // DateTimeType
3292        case -1207109509: /*orderer*/ return this.orderer == null ? new Base[0] : new Base[] {this.orderer}; // Reference
3293        case -120164120: /*allergyIntolerance*/ return this.allergyIntolerance == null ? new Base[0] : this.allergyIntolerance.toArray(new Base[this.allergyIntolerance.size()]); // Reference
3294        case 659473872: /*foodPreferenceModifier*/ return this.foodPreferenceModifier == null ? new Base[0] : this.foodPreferenceModifier.toArray(new Base[this.foodPreferenceModifier.size()]); // CodeableConcept
3295        case 1760260175: /*excludeFoodModifier*/ return this.excludeFoodModifier == null ? new Base[0] : this.excludeFoodModifier.toArray(new Base[this.excludeFoodModifier.size()]); // CodeableConcept
3296        case 1153521250: /*oralDiet*/ return this.oralDiet == null ? new Base[0] : new Base[] {this.oralDiet}; // NutritionOrderOralDietComponent
3297        case -711993159: /*supplement*/ return this.supplement == null ? new Base[0] : this.supplement.toArray(new Base[this.supplement.size()]); // NutritionOrderSupplementComponent
3298        case -671083805: /*enteralFormula*/ return this.enteralFormula == null ? new Base[0] : new Base[] {this.enteralFormula}; // NutritionOrderEnteralFormulaComponent
3299        default: return super.getProperty(hash, name, checkValid);
3300        }
3301
3302      }
3303
3304      @Override
3305      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3306        switch (hash) {
3307        case -1618432855: // identifier
3308          this.getIdentifier().add(castToIdentifier(value)); // Identifier
3309          return value;
3310        case -892481550: // status
3311          value = new NutritionOrderStatusEnumFactory().fromType(castToCode(value));
3312          this.status = (Enumeration) value; // Enumeration<NutritionOrderStatus>
3313          return value;
3314        case -791418107: // patient
3315          this.patient = castToReference(value); // Reference
3316          return value;
3317        case 1524132147: // encounter
3318          this.encounter = castToReference(value); // Reference
3319          return value;
3320        case 1792749467: // dateTime
3321          this.dateTime = castToDateTime(value); // DateTimeType
3322          return value;
3323        case -1207109509: // orderer
3324          this.orderer = castToReference(value); // Reference
3325          return value;
3326        case -120164120: // allergyIntolerance
3327          this.getAllergyIntolerance().add(castToReference(value)); // Reference
3328          return value;
3329        case 659473872: // foodPreferenceModifier
3330          this.getFoodPreferenceModifier().add(castToCodeableConcept(value)); // CodeableConcept
3331          return value;
3332        case 1760260175: // excludeFoodModifier
3333          this.getExcludeFoodModifier().add(castToCodeableConcept(value)); // CodeableConcept
3334          return value;
3335        case 1153521250: // oralDiet
3336          this.oralDiet = (NutritionOrderOralDietComponent) value; // NutritionOrderOralDietComponent
3337          return value;
3338        case -711993159: // supplement
3339          this.getSupplement().add((NutritionOrderSupplementComponent) value); // NutritionOrderSupplementComponent
3340          return value;
3341        case -671083805: // enteralFormula
3342          this.enteralFormula = (NutritionOrderEnteralFormulaComponent) value; // NutritionOrderEnteralFormulaComponent
3343          return value;
3344        default: return super.setProperty(hash, name, value);
3345        }
3346
3347      }
3348
3349      @Override
3350      public Base setProperty(String name, Base value) throws FHIRException {
3351        if (name.equals("identifier")) {
3352          this.getIdentifier().add(castToIdentifier(value));
3353        } else if (name.equals("status")) {
3354          value = new NutritionOrderStatusEnumFactory().fromType(castToCode(value));
3355          this.status = (Enumeration) value; // Enumeration<NutritionOrderStatus>
3356        } else if (name.equals("patient")) {
3357          this.patient = castToReference(value); // Reference
3358        } else if (name.equals("encounter")) {
3359          this.encounter = castToReference(value); // Reference
3360        } else if (name.equals("dateTime")) {
3361          this.dateTime = castToDateTime(value); // DateTimeType
3362        } else if (name.equals("orderer")) {
3363          this.orderer = castToReference(value); // Reference
3364        } else if (name.equals("allergyIntolerance")) {
3365          this.getAllergyIntolerance().add(castToReference(value));
3366        } else if (name.equals("foodPreferenceModifier")) {
3367          this.getFoodPreferenceModifier().add(castToCodeableConcept(value));
3368        } else if (name.equals("excludeFoodModifier")) {
3369          this.getExcludeFoodModifier().add(castToCodeableConcept(value));
3370        } else if (name.equals("oralDiet")) {
3371          this.oralDiet = (NutritionOrderOralDietComponent) value; // NutritionOrderOralDietComponent
3372        } else if (name.equals("supplement")) {
3373          this.getSupplement().add((NutritionOrderSupplementComponent) value);
3374        } else if (name.equals("enteralFormula")) {
3375          this.enteralFormula = (NutritionOrderEnteralFormulaComponent) value; // NutritionOrderEnteralFormulaComponent
3376        } else
3377          return super.setProperty(name, value);
3378        return value;
3379      }
3380
3381      @Override
3382      public Base makeProperty(int hash, String name) throws FHIRException {
3383        switch (hash) {
3384        case -1618432855:  return addIdentifier(); 
3385        case -892481550:  return getStatusElement();
3386        case -791418107:  return getPatient(); 
3387        case 1524132147:  return getEncounter(); 
3388        case 1792749467:  return getDateTimeElement();
3389        case -1207109509:  return getOrderer(); 
3390        case -120164120:  return addAllergyIntolerance(); 
3391        case 659473872:  return addFoodPreferenceModifier(); 
3392        case 1760260175:  return addExcludeFoodModifier(); 
3393        case 1153521250:  return getOralDiet(); 
3394        case -711993159:  return addSupplement(); 
3395        case -671083805:  return getEnteralFormula(); 
3396        default: return super.makeProperty(hash, name);
3397        }
3398
3399      }
3400
3401      @Override
3402      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3403        switch (hash) {
3404        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3405        case -892481550: /*status*/ return new String[] {"code"};
3406        case -791418107: /*patient*/ return new String[] {"Reference"};
3407        case 1524132147: /*encounter*/ return new String[] {"Reference"};
3408        case 1792749467: /*dateTime*/ return new String[] {"dateTime"};
3409        case -1207109509: /*orderer*/ return new String[] {"Reference"};
3410        case -120164120: /*allergyIntolerance*/ return new String[] {"Reference"};
3411        case 659473872: /*foodPreferenceModifier*/ return new String[] {"CodeableConcept"};
3412        case 1760260175: /*excludeFoodModifier*/ return new String[] {"CodeableConcept"};
3413        case 1153521250: /*oralDiet*/ return new String[] {};
3414        case -711993159: /*supplement*/ return new String[] {};
3415        case -671083805: /*enteralFormula*/ return new String[] {};
3416        default: return super.getTypesForProperty(hash, name);
3417        }
3418
3419      }
3420
3421      @Override
3422      public Base addChild(String name) throws FHIRException {
3423        if (name.equals("identifier")) {
3424          return addIdentifier();
3425        }
3426        else if (name.equals("status")) {
3427          throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.status");
3428        }
3429        else if (name.equals("patient")) {
3430          this.patient = new Reference();
3431          return this.patient;
3432        }
3433        else if (name.equals("encounter")) {
3434          this.encounter = new Reference();
3435          return this.encounter;
3436        }
3437        else if (name.equals("dateTime")) {
3438          throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.dateTime");
3439        }
3440        else if (name.equals("orderer")) {
3441          this.orderer = new Reference();
3442          return this.orderer;
3443        }
3444        else if (name.equals("allergyIntolerance")) {
3445          return addAllergyIntolerance();
3446        }
3447        else if (name.equals("foodPreferenceModifier")) {
3448          return addFoodPreferenceModifier();
3449        }
3450        else if (name.equals("excludeFoodModifier")) {
3451          return addExcludeFoodModifier();
3452        }
3453        else if (name.equals("oralDiet")) {
3454          this.oralDiet = new NutritionOrderOralDietComponent();
3455          return this.oralDiet;
3456        }
3457        else if (name.equals("supplement")) {
3458          return addSupplement();
3459        }
3460        else if (name.equals("enteralFormula")) {
3461          this.enteralFormula = new NutritionOrderEnteralFormulaComponent();
3462          return this.enteralFormula;
3463        }
3464        else
3465          return super.addChild(name);
3466      }
3467
3468  public String fhirType() {
3469    return "NutritionOrder";
3470
3471  }
3472
3473      public NutritionOrder copy() {
3474        NutritionOrder dst = new NutritionOrder();
3475        copyValues(dst);
3476        if (identifier != null) {
3477          dst.identifier = new ArrayList<Identifier>();
3478          for (Identifier i : identifier)
3479            dst.identifier.add(i.copy());
3480        };
3481        dst.status = status == null ? null : status.copy();
3482        dst.patient = patient == null ? null : patient.copy();
3483        dst.encounter = encounter == null ? null : encounter.copy();
3484        dst.dateTime = dateTime == null ? null : dateTime.copy();
3485        dst.orderer = orderer == null ? null : orderer.copy();
3486        if (allergyIntolerance != null) {
3487          dst.allergyIntolerance = new ArrayList<Reference>();
3488          for (Reference i : allergyIntolerance)
3489            dst.allergyIntolerance.add(i.copy());
3490        };
3491        if (foodPreferenceModifier != null) {
3492          dst.foodPreferenceModifier = new ArrayList<CodeableConcept>();
3493          for (CodeableConcept i : foodPreferenceModifier)
3494            dst.foodPreferenceModifier.add(i.copy());
3495        };
3496        if (excludeFoodModifier != null) {
3497          dst.excludeFoodModifier = new ArrayList<CodeableConcept>();
3498          for (CodeableConcept i : excludeFoodModifier)
3499            dst.excludeFoodModifier.add(i.copy());
3500        };
3501        dst.oralDiet = oralDiet == null ? null : oralDiet.copy();
3502        if (supplement != null) {
3503          dst.supplement = new ArrayList<NutritionOrderSupplementComponent>();
3504          for (NutritionOrderSupplementComponent i : supplement)
3505            dst.supplement.add(i.copy());
3506        };
3507        dst.enteralFormula = enteralFormula == null ? null : enteralFormula.copy();
3508        return dst;
3509      }
3510
3511      protected NutritionOrder typedCopy() {
3512        return copy();
3513      }
3514
3515      @Override
3516      public boolean equalsDeep(Base other_) {
3517        if (!super.equalsDeep(other_))
3518          return false;
3519        if (!(other_ instanceof NutritionOrder))
3520          return false;
3521        NutritionOrder o = (NutritionOrder) other_;
3522        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(patient, o.patient, true)
3523           && compareDeep(encounter, o.encounter, true) && compareDeep(dateTime, o.dateTime, true) && compareDeep(orderer, o.orderer, true)
3524           && compareDeep(allergyIntolerance, o.allergyIntolerance, true) && compareDeep(foodPreferenceModifier, o.foodPreferenceModifier, true)
3525           && compareDeep(excludeFoodModifier, o.excludeFoodModifier, true) && compareDeep(oralDiet, o.oralDiet, true)
3526           && compareDeep(supplement, o.supplement, true) && compareDeep(enteralFormula, o.enteralFormula, true)
3527          ;
3528      }
3529
3530      @Override
3531      public boolean equalsShallow(Base other_) {
3532        if (!super.equalsShallow(other_))
3533          return false;
3534        if (!(other_ instanceof NutritionOrder))
3535          return false;
3536        NutritionOrder o = (NutritionOrder) other_;
3537        return compareValues(status, o.status, true) && compareValues(dateTime, o.dateTime, true);
3538      }
3539
3540      public boolean isEmpty() {
3541        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, patient
3542          , encounter, dateTime, orderer, allergyIntolerance, foodPreferenceModifier, excludeFoodModifier
3543          , oralDiet, supplement, enteralFormula);
3544      }
3545
3546  @Override
3547  public ResourceType getResourceType() {
3548    return ResourceType.NutritionOrder;
3549   }
3550
3551 /**
3552   * Search parameter: <b>identifier</b>
3553   * <p>
3554   * Description: <b>Return nutrition orders with this external identifier</b><br>
3555   * Type: <b>token</b><br>
3556   * Path: <b>NutritionOrder.identifier</b><br>
3557   * </p>
3558   */
3559  @SearchParamDefinition(name="identifier", path="NutritionOrder.identifier", description="Return nutrition orders with this external identifier", type="token" )
3560  public static final String SP_IDENTIFIER = "identifier";
3561 /**
3562   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3563   * <p>
3564   * Description: <b>Return nutrition orders with this external identifier</b><br>
3565   * Type: <b>token</b><br>
3566   * Path: <b>NutritionOrder.identifier</b><br>
3567   * </p>
3568   */
3569  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3570
3571 /**
3572   * Search parameter: <b>datetime</b>
3573   * <p>
3574   * Description: <b>Return nutrition orders requested on this date</b><br>
3575   * Type: <b>date</b><br>
3576   * Path: <b>NutritionOrder.dateTime</b><br>
3577   * </p>
3578   */
3579  @SearchParamDefinition(name="datetime", path="NutritionOrder.dateTime", description="Return nutrition orders requested on this date", type="date" )
3580  public static final String SP_DATETIME = "datetime";
3581 /**
3582   * <b>Fluent Client</b> search parameter constant for <b>datetime</b>
3583   * <p>
3584   * Description: <b>Return nutrition orders requested on this date</b><br>
3585   * Type: <b>date</b><br>
3586   * Path: <b>NutritionOrder.dateTime</b><br>
3587   * </p>
3588   */
3589  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATETIME = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATETIME);
3590
3591 /**
3592   * Search parameter: <b>provider</b>
3593   * <p>
3594   * Description: <b>The identify of the provider who placed the nutrition order</b><br>
3595   * Type: <b>reference</b><br>
3596   * Path: <b>NutritionOrder.orderer</b><br>
3597   * </p>
3598   */
3599  @SearchParamDefinition(name="provider", path="NutritionOrder.orderer", description="The identify of the provider who placed the nutrition order", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Practitioner.class } )
3600  public static final String SP_PROVIDER = "provider";
3601 /**
3602   * <b>Fluent Client</b> search parameter constant for <b>provider</b>
3603   * <p>
3604   * Description: <b>The identify of the provider who placed the nutrition order</b><br>
3605   * Type: <b>reference</b><br>
3606   * Path: <b>NutritionOrder.orderer</b><br>
3607   * </p>
3608   */
3609  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROVIDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROVIDER);
3610
3611/**
3612   * Constant for fluent queries to be used to add include statements. Specifies
3613   * the path value of "<b>NutritionOrder:provider</b>".
3614   */
3615  public static final ca.uhn.fhir.model.api.Include INCLUDE_PROVIDER = new ca.uhn.fhir.model.api.Include("NutritionOrder:provider").toLocked();
3616
3617 /**
3618   * Search parameter: <b>patient</b>
3619   * <p>
3620   * Description: <b>The identity of the person who requires the diet, formula or nutritional supplement</b><br>
3621   * Type: <b>reference</b><br>
3622   * Path: <b>NutritionOrder.patient</b><br>
3623   * </p>
3624   */
3625  @SearchParamDefinition(name="patient", path="NutritionOrder.patient", description="The identity of the person who requires the diet, formula or nutritional supplement", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class } )
3626  public static final String SP_PATIENT = "patient";
3627 /**
3628   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3629   * <p>
3630   * Description: <b>The identity of the person who requires the diet, formula or nutritional supplement</b><br>
3631   * Type: <b>reference</b><br>
3632   * Path: <b>NutritionOrder.patient</b><br>
3633   * </p>
3634   */
3635  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3636
3637/**
3638   * Constant for fluent queries to be used to add include statements. Specifies
3639   * the path value of "<b>NutritionOrder:patient</b>".
3640   */
3641  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("NutritionOrder:patient").toLocked();
3642
3643 /**
3644   * Search parameter: <b>supplement</b>
3645   * <p>
3646   * Description: <b>Type of supplement product requested</b><br>
3647   * Type: <b>token</b><br>
3648   * Path: <b>NutritionOrder.supplement.type</b><br>
3649   * </p>
3650   */
3651  @SearchParamDefinition(name="supplement", path="NutritionOrder.supplement.type", description="Type of supplement product requested", type="token" )
3652  public static final String SP_SUPPLEMENT = "supplement";
3653 /**
3654   * <b>Fluent Client</b> search parameter constant for <b>supplement</b>
3655   * <p>
3656   * Description: <b>Type of supplement product requested</b><br>
3657   * Type: <b>token</b><br>
3658   * Path: <b>NutritionOrder.supplement.type</b><br>
3659   * </p>
3660   */
3661  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SUPPLEMENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SUPPLEMENT);
3662
3663 /**
3664   * Search parameter: <b>formula</b>
3665   * <p>
3666   * Description: <b>Type of enteral or infant formula</b><br>
3667   * Type: <b>token</b><br>
3668   * Path: <b>NutritionOrder.enteralFormula.baseFormulaType</b><br>
3669   * </p>
3670   */
3671  @SearchParamDefinition(name="formula", path="NutritionOrder.enteralFormula.baseFormulaType", description="Type of enteral or infant formula", type="token" )
3672  public static final String SP_FORMULA = "formula";
3673 /**
3674   * <b>Fluent Client</b> search parameter constant for <b>formula</b>
3675   * <p>
3676   * Description: <b>Type of enteral or infant formula</b><br>
3677   * Type: <b>token</b><br>
3678   * Path: <b>NutritionOrder.enteralFormula.baseFormulaType</b><br>
3679   * </p>
3680   */
3681  public static final ca.uhn.fhir.rest.gclient.TokenClientParam FORMULA = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FORMULA);
3682
3683 /**
3684   * Search parameter: <b>encounter</b>
3685   * <p>
3686   * Description: <b>Return nutrition orders with this encounter identifier</b><br>
3687   * Type: <b>reference</b><br>
3688   * Path: <b>NutritionOrder.encounter</b><br>
3689   * </p>
3690   */
3691  @SearchParamDefinition(name="encounter", path="NutritionOrder.encounter", description="Return nutrition orders with this encounter identifier", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Encounter") }, target={Encounter.class } )
3692  public static final String SP_ENCOUNTER = "encounter";
3693 /**
3694   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
3695   * <p>
3696   * Description: <b>Return nutrition orders with this encounter identifier</b><br>
3697   * Type: <b>reference</b><br>
3698   * Path: <b>NutritionOrder.encounter</b><br>
3699   * </p>
3700   */
3701  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
3702
3703/**
3704   * Constant for fluent queries to be used to add include statements. Specifies
3705   * the path value of "<b>NutritionOrder:encounter</b>".
3706   */
3707  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("NutritionOrder:encounter").toLocked();
3708
3709 /**
3710   * Search parameter: <b>oraldiet</b>
3711   * <p>
3712   * Description: <b>Type of diet that can be consumed orally (i.e., take via the mouth).</b><br>
3713   * Type: <b>token</b><br>
3714   * Path: <b>NutritionOrder.oralDiet.type</b><br>
3715   * </p>
3716   */
3717  @SearchParamDefinition(name="oraldiet", path="NutritionOrder.oralDiet.type", description="Type of diet that can be consumed orally (i.e., take via the mouth).", type="token" )
3718  public static final String SP_ORALDIET = "oraldiet";
3719 /**
3720   * <b>Fluent Client</b> search parameter constant for <b>oraldiet</b>
3721   * <p>
3722   * Description: <b>Type of diet that can be consumed orally (i.e., take via the mouth).</b><br>
3723   * Type: <b>token</b><br>
3724   * Path: <b>NutritionOrder.oralDiet.type</b><br>
3725   * </p>
3726   */
3727  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORALDIET = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORALDIET);
3728
3729 /**
3730   * Search parameter: <b>status</b>
3731   * <p>
3732   * Description: <b>Status of the nutrition order.</b><br>
3733   * Type: <b>token</b><br>
3734   * Path: <b>NutritionOrder.status</b><br>
3735   * </p>
3736   */
3737  @SearchParamDefinition(name="status", path="NutritionOrder.status", description="Status of the nutrition order.", type="token" )
3738  public static final String SP_STATUS = "status";
3739 /**
3740   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3741   * <p>
3742   * Description: <b>Status of the nutrition order.</b><br>
3743   * Type: <b>token</b><br>
3744   * Path: <b>NutritionOrder.status</b><br>
3745   * </p>
3746   */
3747  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3748
3749 /**
3750   * Search parameter: <b>additive</b>
3751   * <p>
3752   * Description: <b>Type of module component to add to the feeding</b><br>
3753   * Type: <b>token</b><br>
3754   * Path: <b>NutritionOrder.enteralFormula.additiveType</b><br>
3755   * </p>
3756   */
3757  @SearchParamDefinition(name="additive", path="NutritionOrder.enteralFormula.additiveType", description="Type of module component to add to the feeding", type="token" )
3758  public static final String SP_ADDITIVE = "additive";
3759 /**
3760   * <b>Fluent Client</b> search parameter constant for <b>additive</b>
3761   * <p>
3762   * Description: <b>Type of module component to add to the feeding</b><br>
3763   * Type: <b>token</b><br>
3764   * Path: <b>NutritionOrder.enteralFormula.additiveType</b><br>
3765   * </p>
3766   */
3767  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDITIVE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDITIVE);
3768
3769
3770}