001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Tue, Dec 28, 2021 07:16+1100 for FHIR v5.0.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc.
052 */
053@ResourceDef(name="Goal", profile="http://hl7.org/fhir/StructureDefinition/Goal")
054public class Goal extends DomainResource {
055
056    public enum GoalLifecycleStatus {
057        /**
058         * A goal is proposed for this patient.
059         */
060        PROPOSED, 
061        /**
062         * A goal is planned for this patient.
063         */
064        PLANNED, 
065        /**
066         * A proposed goal was accepted or acknowledged.
067         */
068        ACCEPTED, 
069        /**
070         * The goal is being sought actively.
071         */
072        ACTIVE, 
073        /**
074         * The goal remains a long term objective but is no longer being actively pursued for a temporary period of time.
075         */
076        ONHOLD, 
077        /**
078         * The goal is no longer being sought.
079         */
080        COMPLETED, 
081        /**
082         * The goal has been abandoned.
083         */
084        CANCELLED, 
085        /**
086         * The goal was entered in error and voided.
087         */
088        ENTEREDINERROR, 
089        /**
090         * A proposed goal was rejected.
091         */
092        REJECTED, 
093        /**
094         * added to help the parsers with the generic types
095         */
096        NULL;
097        public static GoalLifecycleStatus fromCode(String codeString) throws FHIRException {
098            if (codeString == null || "".equals(codeString))
099                return null;
100        if ("proposed".equals(codeString))
101          return PROPOSED;
102        if ("planned".equals(codeString))
103          return PLANNED;
104        if ("accepted".equals(codeString))
105          return ACCEPTED;
106        if ("active".equals(codeString))
107          return ACTIVE;
108        if ("on-hold".equals(codeString))
109          return ONHOLD;
110        if ("completed".equals(codeString))
111          return COMPLETED;
112        if ("cancelled".equals(codeString))
113          return CANCELLED;
114        if ("entered-in-error".equals(codeString))
115          return ENTEREDINERROR;
116        if ("rejected".equals(codeString))
117          return REJECTED;
118        if (Configuration.isAcceptInvalidEnums())
119          return null;
120        else
121          throw new FHIRException("Unknown GoalLifecycleStatus code '"+codeString+"'");
122        }
123        public String toCode() {
124          switch (this) {
125            case PROPOSED: return "proposed";
126            case PLANNED: return "planned";
127            case ACCEPTED: return "accepted";
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 REJECTED: return "rejected";
134            default: return "?";
135          }
136        }
137        public String getSystem() {
138          switch (this) {
139            case PROPOSED: return "http://hl7.org/fhir/goal-status";
140            case PLANNED: return "http://hl7.org/fhir/goal-status";
141            case ACCEPTED: return "http://hl7.org/fhir/goal-status";
142            case ACTIVE: return "http://hl7.org/fhir/goal-status";
143            case ONHOLD: return "http://hl7.org/fhir/goal-status";
144            case COMPLETED: return "http://hl7.org/fhir/goal-status";
145            case CANCELLED: return "http://hl7.org/fhir/goal-status";
146            case ENTEREDINERROR: return "http://hl7.org/fhir/goal-status";
147            case REJECTED: return "http://hl7.org/fhir/goal-status";
148            default: return "?";
149          }
150        }
151        public String getDefinition() {
152          switch (this) {
153            case PROPOSED: return "A goal is proposed for this patient.";
154            case PLANNED: return "A goal is planned for this patient.";
155            case ACCEPTED: return "A proposed goal was accepted or acknowledged.";
156            case ACTIVE: return "The goal is being sought actively.";
157            case ONHOLD: return "The goal remains a long term objective but is no longer being actively pursued for a temporary period of time.";
158            case COMPLETED: return "The goal is no longer being sought.";
159            case CANCELLED: return "The goal has been abandoned.";
160            case ENTEREDINERROR: return "The goal was entered in error and voided.";
161            case REJECTED: return "A proposed goal was rejected.";
162            default: return "?";
163          }
164        }
165        public String getDisplay() {
166          switch (this) {
167            case PROPOSED: return "Proposed";
168            case PLANNED: return "Planned";
169            case ACCEPTED: return "Accepted";
170            case ACTIVE: return "Active";
171            case ONHOLD: return "On Hold";
172            case COMPLETED: return "Completed";
173            case CANCELLED: return "Cancelled";
174            case ENTEREDINERROR: return "Entered in Error";
175            case REJECTED: return "Rejected";
176            default: return "?";
177          }
178        }
179    }
180
181  public static class GoalLifecycleStatusEnumFactory implements EnumFactory<GoalLifecycleStatus> {
182    public GoalLifecycleStatus fromCode(String codeString) throws IllegalArgumentException {
183      if (codeString == null || "".equals(codeString))
184            if (codeString == null || "".equals(codeString))
185                return null;
186        if ("proposed".equals(codeString))
187          return GoalLifecycleStatus.PROPOSED;
188        if ("planned".equals(codeString))
189          return GoalLifecycleStatus.PLANNED;
190        if ("accepted".equals(codeString))
191          return GoalLifecycleStatus.ACCEPTED;
192        if ("active".equals(codeString))
193          return GoalLifecycleStatus.ACTIVE;
194        if ("on-hold".equals(codeString))
195          return GoalLifecycleStatus.ONHOLD;
196        if ("completed".equals(codeString))
197          return GoalLifecycleStatus.COMPLETED;
198        if ("cancelled".equals(codeString))
199          return GoalLifecycleStatus.CANCELLED;
200        if ("entered-in-error".equals(codeString))
201          return GoalLifecycleStatus.ENTEREDINERROR;
202        if ("rejected".equals(codeString))
203          return GoalLifecycleStatus.REJECTED;
204        throw new IllegalArgumentException("Unknown GoalLifecycleStatus code '"+codeString+"'");
205        }
206        public Enumeration<GoalLifecycleStatus> fromType(Base code) throws FHIRException {
207          if (code == null)
208            return null;
209          if (code.isEmpty())
210            return new Enumeration<GoalLifecycleStatus>(this);
211          String codeString = ((PrimitiveType) code).asStringValue();
212          if (codeString == null || "".equals(codeString))
213            return null;
214        if ("proposed".equals(codeString))
215          return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.PROPOSED);
216        if ("planned".equals(codeString))
217          return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.PLANNED);
218        if ("accepted".equals(codeString))
219          return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.ACCEPTED);
220        if ("active".equals(codeString))
221          return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.ACTIVE);
222        if ("on-hold".equals(codeString))
223          return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.ONHOLD);
224        if ("completed".equals(codeString))
225          return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.COMPLETED);
226        if ("cancelled".equals(codeString))
227          return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.CANCELLED);
228        if ("entered-in-error".equals(codeString))
229          return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.ENTEREDINERROR);
230        if ("rejected".equals(codeString))
231          return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.REJECTED);
232        throw new FHIRException("Unknown GoalLifecycleStatus code '"+codeString+"'");
233        }
234    public String toCode(GoalLifecycleStatus code) {
235      if (code == GoalLifecycleStatus.PROPOSED)
236        return "proposed";
237      if (code == GoalLifecycleStatus.PLANNED)
238        return "planned";
239      if (code == GoalLifecycleStatus.ACCEPTED)
240        return "accepted";
241      if (code == GoalLifecycleStatus.ACTIVE)
242        return "active";
243      if (code == GoalLifecycleStatus.ONHOLD)
244        return "on-hold";
245      if (code == GoalLifecycleStatus.COMPLETED)
246        return "completed";
247      if (code == GoalLifecycleStatus.CANCELLED)
248        return "cancelled";
249      if (code == GoalLifecycleStatus.ENTEREDINERROR)
250        return "entered-in-error";
251      if (code == GoalLifecycleStatus.REJECTED)
252        return "rejected";
253      return "?";
254      }
255    public String toSystem(GoalLifecycleStatus code) {
256      return code.getSystem();
257      }
258    }
259
260    @Block()
261    public static class GoalTargetComponent extends BackboneElement implements IBaseBackboneElement {
262        /**
263         * The parameter whose value is being tracked, e.g. body weight, blood pressure, or hemoglobin A1c level.
264         */
265        @Child(name = "measure", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
266        @Description(shortDefinition="The parameter whose value is being tracked", formalDefinition="The parameter whose value is being tracked, e.g. body weight, blood pressure, or hemoglobin A1c level." )
267        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/observation-codes")
268        protected CodeableConcept measure;
269
270        /**
271         * The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.
272         */
273        @Child(name = "detail", type = {Quantity.class, Range.class, CodeableConcept.class, StringType.class, BooleanType.class, IntegerType.class, Ratio.class}, order=2, min=0, max=1, modifier=false, summary=true)
274        @Description(shortDefinition="The target value to be achieved", formalDefinition="The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value." )
275        protected DataType detail;
276
277        /**
278         * Indicates either the date or the duration after start by which the goal should be met.
279         */
280        @Child(name = "due", type = {DateType.class, Duration.class}, order=3, min=0, max=1, modifier=false, summary=true)
281        @Description(shortDefinition="Reach goal on or before", formalDefinition="Indicates either the date or the duration after start by which the goal should be met." )
282        protected DataType due;
283
284        private static final long serialVersionUID = 1975697830L;
285
286    /**
287     * Constructor
288     */
289      public GoalTargetComponent() {
290        super();
291      }
292
293        /**
294         * @return {@link #measure} (The parameter whose value is being tracked, e.g. body weight, blood pressure, or hemoglobin A1c level.)
295         */
296        public CodeableConcept getMeasure() { 
297          if (this.measure == null)
298            if (Configuration.errorOnAutoCreate())
299              throw new Error("Attempt to auto-create GoalTargetComponent.measure");
300            else if (Configuration.doAutoCreate())
301              this.measure = new CodeableConcept(); // cc
302          return this.measure;
303        }
304
305        public boolean hasMeasure() { 
306          return this.measure != null && !this.measure.isEmpty();
307        }
308
309        /**
310         * @param value {@link #measure} (The parameter whose value is being tracked, e.g. body weight, blood pressure, or hemoglobin A1c level.)
311         */
312        public GoalTargetComponent setMeasure(CodeableConcept value) { 
313          this.measure = value;
314          return this;
315        }
316
317        /**
318         * @return {@link #detail} (The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.)
319         */
320        public DataType getDetail() { 
321          return this.detail;
322        }
323
324        /**
325         * @return {@link #detail} (The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.)
326         */
327        public Quantity getDetailQuantity() throws FHIRException { 
328          if (this.detail == null)
329            this.detail = new Quantity();
330          if (!(this.detail instanceof Quantity))
331            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.detail.getClass().getName()+" was encountered");
332          return (Quantity) this.detail;
333        }
334
335        public boolean hasDetailQuantity() { 
336          return this != null && this.detail instanceof Quantity;
337        }
338
339        /**
340         * @return {@link #detail} (The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.)
341         */
342        public Range getDetailRange() throws FHIRException { 
343          if (this.detail == null)
344            this.detail = new Range();
345          if (!(this.detail instanceof Range))
346            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.detail.getClass().getName()+" was encountered");
347          return (Range) this.detail;
348        }
349
350        public boolean hasDetailRange() { 
351          return this != null && this.detail instanceof Range;
352        }
353
354        /**
355         * @return {@link #detail} (The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.)
356         */
357        public CodeableConcept getDetailCodeableConcept() throws FHIRException { 
358          if (this.detail == null)
359            this.detail = new CodeableConcept();
360          if (!(this.detail instanceof CodeableConcept))
361            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.detail.getClass().getName()+" was encountered");
362          return (CodeableConcept) this.detail;
363        }
364
365        public boolean hasDetailCodeableConcept() { 
366          return this != null && this.detail instanceof CodeableConcept;
367        }
368
369        /**
370         * @return {@link #detail} (The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.)
371         */
372        public StringType getDetailStringType() throws FHIRException { 
373          if (this.detail == null)
374            this.detail = new StringType();
375          if (!(this.detail instanceof StringType))
376            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.detail.getClass().getName()+" was encountered");
377          return (StringType) this.detail;
378        }
379
380        public boolean hasDetailStringType() { 
381          return this != null && this.detail instanceof StringType;
382        }
383
384        /**
385         * @return {@link #detail} (The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.)
386         */
387        public BooleanType getDetailBooleanType() throws FHIRException { 
388          if (this.detail == null)
389            this.detail = new BooleanType();
390          if (!(this.detail instanceof BooleanType))
391            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.detail.getClass().getName()+" was encountered");
392          return (BooleanType) this.detail;
393        }
394
395        public boolean hasDetailBooleanType() { 
396          return this != null && this.detail instanceof BooleanType;
397        }
398
399        /**
400         * @return {@link #detail} (The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.)
401         */
402        public IntegerType getDetailIntegerType() throws FHIRException { 
403          if (this.detail == null)
404            this.detail = new IntegerType();
405          if (!(this.detail instanceof IntegerType))
406            throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.detail.getClass().getName()+" was encountered");
407          return (IntegerType) this.detail;
408        }
409
410        public boolean hasDetailIntegerType() { 
411          return this != null && this.detail instanceof IntegerType;
412        }
413
414        /**
415         * @return {@link #detail} (The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.)
416         */
417        public Ratio getDetailRatio() throws FHIRException { 
418          if (this.detail == null)
419            this.detail = new Ratio();
420          if (!(this.detail instanceof Ratio))
421            throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.detail.getClass().getName()+" was encountered");
422          return (Ratio) this.detail;
423        }
424
425        public boolean hasDetailRatio() { 
426          return this != null && this.detail instanceof Ratio;
427        }
428
429        public boolean hasDetail() { 
430          return this.detail != null && !this.detail.isEmpty();
431        }
432
433        /**
434         * @param value {@link #detail} (The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.)
435         */
436        public GoalTargetComponent setDetail(DataType value) { 
437          if (value != null && !(value instanceof Quantity || value instanceof Range || value instanceof CodeableConcept || value instanceof StringType || value instanceof BooleanType || value instanceof IntegerType || value instanceof Ratio))
438            throw new Error("Not the right type for Goal.target.detail[x]: "+value.fhirType());
439          this.detail = value;
440          return this;
441        }
442
443        /**
444         * @return {@link #due} (Indicates either the date or the duration after start by which the goal should be met.)
445         */
446        public DataType getDue() { 
447          return this.due;
448        }
449
450        /**
451         * @return {@link #due} (Indicates either the date or the duration after start by which the goal should be met.)
452         */
453        public DateType getDueDateType() throws FHIRException { 
454          if (this.due == null)
455            this.due = new DateType();
456          if (!(this.due instanceof DateType))
457            throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.due.getClass().getName()+" was encountered");
458          return (DateType) this.due;
459        }
460
461        public boolean hasDueDateType() { 
462          return this != null && this.due instanceof DateType;
463        }
464
465        /**
466         * @return {@link #due} (Indicates either the date or the duration after start by which the goal should be met.)
467         */
468        public Duration getDueDuration() throws FHIRException { 
469          if (this.due == null)
470            this.due = new Duration();
471          if (!(this.due instanceof Duration))
472            throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.due.getClass().getName()+" was encountered");
473          return (Duration) this.due;
474        }
475
476        public boolean hasDueDuration() { 
477          return this != null && this.due instanceof Duration;
478        }
479
480        public boolean hasDue() { 
481          return this.due != null && !this.due.isEmpty();
482        }
483
484        /**
485         * @param value {@link #due} (Indicates either the date or the duration after start by which the goal should be met.)
486         */
487        public GoalTargetComponent setDue(DataType value) { 
488          if (value != null && !(value instanceof DateType || value instanceof Duration))
489            throw new Error("Not the right type for Goal.target.due[x]: "+value.fhirType());
490          this.due = value;
491          return this;
492        }
493
494        protected void listChildren(List<Property> children) {
495          super.listChildren(children);
496          children.add(new Property("measure", "CodeableConcept", "The parameter whose value is being tracked, e.g. body weight, blood pressure, or hemoglobin A1c level.", 0, 1, measure));
497          children.add(new Property("detail[x]", "Quantity|Range|CodeableConcept|string|boolean|integer|Ratio", "The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.", 0, 1, detail));
498          children.add(new Property("due[x]", "date|Duration", "Indicates either the date or the duration after start by which the goal should be met.", 0, 1, due));
499        }
500
501        @Override
502        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
503          switch (_hash) {
504          case 938321246: /*measure*/  return new Property("measure", "CodeableConcept", "The parameter whose value is being tracked, e.g. body weight, blood pressure, or hemoglobin A1c level.", 0, 1, measure);
505          case -1973084529: /*detail[x]*/  return new Property("detail[x]", "Quantity|Range|CodeableConcept|string|boolean|integer|Ratio", "The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.", 0, 1, detail);
506          case -1335224239: /*detail*/  return new Property("detail[x]", "Quantity|Range|CodeableConcept|string|boolean|integer|Ratio", "The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.", 0, 1, detail);
507          case -1313079300: /*detailQuantity*/  return new Property("detail[x]", "Quantity", "The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.", 0, 1, detail);
508          case -2062632084: /*detailRange*/  return new Property("detail[x]", "Range", "The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.", 0, 1, detail);
509          case -175586544: /*detailCodeableConcept*/  return new Property("detail[x]", "CodeableConcept", "The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.", 0, 1, detail);
510          case 529212354: /*detailString*/  return new Property("detail[x]", "string", "The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.", 0, 1, detail);
511          case 1172184727: /*detailBoolean*/  return new Property("detail[x]", "boolean", "The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.", 0, 1, detail);
512          case -1229442131: /*detailInteger*/  return new Property("detail[x]", "integer", "The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.", 0, 1, detail);
513          case -2062626246: /*detailRatio*/  return new Property("detail[x]", "Ratio", "The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.", 0, 1, detail);
514          case -1320900084: /*due[x]*/  return new Property("due[x]", "date|Duration", "Indicates either the date or the duration after start by which the goal should be met.", 0, 1, due);
515          case 99828: /*due*/  return new Property("due[x]", "date|Duration", "Indicates either the date or the duration after start by which the goal should be met.", 0, 1, due);
516          case 2001063874: /*dueDate*/  return new Property("due[x]", "date", "Indicates either the date or the duration after start by which the goal should be met.", 0, 1, due);
517          case -620428376: /*dueDuration*/  return new Property("due[x]", "Duration", "Indicates either the date or the duration after start by which the goal should be met.", 0, 1, due);
518          default: return super.getNamedProperty(_hash, _name, _checkValid);
519          }
520
521        }
522
523      @Override
524      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
525        switch (hash) {
526        case 938321246: /*measure*/ return this.measure == null ? new Base[0] : new Base[] {this.measure}; // CodeableConcept
527        case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : new Base[] {this.detail}; // DataType
528        case 99828: /*due*/ return this.due == null ? new Base[0] : new Base[] {this.due}; // DataType
529        default: return super.getProperty(hash, name, checkValid);
530        }
531
532      }
533
534      @Override
535      public Base setProperty(int hash, String name, Base value) throws FHIRException {
536        switch (hash) {
537        case 938321246: // measure
538          this.measure = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
539          return value;
540        case -1335224239: // detail
541          this.detail = TypeConvertor.castToType(value); // DataType
542          return value;
543        case 99828: // due
544          this.due = TypeConvertor.castToType(value); // DataType
545          return value;
546        default: return super.setProperty(hash, name, value);
547        }
548
549      }
550
551      @Override
552      public Base setProperty(String name, Base value) throws FHIRException {
553        if (name.equals("measure")) {
554          this.measure = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
555        } else if (name.equals("detail[x]")) {
556          this.detail = TypeConvertor.castToType(value); // DataType
557        } else if (name.equals("due[x]")) {
558          this.due = TypeConvertor.castToType(value); // DataType
559        } else
560          return super.setProperty(name, value);
561        return value;
562      }
563
564      @Override
565      public Base makeProperty(int hash, String name) throws FHIRException {
566        switch (hash) {
567        case 938321246:  return getMeasure();
568        case -1973084529:  return getDetail();
569        case -1335224239:  return getDetail();
570        case -1320900084:  return getDue();
571        case 99828:  return getDue();
572        default: return super.makeProperty(hash, name);
573        }
574
575      }
576
577      @Override
578      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
579        switch (hash) {
580        case 938321246: /*measure*/ return new String[] {"CodeableConcept"};
581        case -1335224239: /*detail*/ return new String[] {"Quantity", "Range", "CodeableConcept", "string", "boolean", "integer", "Ratio"};
582        case 99828: /*due*/ return new String[] {"date", "Duration"};
583        default: return super.getTypesForProperty(hash, name);
584        }
585
586      }
587
588      @Override
589      public Base addChild(String name) throws FHIRException {
590        if (name.equals("measure")) {
591          this.measure = new CodeableConcept();
592          return this.measure;
593        }
594        else if (name.equals("detailQuantity")) {
595          this.detail = new Quantity();
596          return this.detail;
597        }
598        else if (name.equals("detailRange")) {
599          this.detail = new Range();
600          return this.detail;
601        }
602        else if (name.equals("detailCodeableConcept")) {
603          this.detail = new CodeableConcept();
604          return this.detail;
605        }
606        else if (name.equals("detailString")) {
607          this.detail = new StringType();
608          return this.detail;
609        }
610        else if (name.equals("detailBoolean")) {
611          this.detail = new BooleanType();
612          return this.detail;
613        }
614        else if (name.equals("detailInteger")) {
615          this.detail = new IntegerType();
616          return this.detail;
617        }
618        else if (name.equals("detailRatio")) {
619          this.detail = new Ratio();
620          return this.detail;
621        }
622        else if (name.equals("dueDate")) {
623          this.due = new DateType();
624          return this.due;
625        }
626        else if (name.equals("dueDuration")) {
627          this.due = new Duration();
628          return this.due;
629        }
630        else
631          return super.addChild(name);
632      }
633
634      public GoalTargetComponent copy() {
635        GoalTargetComponent dst = new GoalTargetComponent();
636        copyValues(dst);
637        return dst;
638      }
639
640      public void copyValues(GoalTargetComponent dst) {
641        super.copyValues(dst);
642        dst.measure = measure == null ? null : measure.copy();
643        dst.detail = detail == null ? null : detail.copy();
644        dst.due = due == null ? null : due.copy();
645      }
646
647      @Override
648      public boolean equalsDeep(Base other_) {
649        if (!super.equalsDeep(other_))
650          return false;
651        if (!(other_ instanceof GoalTargetComponent))
652          return false;
653        GoalTargetComponent o = (GoalTargetComponent) other_;
654        return compareDeep(measure, o.measure, true) && compareDeep(detail, o.detail, true) && compareDeep(due, o.due, true)
655          ;
656      }
657
658      @Override
659      public boolean equalsShallow(Base other_) {
660        if (!super.equalsShallow(other_))
661          return false;
662        if (!(other_ instanceof GoalTargetComponent))
663          return false;
664        GoalTargetComponent o = (GoalTargetComponent) other_;
665        return true;
666      }
667
668      public boolean isEmpty() {
669        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(measure, detail, due);
670      }
671
672  public String fhirType() {
673    return "Goal.target";
674
675  }
676
677  }
678
679    /**
680     * Business identifiers assigned to this goal by the performer or other systems which remain constant as the resource is updated and propagates from server to server.
681     */
682    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
683    @Description(shortDefinition="External Ids for this goal", formalDefinition="Business identifiers assigned to this goal by the performer or other systems which remain constant as the resource is updated and propagates from server to server." )
684    protected List<Identifier> identifier;
685
686    /**
687     * The state of the goal throughout its lifecycle.
688     */
689    @Child(name = "lifecycleStatus", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
690    @Description(shortDefinition="proposed | planned | accepted | active | on-hold | completed | cancelled | entered-in-error | rejected", formalDefinition="The state of the goal throughout its lifecycle." )
691    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/goal-status")
692    protected Enumeration<GoalLifecycleStatus> lifecycleStatus;
693
694    /**
695     * Describes the progression, or lack thereof, towards the goal against the target.
696     */
697    @Child(name = "achievementStatus", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
698    @Description(shortDefinition="in-progress | improving | worsening | no-change | achieved | sustaining | not-achieved | no-progress | not-attainable", formalDefinition="Describes the progression, or lack thereof, towards the goal against the target." )
699    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/goal-achievement")
700    protected CodeableConcept achievementStatus;
701
702    /**
703     * Indicates a category the goal falls within.
704     */
705    @Child(name = "category", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
706    @Description(shortDefinition="E.g. Treatment, dietary, behavioral, etc.", formalDefinition="Indicates a category the goal falls within." )
707    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/goal-category")
708    protected List<CodeableConcept> category;
709
710    /**
711     * After meeting the goal, ongoing activity is needed to sustain the goal objective.
712     */
713    @Child(name = "continuous", type = {BooleanType.class}, order=4, min=0, max=1, modifier=false, summary=false)
714    @Description(shortDefinition="After meeting the goal, ongoing activity is needed to sustain the goal objective", formalDefinition="After meeting the goal, ongoing activity is needed to sustain the goal objective." )
715    protected BooleanType continuous;
716
717    /**
718     * Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.
719     */
720    @Child(name = "priority", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true)
721    @Description(shortDefinition="high-priority | medium-priority | low-priority", formalDefinition="Identifies the mutually agreed level of importance associated with reaching/sustaining the goal." )
722    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/goal-priority")
723    protected CodeableConcept priority;
724
725    /**
726     * Human-readable and/or coded description of a specific desired objective of care, such as "control blood pressure" or "negotiate an obstacle course" or "dance with child at wedding".
727     */
728    @Child(name = "description", type = {CodeableConcept.class}, order=6, min=1, max=1, modifier=false, summary=true)
729    @Description(shortDefinition="Code or text describing goal", formalDefinition="Human-readable and/or coded description of a specific desired objective of care, such as \"control blood pressure\" or \"negotiate an obstacle course\" or \"dance with child at wedding\"." )
730    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/clinical-findings")
731    protected CodeableConcept description;
732
733    /**
734     * Identifies the patient, group or organization for whom the goal is being established.
735     */
736    @Child(name = "subject", type = {Patient.class, Group.class, Organization.class}, order=7, min=1, max=1, modifier=false, summary=true)
737    @Description(shortDefinition="Who this goal is intended for", formalDefinition="Identifies the patient, group or organization for whom the goal is being established." )
738    protected Reference subject;
739
740    /**
741     * The date or event after which the goal should begin being pursued.
742     */
743    @Child(name = "start", type = {DateType.class, CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=true)
744    @Description(shortDefinition="When goal pursuit begins", formalDefinition="The date or event after which the goal should begin being pursued." )
745    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/goal-start-event")
746    protected DataType start;
747
748    /**
749     * Indicates what should be done by when.
750     */
751    @Child(name = "target", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
752    @Description(shortDefinition="Target outcome for the goal", formalDefinition="Indicates what should be done by when." )
753    protected List<GoalTargetComponent> target;
754
755    /**
756     * Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc.
757     */
758    @Child(name = "statusDate", type = {DateType.class}, order=10, min=0, max=1, modifier=false, summary=true)
759    @Description(shortDefinition="When goal status took effect", formalDefinition="Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc." )
760    protected DateType statusDate;
761
762    /**
763     * Captures the reason for the current status.
764     */
765    @Child(name = "statusReason", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false)
766    @Description(shortDefinition="Reason for current status", formalDefinition="Captures the reason for the current status." )
767    protected StringType statusReason;
768
769    /**
770     * Indicates whose goal this is - patient goal, practitioner goal, etc.
771     */
772    @Child(name = "source", type = {Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class, CareTeam.class}, order=12, min=0, max=1, modifier=false, summary=true)
773    @Description(shortDefinition="Who's responsible for creating Goal?", formalDefinition="Indicates whose goal this is - patient goal, practitioner goal, etc." )
774    protected Reference source;
775
776    /**
777     * The identified conditions and other health record elements that are intended to be addressed by the goal.
778     */
779    @Child(name = "addresses", type = {Condition.class, Observation.class, MedicationUsage.class, MedicationRequest.class, NutritionOrder.class, ServiceRequest.class, RiskAssessment.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
780    @Description(shortDefinition="Issues addressed by this goal", formalDefinition="The identified conditions and other health record elements that are intended to be addressed by the goal." )
781    protected List<Reference> addresses;
782
783    /**
784     * Any comments related to the goal.
785     */
786    @Child(name = "note", type = {Annotation.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
787    @Description(shortDefinition="Comments about the goal", formalDefinition="Any comments related to the goal." )
788    protected List<Annotation> note;
789
790    /**
791     * Identifies the change (or lack of change) at the point when the status of the goal is assessed.
792     */
793    @Child(name = "outcome", type = {CodeableReference.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
794    @Description(shortDefinition="What result was achieved regarding the goal?", formalDefinition="Identifies the change (or lack of change) at the point when the status of the goal is assessed." )
795    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/clinical-findings")
796    protected List<CodeableReference> outcome;
797
798    private static final long serialVersionUID = -884300976L;
799
800  /**
801   * Constructor
802   */
803    public Goal() {
804      super();
805    }
806
807  /**
808   * Constructor
809   */
810    public Goal(GoalLifecycleStatus lifecycleStatus, CodeableConcept description, Reference subject) {
811      super();
812      this.setLifecycleStatus(lifecycleStatus);
813      this.setDescription(description);
814      this.setSubject(subject);
815    }
816
817    /**
818     * @return {@link #identifier} (Business identifiers assigned to this goal by the performer or other systems which remain constant as the resource is updated and propagates from server to server.)
819     */
820    public List<Identifier> getIdentifier() { 
821      if (this.identifier == null)
822        this.identifier = new ArrayList<Identifier>();
823      return this.identifier;
824    }
825
826    /**
827     * @return Returns a reference to <code>this</code> for easy method chaining
828     */
829    public Goal setIdentifier(List<Identifier> theIdentifier) { 
830      this.identifier = theIdentifier;
831      return this;
832    }
833
834    public boolean hasIdentifier() { 
835      if (this.identifier == null)
836        return false;
837      for (Identifier item : this.identifier)
838        if (!item.isEmpty())
839          return true;
840      return false;
841    }
842
843    public Identifier addIdentifier() { //3
844      Identifier t = new Identifier();
845      if (this.identifier == null)
846        this.identifier = new ArrayList<Identifier>();
847      this.identifier.add(t);
848      return t;
849    }
850
851    public Goal addIdentifier(Identifier t) { //3
852      if (t == null)
853        return this;
854      if (this.identifier == null)
855        this.identifier = new ArrayList<Identifier>();
856      this.identifier.add(t);
857      return this;
858    }
859
860    /**
861     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
862     */
863    public Identifier getIdentifierFirstRep() { 
864      if (getIdentifier().isEmpty()) {
865        addIdentifier();
866      }
867      return getIdentifier().get(0);
868    }
869
870    /**
871     * @return {@link #lifecycleStatus} (The state of the goal throughout its lifecycle.). This is the underlying object with id, value and extensions. The accessor "getLifecycleStatus" gives direct access to the value
872     */
873    public Enumeration<GoalLifecycleStatus> getLifecycleStatusElement() { 
874      if (this.lifecycleStatus == null)
875        if (Configuration.errorOnAutoCreate())
876          throw new Error("Attempt to auto-create Goal.lifecycleStatus");
877        else if (Configuration.doAutoCreate())
878          this.lifecycleStatus = new Enumeration<GoalLifecycleStatus>(new GoalLifecycleStatusEnumFactory()); // bb
879      return this.lifecycleStatus;
880    }
881
882    public boolean hasLifecycleStatusElement() { 
883      return this.lifecycleStatus != null && !this.lifecycleStatus.isEmpty();
884    }
885
886    public boolean hasLifecycleStatus() { 
887      return this.lifecycleStatus != null && !this.lifecycleStatus.isEmpty();
888    }
889
890    /**
891     * @param value {@link #lifecycleStatus} (The state of the goal throughout its lifecycle.). This is the underlying object with id, value and extensions. The accessor "getLifecycleStatus" gives direct access to the value
892     */
893    public Goal setLifecycleStatusElement(Enumeration<GoalLifecycleStatus> value) { 
894      this.lifecycleStatus = value;
895      return this;
896    }
897
898    /**
899     * @return The state of the goal throughout its lifecycle.
900     */
901    public GoalLifecycleStatus getLifecycleStatus() { 
902      return this.lifecycleStatus == null ? null : this.lifecycleStatus.getValue();
903    }
904
905    /**
906     * @param value The state of the goal throughout its lifecycle.
907     */
908    public Goal setLifecycleStatus(GoalLifecycleStatus value) { 
909        if (this.lifecycleStatus == null)
910          this.lifecycleStatus = new Enumeration<GoalLifecycleStatus>(new GoalLifecycleStatusEnumFactory());
911        this.lifecycleStatus.setValue(value);
912      return this;
913    }
914
915    /**
916     * @return {@link #achievementStatus} (Describes the progression, or lack thereof, towards the goal against the target.)
917     */
918    public CodeableConcept getAchievementStatus() { 
919      if (this.achievementStatus == null)
920        if (Configuration.errorOnAutoCreate())
921          throw new Error("Attempt to auto-create Goal.achievementStatus");
922        else if (Configuration.doAutoCreate())
923          this.achievementStatus = new CodeableConcept(); // cc
924      return this.achievementStatus;
925    }
926
927    public boolean hasAchievementStatus() { 
928      return this.achievementStatus != null && !this.achievementStatus.isEmpty();
929    }
930
931    /**
932     * @param value {@link #achievementStatus} (Describes the progression, or lack thereof, towards the goal against the target.)
933     */
934    public Goal setAchievementStatus(CodeableConcept value) { 
935      this.achievementStatus = value;
936      return this;
937    }
938
939    /**
940     * @return {@link #category} (Indicates a category the goal falls within.)
941     */
942    public List<CodeableConcept> getCategory() { 
943      if (this.category == null)
944        this.category = new ArrayList<CodeableConcept>();
945      return this.category;
946    }
947
948    /**
949     * @return Returns a reference to <code>this</code> for easy method chaining
950     */
951    public Goal setCategory(List<CodeableConcept> theCategory) { 
952      this.category = theCategory;
953      return this;
954    }
955
956    public boolean hasCategory() { 
957      if (this.category == null)
958        return false;
959      for (CodeableConcept item : this.category)
960        if (!item.isEmpty())
961          return true;
962      return false;
963    }
964
965    public CodeableConcept addCategory() { //3
966      CodeableConcept t = new CodeableConcept();
967      if (this.category == null)
968        this.category = new ArrayList<CodeableConcept>();
969      this.category.add(t);
970      return t;
971    }
972
973    public Goal addCategory(CodeableConcept t) { //3
974      if (t == null)
975        return this;
976      if (this.category == null)
977        this.category = new ArrayList<CodeableConcept>();
978      this.category.add(t);
979      return this;
980    }
981
982    /**
983     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist {3}
984     */
985    public CodeableConcept getCategoryFirstRep() { 
986      if (getCategory().isEmpty()) {
987        addCategory();
988      }
989      return getCategory().get(0);
990    }
991
992    /**
993     * @return {@link #continuous} (After meeting the goal, ongoing activity is needed to sustain the goal objective.). This is the underlying object with id, value and extensions. The accessor "getContinuous" gives direct access to the value
994     */
995    public BooleanType getContinuousElement() { 
996      if (this.continuous == null)
997        if (Configuration.errorOnAutoCreate())
998          throw new Error("Attempt to auto-create Goal.continuous");
999        else if (Configuration.doAutoCreate())
1000          this.continuous = new BooleanType(); // bb
1001      return this.continuous;
1002    }
1003
1004    public boolean hasContinuousElement() { 
1005      return this.continuous != null && !this.continuous.isEmpty();
1006    }
1007
1008    public boolean hasContinuous() { 
1009      return this.continuous != null && !this.continuous.isEmpty();
1010    }
1011
1012    /**
1013     * @param value {@link #continuous} (After meeting the goal, ongoing activity is needed to sustain the goal objective.). This is the underlying object with id, value and extensions. The accessor "getContinuous" gives direct access to the value
1014     */
1015    public Goal setContinuousElement(BooleanType value) { 
1016      this.continuous = value;
1017      return this;
1018    }
1019
1020    /**
1021     * @return After meeting the goal, ongoing activity is needed to sustain the goal objective.
1022     */
1023    public boolean getContinuous() { 
1024      return this.continuous == null || this.continuous.isEmpty() ? false : this.continuous.getValue();
1025    }
1026
1027    /**
1028     * @param value After meeting the goal, ongoing activity is needed to sustain the goal objective.
1029     */
1030    public Goal setContinuous(boolean value) { 
1031        if (this.continuous == null)
1032          this.continuous = new BooleanType();
1033        this.continuous.setValue(value);
1034      return this;
1035    }
1036
1037    /**
1038     * @return {@link #priority} (Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.)
1039     */
1040    public CodeableConcept getPriority() { 
1041      if (this.priority == null)
1042        if (Configuration.errorOnAutoCreate())
1043          throw new Error("Attempt to auto-create Goal.priority");
1044        else if (Configuration.doAutoCreate())
1045          this.priority = new CodeableConcept(); // cc
1046      return this.priority;
1047    }
1048
1049    public boolean hasPriority() { 
1050      return this.priority != null && !this.priority.isEmpty();
1051    }
1052
1053    /**
1054     * @param value {@link #priority} (Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.)
1055     */
1056    public Goal setPriority(CodeableConcept value) { 
1057      this.priority = value;
1058      return this;
1059    }
1060
1061    /**
1062     * @return {@link #description} (Human-readable and/or coded description of a specific desired objective of care, such as "control blood pressure" or "negotiate an obstacle course" or "dance with child at wedding".)
1063     */
1064    public CodeableConcept getDescription() { 
1065      if (this.description == null)
1066        if (Configuration.errorOnAutoCreate())
1067          throw new Error("Attempt to auto-create Goal.description");
1068        else if (Configuration.doAutoCreate())
1069          this.description = new CodeableConcept(); // cc
1070      return this.description;
1071    }
1072
1073    public boolean hasDescription() { 
1074      return this.description != null && !this.description.isEmpty();
1075    }
1076
1077    /**
1078     * @param value {@link #description} (Human-readable and/or coded description of a specific desired objective of care, such as "control blood pressure" or "negotiate an obstacle course" or "dance with child at wedding".)
1079     */
1080    public Goal setDescription(CodeableConcept value) { 
1081      this.description = value;
1082      return this;
1083    }
1084
1085    /**
1086     * @return {@link #subject} (Identifies the patient, group or organization for whom the goal is being established.)
1087     */
1088    public Reference getSubject() { 
1089      if (this.subject == null)
1090        if (Configuration.errorOnAutoCreate())
1091          throw new Error("Attempt to auto-create Goal.subject");
1092        else if (Configuration.doAutoCreate())
1093          this.subject = new Reference(); // cc
1094      return this.subject;
1095    }
1096
1097    public boolean hasSubject() { 
1098      return this.subject != null && !this.subject.isEmpty();
1099    }
1100
1101    /**
1102     * @param value {@link #subject} (Identifies the patient, group or organization for whom the goal is being established.)
1103     */
1104    public Goal setSubject(Reference value) { 
1105      this.subject = value;
1106      return this;
1107    }
1108
1109    /**
1110     * @return {@link #start} (The date or event after which the goal should begin being pursued.)
1111     */
1112    public DataType getStart() { 
1113      return this.start;
1114    }
1115
1116    /**
1117     * @return {@link #start} (The date or event after which the goal should begin being pursued.)
1118     */
1119    public DateType getStartDateType() throws FHIRException { 
1120      if (this.start == null)
1121        this.start = new DateType();
1122      if (!(this.start instanceof DateType))
1123        throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.start.getClass().getName()+" was encountered");
1124      return (DateType) this.start;
1125    }
1126
1127    public boolean hasStartDateType() { 
1128      return this != null && this.start instanceof DateType;
1129    }
1130
1131    /**
1132     * @return {@link #start} (The date or event after which the goal should begin being pursued.)
1133     */
1134    public CodeableConcept getStartCodeableConcept() throws FHIRException { 
1135      if (this.start == null)
1136        this.start = new CodeableConcept();
1137      if (!(this.start instanceof CodeableConcept))
1138        throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.start.getClass().getName()+" was encountered");
1139      return (CodeableConcept) this.start;
1140    }
1141
1142    public boolean hasStartCodeableConcept() { 
1143      return this != null && this.start instanceof CodeableConcept;
1144    }
1145
1146    public boolean hasStart() { 
1147      return this.start != null && !this.start.isEmpty();
1148    }
1149
1150    /**
1151     * @param value {@link #start} (The date or event after which the goal should begin being pursued.)
1152     */
1153    public Goal setStart(DataType value) { 
1154      if (value != null && !(value instanceof DateType || value instanceof CodeableConcept))
1155        throw new Error("Not the right type for Goal.start[x]: "+value.fhirType());
1156      this.start = value;
1157      return this;
1158    }
1159
1160    /**
1161     * @return {@link #target} (Indicates what should be done by when.)
1162     */
1163    public List<GoalTargetComponent> getTarget() { 
1164      if (this.target == null)
1165        this.target = new ArrayList<GoalTargetComponent>();
1166      return this.target;
1167    }
1168
1169    /**
1170     * @return Returns a reference to <code>this</code> for easy method chaining
1171     */
1172    public Goal setTarget(List<GoalTargetComponent> theTarget) { 
1173      this.target = theTarget;
1174      return this;
1175    }
1176
1177    public boolean hasTarget() { 
1178      if (this.target == null)
1179        return false;
1180      for (GoalTargetComponent item : this.target)
1181        if (!item.isEmpty())
1182          return true;
1183      return false;
1184    }
1185
1186    public GoalTargetComponent addTarget() { //3
1187      GoalTargetComponent t = new GoalTargetComponent();
1188      if (this.target == null)
1189        this.target = new ArrayList<GoalTargetComponent>();
1190      this.target.add(t);
1191      return t;
1192    }
1193
1194    public Goal addTarget(GoalTargetComponent t) { //3
1195      if (t == null)
1196        return this;
1197      if (this.target == null)
1198        this.target = new ArrayList<GoalTargetComponent>();
1199      this.target.add(t);
1200      return this;
1201    }
1202
1203    /**
1204     * @return The first repetition of repeating field {@link #target}, creating it if it does not already exist {3}
1205     */
1206    public GoalTargetComponent getTargetFirstRep() { 
1207      if (getTarget().isEmpty()) {
1208        addTarget();
1209      }
1210      return getTarget().get(0);
1211    }
1212
1213    /**
1214     * @return {@link #statusDate} (Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value
1215     */
1216    public DateType getStatusDateElement() { 
1217      if (this.statusDate == null)
1218        if (Configuration.errorOnAutoCreate())
1219          throw new Error("Attempt to auto-create Goal.statusDate");
1220        else if (Configuration.doAutoCreate())
1221          this.statusDate = new DateType(); // bb
1222      return this.statusDate;
1223    }
1224
1225    public boolean hasStatusDateElement() { 
1226      return this.statusDate != null && !this.statusDate.isEmpty();
1227    }
1228
1229    public boolean hasStatusDate() { 
1230      return this.statusDate != null && !this.statusDate.isEmpty();
1231    }
1232
1233    /**
1234     * @param value {@link #statusDate} (Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value
1235     */
1236    public Goal setStatusDateElement(DateType value) { 
1237      this.statusDate = value;
1238      return this;
1239    }
1240
1241    /**
1242     * @return Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc.
1243     */
1244    public Date getStatusDate() { 
1245      return this.statusDate == null ? null : this.statusDate.getValue();
1246    }
1247
1248    /**
1249     * @param value Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc.
1250     */
1251    public Goal setStatusDate(Date value) { 
1252      if (value == null)
1253        this.statusDate = null;
1254      else {
1255        if (this.statusDate == null)
1256          this.statusDate = new DateType();
1257        this.statusDate.setValue(value);
1258      }
1259      return this;
1260    }
1261
1262    /**
1263     * @return {@link #statusReason} (Captures the reason for the current status.). This is the underlying object with id, value and extensions. The accessor "getStatusReason" gives direct access to the value
1264     */
1265    public StringType getStatusReasonElement() { 
1266      if (this.statusReason == null)
1267        if (Configuration.errorOnAutoCreate())
1268          throw new Error("Attempt to auto-create Goal.statusReason");
1269        else if (Configuration.doAutoCreate())
1270          this.statusReason = new StringType(); // bb
1271      return this.statusReason;
1272    }
1273
1274    public boolean hasStatusReasonElement() { 
1275      return this.statusReason != null && !this.statusReason.isEmpty();
1276    }
1277
1278    public boolean hasStatusReason() { 
1279      return this.statusReason != null && !this.statusReason.isEmpty();
1280    }
1281
1282    /**
1283     * @param value {@link #statusReason} (Captures the reason for the current status.). This is the underlying object with id, value and extensions. The accessor "getStatusReason" gives direct access to the value
1284     */
1285    public Goal setStatusReasonElement(StringType value) { 
1286      this.statusReason = value;
1287      return this;
1288    }
1289
1290    /**
1291     * @return Captures the reason for the current status.
1292     */
1293    public String getStatusReason() { 
1294      return this.statusReason == null ? null : this.statusReason.getValue();
1295    }
1296
1297    /**
1298     * @param value Captures the reason for the current status.
1299     */
1300    public Goal setStatusReason(String value) { 
1301      if (Utilities.noString(value))
1302        this.statusReason = null;
1303      else {
1304        if (this.statusReason == null)
1305          this.statusReason = new StringType();
1306        this.statusReason.setValue(value);
1307      }
1308      return this;
1309    }
1310
1311    /**
1312     * @return {@link #source} (Indicates whose goal this is - patient goal, practitioner goal, etc.)
1313     */
1314    public Reference getSource() { 
1315      if (this.source == null)
1316        if (Configuration.errorOnAutoCreate())
1317          throw new Error("Attempt to auto-create Goal.source");
1318        else if (Configuration.doAutoCreate())
1319          this.source = new Reference(); // cc
1320      return this.source;
1321    }
1322
1323    public boolean hasSource() { 
1324      return this.source != null && !this.source.isEmpty();
1325    }
1326
1327    /**
1328     * @param value {@link #source} (Indicates whose goal this is - patient goal, practitioner goal, etc.)
1329     */
1330    public Goal setSource(Reference value) { 
1331      this.source = value;
1332      return this;
1333    }
1334
1335    /**
1336     * @return {@link #addresses} (The identified conditions and other health record elements that are intended to be addressed by the goal.)
1337     */
1338    public List<Reference> getAddresses() { 
1339      if (this.addresses == null)
1340        this.addresses = new ArrayList<Reference>();
1341      return this.addresses;
1342    }
1343
1344    /**
1345     * @return Returns a reference to <code>this</code> for easy method chaining
1346     */
1347    public Goal setAddresses(List<Reference> theAddresses) { 
1348      this.addresses = theAddresses;
1349      return this;
1350    }
1351
1352    public boolean hasAddresses() { 
1353      if (this.addresses == null)
1354        return false;
1355      for (Reference item : this.addresses)
1356        if (!item.isEmpty())
1357          return true;
1358      return false;
1359    }
1360
1361    public Reference addAddresses() { //3
1362      Reference t = new Reference();
1363      if (this.addresses == null)
1364        this.addresses = new ArrayList<Reference>();
1365      this.addresses.add(t);
1366      return t;
1367    }
1368
1369    public Goal addAddresses(Reference t) { //3
1370      if (t == null)
1371        return this;
1372      if (this.addresses == null)
1373        this.addresses = new ArrayList<Reference>();
1374      this.addresses.add(t);
1375      return this;
1376    }
1377
1378    /**
1379     * @return The first repetition of repeating field {@link #addresses}, creating it if it does not already exist {3}
1380     */
1381    public Reference getAddressesFirstRep() { 
1382      if (getAddresses().isEmpty()) {
1383        addAddresses();
1384      }
1385      return getAddresses().get(0);
1386    }
1387
1388    /**
1389     * @return {@link #note} (Any comments related to the goal.)
1390     */
1391    public List<Annotation> getNote() { 
1392      if (this.note == null)
1393        this.note = new ArrayList<Annotation>();
1394      return this.note;
1395    }
1396
1397    /**
1398     * @return Returns a reference to <code>this</code> for easy method chaining
1399     */
1400    public Goal setNote(List<Annotation> theNote) { 
1401      this.note = theNote;
1402      return this;
1403    }
1404
1405    public boolean hasNote() { 
1406      if (this.note == null)
1407        return false;
1408      for (Annotation item : this.note)
1409        if (!item.isEmpty())
1410          return true;
1411      return false;
1412    }
1413
1414    public Annotation addNote() { //3
1415      Annotation t = new Annotation();
1416      if (this.note == null)
1417        this.note = new ArrayList<Annotation>();
1418      this.note.add(t);
1419      return t;
1420    }
1421
1422    public Goal addNote(Annotation t) { //3
1423      if (t == null)
1424        return this;
1425      if (this.note == null)
1426        this.note = new ArrayList<Annotation>();
1427      this.note.add(t);
1428      return this;
1429    }
1430
1431    /**
1432     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
1433     */
1434    public Annotation getNoteFirstRep() { 
1435      if (getNote().isEmpty()) {
1436        addNote();
1437      }
1438      return getNote().get(0);
1439    }
1440
1441    /**
1442     * @return {@link #outcome} (Identifies the change (or lack of change) at the point when the status of the goal is assessed.)
1443     */
1444    public List<CodeableReference> getOutcome() { 
1445      if (this.outcome == null)
1446        this.outcome = new ArrayList<CodeableReference>();
1447      return this.outcome;
1448    }
1449
1450    /**
1451     * @return Returns a reference to <code>this</code> for easy method chaining
1452     */
1453    public Goal setOutcome(List<CodeableReference> theOutcome) { 
1454      this.outcome = theOutcome;
1455      return this;
1456    }
1457
1458    public boolean hasOutcome() { 
1459      if (this.outcome == null)
1460        return false;
1461      for (CodeableReference item : this.outcome)
1462        if (!item.isEmpty())
1463          return true;
1464      return false;
1465    }
1466
1467    public CodeableReference addOutcome() { //3
1468      CodeableReference t = new CodeableReference();
1469      if (this.outcome == null)
1470        this.outcome = new ArrayList<CodeableReference>();
1471      this.outcome.add(t);
1472      return t;
1473    }
1474
1475    public Goal addOutcome(CodeableReference t) { //3
1476      if (t == null)
1477        return this;
1478      if (this.outcome == null)
1479        this.outcome = new ArrayList<CodeableReference>();
1480      this.outcome.add(t);
1481      return this;
1482    }
1483
1484    /**
1485     * @return The first repetition of repeating field {@link #outcome}, creating it if it does not already exist {3}
1486     */
1487    public CodeableReference getOutcomeFirstRep() { 
1488      if (getOutcome().isEmpty()) {
1489        addOutcome();
1490      }
1491      return getOutcome().get(0);
1492    }
1493
1494      protected void listChildren(List<Property> children) {
1495        super.listChildren(children);
1496        children.add(new Property("identifier", "Identifier", "Business identifiers assigned to this goal by the performer or other systems which remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier));
1497        children.add(new Property("lifecycleStatus", "code", "The state of the goal throughout its lifecycle.", 0, 1, lifecycleStatus));
1498        children.add(new Property("achievementStatus", "CodeableConcept", "Describes the progression, or lack thereof, towards the goal against the target.", 0, 1, achievementStatus));
1499        children.add(new Property("category", "CodeableConcept", "Indicates a category the goal falls within.", 0, java.lang.Integer.MAX_VALUE, category));
1500        children.add(new Property("continuous", "boolean", "After meeting the goal, ongoing activity is needed to sustain the goal objective.", 0, 1, continuous));
1501        children.add(new Property("priority", "CodeableConcept", "Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.", 0, 1, priority));
1502        children.add(new Property("description", "CodeableConcept", "Human-readable and/or coded description of a specific desired objective of care, such as \"control blood pressure\" or \"negotiate an obstacle course\" or \"dance with child at wedding\".", 0, 1, description));
1503        children.add(new Property("subject", "Reference(Patient|Group|Organization)", "Identifies the patient, group or organization for whom the goal is being established.", 0, 1, subject));
1504        children.add(new Property("start[x]", "date|CodeableConcept", "The date or event after which the goal should begin being pursued.", 0, 1, start));
1505        children.add(new Property("target", "", "Indicates what should be done by when.", 0, java.lang.Integer.MAX_VALUE, target));
1506        children.add(new Property("statusDate", "date", "Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc.", 0, 1, statusDate));
1507        children.add(new Property("statusReason", "string", "Captures the reason for the current status.", 0, 1, statusReason));
1508        children.add(new Property("source", "Reference(Patient|Practitioner|PractitionerRole|RelatedPerson|CareTeam)", "Indicates whose goal this is - patient goal, practitioner goal, etc.", 0, 1, source));
1509        children.add(new Property("addresses", "Reference(Condition|Observation|MedicationUsage|MedicationRequest|NutritionOrder|ServiceRequest|RiskAssessment)", "The identified conditions and other health record elements that are intended to be addressed by the goal.", 0, java.lang.Integer.MAX_VALUE, addresses));
1510        children.add(new Property("note", "Annotation", "Any comments related to the goal.", 0, java.lang.Integer.MAX_VALUE, note));
1511        children.add(new Property("outcome", "CodeableReference(Observation)", "Identifies the change (or lack of change) at the point when the status of the goal is assessed.", 0, java.lang.Integer.MAX_VALUE, outcome));
1512      }
1513
1514      @Override
1515      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1516        switch (_hash) {
1517        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Business identifiers assigned to this goal by the performer or other systems which remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier);
1518        case 1165552636: /*lifecycleStatus*/  return new Property("lifecycleStatus", "code", "The state of the goal throughout its lifecycle.", 0, 1, lifecycleStatus);
1519        case 104524801: /*achievementStatus*/  return new Property("achievementStatus", "CodeableConcept", "Describes the progression, or lack thereof, towards the goal against the target.", 0, 1, achievementStatus);
1520        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "Indicates a category the goal falls within.", 0, java.lang.Integer.MAX_VALUE, category);
1521        case 379114255: /*continuous*/  return new Property("continuous", "boolean", "After meeting the goal, ongoing activity is needed to sustain the goal objective.", 0, 1, continuous);
1522        case -1165461084: /*priority*/  return new Property("priority", "CodeableConcept", "Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.", 0, 1, priority);
1523        case -1724546052: /*description*/  return new Property("description", "CodeableConcept", "Human-readable and/or coded description of a specific desired objective of care, such as \"control blood pressure\" or \"negotiate an obstacle course\" or \"dance with child at wedding\".", 0, 1, description);
1524        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group|Organization)", "Identifies the patient, group or organization for whom the goal is being established.", 0, 1, subject);
1525        case 1316793566: /*start[x]*/  return new Property("start[x]", "date|CodeableConcept", "The date or event after which the goal should begin being pursued.", 0, 1, start);
1526        case 109757538: /*start*/  return new Property("start[x]", "date|CodeableConcept", "The date or event after which the goal should begin being pursued.", 0, 1, start);
1527        case -2129778896: /*startDate*/  return new Property("start[x]", "date", "The date or event after which the goal should begin being pursued.", 0, 1, start);
1528        case -1758833953: /*startCodeableConcept*/  return new Property("start[x]", "CodeableConcept", "The date or event after which the goal should begin being pursued.", 0, 1, start);
1529        case -880905839: /*target*/  return new Property("target", "", "Indicates what should be done by when.", 0, java.lang.Integer.MAX_VALUE, target);
1530        case 247524032: /*statusDate*/  return new Property("statusDate", "date", "Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc.", 0, 1, statusDate);
1531        case 2051346646: /*statusReason*/  return new Property("statusReason", "string", "Captures the reason for the current status.", 0, 1, statusReason);
1532        case -896505829: /*source*/  return new Property("source", "Reference(Patient|Practitioner|PractitionerRole|RelatedPerson|CareTeam)", "Indicates whose goal this is - patient goal, practitioner goal, etc.", 0, 1, source);
1533        case 874544034: /*addresses*/  return new Property("addresses", "Reference(Condition|Observation|MedicationUsage|MedicationRequest|NutritionOrder|ServiceRequest|RiskAssessment)", "The identified conditions and other health record elements that are intended to be addressed by the goal.", 0, java.lang.Integer.MAX_VALUE, addresses);
1534        case 3387378: /*note*/  return new Property("note", "Annotation", "Any comments related to the goal.", 0, java.lang.Integer.MAX_VALUE, note);
1535        case -1106507950: /*outcome*/  return new Property("outcome", "CodeableReference(Observation)", "Identifies the change (or lack of change) at the point when the status of the goal is assessed.", 0, java.lang.Integer.MAX_VALUE, outcome);
1536        default: return super.getNamedProperty(_hash, _name, _checkValid);
1537        }
1538
1539      }
1540
1541      @Override
1542      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1543        switch (hash) {
1544        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1545        case 1165552636: /*lifecycleStatus*/ return this.lifecycleStatus == null ? new Base[0] : new Base[] {this.lifecycleStatus}; // Enumeration<GoalLifecycleStatus>
1546        case 104524801: /*achievementStatus*/ return this.achievementStatus == null ? new Base[0] : new Base[] {this.achievementStatus}; // CodeableConcept
1547        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
1548        case 379114255: /*continuous*/ return this.continuous == null ? new Base[0] : new Base[] {this.continuous}; // BooleanType
1549        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // CodeableConcept
1550        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // CodeableConcept
1551        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
1552        case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // DataType
1553        case -880905839: /*target*/ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // GoalTargetComponent
1554        case 247524032: /*statusDate*/ return this.statusDate == null ? new Base[0] : new Base[] {this.statusDate}; // DateType
1555        case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : new Base[] {this.statusReason}; // StringType
1556        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference
1557        case 874544034: /*addresses*/ return this.addresses == null ? new Base[0] : this.addresses.toArray(new Base[this.addresses.size()]); // Reference
1558        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
1559        case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : this.outcome.toArray(new Base[this.outcome.size()]); // CodeableReference
1560        default: return super.getProperty(hash, name, checkValid);
1561        }
1562
1563      }
1564
1565      @Override
1566      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1567        switch (hash) {
1568        case -1618432855: // identifier
1569          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1570          return value;
1571        case 1165552636: // lifecycleStatus
1572          value = new GoalLifecycleStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1573          this.lifecycleStatus = (Enumeration) value; // Enumeration<GoalLifecycleStatus>
1574          return value;
1575        case 104524801: // achievementStatus
1576          this.achievementStatus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1577          return value;
1578        case 50511102: // category
1579          this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1580          return value;
1581        case 379114255: // continuous
1582          this.continuous = TypeConvertor.castToBoolean(value); // BooleanType
1583          return value;
1584        case -1165461084: // priority
1585          this.priority = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1586          return value;
1587        case -1724546052: // description
1588          this.description = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1589          return value;
1590        case -1867885268: // subject
1591          this.subject = TypeConvertor.castToReference(value); // Reference
1592          return value;
1593        case 109757538: // start
1594          this.start = TypeConvertor.castToType(value); // DataType
1595          return value;
1596        case -880905839: // target
1597          this.getTarget().add((GoalTargetComponent) value); // GoalTargetComponent
1598          return value;
1599        case 247524032: // statusDate
1600          this.statusDate = TypeConvertor.castToDate(value); // DateType
1601          return value;
1602        case 2051346646: // statusReason
1603          this.statusReason = TypeConvertor.castToString(value); // StringType
1604          return value;
1605        case -896505829: // source
1606          this.source = TypeConvertor.castToReference(value); // Reference
1607          return value;
1608        case 874544034: // addresses
1609          this.getAddresses().add(TypeConvertor.castToReference(value)); // Reference
1610          return value;
1611        case 3387378: // note
1612          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
1613          return value;
1614        case -1106507950: // outcome
1615          this.getOutcome().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
1616          return value;
1617        default: return super.setProperty(hash, name, value);
1618        }
1619
1620      }
1621
1622      @Override
1623      public Base setProperty(String name, Base value) throws FHIRException {
1624        if (name.equals("identifier")) {
1625          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
1626        } else if (name.equals("lifecycleStatus")) {
1627          value = new GoalLifecycleStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1628          this.lifecycleStatus = (Enumeration) value; // Enumeration<GoalLifecycleStatus>
1629        } else if (name.equals("achievementStatus")) {
1630          this.achievementStatus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1631        } else if (name.equals("category")) {
1632          this.getCategory().add(TypeConvertor.castToCodeableConcept(value));
1633        } else if (name.equals("continuous")) {
1634          this.continuous = TypeConvertor.castToBoolean(value); // BooleanType
1635        } else if (name.equals("priority")) {
1636          this.priority = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1637        } else if (name.equals("description")) {
1638          this.description = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1639        } else if (name.equals("subject")) {
1640          this.subject = TypeConvertor.castToReference(value); // Reference
1641        } else if (name.equals("start[x]")) {
1642          this.start = TypeConvertor.castToType(value); // DataType
1643        } else if (name.equals("target")) {
1644          this.getTarget().add((GoalTargetComponent) value);
1645        } else if (name.equals("statusDate")) {
1646          this.statusDate = TypeConvertor.castToDate(value); // DateType
1647        } else if (name.equals("statusReason")) {
1648          this.statusReason = TypeConvertor.castToString(value); // StringType
1649        } else if (name.equals("source")) {
1650          this.source = TypeConvertor.castToReference(value); // Reference
1651        } else if (name.equals("addresses")) {
1652          this.getAddresses().add(TypeConvertor.castToReference(value));
1653        } else if (name.equals("note")) {
1654          this.getNote().add(TypeConvertor.castToAnnotation(value));
1655        } else if (name.equals("outcome")) {
1656          this.getOutcome().add(TypeConvertor.castToCodeableReference(value));
1657        } else
1658          return super.setProperty(name, value);
1659        return value;
1660      }
1661
1662      @Override
1663      public Base makeProperty(int hash, String name) throws FHIRException {
1664        switch (hash) {
1665        case -1618432855:  return addIdentifier(); 
1666        case 1165552636:  return getLifecycleStatusElement();
1667        case 104524801:  return getAchievementStatus();
1668        case 50511102:  return addCategory(); 
1669        case 379114255:  return getContinuousElement();
1670        case -1165461084:  return getPriority();
1671        case -1724546052:  return getDescription();
1672        case -1867885268:  return getSubject();
1673        case 1316793566:  return getStart();
1674        case 109757538:  return getStart();
1675        case -880905839:  return addTarget(); 
1676        case 247524032:  return getStatusDateElement();
1677        case 2051346646:  return getStatusReasonElement();
1678        case -896505829:  return getSource();
1679        case 874544034:  return addAddresses(); 
1680        case 3387378:  return addNote(); 
1681        case -1106507950:  return addOutcome(); 
1682        default: return super.makeProperty(hash, name);
1683        }
1684
1685      }
1686
1687      @Override
1688      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1689        switch (hash) {
1690        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1691        case 1165552636: /*lifecycleStatus*/ return new String[] {"code"};
1692        case 104524801: /*achievementStatus*/ return new String[] {"CodeableConcept"};
1693        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
1694        case 379114255: /*continuous*/ return new String[] {"boolean"};
1695        case -1165461084: /*priority*/ return new String[] {"CodeableConcept"};
1696        case -1724546052: /*description*/ return new String[] {"CodeableConcept"};
1697        case -1867885268: /*subject*/ return new String[] {"Reference"};
1698        case 109757538: /*start*/ return new String[] {"date", "CodeableConcept"};
1699        case -880905839: /*target*/ return new String[] {};
1700        case 247524032: /*statusDate*/ return new String[] {"date"};
1701        case 2051346646: /*statusReason*/ return new String[] {"string"};
1702        case -896505829: /*source*/ return new String[] {"Reference"};
1703        case 874544034: /*addresses*/ return new String[] {"Reference"};
1704        case 3387378: /*note*/ return new String[] {"Annotation"};
1705        case -1106507950: /*outcome*/ return new String[] {"CodeableReference"};
1706        default: return super.getTypesForProperty(hash, name);
1707        }
1708
1709      }
1710
1711      @Override
1712      public Base addChild(String name) throws FHIRException {
1713        if (name.equals("identifier")) {
1714          return addIdentifier();
1715        }
1716        else if (name.equals("lifecycleStatus")) {
1717          throw new FHIRException("Cannot call addChild on a primitive type Goal.lifecycleStatus");
1718        }
1719        else if (name.equals("achievementStatus")) {
1720          this.achievementStatus = new CodeableConcept();
1721          return this.achievementStatus;
1722        }
1723        else if (name.equals("category")) {
1724          return addCategory();
1725        }
1726        else if (name.equals("continuous")) {
1727          throw new FHIRException("Cannot call addChild on a primitive type Goal.continuous");
1728        }
1729        else if (name.equals("priority")) {
1730          this.priority = new CodeableConcept();
1731          return this.priority;
1732        }
1733        else if (name.equals("description")) {
1734          this.description = new CodeableConcept();
1735          return this.description;
1736        }
1737        else if (name.equals("subject")) {
1738          this.subject = new Reference();
1739          return this.subject;
1740        }
1741        else if (name.equals("startDate")) {
1742          this.start = new DateType();
1743          return this.start;
1744        }
1745        else if (name.equals("startCodeableConcept")) {
1746          this.start = new CodeableConcept();
1747          return this.start;
1748        }
1749        else if (name.equals("target")) {
1750          return addTarget();
1751        }
1752        else if (name.equals("statusDate")) {
1753          throw new FHIRException("Cannot call addChild on a primitive type Goal.statusDate");
1754        }
1755        else if (name.equals("statusReason")) {
1756          throw new FHIRException("Cannot call addChild on a primitive type Goal.statusReason");
1757        }
1758        else if (name.equals("source")) {
1759          this.source = new Reference();
1760          return this.source;
1761        }
1762        else if (name.equals("addresses")) {
1763          return addAddresses();
1764        }
1765        else if (name.equals("note")) {
1766          return addNote();
1767        }
1768        else if (name.equals("outcome")) {
1769          return addOutcome();
1770        }
1771        else
1772          return super.addChild(name);
1773      }
1774
1775  public String fhirType() {
1776    return "Goal";
1777
1778  }
1779
1780      public Goal copy() {
1781        Goal dst = new Goal();
1782        copyValues(dst);
1783        return dst;
1784      }
1785
1786      public void copyValues(Goal dst) {
1787        super.copyValues(dst);
1788        if (identifier != null) {
1789          dst.identifier = new ArrayList<Identifier>();
1790          for (Identifier i : identifier)
1791            dst.identifier.add(i.copy());
1792        };
1793        dst.lifecycleStatus = lifecycleStatus == null ? null : lifecycleStatus.copy();
1794        dst.achievementStatus = achievementStatus == null ? null : achievementStatus.copy();
1795        if (category != null) {
1796          dst.category = new ArrayList<CodeableConcept>();
1797          for (CodeableConcept i : category)
1798            dst.category.add(i.copy());
1799        };
1800        dst.continuous = continuous == null ? null : continuous.copy();
1801        dst.priority = priority == null ? null : priority.copy();
1802        dst.description = description == null ? null : description.copy();
1803        dst.subject = subject == null ? null : subject.copy();
1804        dst.start = start == null ? null : start.copy();
1805        if (target != null) {
1806          dst.target = new ArrayList<GoalTargetComponent>();
1807          for (GoalTargetComponent i : target)
1808            dst.target.add(i.copy());
1809        };
1810        dst.statusDate = statusDate == null ? null : statusDate.copy();
1811        dst.statusReason = statusReason == null ? null : statusReason.copy();
1812        dst.source = source == null ? null : source.copy();
1813        if (addresses != null) {
1814          dst.addresses = new ArrayList<Reference>();
1815          for (Reference i : addresses)
1816            dst.addresses.add(i.copy());
1817        };
1818        if (note != null) {
1819          dst.note = new ArrayList<Annotation>();
1820          for (Annotation i : note)
1821            dst.note.add(i.copy());
1822        };
1823        if (outcome != null) {
1824          dst.outcome = new ArrayList<CodeableReference>();
1825          for (CodeableReference i : outcome)
1826            dst.outcome.add(i.copy());
1827        };
1828      }
1829
1830      protected Goal typedCopy() {
1831        return copy();
1832      }
1833
1834      @Override
1835      public boolean equalsDeep(Base other_) {
1836        if (!super.equalsDeep(other_))
1837          return false;
1838        if (!(other_ instanceof Goal))
1839          return false;
1840        Goal o = (Goal) other_;
1841        return compareDeep(identifier, o.identifier, true) && compareDeep(lifecycleStatus, o.lifecycleStatus, true)
1842           && compareDeep(achievementStatus, o.achievementStatus, true) && compareDeep(category, o.category, true)
1843           && compareDeep(continuous, o.continuous, true) && compareDeep(priority, o.priority, true) && compareDeep(description, o.description, true)
1844           && compareDeep(subject, o.subject, true) && compareDeep(start, o.start, true) && compareDeep(target, o.target, true)
1845           && compareDeep(statusDate, o.statusDate, true) && compareDeep(statusReason, o.statusReason, true)
1846           && compareDeep(source, o.source, true) && compareDeep(addresses, o.addresses, true) && compareDeep(note, o.note, true)
1847           && compareDeep(outcome, o.outcome, true);
1848      }
1849
1850      @Override
1851      public boolean equalsShallow(Base other_) {
1852        if (!super.equalsShallow(other_))
1853          return false;
1854        if (!(other_ instanceof Goal))
1855          return false;
1856        Goal o = (Goal) other_;
1857        return compareValues(lifecycleStatus, o.lifecycleStatus, true) && compareValues(continuous, o.continuous, true)
1858           && compareValues(statusDate, o.statusDate, true) && compareValues(statusReason, o.statusReason, true)
1859          ;
1860      }
1861
1862      public boolean isEmpty() {
1863        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, lifecycleStatus
1864          , achievementStatus, category, continuous, priority, description, subject, start
1865          , target, statusDate, statusReason, source, addresses, note, outcome);
1866      }
1867
1868  @Override
1869  public ResourceType getResourceType() {
1870    return ResourceType.Goal;
1871   }
1872
1873 /**
1874   * Search parameter: <b>achievement-status</b>
1875   * <p>
1876   * Description: <b>in-progress | improving | worsening | no-change | achieved | sustaining | not-achieved | no-progress | not-attainable</b><br>
1877   * Type: <b>token</b><br>
1878   * Path: <b>Goal.achievementStatus</b><br>
1879   * </p>
1880   */
1881  @SearchParamDefinition(name="achievement-status", path="Goal.achievementStatus", description="in-progress | improving | worsening | no-change | achieved | sustaining | not-achieved | no-progress | not-attainable", type="token" )
1882  public static final String SP_ACHIEVEMENT_STATUS = "achievement-status";
1883 /**
1884   * <b>Fluent Client</b> search parameter constant for <b>achievement-status</b>
1885   * <p>
1886   * Description: <b>in-progress | improving | worsening | no-change | achieved | sustaining | not-achieved | no-progress | not-attainable</b><br>
1887   * Type: <b>token</b><br>
1888   * Path: <b>Goal.achievementStatus</b><br>
1889   * </p>
1890   */
1891  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACHIEVEMENT_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACHIEVEMENT_STATUS);
1892
1893 /**
1894   * Search parameter: <b>category</b>
1895   * <p>
1896   * Description: <b>E.g. Treatment, dietary, behavioral, etc.</b><br>
1897   * Type: <b>token</b><br>
1898   * Path: <b>Goal.category</b><br>
1899   * </p>
1900   */
1901  @SearchParamDefinition(name="category", path="Goal.category", description="E.g. Treatment, dietary, behavioral, etc.", type="token" )
1902  public static final String SP_CATEGORY = "category";
1903 /**
1904   * <b>Fluent Client</b> search parameter constant for <b>category</b>
1905   * <p>
1906   * Description: <b>E.g. Treatment, dietary, behavioral, etc.</b><br>
1907   * Type: <b>token</b><br>
1908   * Path: <b>Goal.category</b><br>
1909   * </p>
1910   */
1911  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
1912
1913 /**
1914   * Search parameter: <b>lifecycle-status</b>
1915   * <p>
1916   * Description: <b>proposed | planned | accepted | active | on-hold | completed | cancelled | entered-in-error | rejected</b><br>
1917   * Type: <b>token</b><br>
1918   * Path: <b>Goal.lifecycleStatus</b><br>
1919   * </p>
1920   */
1921  @SearchParamDefinition(name="lifecycle-status", path="Goal.lifecycleStatus", description="proposed | planned | accepted | active | on-hold | completed | cancelled | entered-in-error | rejected", type="token" )
1922  public static final String SP_LIFECYCLE_STATUS = "lifecycle-status";
1923 /**
1924   * <b>Fluent Client</b> search parameter constant for <b>lifecycle-status</b>
1925   * <p>
1926   * Description: <b>proposed | planned | accepted | active | on-hold | completed | cancelled | entered-in-error | rejected</b><br>
1927   * Type: <b>token</b><br>
1928   * Path: <b>Goal.lifecycleStatus</b><br>
1929   * </p>
1930   */
1931  public static final ca.uhn.fhir.rest.gclient.TokenClientParam LIFECYCLE_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_LIFECYCLE_STATUS);
1932
1933 /**
1934   * Search parameter: <b>start-date</b>
1935   * <p>
1936   * Description: <b>When goal pursuit begins</b><br>
1937   * Type: <b>date</b><br>
1938   * Path: <b>(Goal.start as date)</b><br>
1939   * </p>
1940   */
1941  @SearchParamDefinition(name="start-date", path="(Goal.start as date)", description="When goal pursuit begins", type="date" )
1942  public static final String SP_START_DATE = "start-date";
1943 /**
1944   * <b>Fluent Client</b> search parameter constant for <b>start-date</b>
1945   * <p>
1946   * Description: <b>When goal pursuit begins</b><br>
1947   * Type: <b>date</b><br>
1948   * Path: <b>(Goal.start as date)</b><br>
1949   * </p>
1950   */
1951  public static final ca.uhn.fhir.rest.gclient.DateClientParam START_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_START_DATE);
1952
1953 /**
1954   * Search parameter: <b>subject</b>
1955   * <p>
1956   * Description: <b>Who this goal is intended for</b><br>
1957   * Type: <b>reference</b><br>
1958   * Path: <b>Goal.subject</b><br>
1959   * </p>
1960   */
1961  @SearchParamDefinition(name="subject", path="Goal.subject", description="Who this goal is intended for", type="reference", target={Group.class, Organization.class, Patient.class } )
1962  public static final String SP_SUBJECT = "subject";
1963 /**
1964   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
1965   * <p>
1966   * Description: <b>Who this goal is intended for</b><br>
1967   * Type: <b>reference</b><br>
1968   * Path: <b>Goal.subject</b><br>
1969   * </p>
1970   */
1971  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
1972
1973/**
1974   * Constant for fluent queries to be used to add include statements. Specifies
1975   * the path value of "<b>Goal:subject</b>".
1976   */
1977  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Goal:subject").toLocked();
1978
1979 /**
1980   * Search parameter: <b>target-date</b>
1981   * <p>
1982   * Description: <b>Reach goal on or before</b><br>
1983   * Type: <b>date</b><br>
1984   * Path: <b>(Goal.target.due as date)</b><br>
1985   * </p>
1986   */
1987  @SearchParamDefinition(name="target-date", path="(Goal.target.due as date)", description="Reach goal on or before", type="date" )
1988  public static final String SP_TARGET_DATE = "target-date";
1989 /**
1990   * <b>Fluent Client</b> search parameter constant for <b>target-date</b>
1991   * <p>
1992   * Description: <b>Reach goal on or before</b><br>
1993   * Type: <b>date</b><br>
1994   * Path: <b>(Goal.target.due as date)</b><br>
1995   * </p>
1996   */
1997  public static final ca.uhn.fhir.rest.gclient.DateClientParam TARGET_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_TARGET_DATE);
1998
1999 /**
2000   * Search parameter: <b>identifier</b>
2001   * <p>
2002   * Description: <b>Multiple Resources: 
2003
2004* [AllergyIntolerance](allergyintolerance.html): External ids for this item
2005* [CarePlan](careplan.html): External Ids for this plan
2006* [CareTeam](careteam.html): External Ids for this team
2007* [Composition](composition.html): Version-independent identifier for the Composition
2008* [Condition](condition.html): A unique identifier of the condition record
2009* [Consent](consent.html): Identifier for this record (external references)
2010* [DetectedIssue](detectedissue.html): Unique id for the detected issue
2011* [DeviceRequest](devicerequest.html): Business identifier for request/order
2012* [DiagnosticReport](diagnosticreport.html): An identifier for the report
2013* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
2014* [DocumentReference](documentreference.html): Identifier of the attachment binary
2015* [Encounter](encounter.html): Identifier(s) by which this encounter is known
2016* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
2017* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
2018* [Goal](goal.html): External Ids for this goal
2019* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
2020* [Immunization](immunization.html): Business identifier
2021* [List](list.html): Business identifier
2022* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
2023* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
2024* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
2025* [MedicationUsage](medicationusage.html): Return statements with this external identifier
2026* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
2027* [Observation](observation.html): The unique id for a particular observation
2028* [Procedure](procedure.html): A unique identifier for a procedure
2029* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
2030* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
2031* [SupplyDelivery](supplydelivery.html): External identifier
2032* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
2033* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
2034</b><br>
2035   * Type: <b>token</b><br>
2036   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.content.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
2037   * </p>
2038   */
2039  @SearchParamDefinition(name="identifier", path="AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.content.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): External ids for this item\r\n* [CarePlan](careplan.html): External Ids for this plan\r\n* [CareTeam](careteam.html): External Ids for this team\r\n* [Composition](composition.html): Version-independent identifier for the Composition\r\n* [Condition](condition.html): A unique identifier of the condition record\r\n* [Consent](consent.html): Identifier for this record (external references)\r\n* [DetectedIssue](detectedissue.html): Unique id for the detected issue\r\n* [DeviceRequest](devicerequest.html): Business identifier for request/order\r\n* [DiagnosticReport](diagnosticreport.html): An identifier for the report\r\n* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents\r\n* [DocumentReference](documentreference.html): Identifier of the attachment binary\r\n* [Encounter](encounter.html): Identifier(s) by which this encounter is known\r\n* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier\r\n* [Goal](goal.html): External Ids for this goal\r\n* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID\r\n* [Immunization](immunization.html): Business identifier\r\n* [List](list.html): Business identifier\r\n* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier\r\n* [MedicationUsage](medicationusage.html): Return statements with this external identifier\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier\r\n* [Observation](observation.html): The unique id for a particular observation\r\n* [Procedure](procedure.html): A unique identifier for a procedure\r\n* [RiskAssessment](riskassessment.html): Unique identifier for the assessment\r\n* [ServiceRequest](servicerequest.html): Identifiers assigned to this order\r\n* [SupplyDelivery](supplydelivery.html): External identifier\r\n* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier\r\n", type="token" )
2040  public static final String SP_IDENTIFIER = "identifier";
2041 /**
2042   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2043   * <p>
2044   * Description: <b>Multiple Resources: 
2045
2046* [AllergyIntolerance](allergyintolerance.html): External ids for this item
2047* [CarePlan](careplan.html): External Ids for this plan
2048* [CareTeam](careteam.html): External Ids for this team
2049* [Composition](composition.html): Version-independent identifier for the Composition
2050* [Condition](condition.html): A unique identifier of the condition record
2051* [Consent](consent.html): Identifier for this record (external references)
2052* [DetectedIssue](detectedissue.html): Unique id for the detected issue
2053* [DeviceRequest](devicerequest.html): Business identifier for request/order
2054* [DiagnosticReport](diagnosticreport.html): An identifier for the report
2055* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
2056* [DocumentReference](documentreference.html): Identifier of the attachment binary
2057* [Encounter](encounter.html): Identifier(s) by which this encounter is known
2058* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
2059* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
2060* [Goal](goal.html): External Ids for this goal
2061* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
2062* [Immunization](immunization.html): Business identifier
2063* [List](list.html): Business identifier
2064* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
2065* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
2066* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
2067* [MedicationUsage](medicationusage.html): Return statements with this external identifier
2068* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
2069* [Observation](observation.html): The unique id for a particular observation
2070* [Procedure](procedure.html): A unique identifier for a procedure
2071* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
2072* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
2073* [SupplyDelivery](supplydelivery.html): External identifier
2074* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
2075* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
2076</b><br>
2077   * Type: <b>token</b><br>
2078   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.content.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
2079   * </p>
2080   */
2081  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2082
2083 /**
2084   * Search parameter: <b>patient</b>
2085   * <p>
2086   * Description: <b>Multiple Resources: 
2087
2088* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
2089* [CarePlan](careplan.html): Who the care plan is for
2090* [CareTeam](careteam.html): Who care team is for
2091* [ClinicalImpression](clinicalimpression.html): Patient assessed
2092* [Composition](composition.html): Who and/or what the composition is about
2093* [Condition](condition.html): Who has the condition?
2094* [Consent](consent.html): Who the consent applies to
2095* [DetectedIssue](detectedissue.html): Associated patient
2096* [DeviceRequest](devicerequest.html): Individual the service is ordered for
2097* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
2098* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2099* [DocumentManifest](documentmanifest.html): The subject of the set of documents
2100* [DocumentReference](documentreference.html): Who/what is the subject of the document
2101* [Encounter](encounter.html): The patient present at the encounter
2102* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2103* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2104* [Flag](flag.html): The identity of a subject to list flags for
2105* [Goal](goal.html): Who this goal is intended for
2106* [ImagingStudy](imagingstudy.html): Who the study is about
2107* [Immunization](immunization.html): The patient for the vaccination record
2108* [List](list.html): If all resources have the same subject
2109* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2110* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2111* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2112* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
2113* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement
2114* [Observation](observation.html): The subject that the observation is about (if patient)
2115* [Procedure](procedure.html): Search by subject - a patient
2116* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2117* [ServiceRequest](servicerequest.html): Search by subject - a patient
2118* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2119* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2120</b><br>
2121   * Type: <b>reference</b><br>
2122   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient</b><br>
2123   * </p>
2124   */
2125  @SearchParamDefinition(name="patient", path="AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for\r\n* [CarePlan](careplan.html): Who the care plan is for\r\n* [CareTeam](careteam.html): Who care team is for\r\n* [ClinicalImpression](clinicalimpression.html): Patient assessed\r\n* [Composition](composition.html): Who and/or what the composition is about\r\n* [Condition](condition.html): Who has the condition?\r\n* [Consent](consent.html): Who the consent applies to\r\n* [DetectedIssue](detectedissue.html): Associated patient\r\n* [DeviceRequest](devicerequest.html): Individual the service is ordered for\r\n* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device\r\n* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient\r\n* [DocumentManifest](documentmanifest.html): The subject of the set of documents\r\n* [DocumentReference](documentreference.html): Who/what is the subject of the document\r\n* [Encounter](encounter.html): The patient present at the encounter\r\n* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care\r\n* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for\r\n* [Flag](flag.html): The identity of a subject to list flags for\r\n* [Goal](goal.html): Who this goal is intended for\r\n* [ImagingStudy](imagingstudy.html): Who the study is about\r\n* [Immunization](immunization.html): The patient for the vaccination record\r\n* [List](list.html): If all resources have the same subject\r\n* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for\r\n* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for\r\n* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient\r\n* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.\r\n* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement\r\n* [Observation](observation.html): The subject that the observation is about (if patient)\r\n* [Procedure](procedure.html): Search by subject - a patient\r\n* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?\r\n* [ServiceRequest](servicerequest.html): Search by subject - a patient\r\n* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied\r\n* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for\r\n", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, ArtifactAssessment.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CapabilityStatement2.class, CarePlan.class, CareTeam.class, ChargeItem.class, ChargeItemDefinition.class, Citation.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseDefinition.class, ClinicalUseIssue.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, ConceptMap2.class, Condition.class, ConditionDefinition.class, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceDispense.class, DeviceMetric.class, DeviceRequest.class, DeviceUsage.class, DiagnosticReport.class, DocumentManifest.class, DocumentReference.class, Encounter.class, Endpoint.class, EnrollmentRequest.class, EnrollmentResponse.class, EpisodeOfCare.class, EventDefinition.class, Evidence.class, EvidenceReport.class, EvidenceVariable.class, ExampleScenario.class, ExplanationOfBenefit.class, FamilyMemberHistory.class, Flag.class, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingSelection.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, InventoryReport.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationUsage.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionIntake.class, NutritionOrder.class, NutritionProduct.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Permission.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, SubscriptionStatus.class, SubscriptionTopic.class, Substance.class, SubstanceDefinition.class, SubstanceNucleicAcid.class, SubstancePolymer.class, SubstanceProtein.class, SubstanceReferenceInformation.class, SubstanceSourceMaterial.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
2126  public static final String SP_PATIENT = "patient";
2127 /**
2128   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2129   * <p>
2130   * Description: <b>Multiple Resources: 
2131
2132* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
2133* [CarePlan](careplan.html): Who the care plan is for
2134* [CareTeam](careteam.html): Who care team is for
2135* [ClinicalImpression](clinicalimpression.html): Patient assessed
2136* [Composition](composition.html): Who and/or what the composition is about
2137* [Condition](condition.html): Who has the condition?
2138* [Consent](consent.html): Who the consent applies to
2139* [DetectedIssue](detectedissue.html): Associated patient
2140* [DeviceRequest](devicerequest.html): Individual the service is ordered for
2141* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
2142* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2143* [DocumentManifest](documentmanifest.html): The subject of the set of documents
2144* [DocumentReference](documentreference.html): Who/what is the subject of the document
2145* [Encounter](encounter.html): The patient present at the encounter
2146* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2147* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2148* [Flag](flag.html): The identity of a subject to list flags for
2149* [Goal](goal.html): Who this goal is intended for
2150* [ImagingStudy](imagingstudy.html): Who the study is about
2151* [Immunization](immunization.html): The patient for the vaccination record
2152* [List](list.html): If all resources have the same subject
2153* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2154* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2155* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2156* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
2157* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement
2158* [Observation](observation.html): The subject that the observation is about (if patient)
2159* [Procedure](procedure.html): Search by subject - a patient
2160* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2161* [ServiceRequest](servicerequest.html): Search by subject - a patient
2162* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2163* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2164</b><br>
2165   * Type: <b>reference</b><br>
2166   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient</b><br>
2167   * </p>
2168   */
2169  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2170
2171/**
2172   * Constant for fluent queries to be used to add include statements. Specifies
2173   * the path value of "<b>Goal:patient</b>".
2174   */
2175  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Goal:patient").toLocked();
2176
2177
2178}
2179