001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
033import java.util.ArrayList;
034import java.util.Date;
035import java.util.List;
036
037import org.hl7.fhir.exceptions.FHIRException;
038import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
039import org.hl7.fhir.utilities.Utilities;
040
041import ca.uhn.fhir.model.api.annotation.Block;
042import ca.uhn.fhir.model.api.annotation.Child;
043import ca.uhn.fhir.model.api.annotation.Description;
044import ca.uhn.fhir.model.api.annotation.ResourceDef;
045import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
046
047/**
048 * Describes the intended objective(s) for a patient, group or organization
049 * care, for example, weight loss, restoring an activity of daily living,
050 * obtaining herd immunity via immunization, meeting a process improvement
051 * 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
075     * pursued for a temporary period of time.
076     */
077    ONHOLD,
078    /**
079     * The goal is no longer being sought.
080     */
081    COMPLETED,
082    /**
083     * The goal has been abandoned.
084     */
085    CANCELLED,
086    /**
087     * The goal was entered in error and voided.
088     */
089    ENTEREDINERROR,
090    /**
091     * A proposed goal was rejected.
092     */
093    REJECTED,
094    /**
095     * added to help the parsers with the generic types
096     */
097    NULL;
098
099    public static GoalLifecycleStatus fromCode(String codeString) throws FHIRException {
100      if (codeString == null || "".equals(codeString))
101        return null;
102      if ("proposed".equals(codeString))
103        return PROPOSED;
104      if ("planned".equals(codeString))
105        return PLANNED;
106      if ("accepted".equals(codeString))
107        return ACCEPTED;
108      if ("active".equals(codeString))
109        return ACTIVE;
110      if ("on-hold".equals(codeString))
111        return ONHOLD;
112      if ("completed".equals(codeString))
113        return COMPLETED;
114      if ("cancelled".equals(codeString))
115        return CANCELLED;
116      if ("entered-in-error".equals(codeString))
117        return ENTEREDINERROR;
118      if ("rejected".equals(codeString))
119        return REJECTED;
120      if (Configuration.isAcceptInvalidEnums())
121        return null;
122      else
123        throw new FHIRException("Unknown GoalLifecycleStatus code '" + codeString + "'");
124    }
125
126    public String toCode() {
127      switch (this) {
128      case PROPOSED:
129        return "proposed";
130      case PLANNED:
131        return "planned";
132      case ACCEPTED:
133        return "accepted";
134      case ACTIVE:
135        return "active";
136      case ONHOLD:
137        return "on-hold";
138      case COMPLETED:
139        return "completed";
140      case CANCELLED:
141        return "cancelled";
142      case ENTEREDINERROR:
143        return "entered-in-error";
144      case REJECTED:
145        return "rejected";
146      case NULL:
147        return null;
148      default:
149        return "?";
150      }
151    }
152
153    public String getSystem() {
154      switch (this) {
155      case PROPOSED:
156        return "http://hl7.org/fhir/goal-status";
157      case PLANNED:
158        return "http://hl7.org/fhir/goal-status";
159      case ACCEPTED:
160        return "http://hl7.org/fhir/goal-status";
161      case ACTIVE:
162        return "http://hl7.org/fhir/goal-status";
163      case ONHOLD:
164        return "http://hl7.org/fhir/goal-status";
165      case COMPLETED:
166        return "http://hl7.org/fhir/goal-status";
167      case CANCELLED:
168        return "http://hl7.org/fhir/goal-status";
169      case ENTEREDINERROR:
170        return "http://hl7.org/fhir/goal-status";
171      case REJECTED:
172        return "http://hl7.org/fhir/goal-status";
173      case NULL:
174        return null;
175      default:
176        return "?";
177      }
178    }
179
180    public String getDefinition() {
181      switch (this) {
182      case PROPOSED:
183        return "A goal is proposed for this patient.";
184      case PLANNED:
185        return "A goal is planned for this patient.";
186      case ACCEPTED:
187        return "A proposed goal was accepted or acknowledged.";
188      case ACTIVE:
189        return "The goal is being sought actively.";
190      case ONHOLD:
191        return "The goal remains a long term objective but is no longer being actively pursued for a temporary period of time.";
192      case COMPLETED:
193        return "The goal is no longer being sought.";
194      case CANCELLED:
195        return "The goal has been abandoned.";
196      case ENTEREDINERROR:
197        return "The goal was entered in error and voided.";
198      case REJECTED:
199        return "A proposed goal was rejected.";
200      case NULL:
201        return null;
202      default:
203        return "?";
204      }
205    }
206
207    public String getDisplay() {
208      switch (this) {
209      case PROPOSED:
210        return "Proposed";
211      case PLANNED:
212        return "Planned";
213      case ACCEPTED:
214        return "Accepted";
215      case ACTIVE:
216        return "Active";
217      case ONHOLD:
218        return "On Hold";
219      case COMPLETED:
220        return "Completed";
221      case CANCELLED:
222        return "Cancelled";
223      case ENTEREDINERROR:
224        return "Entered in Error";
225      case REJECTED:
226        return "Rejected";
227      case NULL:
228        return null;
229      default:
230        return "?";
231      }
232    }
233  }
234
235  public static class GoalLifecycleStatusEnumFactory implements EnumFactory<GoalLifecycleStatus> {
236    public GoalLifecycleStatus fromCode(String codeString) throws IllegalArgumentException {
237      if (codeString == null || "".equals(codeString))
238        if (codeString == null || "".equals(codeString))
239          return null;
240      if ("proposed".equals(codeString))
241        return GoalLifecycleStatus.PROPOSED;
242      if ("planned".equals(codeString))
243        return GoalLifecycleStatus.PLANNED;
244      if ("accepted".equals(codeString))
245        return GoalLifecycleStatus.ACCEPTED;
246      if ("active".equals(codeString))
247        return GoalLifecycleStatus.ACTIVE;
248      if ("on-hold".equals(codeString))
249        return GoalLifecycleStatus.ONHOLD;
250      if ("completed".equals(codeString))
251        return GoalLifecycleStatus.COMPLETED;
252      if ("cancelled".equals(codeString))
253        return GoalLifecycleStatus.CANCELLED;
254      if ("entered-in-error".equals(codeString))
255        return GoalLifecycleStatus.ENTEREDINERROR;
256      if ("rejected".equals(codeString))
257        return GoalLifecycleStatus.REJECTED;
258      throw new IllegalArgumentException("Unknown GoalLifecycleStatus code '" + codeString + "'");
259    }
260
261    public Enumeration<GoalLifecycleStatus> fromType(PrimitiveType<?> code) throws FHIRException {
262      if (code == null)
263        return null;
264      if (code.isEmpty())
265        return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.NULL, code);
266      String codeString = code.asStringValue();
267      if (codeString == null || "".equals(codeString))
268        return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.NULL, code);
269      if ("proposed".equals(codeString))
270        return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.PROPOSED, code);
271      if ("planned".equals(codeString))
272        return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.PLANNED, code);
273      if ("accepted".equals(codeString))
274        return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.ACCEPTED, code);
275      if ("active".equals(codeString))
276        return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.ACTIVE, code);
277      if ("on-hold".equals(codeString))
278        return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.ONHOLD, code);
279      if ("completed".equals(codeString))
280        return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.COMPLETED, code);
281      if ("cancelled".equals(codeString))
282        return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.CANCELLED, code);
283      if ("entered-in-error".equals(codeString))
284        return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.ENTEREDINERROR, code);
285      if ("rejected".equals(codeString))
286        return new Enumeration<GoalLifecycleStatus>(this, GoalLifecycleStatus.REJECTED, code);
287      throw new FHIRException("Unknown GoalLifecycleStatus code '" + codeString + "'");
288    }
289
290    public String toCode(GoalLifecycleStatus code) {
291      if (code == GoalLifecycleStatus.PROPOSED)
292        return "proposed";
293      if (code == GoalLifecycleStatus.PLANNED)
294        return "planned";
295      if (code == GoalLifecycleStatus.ACCEPTED)
296        return "accepted";
297      if (code == GoalLifecycleStatus.ACTIVE)
298        return "active";
299      if (code == GoalLifecycleStatus.ONHOLD)
300        return "on-hold";
301      if (code == GoalLifecycleStatus.COMPLETED)
302        return "completed";
303      if (code == GoalLifecycleStatus.CANCELLED)
304        return "cancelled";
305      if (code == GoalLifecycleStatus.ENTEREDINERROR)
306        return "entered-in-error";
307      if (code == GoalLifecycleStatus.REJECTED)
308        return "rejected";
309      return "?";
310    }
311
312    public String toSystem(GoalLifecycleStatus code) {
313      return code.getSystem();
314    }
315  }
316
317  @Block()
318  public static class GoalTargetComponent extends BackboneElement implements IBaseBackboneElement {
319    /**
320     * The parameter whose value is being tracked, e.g. body weight, blood pressure,
321     * or hemoglobin A1c level.
322     */
323    @Child(name = "measure", type = {
324        CodeableConcept.class }, order = 1, min = 0, max = 1, modifier = false, summary = true)
325    @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.")
326    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/observation-codes")
327    protected CodeableConcept measure;
328
329    /**
330     * The target value of the focus to be achieved to signify the fulfillment of
331     * the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the
332     * range can be specified. When a low value is missing, it indicates that the
333     * goal is achieved at any focus value at or below the high value. Similarly, if
334     * the high value is missing, it indicates that the goal is achieved at any
335     * focus value at or above the low value.
336     */
337    @Child(name = "detail", type = { Quantity.class, Range.class, CodeableConcept.class, StringType.class,
338        BooleanType.class, IntegerType.class,
339        Ratio.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
340    @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.")
341    protected Type detail;
342
343    /**
344     * Indicates either the date or the duration after start by which the goal
345     * should be met.
346     */
347    @Child(name = "due", type = { DateType.class,
348        Duration.class }, order = 3, min = 0, max = 1, modifier = false, summary = true)
349    @Description(shortDefinition = "Reach goal on or before", formalDefinition = "Indicates either the date or the duration after start by which the goal should be met.")
350    protected Type due;
351
352    private static final long serialVersionUID = -585108934L;
353
354    /**
355     * Constructor
356     */
357    public GoalTargetComponent() {
358      super();
359    }
360
361    /**
362     * @return {@link #measure} (The parameter whose value is being tracked, e.g.
363     *         body weight, blood pressure, or hemoglobin A1c level.)
364     */
365    public CodeableConcept getMeasure() {
366      if (this.measure == null)
367        if (Configuration.errorOnAutoCreate())
368          throw new Error("Attempt to auto-create GoalTargetComponent.measure");
369        else if (Configuration.doAutoCreate())
370          this.measure = new CodeableConcept(); // cc
371      return this.measure;
372    }
373
374    public boolean hasMeasure() {
375      return this.measure != null && !this.measure.isEmpty();
376    }
377
378    /**
379     * @param value {@link #measure} (The parameter whose value is being tracked,
380     *              e.g. body weight, blood pressure, or hemoglobin A1c level.)
381     */
382    public GoalTargetComponent setMeasure(CodeableConcept value) {
383      this.measure = value;
384      return this;
385    }
386
387    /**
388     * @return {@link #detail} (The target value of the focus to be achieved to
389     *         signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either
390     *         the high or low or both values of the range can be specified. When a
391     *         low value is missing, it indicates that the goal is achieved at any
392     *         focus value at or below the high value. Similarly, if the high value
393     *         is missing, it indicates that the goal is achieved at any focus value
394     *         at or above the low value.)
395     */
396    public Type getDetail() {
397      return this.detail;
398    }
399
400    /**
401     * @return {@link #detail} (The target value of the focus to be achieved to
402     *         signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either
403     *         the high or low or both values of the range can be specified. When a
404     *         low value is missing, it indicates that the goal is achieved at any
405     *         focus value at or below the high value. Similarly, if the high value
406     *         is missing, it indicates that the goal is achieved at any focus value
407     *         at or above the low value.)
408     */
409    public Quantity getDetailQuantity() throws FHIRException {
410      if (this.detail == null)
411        this.detail = new Quantity();
412      if (!(this.detail instanceof Quantity))
413        throw new FHIRException("Type mismatch: the type Quantity was expected, but " + this.detail.getClass().getName()
414            + " was encountered");
415      return (Quantity) this.detail;
416    }
417
418    public boolean hasDetailQuantity() {
419      return this != null && this.detail instanceof Quantity;
420    }
421
422    /**
423     * @return {@link #detail} (The target value of the focus to be achieved to
424     *         signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either
425     *         the high or low or both values of the range can be specified. When a
426     *         low value is missing, it indicates that the goal is achieved at any
427     *         focus value at or below the high value. Similarly, if the high value
428     *         is missing, it indicates that the goal is achieved at any focus value
429     *         at or above the low value.)
430     */
431    public Range getDetailRange() throws FHIRException {
432      if (this.detail == null)
433        this.detail = new Range();
434      if (!(this.detail instanceof Range))
435        throw new FHIRException(
436            "Type mismatch: the type Range was expected, but " + this.detail.getClass().getName() + " was encountered");
437      return (Range) this.detail;
438    }
439
440    public boolean hasDetailRange() {
441      return this != null && this.detail instanceof Range;
442    }
443
444    /**
445     * @return {@link #detail} (The target value of the focus to be achieved to
446     *         signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either
447     *         the high or low or both values of the range can be specified. When a
448     *         low value is missing, it indicates that the goal is achieved at any
449     *         focus value at or below the high value. Similarly, if the high value
450     *         is missing, it indicates that the goal is achieved at any focus value
451     *         at or above the low value.)
452     */
453    public CodeableConcept getDetailCodeableConcept() throws FHIRException {
454      if (this.detail == null)
455        this.detail = new CodeableConcept();
456      if (!(this.detail instanceof CodeableConcept))
457        throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "
458            + this.detail.getClass().getName() + " was encountered");
459      return (CodeableConcept) this.detail;
460    }
461
462    public boolean hasDetailCodeableConcept() {
463      return this != null && this.detail instanceof CodeableConcept;
464    }
465
466    /**
467     * @return {@link #detail} (The target value of the focus to be achieved to
468     *         signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either
469     *         the high or low or both values of the range can be specified. When a
470     *         low value is missing, it indicates that the goal is achieved at any
471     *         focus value at or below the high value. Similarly, if the high value
472     *         is missing, it indicates that the goal is achieved at any focus value
473     *         at or above the low value.)
474     */
475    public StringType getDetailStringType() throws FHIRException {
476      if (this.detail == null)
477        this.detail = new StringType();
478      if (!(this.detail instanceof StringType))
479        throw new FHIRException("Type mismatch: the type StringType was expected, but "
480            + this.detail.getClass().getName() + " was encountered");
481      return (StringType) this.detail;
482    }
483
484    public boolean hasDetailStringType() {
485      return this != null && this.detail instanceof StringType;
486    }
487
488    /**
489     * @return {@link #detail} (The target value of the focus to be achieved to
490     *         signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either
491     *         the high or low or both values of the range can be specified. When a
492     *         low value is missing, it indicates that the goal is achieved at any
493     *         focus value at or below the high value. Similarly, if the high value
494     *         is missing, it indicates that the goal is achieved at any focus value
495     *         at or above the low value.)
496     */
497    public BooleanType getDetailBooleanType() throws FHIRException {
498      if (this.detail == null)
499        this.detail = new BooleanType();
500      if (!(this.detail instanceof BooleanType))
501        throw new FHIRException("Type mismatch: the type BooleanType was expected, but "
502            + this.detail.getClass().getName() + " was encountered");
503      return (BooleanType) this.detail;
504    }
505
506    public boolean hasDetailBooleanType() {
507      return this != null && this.detail instanceof BooleanType;
508    }
509
510    /**
511     * @return {@link #detail} (The target value of the focus to be achieved to
512     *         signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either
513     *         the high or low or both values of the range can be specified. When a
514     *         low value is missing, it indicates that the goal is achieved at any
515     *         focus value at or below the high value. Similarly, if the high value
516     *         is missing, it indicates that the goal is achieved at any focus value
517     *         at or above the low value.)
518     */
519    public IntegerType getDetailIntegerType() throws FHIRException {
520      if (this.detail == null)
521        this.detail = new IntegerType();
522      if (!(this.detail instanceof IntegerType))
523        throw new FHIRException("Type mismatch: the type IntegerType was expected, but "
524            + this.detail.getClass().getName() + " was encountered");
525      return (IntegerType) this.detail;
526    }
527
528    public boolean hasDetailIntegerType() {
529      return this != null && this.detail instanceof IntegerType;
530    }
531
532    /**
533     * @return {@link #detail} (The target value of the focus to be achieved to
534     *         signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either
535     *         the high or low or both values of the range can be specified. When a
536     *         low value is missing, it indicates that the goal is achieved at any
537     *         focus value at or below the high value. Similarly, if the high value
538     *         is missing, it indicates that the goal is achieved at any focus value
539     *         at or above the low value.)
540     */
541    public Ratio getDetailRatio() throws FHIRException {
542      if (this.detail == null)
543        this.detail = new Ratio();
544      if (!(this.detail instanceof Ratio))
545        throw new FHIRException(
546            "Type mismatch: the type Ratio was expected, but " + this.detail.getClass().getName() + " was encountered");
547      return (Ratio) this.detail;
548    }
549
550    public boolean hasDetailRatio() {
551      return this != null && this.detail instanceof Ratio;
552    }
553
554    public boolean hasDetail() {
555      return this.detail != null && !this.detail.isEmpty();
556    }
557
558    /**
559     * @param value {@link #detail} (The target value of the focus to be achieved to
560     *              signify the fulfillment of the goal, e.g. 150 pounds, 7.0%.
561     *              Either the high or low or both values of the range can be
562     *              specified. When a low value is missing, it indicates that the
563     *              goal is achieved at any focus value at or below the high value.
564     *              Similarly, if the high value is missing, it indicates that the
565     *              goal is achieved at any focus value at or above the low value.)
566     */
567    public GoalTargetComponent setDetail(Type value) {
568      if (value != null && !(value instanceof Quantity || value instanceof Range || value instanceof CodeableConcept
569          || value instanceof StringType || value instanceof BooleanType || value instanceof IntegerType
570          || value instanceof Ratio))
571        throw new Error("Not the right type for Goal.target.detail[x]: " + value.fhirType());
572      this.detail = value;
573      return this;
574    }
575
576    /**
577     * @return {@link #due} (Indicates either the date or the duration after start
578     *         by which the goal should be met.)
579     */
580    public Type getDue() {
581      return this.due;
582    }
583
584    /**
585     * @return {@link #due} (Indicates either the date or the duration after start
586     *         by which the goal should be met.)
587     */
588    public DateType getDueDateType() throws FHIRException {
589      if (this.due == null)
590        this.due = new DateType();
591      if (!(this.due instanceof DateType))
592        throw new FHIRException(
593            "Type mismatch: the type DateType was expected, but " + this.due.getClass().getName() + " was encountered");
594      return (DateType) this.due;
595    }
596
597    public boolean hasDueDateType() {
598      return this != null && this.due instanceof DateType;
599    }
600
601    /**
602     * @return {@link #due} (Indicates either the date or the duration after start
603     *         by which the goal should be met.)
604     */
605    public Duration getDueDuration() throws FHIRException {
606      if (this.due == null)
607        this.due = new Duration();
608      if (!(this.due instanceof Duration))
609        throw new FHIRException(
610            "Type mismatch: the type Duration was expected, but " + this.due.getClass().getName() + " was encountered");
611      return (Duration) this.due;
612    }
613
614    public boolean hasDueDuration() {
615      return this != null && this.due instanceof Duration;
616    }
617
618    public boolean hasDue() {
619      return this.due != null && !this.due.isEmpty();
620    }
621
622    /**
623     * @param value {@link #due} (Indicates either the date or the duration after
624     *              start by which the goal should be met.)
625     */
626    public GoalTargetComponent setDue(Type value) {
627      if (value != null && !(value instanceof DateType || value instanceof Duration))
628        throw new Error("Not the right type for Goal.target.due[x]: " + value.fhirType());
629      this.due = value;
630      return this;
631    }
632
633    protected void listChildren(List<Property> children) {
634      super.listChildren(children);
635      children.add(new Property("measure", "CodeableConcept",
636          "The parameter whose value is being tracked, e.g. body weight, blood pressure, or hemoglobin A1c level.", 0,
637          1, measure));
638      children.add(new Property("detail[x]", "Quantity|Range|CodeableConcept|string|boolean|integer|Ratio",
639          "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.",
640          0, 1, detail));
641      children.add(new Property("due[x]", "date|Duration",
642          "Indicates either the date or the duration after start by which the goal should be met.", 0, 1, due));
643    }
644
645    @Override
646    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
647      switch (_hash) {
648      case 938321246:
649        /* measure */ return new Property("measure", "CodeableConcept",
650            "The parameter whose value is being tracked, e.g. body weight, blood pressure, or hemoglobin A1c level.", 0,
651            1, measure);
652      case -1973084529:
653        /* detail[x] */ return new Property("detail[x]", "Quantity|Range|CodeableConcept|string|boolean|integer|Ratio",
654            "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.",
655            0, 1, detail);
656      case -1335224239:
657        /* detail */ return new Property("detail[x]", "Quantity|Range|CodeableConcept|string|boolean|integer|Ratio",
658            "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.",
659            0, 1, detail);
660      case -1313079300:
661        /* detailQuantity */ return new Property("detail[x]",
662            "Quantity|Range|CodeableConcept|string|boolean|integer|Ratio",
663            "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.",
664            0, 1, detail);
665      case -2062632084:
666        /* detailRange */ return new Property("detail[x]",
667            "Quantity|Range|CodeableConcept|string|boolean|integer|Ratio",
668            "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.",
669            0, 1, detail);
670      case -175586544:
671        /* detailCodeableConcept */ return new Property("detail[x]",
672            "Quantity|Range|CodeableConcept|string|boolean|integer|Ratio",
673            "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.",
674            0, 1, detail);
675      case 529212354:
676        /* detailString */ return new Property("detail[x]",
677            "Quantity|Range|CodeableConcept|string|boolean|integer|Ratio",
678            "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.",
679            0, 1, detail);
680      case 1172184727:
681        /* detailBoolean */ return new Property("detail[x]",
682            "Quantity|Range|CodeableConcept|string|boolean|integer|Ratio",
683            "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.",
684            0, 1, detail);
685      case -1229442131:
686        /* detailInteger */ return new Property("detail[x]",
687            "Quantity|Range|CodeableConcept|string|boolean|integer|Ratio",
688            "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.",
689            0, 1, detail);
690      case -2062626246:
691        /* detailRatio */ return new Property("detail[x]",
692            "Quantity|Range|CodeableConcept|string|boolean|integer|Ratio",
693            "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.",
694            0, 1, detail);
695      case -1320900084:
696        /* due[x] */ return new Property("due[x]", "date|Duration",
697            "Indicates either the date or the duration after start by which the goal should be met.", 0, 1, due);
698      case 99828:
699        /* due */ return new Property("due[x]", "date|Duration",
700            "Indicates either the date or the duration after start by which the goal should be met.", 0, 1, due);
701      case 2001063874:
702        /* dueDate */ return new Property("due[x]", "date|Duration",
703            "Indicates either the date or the duration after start by which the goal should be met.", 0, 1, due);
704      case -620428376:
705        /* dueDuration */ return new Property("due[x]", "date|Duration",
706            "Indicates either the date or the duration after start by which the goal should be met.", 0, 1, due);
707      default:
708        return super.getNamedProperty(_hash, _name, _checkValid);
709      }
710
711    }
712
713    @Override
714    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
715      switch (hash) {
716      case 938321246:
717        /* measure */ return this.measure == null ? new Base[0] : new Base[] { this.measure }; // CodeableConcept
718      case -1335224239:
719        /* detail */ return this.detail == null ? new Base[0] : new Base[] { this.detail }; // Type
720      case 99828:
721        /* due */ return this.due == null ? new Base[0] : new Base[] { this.due }; // Type
722      default:
723        return super.getProperty(hash, name, checkValid);
724      }
725
726    }
727
728    @Override
729    public Base setProperty(int hash, String name, Base value) throws FHIRException {
730      switch (hash) {
731      case 938321246: // measure
732        this.measure = castToCodeableConcept(value); // CodeableConcept
733        return value;
734      case -1335224239: // detail
735        this.detail = castToType(value); // Type
736        return value;
737      case 99828: // due
738        this.due = castToType(value); // Type
739        return value;
740      default:
741        return super.setProperty(hash, name, value);
742      }
743
744    }
745
746    @Override
747    public Base setProperty(String name, Base value) throws FHIRException {
748      if (name.equals("measure")) {
749        this.measure = castToCodeableConcept(value); // CodeableConcept
750      } else if (name.equals("detail[x]")) {
751        this.detail = castToType(value); // Type
752      } else if (name.equals("due[x]")) {
753        this.due = castToType(value); // Type
754      } else
755        return super.setProperty(name, value);
756      return value;
757    }
758
759    @Override
760    public Base makeProperty(int hash, String name) throws FHIRException {
761      switch (hash) {
762      case 938321246:
763        return getMeasure();
764      case -1973084529:
765        return getDetail();
766      case -1335224239:
767        return getDetail();
768      case -1320900084:
769        return getDue();
770      case 99828:
771        return getDue();
772      default:
773        return super.makeProperty(hash, name);
774      }
775
776    }
777
778    @Override
779    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
780      switch (hash) {
781      case 938321246:
782        /* measure */ return new String[] { "CodeableConcept" };
783      case -1335224239:
784        /* detail */ return new String[] { "Quantity", "Range", "CodeableConcept", "string", "boolean", "integer",
785            "Ratio" };
786      case 99828:
787        /* due */ return new String[] { "date", "Duration" };
788      default:
789        return super.getTypesForProperty(hash, name);
790      }
791
792    }
793
794    @Override
795    public Base addChild(String name) throws FHIRException {
796      if (name.equals("measure")) {
797        this.measure = new CodeableConcept();
798        return this.measure;
799      } else if (name.equals("detailQuantity")) {
800        this.detail = new Quantity();
801        return this.detail;
802      } else if (name.equals("detailRange")) {
803        this.detail = new Range();
804        return this.detail;
805      } else if (name.equals("detailCodeableConcept")) {
806        this.detail = new CodeableConcept();
807        return this.detail;
808      } else if (name.equals("detailString")) {
809        this.detail = new StringType();
810        return this.detail;
811      } else if (name.equals("detailBoolean")) {
812        this.detail = new BooleanType();
813        return this.detail;
814      } else if (name.equals("detailInteger")) {
815        this.detail = new IntegerType();
816        return this.detail;
817      } else if (name.equals("detailRatio")) {
818        this.detail = new Ratio();
819        return this.detail;
820      } else if (name.equals("dueDate")) {
821        this.due = new DateType();
822        return this.due;
823      } else if (name.equals("dueDuration")) {
824        this.due = new Duration();
825        return this.due;
826      } else
827        return super.addChild(name);
828    }
829
830    public GoalTargetComponent copy() {
831      GoalTargetComponent dst = new GoalTargetComponent();
832      copyValues(dst);
833      return dst;
834    }
835
836    public void copyValues(GoalTargetComponent dst) {
837      super.copyValues(dst);
838      dst.measure = measure == null ? null : measure.copy();
839      dst.detail = detail == null ? null : detail.copy();
840      dst.due = due == null ? null : due.copy();
841    }
842
843    @Override
844    public boolean equalsDeep(Base other_) {
845      if (!super.equalsDeep(other_))
846        return false;
847      if (!(other_ instanceof GoalTargetComponent))
848        return false;
849      GoalTargetComponent o = (GoalTargetComponent) other_;
850      return compareDeep(measure, o.measure, true) && compareDeep(detail, o.detail, true)
851          && compareDeep(due, o.due, true);
852    }
853
854    @Override
855    public boolean equalsShallow(Base other_) {
856      if (!super.equalsShallow(other_))
857        return false;
858      if (!(other_ instanceof GoalTargetComponent))
859        return false;
860      GoalTargetComponent o = (GoalTargetComponent) other_;
861      return true;
862    }
863
864    public boolean isEmpty() {
865      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(measure, detail, due);
866    }
867
868    public String fhirType() {
869      return "Goal.target";
870
871    }
872
873  }
874
875  /**
876   * Business identifiers assigned to this goal by the performer or other systems
877   * which remain constant as the resource is updated and propagates from server
878   * to server.
879   */
880  @Child(name = "identifier", type = {
881      Identifier.class }, order = 0, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
882  @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.")
883  protected List<Identifier> identifier;
884
885  /**
886   * The state of the goal throughout its lifecycle.
887   */
888  @Child(name = "lifecycleStatus", type = {
889      CodeType.class }, order = 1, min = 1, max = 1, modifier = true, summary = true)
890  @Description(shortDefinition = "proposed | planned | accepted | active | on-hold | completed | cancelled | entered-in-error | rejected", formalDefinition = "The state of the goal throughout its lifecycle.")
891  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/goal-status")
892  protected Enumeration<GoalLifecycleStatus> lifecycleStatus;
893
894  /**
895   * Describes the progression, or lack thereof, towards the goal against the
896   * target.
897   */
898  @Child(name = "achievementStatus", type = {
899      CodeableConcept.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
900  @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.")
901  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/goal-achievement")
902  protected CodeableConcept achievementStatus;
903
904  /**
905   * Indicates a category the goal falls within.
906   */
907  @Child(name = "category", type = {
908      CodeableConcept.class }, order = 3, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
909  @Description(shortDefinition = "E.g. Treatment, dietary, behavioral, etc.", formalDefinition = "Indicates a category the goal falls within.")
910  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/goal-category")
911  protected List<CodeableConcept> category;
912
913  /**
914   * Identifies the mutually agreed level of importance associated with
915   * reaching/sustaining the goal.
916   */
917  @Child(name = "priority", type = {
918      CodeableConcept.class }, order = 4, min = 0, max = 1, modifier = false, summary = true)
919  @Description(shortDefinition = "high-priority | medium-priority | low-priority", formalDefinition = "Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.")
920  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/goal-priority")
921  protected CodeableConcept priority;
922
923  /**
924   * Human-readable and/or coded description of a specific desired objective of
925   * care, such as "control blood pressure" or "negotiate an obstacle course" or
926   * "dance with child at wedding".
927   */
928  @Child(name = "description", type = {
929      CodeableConcept.class }, order = 5, min = 1, max = 1, modifier = false, summary = true)
930  @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\".")
931  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/clinical-findings")
932  protected CodeableConcept description;
933
934  /**
935   * Identifies the patient, group or organization for whom the goal is being
936   * established.
937   */
938  @Child(name = "subject", type = { Patient.class, Group.class,
939      Organization.class }, order = 6, min = 1, max = 1, modifier = false, summary = true)
940  @Description(shortDefinition = "Who this goal is intended for", formalDefinition = "Identifies the patient, group or organization for whom the goal is being established.")
941  protected Reference subject;
942
943  /**
944   * The actual object that is the target of the reference (Identifies the
945   * patient, group or organization for whom the goal is being established.)
946   */
947  protected Resource subjectTarget;
948
949  /**
950   * The date or event after which the goal should begin being pursued.
951   */
952  @Child(name = "start", type = { DateType.class,
953      CodeableConcept.class }, order = 7, min = 0, max = 1, modifier = false, summary = true)
954  @Description(shortDefinition = "When goal pursuit begins", formalDefinition = "The date or event after which the goal should begin being pursued.")
955  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/goal-start-event")
956  protected Type start;
957
958  /**
959   * Indicates what should be done by when.
960   */
961  @Child(name = "target", type = {}, order = 8, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
962  @Description(shortDefinition = "Target outcome for the goal", formalDefinition = "Indicates what should be done by when.")
963  protected List<GoalTargetComponent> target;
964
965  /**
966   * Identifies when the current status. I.e. When initially created, when
967   * achieved, when cancelled, etc.
968   */
969  @Child(name = "statusDate", type = { DateType.class }, order = 9, min = 0, max = 1, modifier = false, summary = true)
970  @Description(shortDefinition = "When goal status took effect", formalDefinition = "Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc.")
971  protected DateType statusDate;
972
973  /**
974   * Captures the reason for the current status.
975   */
976  @Child(name = "statusReason", type = {
977      StringType.class }, order = 10, min = 0, max = 1, modifier = false, summary = false)
978  @Description(shortDefinition = "Reason for current status", formalDefinition = "Captures the reason for the current status.")
979  protected StringType statusReason;
980
981  /**
982   * Indicates whose goal this is - patient goal, practitioner goal, etc.
983   */
984  @Child(name = "expressedBy", type = { Patient.class, Practitioner.class, PractitionerRole.class,
985      RelatedPerson.class }, order = 11, min = 0, max = 1, modifier = false, summary = true)
986  @Description(shortDefinition = "Who's responsible for creating Goal?", formalDefinition = "Indicates whose goal this is - patient goal, practitioner goal, etc.")
987  protected Reference expressedBy;
988
989  /**
990   * The actual object that is the target of the reference (Indicates whose goal
991   * this is - patient goal, practitioner goal, etc.)
992   */
993  protected Resource expressedByTarget;
994
995  /**
996   * The identified conditions and other health record elements that are intended
997   * to be addressed by the goal.
998   */
999  @Child(name = "addresses", type = { Condition.class, Observation.class, MedicationStatement.class,
1000      NutritionOrder.class, ServiceRequest.class,
1001      RiskAssessment.class }, order = 12, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1002  @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.")
1003  protected List<Reference> addresses;
1004  /**
1005   * The actual objects that are the target of the reference (The identified
1006   * conditions and other health record elements that are intended to be addressed
1007   * by the goal.)
1008   */
1009  protected List<Resource> addressesTarget;
1010
1011  /**
1012   * Any comments related to the goal.
1013   */
1014  @Child(name = "note", type = {
1015      Annotation.class }, order = 13, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1016  @Description(shortDefinition = "Comments about the goal", formalDefinition = "Any comments related to the goal.")
1017  protected List<Annotation> note;
1018
1019  /**
1020   * Identifies the change (or lack of change) at the point when the status of the
1021   * goal is assessed.
1022   */
1023  @Child(name = "outcomeCode", type = {
1024      CodeableConcept.class }, order = 14, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1025  @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.")
1026  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/clinical-findings")
1027  protected List<CodeableConcept> outcomeCode;
1028
1029  /**
1030   * Details of what's changed (or not changed).
1031   */
1032  @Child(name = "outcomeReference", type = {
1033      Observation.class }, order = 15, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1034  @Description(shortDefinition = "Observation that resulted from goal", formalDefinition = "Details of what's changed (or not changed).")
1035  protected List<Reference> outcomeReference;
1036  /**
1037   * The actual objects that are the target of the reference (Details of what's
1038   * changed (or not changed).)
1039   */
1040  protected List<Observation> outcomeReferenceTarget;
1041
1042  private static final long serialVersionUID = -1366854797L;
1043
1044  /**
1045   * Constructor
1046   */
1047  public Goal() {
1048    super();
1049  }
1050
1051  /**
1052   * Constructor
1053   */
1054  public Goal(Enumeration<GoalLifecycleStatus> lifecycleStatus, CodeableConcept description, Reference subject) {
1055    super();
1056    this.lifecycleStatus = lifecycleStatus;
1057    this.description = description;
1058    this.subject = subject;
1059  }
1060
1061  /**
1062   * @return {@link #identifier} (Business identifiers assigned to this goal by
1063   *         the performer or other systems which remain constant as the resource
1064   *         is updated and propagates from server to server.)
1065   */
1066  public List<Identifier> getIdentifier() {
1067    if (this.identifier == null)
1068      this.identifier = new ArrayList<Identifier>();
1069    return this.identifier;
1070  }
1071
1072  /**
1073   * @return Returns a reference to <code>this</code> for easy method chaining
1074   */
1075  public Goal setIdentifier(List<Identifier> theIdentifier) {
1076    this.identifier = theIdentifier;
1077    return this;
1078  }
1079
1080  public boolean hasIdentifier() {
1081    if (this.identifier == null)
1082      return false;
1083    for (Identifier item : this.identifier)
1084      if (!item.isEmpty())
1085        return true;
1086    return false;
1087  }
1088
1089  public Identifier addIdentifier() { // 3
1090    Identifier t = new Identifier();
1091    if (this.identifier == null)
1092      this.identifier = new ArrayList<Identifier>();
1093    this.identifier.add(t);
1094    return t;
1095  }
1096
1097  public Goal addIdentifier(Identifier t) { // 3
1098    if (t == null)
1099      return this;
1100    if (this.identifier == null)
1101      this.identifier = new ArrayList<Identifier>();
1102    this.identifier.add(t);
1103    return this;
1104  }
1105
1106  /**
1107   * @return The first repetition of repeating field {@link #identifier}, creating
1108   *         it if it does not already exist
1109   */
1110  public Identifier getIdentifierFirstRep() {
1111    if (getIdentifier().isEmpty()) {
1112      addIdentifier();
1113    }
1114    return getIdentifier().get(0);
1115  }
1116
1117  /**
1118   * @return {@link #lifecycleStatus} (The state of the goal throughout its
1119   *         lifecycle.). This is the underlying object with id, value and
1120   *         extensions. The accessor "getLifecycleStatus" gives direct access to
1121   *         the value
1122   */
1123  public Enumeration<GoalLifecycleStatus> getLifecycleStatusElement() {
1124    if (this.lifecycleStatus == null)
1125      if (Configuration.errorOnAutoCreate())
1126        throw new Error("Attempt to auto-create Goal.lifecycleStatus");
1127      else if (Configuration.doAutoCreate())
1128        this.lifecycleStatus = new Enumeration<GoalLifecycleStatus>(new GoalLifecycleStatusEnumFactory()); // bb
1129    return this.lifecycleStatus;
1130  }
1131
1132  public boolean hasLifecycleStatusElement() {
1133    return this.lifecycleStatus != null && !this.lifecycleStatus.isEmpty();
1134  }
1135
1136  public boolean hasLifecycleStatus() {
1137    return this.lifecycleStatus != null && !this.lifecycleStatus.isEmpty();
1138  }
1139
1140  /**
1141   * @param value {@link #lifecycleStatus} (The state of the goal throughout its
1142   *              lifecycle.). This is the underlying object with id, value and
1143   *              extensions. The accessor "getLifecycleStatus" gives direct
1144   *              access to the value
1145   */
1146  public Goal setLifecycleStatusElement(Enumeration<GoalLifecycleStatus> value) {
1147    this.lifecycleStatus = value;
1148    return this;
1149  }
1150
1151  /**
1152   * @return The state of the goal throughout its lifecycle.
1153   */
1154  public GoalLifecycleStatus getLifecycleStatus() {
1155    return this.lifecycleStatus == null ? null : this.lifecycleStatus.getValue();
1156  }
1157
1158  /**
1159   * @param value The state of the goal throughout its lifecycle.
1160   */
1161  public Goal setLifecycleStatus(GoalLifecycleStatus value) {
1162    if (this.lifecycleStatus == null)
1163      this.lifecycleStatus = new Enumeration<GoalLifecycleStatus>(new GoalLifecycleStatusEnumFactory());
1164    this.lifecycleStatus.setValue(value);
1165    return this;
1166  }
1167
1168  /**
1169   * @return {@link #achievementStatus} (Describes the progression, or lack
1170   *         thereof, towards the goal against the target.)
1171   */
1172  public CodeableConcept getAchievementStatus() {
1173    if (this.achievementStatus == null)
1174      if (Configuration.errorOnAutoCreate())
1175        throw new Error("Attempt to auto-create Goal.achievementStatus");
1176      else if (Configuration.doAutoCreate())
1177        this.achievementStatus = new CodeableConcept(); // cc
1178    return this.achievementStatus;
1179  }
1180
1181  public boolean hasAchievementStatus() {
1182    return this.achievementStatus != null && !this.achievementStatus.isEmpty();
1183  }
1184
1185  /**
1186   * @param value {@link #achievementStatus} (Describes the progression, or lack
1187   *              thereof, towards the goal against the target.)
1188   */
1189  public Goal setAchievementStatus(CodeableConcept value) {
1190    this.achievementStatus = value;
1191    return this;
1192  }
1193
1194  /**
1195   * @return {@link #category} (Indicates a category the goal falls within.)
1196   */
1197  public List<CodeableConcept> getCategory() {
1198    if (this.category == null)
1199      this.category = new ArrayList<CodeableConcept>();
1200    return this.category;
1201  }
1202
1203  /**
1204   * @return Returns a reference to <code>this</code> for easy method chaining
1205   */
1206  public Goal setCategory(List<CodeableConcept> theCategory) {
1207    this.category = theCategory;
1208    return this;
1209  }
1210
1211  public boolean hasCategory() {
1212    if (this.category == null)
1213      return false;
1214    for (CodeableConcept item : this.category)
1215      if (!item.isEmpty())
1216        return true;
1217    return false;
1218  }
1219
1220  public CodeableConcept addCategory() { // 3
1221    CodeableConcept t = new CodeableConcept();
1222    if (this.category == null)
1223      this.category = new ArrayList<CodeableConcept>();
1224    this.category.add(t);
1225    return t;
1226  }
1227
1228  public Goal addCategory(CodeableConcept t) { // 3
1229    if (t == null)
1230      return this;
1231    if (this.category == null)
1232      this.category = new ArrayList<CodeableConcept>();
1233    this.category.add(t);
1234    return this;
1235  }
1236
1237  /**
1238   * @return The first repetition of repeating field {@link #category}, creating
1239   *         it if it does not already exist
1240   */
1241  public CodeableConcept getCategoryFirstRep() {
1242    if (getCategory().isEmpty()) {
1243      addCategory();
1244    }
1245    return getCategory().get(0);
1246  }
1247
1248  /**
1249   * @return {@link #priority} (Identifies the mutually agreed level of importance
1250   *         associated with reaching/sustaining the goal.)
1251   */
1252  public CodeableConcept getPriority() {
1253    if (this.priority == null)
1254      if (Configuration.errorOnAutoCreate())
1255        throw new Error("Attempt to auto-create Goal.priority");
1256      else if (Configuration.doAutoCreate())
1257        this.priority = new CodeableConcept(); // cc
1258    return this.priority;
1259  }
1260
1261  public boolean hasPriority() {
1262    return this.priority != null && !this.priority.isEmpty();
1263  }
1264
1265  /**
1266   * @param value {@link #priority} (Identifies the mutually agreed level of
1267   *              importance associated with reaching/sustaining the goal.)
1268   */
1269  public Goal setPriority(CodeableConcept value) {
1270    this.priority = value;
1271    return this;
1272  }
1273
1274  /**
1275   * @return {@link #description} (Human-readable and/or coded description of a
1276   *         specific desired objective of care, such as "control blood pressure"
1277   *         or "negotiate an obstacle course" or "dance with child at wedding".)
1278   */
1279  public CodeableConcept getDescription() {
1280    if (this.description == null)
1281      if (Configuration.errorOnAutoCreate())
1282        throw new Error("Attempt to auto-create Goal.description");
1283      else if (Configuration.doAutoCreate())
1284        this.description = new CodeableConcept(); // cc
1285    return this.description;
1286  }
1287
1288  public boolean hasDescription() {
1289    return this.description != null && !this.description.isEmpty();
1290  }
1291
1292  /**
1293   * @param value {@link #description} (Human-readable and/or coded description of
1294   *              a specific desired objective of care, such as "control blood
1295   *              pressure" or "negotiate an obstacle course" or "dance with child
1296   *              at wedding".)
1297   */
1298  public Goal setDescription(CodeableConcept value) {
1299    this.description = value;
1300    return this;
1301  }
1302
1303  /**
1304   * @return {@link #subject} (Identifies the patient, group or organization for
1305   *         whom the goal is being established.)
1306   */
1307  public Reference getSubject() {
1308    if (this.subject == null)
1309      if (Configuration.errorOnAutoCreate())
1310        throw new Error("Attempt to auto-create Goal.subject");
1311      else if (Configuration.doAutoCreate())
1312        this.subject = new Reference(); // cc
1313    return this.subject;
1314  }
1315
1316  public boolean hasSubject() {
1317    return this.subject != null && !this.subject.isEmpty();
1318  }
1319
1320  /**
1321   * @param value {@link #subject} (Identifies the patient, group or organization
1322   *              for whom the goal is being established.)
1323   */
1324  public Goal setSubject(Reference value) {
1325    this.subject = value;
1326    return this;
1327  }
1328
1329  /**
1330   * @return {@link #subject} The actual object that is the target of the
1331   *         reference. The reference library doesn't populate this, but you can
1332   *         use it to hold the resource if you resolve it. (Identifies the
1333   *         patient, group or organization for whom the goal is being
1334   *         established.)
1335   */
1336  public Resource getSubjectTarget() {
1337    return this.subjectTarget;
1338  }
1339
1340  /**
1341   * @param value {@link #subject} The actual object that is the target of the
1342   *              reference. The reference library doesn't use these, but you can
1343   *              use it to hold the resource if you resolve it. (Identifies the
1344   *              patient, group or organization for whom the goal is being
1345   *              established.)
1346   */
1347  public Goal setSubjectTarget(Resource value) {
1348    this.subjectTarget = value;
1349    return this;
1350  }
1351
1352  /**
1353   * @return {@link #start} (The date or event after which the goal should begin
1354   *         being pursued.)
1355   */
1356  public Type getStart() {
1357    return this.start;
1358  }
1359
1360  /**
1361   * @return {@link #start} (The date or event after which the goal should begin
1362   *         being pursued.)
1363   */
1364  public DateType getStartDateType() throws FHIRException {
1365    if (this.start == null)
1366      this.start = new DateType();
1367    if (!(this.start instanceof DateType))
1368      throw new FHIRException(
1369          "Type mismatch: the type DateType was expected, but " + this.start.getClass().getName() + " was encountered");
1370    return (DateType) this.start;
1371  }
1372
1373  public boolean hasStartDateType() {
1374    return this != null && this.start instanceof DateType;
1375  }
1376
1377  /**
1378   * @return {@link #start} (The date or event after which the goal should begin
1379   *         being pursued.)
1380   */
1381  public CodeableConcept getStartCodeableConcept() throws FHIRException {
1382    if (this.start == null)
1383      this.start = new CodeableConcept();
1384    if (!(this.start instanceof CodeableConcept))
1385      throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "
1386          + this.start.getClass().getName() + " was encountered");
1387    return (CodeableConcept) this.start;
1388  }
1389
1390  public boolean hasStartCodeableConcept() {
1391    return this != null && this.start instanceof CodeableConcept;
1392  }
1393
1394  public boolean hasStart() {
1395    return this.start != null && !this.start.isEmpty();
1396  }
1397
1398  /**
1399   * @param value {@link #start} (The date or event after which the goal should
1400   *              begin being pursued.)
1401   */
1402  public Goal setStart(Type value) {
1403    if (value != null && !(value instanceof DateType || value instanceof CodeableConcept))
1404      throw new Error("Not the right type for Goal.start[x]: " + value.fhirType());
1405    this.start = value;
1406    return this;
1407  }
1408
1409  /**
1410   * @return {@link #target} (Indicates what should be done by when.)
1411   */
1412  public List<GoalTargetComponent> getTarget() {
1413    if (this.target == null)
1414      this.target = new ArrayList<GoalTargetComponent>();
1415    return this.target;
1416  }
1417
1418  /**
1419   * @return Returns a reference to <code>this</code> for easy method chaining
1420   */
1421  public Goal setTarget(List<GoalTargetComponent> theTarget) {
1422    this.target = theTarget;
1423    return this;
1424  }
1425
1426  public boolean hasTarget() {
1427    if (this.target == null)
1428      return false;
1429    for (GoalTargetComponent item : this.target)
1430      if (!item.isEmpty())
1431        return true;
1432    return false;
1433  }
1434
1435  public GoalTargetComponent addTarget() { // 3
1436    GoalTargetComponent t = new GoalTargetComponent();
1437    if (this.target == null)
1438      this.target = new ArrayList<GoalTargetComponent>();
1439    this.target.add(t);
1440    return t;
1441  }
1442
1443  public Goal addTarget(GoalTargetComponent t) { // 3
1444    if (t == null)
1445      return this;
1446    if (this.target == null)
1447      this.target = new ArrayList<GoalTargetComponent>();
1448    this.target.add(t);
1449    return this;
1450  }
1451
1452  /**
1453   * @return The first repetition of repeating field {@link #target}, creating it
1454   *         if it does not already exist
1455   */
1456  public GoalTargetComponent getTargetFirstRep() {
1457    if (getTarget().isEmpty()) {
1458      addTarget();
1459    }
1460    return getTarget().get(0);
1461  }
1462
1463  /**
1464   * @return {@link #statusDate} (Identifies when the current status. I.e. When
1465   *         initially created, when achieved, when cancelled, etc.). This is the
1466   *         underlying object with id, value and extensions. The accessor
1467   *         "getStatusDate" gives direct access to the value
1468   */
1469  public DateType getStatusDateElement() {
1470    if (this.statusDate == null)
1471      if (Configuration.errorOnAutoCreate())
1472        throw new Error("Attempt to auto-create Goal.statusDate");
1473      else if (Configuration.doAutoCreate())
1474        this.statusDate = new DateType(); // bb
1475    return this.statusDate;
1476  }
1477
1478  public boolean hasStatusDateElement() {
1479    return this.statusDate != null && !this.statusDate.isEmpty();
1480  }
1481
1482  public boolean hasStatusDate() {
1483    return this.statusDate != null && !this.statusDate.isEmpty();
1484  }
1485
1486  /**
1487   * @param value {@link #statusDate} (Identifies when the current status. I.e.
1488   *              When initially created, when achieved, when cancelled, etc.).
1489   *              This is the underlying object with id, value and extensions. The
1490   *              accessor "getStatusDate" gives direct access to the value
1491   */
1492  public Goal setStatusDateElement(DateType value) {
1493    this.statusDate = value;
1494    return this;
1495  }
1496
1497  /**
1498   * @return Identifies when the current status. I.e. When initially created, when
1499   *         achieved, when cancelled, etc.
1500   */
1501  public Date getStatusDate() {
1502    return this.statusDate == null ? null : this.statusDate.getValue();
1503  }
1504
1505  /**
1506   * @param value Identifies when the current status. I.e. When initially created,
1507   *              when achieved, when cancelled, etc.
1508   */
1509  public Goal setStatusDate(Date value) {
1510    if (value == null)
1511      this.statusDate = null;
1512    else {
1513      if (this.statusDate == null)
1514        this.statusDate = new DateType();
1515      this.statusDate.setValue(value);
1516    }
1517    return this;
1518  }
1519
1520  /**
1521   * @return {@link #statusReason} (Captures the reason for the current status.).
1522   *         This is the underlying object with id, value and extensions. The
1523   *         accessor "getStatusReason" gives direct access to the value
1524   */
1525  public StringType getStatusReasonElement() {
1526    if (this.statusReason == null)
1527      if (Configuration.errorOnAutoCreate())
1528        throw new Error("Attempt to auto-create Goal.statusReason");
1529      else if (Configuration.doAutoCreate())
1530        this.statusReason = new StringType(); // bb
1531    return this.statusReason;
1532  }
1533
1534  public boolean hasStatusReasonElement() {
1535    return this.statusReason != null && !this.statusReason.isEmpty();
1536  }
1537
1538  public boolean hasStatusReason() {
1539    return this.statusReason != null && !this.statusReason.isEmpty();
1540  }
1541
1542  /**
1543   * @param value {@link #statusReason} (Captures the reason for the current
1544   *              status.). This is the underlying object with id, value and
1545   *              extensions. The accessor "getStatusReason" gives direct access
1546   *              to the value
1547   */
1548  public Goal setStatusReasonElement(StringType value) {
1549    this.statusReason = value;
1550    return this;
1551  }
1552
1553  /**
1554   * @return Captures the reason for the current status.
1555   */
1556  public String getStatusReason() {
1557    return this.statusReason == null ? null : this.statusReason.getValue();
1558  }
1559
1560  /**
1561   * @param value Captures the reason for the current status.
1562   */
1563  public Goal setStatusReason(String value) {
1564    if (Utilities.noString(value))
1565      this.statusReason = null;
1566    else {
1567      if (this.statusReason == null)
1568        this.statusReason = new StringType();
1569      this.statusReason.setValue(value);
1570    }
1571    return this;
1572  }
1573
1574  /**
1575   * @return {@link #expressedBy} (Indicates whose goal this is - patient goal,
1576   *         practitioner goal, etc.)
1577   */
1578  public Reference getExpressedBy() {
1579    if (this.expressedBy == null)
1580      if (Configuration.errorOnAutoCreate())
1581        throw new Error("Attempt to auto-create Goal.expressedBy");
1582      else if (Configuration.doAutoCreate())
1583        this.expressedBy = new Reference(); // cc
1584    return this.expressedBy;
1585  }
1586
1587  public boolean hasExpressedBy() {
1588    return this.expressedBy != null && !this.expressedBy.isEmpty();
1589  }
1590
1591  /**
1592   * @param value {@link #expressedBy} (Indicates whose goal this is - patient
1593   *              goal, practitioner goal, etc.)
1594   */
1595  public Goal setExpressedBy(Reference value) {
1596    this.expressedBy = value;
1597    return this;
1598  }
1599
1600  /**
1601   * @return {@link #expressedBy} The actual object that is the target of the
1602   *         reference. The reference library doesn't populate this, but you can
1603   *         use it to hold the resource if you resolve it. (Indicates whose goal
1604   *         this is - patient goal, practitioner goal, etc.)
1605   */
1606  public Resource getExpressedByTarget() {
1607    return this.expressedByTarget;
1608  }
1609
1610  /**
1611   * @param value {@link #expressedBy} The actual object that is the target of the
1612   *              reference. The reference library doesn't use these, but you can
1613   *              use it to hold the resource if you resolve it. (Indicates whose
1614   *              goal this is - patient goal, practitioner goal, etc.)
1615   */
1616  public Goal setExpressedByTarget(Resource value) {
1617    this.expressedByTarget = value;
1618    return this;
1619  }
1620
1621  /**
1622   * @return {@link #addresses} (The identified conditions and other health record
1623   *         elements that are intended to be addressed by the goal.)
1624   */
1625  public List<Reference> getAddresses() {
1626    if (this.addresses == null)
1627      this.addresses = new ArrayList<Reference>();
1628    return this.addresses;
1629  }
1630
1631  /**
1632   * @return Returns a reference to <code>this</code> for easy method chaining
1633   */
1634  public Goal setAddresses(List<Reference> theAddresses) {
1635    this.addresses = theAddresses;
1636    return this;
1637  }
1638
1639  public boolean hasAddresses() {
1640    if (this.addresses == null)
1641      return false;
1642    for (Reference item : this.addresses)
1643      if (!item.isEmpty())
1644        return true;
1645    return false;
1646  }
1647
1648  public Reference addAddresses() { // 3
1649    Reference t = new Reference();
1650    if (this.addresses == null)
1651      this.addresses = new ArrayList<Reference>();
1652    this.addresses.add(t);
1653    return t;
1654  }
1655
1656  public Goal addAddresses(Reference t) { // 3
1657    if (t == null)
1658      return this;
1659    if (this.addresses == null)
1660      this.addresses = new ArrayList<Reference>();
1661    this.addresses.add(t);
1662    return this;
1663  }
1664
1665  /**
1666   * @return The first repetition of repeating field {@link #addresses}, creating
1667   *         it if it does not already exist
1668   */
1669  public Reference getAddressesFirstRep() {
1670    if (getAddresses().isEmpty()) {
1671      addAddresses();
1672    }
1673    return getAddresses().get(0);
1674  }
1675
1676  /**
1677   * @deprecated Use Reference#setResource(IBaseResource) instead
1678   */
1679  @Deprecated
1680  public List<Resource> getAddressesTarget() {
1681    if (this.addressesTarget == null)
1682      this.addressesTarget = new ArrayList<Resource>();
1683    return this.addressesTarget;
1684  }
1685
1686  /**
1687   * @return {@link #note} (Any comments related to the goal.)
1688   */
1689  public List<Annotation> getNote() {
1690    if (this.note == null)
1691      this.note = new ArrayList<Annotation>();
1692    return this.note;
1693  }
1694
1695  /**
1696   * @return Returns a reference to <code>this</code> for easy method chaining
1697   */
1698  public Goal setNote(List<Annotation> theNote) {
1699    this.note = theNote;
1700    return this;
1701  }
1702
1703  public boolean hasNote() {
1704    if (this.note == null)
1705      return false;
1706    for (Annotation item : this.note)
1707      if (!item.isEmpty())
1708        return true;
1709    return false;
1710  }
1711
1712  public Annotation addNote() { // 3
1713    Annotation t = new Annotation();
1714    if (this.note == null)
1715      this.note = new ArrayList<Annotation>();
1716    this.note.add(t);
1717    return t;
1718  }
1719
1720  public Goal addNote(Annotation t) { // 3
1721    if (t == null)
1722      return this;
1723    if (this.note == null)
1724      this.note = new ArrayList<Annotation>();
1725    this.note.add(t);
1726    return this;
1727  }
1728
1729  /**
1730   * @return The first repetition of repeating field {@link #note}, creating it if
1731   *         it does not already exist
1732   */
1733  public Annotation getNoteFirstRep() {
1734    if (getNote().isEmpty()) {
1735      addNote();
1736    }
1737    return getNote().get(0);
1738  }
1739
1740  /**
1741   * @return {@link #outcomeCode} (Identifies the change (or lack of change) at
1742   *         the point when the status of the goal is assessed.)
1743   */
1744  public List<CodeableConcept> getOutcomeCode() {
1745    if (this.outcomeCode == null)
1746      this.outcomeCode = new ArrayList<CodeableConcept>();
1747    return this.outcomeCode;
1748  }
1749
1750  /**
1751   * @return Returns a reference to <code>this</code> for easy method chaining
1752   */
1753  public Goal setOutcomeCode(List<CodeableConcept> theOutcomeCode) {
1754    this.outcomeCode = theOutcomeCode;
1755    return this;
1756  }
1757
1758  public boolean hasOutcomeCode() {
1759    if (this.outcomeCode == null)
1760      return false;
1761    for (CodeableConcept item : this.outcomeCode)
1762      if (!item.isEmpty())
1763        return true;
1764    return false;
1765  }
1766
1767  public CodeableConcept addOutcomeCode() { // 3
1768    CodeableConcept t = new CodeableConcept();
1769    if (this.outcomeCode == null)
1770      this.outcomeCode = new ArrayList<CodeableConcept>();
1771    this.outcomeCode.add(t);
1772    return t;
1773  }
1774
1775  public Goal addOutcomeCode(CodeableConcept t) { // 3
1776    if (t == null)
1777      return this;
1778    if (this.outcomeCode == null)
1779      this.outcomeCode = new ArrayList<CodeableConcept>();
1780    this.outcomeCode.add(t);
1781    return this;
1782  }
1783
1784  /**
1785   * @return The first repetition of repeating field {@link #outcomeCode},
1786   *         creating it if it does not already exist
1787   */
1788  public CodeableConcept getOutcomeCodeFirstRep() {
1789    if (getOutcomeCode().isEmpty()) {
1790      addOutcomeCode();
1791    }
1792    return getOutcomeCode().get(0);
1793  }
1794
1795  /**
1796   * @return {@link #outcomeReference} (Details of what's changed (or not
1797   *         changed).)
1798   */
1799  public List<Reference> getOutcomeReference() {
1800    if (this.outcomeReference == null)
1801      this.outcomeReference = new ArrayList<Reference>();
1802    return this.outcomeReference;
1803  }
1804
1805  /**
1806   * @return Returns a reference to <code>this</code> for easy method chaining
1807   */
1808  public Goal setOutcomeReference(List<Reference> theOutcomeReference) {
1809    this.outcomeReference = theOutcomeReference;
1810    return this;
1811  }
1812
1813  public boolean hasOutcomeReference() {
1814    if (this.outcomeReference == null)
1815      return false;
1816    for (Reference item : this.outcomeReference)
1817      if (!item.isEmpty())
1818        return true;
1819    return false;
1820  }
1821
1822  public Reference addOutcomeReference() { // 3
1823    Reference t = new Reference();
1824    if (this.outcomeReference == null)
1825      this.outcomeReference = new ArrayList<Reference>();
1826    this.outcomeReference.add(t);
1827    return t;
1828  }
1829
1830  public Goal addOutcomeReference(Reference t) { // 3
1831    if (t == null)
1832      return this;
1833    if (this.outcomeReference == null)
1834      this.outcomeReference = new ArrayList<Reference>();
1835    this.outcomeReference.add(t);
1836    return this;
1837  }
1838
1839  /**
1840   * @return The first repetition of repeating field {@link #outcomeReference},
1841   *         creating it if it does not already exist
1842   */
1843  public Reference getOutcomeReferenceFirstRep() {
1844    if (getOutcomeReference().isEmpty()) {
1845      addOutcomeReference();
1846    }
1847    return getOutcomeReference().get(0);
1848  }
1849
1850  /**
1851   * @deprecated Use Reference#setResource(IBaseResource) instead
1852   */
1853  @Deprecated
1854  public List<Observation> getOutcomeReferenceTarget() {
1855    if (this.outcomeReferenceTarget == null)
1856      this.outcomeReferenceTarget = new ArrayList<Observation>();
1857    return this.outcomeReferenceTarget;
1858  }
1859
1860  /**
1861   * @deprecated Use Reference#setResource(IBaseResource) instead
1862   */
1863  @Deprecated
1864  public Observation addOutcomeReferenceTarget() {
1865    Observation r = new Observation();
1866    if (this.outcomeReferenceTarget == null)
1867      this.outcomeReferenceTarget = new ArrayList<Observation>();
1868    this.outcomeReferenceTarget.add(r);
1869    return r;
1870  }
1871
1872  protected void listChildren(List<Property> children) {
1873    super.listChildren(children);
1874    children.add(new Property("identifier", "Identifier",
1875        "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.",
1876        0, java.lang.Integer.MAX_VALUE, identifier));
1877    children.add(new Property("lifecycleStatus", "code", "The state of the goal throughout its lifecycle.", 0, 1,
1878        lifecycleStatus));
1879    children.add(new Property("achievementStatus", "CodeableConcept",
1880        "Describes the progression, or lack thereof, towards the goal against the target.", 0, 1, achievementStatus));
1881    children.add(new Property("category", "CodeableConcept", "Indicates a category the goal falls within.", 0,
1882        java.lang.Integer.MAX_VALUE, category));
1883    children.add(new Property("priority", "CodeableConcept",
1884        "Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.", 0, 1,
1885        priority));
1886    children.add(new Property("description", "CodeableConcept",
1887        "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\".",
1888        0, 1, description));
1889    children.add(new Property("subject", "Reference(Patient|Group|Organization)",
1890        "Identifies the patient, group or organization for whom the goal is being established.", 0, 1, subject));
1891    children.add(new Property("start[x]", "date|CodeableConcept",
1892        "The date or event after which the goal should begin being pursued.", 0, 1, start));
1893    children.add(
1894        new Property("target", "", "Indicates what should be done by when.", 0, java.lang.Integer.MAX_VALUE, target));
1895    children.add(new Property("statusDate", "date",
1896        "Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc.", 0, 1,
1897        statusDate));
1898    children
1899        .add(new Property("statusReason", "string", "Captures the reason for the current status.", 0, 1, statusReason));
1900    children.add(new Property("expressedBy", "Reference(Patient|Practitioner|PractitionerRole|RelatedPerson)",
1901        "Indicates whose goal this is - patient goal, practitioner goal, etc.", 0, 1, expressedBy));
1902    children.add(new Property("addresses",
1903        "Reference(Condition|Observation|MedicationStatement|NutritionOrder|ServiceRequest|RiskAssessment)",
1904        "The identified conditions and other health record elements that are intended to be addressed by the goal.", 0,
1905        java.lang.Integer.MAX_VALUE, addresses));
1906    children.add(
1907        new Property("note", "Annotation", "Any comments related to the goal.", 0, java.lang.Integer.MAX_VALUE, note));
1908    children.add(new Property("outcomeCode", "CodeableConcept",
1909        "Identifies the change (or lack of change) at the point when the status of the goal is assessed.", 0,
1910        java.lang.Integer.MAX_VALUE, outcomeCode));
1911    children.add(new Property("outcomeReference", "Reference(Observation)",
1912        "Details of what's changed (or not changed).", 0, java.lang.Integer.MAX_VALUE, outcomeReference));
1913  }
1914
1915  @Override
1916  public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1917    switch (_hash) {
1918    case -1618432855:
1919      /* identifier */ return new Property("identifier", "Identifier",
1920          "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.",
1921          0, java.lang.Integer.MAX_VALUE, identifier);
1922    case 1165552636:
1923      /* lifecycleStatus */ return new Property("lifecycleStatus", "code",
1924          "The state of the goal throughout its lifecycle.", 0, 1, lifecycleStatus);
1925    case 104524801:
1926      /* achievementStatus */ return new Property("achievementStatus", "CodeableConcept",
1927          "Describes the progression, or lack thereof, towards the goal against the target.", 0, 1, achievementStatus);
1928    case 50511102:
1929      /* category */ return new Property("category", "CodeableConcept", "Indicates a category the goal falls within.",
1930          0, java.lang.Integer.MAX_VALUE, category);
1931    case -1165461084:
1932      /* priority */ return new Property("priority", "CodeableConcept",
1933          "Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.", 0, 1,
1934          priority);
1935    case -1724546052:
1936      /* description */ return new Property("description", "CodeableConcept",
1937          "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\".",
1938          0, 1, description);
1939    case -1867885268:
1940      /* subject */ return new Property("subject", "Reference(Patient|Group|Organization)",
1941          "Identifies the patient, group or organization for whom the goal is being established.", 0, 1, subject);
1942    case 1316793566:
1943      /* start[x] */ return new Property("start[x]", "date|CodeableConcept",
1944          "The date or event after which the goal should begin being pursued.", 0, 1, start);
1945    case 109757538:
1946      /* start */ return new Property("start[x]", "date|CodeableConcept",
1947          "The date or event after which the goal should begin being pursued.", 0, 1, start);
1948    case -2129778896:
1949      /* startDate */ return new Property("start[x]", "date|CodeableConcept",
1950          "The date or event after which the goal should begin being pursued.", 0, 1, start);
1951    case -1758833953:
1952      /* startCodeableConcept */ return new Property("start[x]", "date|CodeableConcept",
1953          "The date or event after which the goal should begin being pursued.", 0, 1, start);
1954    case -880905839:
1955      /* target */ return new Property("target", "", "Indicates what should be done by when.", 0,
1956          java.lang.Integer.MAX_VALUE, target);
1957    case 247524032:
1958      /* statusDate */ return new Property("statusDate", "date",
1959          "Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc.", 0, 1,
1960          statusDate);
1961    case 2051346646:
1962      /* statusReason */ return new Property("statusReason", "string", "Captures the reason for the current status.", 0,
1963          1, statusReason);
1964    case 175423686:
1965      /* expressedBy */ return new Property("expressedBy",
1966          "Reference(Patient|Practitioner|PractitionerRole|RelatedPerson)",
1967          "Indicates whose goal this is - patient goal, practitioner goal, etc.", 0, 1, expressedBy);
1968    case 874544034:
1969      /* addresses */ return new Property("addresses",
1970          "Reference(Condition|Observation|MedicationStatement|NutritionOrder|ServiceRequest|RiskAssessment)",
1971          "The identified conditions and other health record elements that are intended to be addressed by the goal.",
1972          0, java.lang.Integer.MAX_VALUE, addresses);
1973    case 3387378:
1974      /* note */ return new Property("note", "Annotation", "Any comments related to the goal.", 0,
1975          java.lang.Integer.MAX_VALUE, note);
1976    case 1062482015:
1977      /* outcomeCode */ return new Property("outcomeCode", "CodeableConcept",
1978          "Identifies the change (or lack of change) at the point when the status of the goal is assessed.", 0,
1979          java.lang.Integer.MAX_VALUE, outcomeCode);
1980    case -782273511:
1981      /* outcomeReference */ return new Property("outcomeReference", "Reference(Observation)",
1982          "Details of what's changed (or not changed).", 0, java.lang.Integer.MAX_VALUE, outcomeReference);
1983    default:
1984      return super.getNamedProperty(_hash, _name, _checkValid);
1985    }
1986
1987  }
1988
1989  @Override
1990  public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1991    switch (hash) {
1992    case -1618432855:
1993      /* identifier */ return this.identifier == null ? new Base[0]
1994          : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1995    case 1165552636:
1996      /* lifecycleStatus */ return this.lifecycleStatus == null ? new Base[0] : new Base[] { this.lifecycleStatus }; // Enumeration<GoalLifecycleStatus>
1997    case 104524801:
1998      /* achievementStatus */ return this.achievementStatus == null ? new Base[0]
1999          : new Base[] { this.achievementStatus }; // CodeableConcept
2000    case 50511102:
2001      /* category */ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
2002    case -1165461084:
2003      /* priority */ return this.priority == null ? new Base[0] : new Base[] { this.priority }; // CodeableConcept
2004    case -1724546052:
2005      /* description */ return this.description == null ? new Base[0] : new Base[] { this.description }; // CodeableConcept
2006    case -1867885268:
2007      /* subject */ return this.subject == null ? new Base[0] : new Base[] { this.subject }; // Reference
2008    case 109757538:
2009      /* start */ return this.start == null ? new Base[0] : new Base[] { this.start }; // Type
2010    case -880905839:
2011      /* target */ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // GoalTargetComponent
2012    case 247524032:
2013      /* statusDate */ return this.statusDate == null ? new Base[0] : new Base[] { this.statusDate }; // DateType
2014    case 2051346646:
2015      /* statusReason */ return this.statusReason == null ? new Base[0] : new Base[] { this.statusReason }; // StringType
2016    case 175423686:
2017      /* expressedBy */ return this.expressedBy == null ? new Base[0] : new Base[] { this.expressedBy }; // Reference
2018    case 874544034:
2019      /* addresses */ return this.addresses == null ? new Base[0]
2020          : this.addresses.toArray(new Base[this.addresses.size()]); // Reference
2021    case 3387378:
2022      /* note */ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
2023    case 1062482015:
2024      /* outcomeCode */ return this.outcomeCode == null ? new Base[0]
2025          : this.outcomeCode.toArray(new Base[this.outcomeCode.size()]); // CodeableConcept
2026    case -782273511:
2027      /* outcomeReference */ return this.outcomeReference == null ? new Base[0]
2028          : this.outcomeReference.toArray(new Base[this.outcomeReference.size()]); // Reference
2029    default:
2030      return super.getProperty(hash, name, checkValid);
2031    }
2032
2033  }
2034
2035  @Override
2036  public Base setProperty(int hash, String name, Base value) throws FHIRException {
2037    switch (hash) {
2038    case -1618432855: // identifier
2039      this.getIdentifier().add(castToIdentifier(value)); // Identifier
2040      return value;
2041    case 1165552636: // lifecycleStatus
2042      value = new GoalLifecycleStatusEnumFactory().fromType(castToCode(value));
2043      this.lifecycleStatus = (Enumeration) value; // Enumeration<GoalLifecycleStatus>
2044      return value;
2045    case 104524801: // achievementStatus
2046      this.achievementStatus = castToCodeableConcept(value); // CodeableConcept
2047      return value;
2048    case 50511102: // category
2049      this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept
2050      return value;
2051    case -1165461084: // priority
2052      this.priority = castToCodeableConcept(value); // CodeableConcept
2053      return value;
2054    case -1724546052: // description
2055      this.description = castToCodeableConcept(value); // CodeableConcept
2056      return value;
2057    case -1867885268: // subject
2058      this.subject = castToReference(value); // Reference
2059      return value;
2060    case 109757538: // start
2061      this.start = castToType(value); // Type
2062      return value;
2063    case -880905839: // target
2064      this.getTarget().add((GoalTargetComponent) value); // GoalTargetComponent
2065      return value;
2066    case 247524032: // statusDate
2067      this.statusDate = castToDate(value); // DateType
2068      return value;
2069    case 2051346646: // statusReason
2070      this.statusReason = castToString(value); // StringType
2071      return value;
2072    case 175423686: // expressedBy
2073      this.expressedBy = castToReference(value); // Reference
2074      return value;
2075    case 874544034: // addresses
2076      this.getAddresses().add(castToReference(value)); // Reference
2077      return value;
2078    case 3387378: // note
2079      this.getNote().add(castToAnnotation(value)); // Annotation
2080      return value;
2081    case 1062482015: // outcomeCode
2082      this.getOutcomeCode().add(castToCodeableConcept(value)); // CodeableConcept
2083      return value;
2084    case -782273511: // outcomeReference
2085      this.getOutcomeReference().add(castToReference(value)); // Reference
2086      return value;
2087    default:
2088      return super.setProperty(hash, name, value);
2089    }
2090
2091  }
2092
2093  @Override
2094  public Base setProperty(String name, Base value) throws FHIRException {
2095    if (name.equals("identifier")) {
2096      this.getIdentifier().add(castToIdentifier(value));
2097    } else if (name.equals("lifecycleStatus")) {
2098      value = new GoalLifecycleStatusEnumFactory().fromType(castToCode(value));
2099      this.lifecycleStatus = (Enumeration) value; // Enumeration<GoalLifecycleStatus>
2100    } else if (name.equals("achievementStatus")) {
2101      this.achievementStatus = castToCodeableConcept(value); // CodeableConcept
2102    } else if (name.equals("category")) {
2103      this.getCategory().add(castToCodeableConcept(value));
2104    } else if (name.equals("priority")) {
2105      this.priority = castToCodeableConcept(value); // CodeableConcept
2106    } else if (name.equals("description")) {
2107      this.description = castToCodeableConcept(value); // CodeableConcept
2108    } else if (name.equals("subject")) {
2109      this.subject = castToReference(value); // Reference
2110    } else if (name.equals("start[x]")) {
2111      this.start = castToType(value); // Type
2112    } else if (name.equals("target")) {
2113      this.getTarget().add((GoalTargetComponent) value);
2114    } else if (name.equals("statusDate")) {
2115      this.statusDate = castToDate(value); // DateType
2116    } else if (name.equals("statusReason")) {
2117      this.statusReason = castToString(value); // StringType
2118    } else if (name.equals("expressedBy")) {
2119      this.expressedBy = castToReference(value); // Reference
2120    } else if (name.equals("addresses")) {
2121      this.getAddresses().add(castToReference(value));
2122    } else if (name.equals("note")) {
2123      this.getNote().add(castToAnnotation(value));
2124    } else if (name.equals("outcomeCode")) {
2125      this.getOutcomeCode().add(castToCodeableConcept(value));
2126    } else if (name.equals("outcomeReference")) {
2127      this.getOutcomeReference().add(castToReference(value));
2128    } else
2129      return super.setProperty(name, value);
2130    return value;
2131  }
2132
2133  @Override
2134  public Base makeProperty(int hash, String name) throws FHIRException {
2135    switch (hash) {
2136    case -1618432855:
2137      return addIdentifier();
2138    case 1165552636:
2139      return getLifecycleStatusElement();
2140    case 104524801:
2141      return getAchievementStatus();
2142    case 50511102:
2143      return addCategory();
2144    case -1165461084:
2145      return getPriority();
2146    case -1724546052:
2147      return getDescription();
2148    case -1867885268:
2149      return getSubject();
2150    case 1316793566:
2151      return getStart();
2152    case 109757538:
2153      return getStart();
2154    case -880905839:
2155      return addTarget();
2156    case 247524032:
2157      return getStatusDateElement();
2158    case 2051346646:
2159      return getStatusReasonElement();
2160    case 175423686:
2161      return getExpressedBy();
2162    case 874544034:
2163      return addAddresses();
2164    case 3387378:
2165      return addNote();
2166    case 1062482015:
2167      return addOutcomeCode();
2168    case -782273511:
2169      return addOutcomeReference();
2170    default:
2171      return super.makeProperty(hash, name);
2172    }
2173
2174  }
2175
2176  @Override
2177  public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2178    switch (hash) {
2179    case -1618432855:
2180      /* identifier */ return new String[] { "Identifier" };
2181    case 1165552636:
2182      /* lifecycleStatus */ return new String[] { "code" };
2183    case 104524801:
2184      /* achievementStatus */ return new String[] { "CodeableConcept" };
2185    case 50511102:
2186      /* category */ return new String[] { "CodeableConcept" };
2187    case -1165461084:
2188      /* priority */ return new String[] { "CodeableConcept" };
2189    case -1724546052:
2190      /* description */ return new String[] { "CodeableConcept" };
2191    case -1867885268:
2192      /* subject */ return new String[] { "Reference" };
2193    case 109757538:
2194      /* start */ return new String[] { "date", "CodeableConcept" };
2195    case -880905839:
2196      /* target */ return new String[] {};
2197    case 247524032:
2198      /* statusDate */ return new String[] { "date" };
2199    case 2051346646:
2200      /* statusReason */ return new String[] { "string" };
2201    case 175423686:
2202      /* expressedBy */ return new String[] { "Reference" };
2203    case 874544034:
2204      /* addresses */ return new String[] { "Reference" };
2205    case 3387378:
2206      /* note */ return new String[] { "Annotation" };
2207    case 1062482015:
2208      /* outcomeCode */ return new String[] { "CodeableConcept" };
2209    case -782273511:
2210      /* outcomeReference */ return new String[] { "Reference" };
2211    default:
2212      return super.getTypesForProperty(hash, name);
2213    }
2214
2215  }
2216
2217  @Override
2218  public Base addChild(String name) throws FHIRException {
2219    if (name.equals("identifier")) {
2220      return addIdentifier();
2221    } else if (name.equals("lifecycleStatus")) {
2222      throw new FHIRException("Cannot call addChild on a singleton property Goal.lifecycleStatus");
2223    } else if (name.equals("achievementStatus")) {
2224      this.achievementStatus = new CodeableConcept();
2225      return this.achievementStatus;
2226    } else if (name.equals("category")) {
2227      return addCategory();
2228    } else if (name.equals("priority")) {
2229      this.priority = new CodeableConcept();
2230      return this.priority;
2231    } else if (name.equals("description")) {
2232      this.description = new CodeableConcept();
2233      return this.description;
2234    } else if (name.equals("subject")) {
2235      this.subject = new Reference();
2236      return this.subject;
2237    } else if (name.equals("startDate")) {
2238      this.start = new DateType();
2239      return this.start;
2240    } else if (name.equals("startCodeableConcept")) {
2241      this.start = new CodeableConcept();
2242      return this.start;
2243    } else if (name.equals("target")) {
2244      return addTarget();
2245    } else if (name.equals("statusDate")) {
2246      throw new FHIRException("Cannot call addChild on a singleton property Goal.statusDate");
2247    } else if (name.equals("statusReason")) {
2248      throw new FHIRException("Cannot call addChild on a singleton property Goal.statusReason");
2249    } else if (name.equals("expressedBy")) {
2250      this.expressedBy = new Reference();
2251      return this.expressedBy;
2252    } else if (name.equals("addresses")) {
2253      return addAddresses();
2254    } else if (name.equals("note")) {
2255      return addNote();
2256    } else if (name.equals("outcomeCode")) {
2257      return addOutcomeCode();
2258    } else if (name.equals("outcomeReference")) {
2259      return addOutcomeReference();
2260    } else
2261      return super.addChild(name);
2262  }
2263
2264  public String fhirType() {
2265    return "Goal";
2266
2267  }
2268
2269  public Goal copy() {
2270    Goal dst = new Goal();
2271    copyValues(dst);
2272    return dst;
2273  }
2274
2275  public void copyValues(Goal dst) {
2276    super.copyValues(dst);
2277    if (identifier != null) {
2278      dst.identifier = new ArrayList<Identifier>();
2279      for (Identifier i : identifier)
2280        dst.identifier.add(i.copy());
2281    }
2282    ;
2283    dst.lifecycleStatus = lifecycleStatus == null ? null : lifecycleStatus.copy();
2284    dst.achievementStatus = achievementStatus == null ? null : achievementStatus.copy();
2285    if (category != null) {
2286      dst.category = new ArrayList<CodeableConcept>();
2287      for (CodeableConcept i : category)
2288        dst.category.add(i.copy());
2289    }
2290    ;
2291    dst.priority = priority == null ? null : priority.copy();
2292    dst.description = description == null ? null : description.copy();
2293    dst.subject = subject == null ? null : subject.copy();
2294    dst.start = start == null ? null : start.copy();
2295    if (target != null) {
2296      dst.target = new ArrayList<GoalTargetComponent>();
2297      for (GoalTargetComponent i : target)
2298        dst.target.add(i.copy());
2299    }
2300    ;
2301    dst.statusDate = statusDate == null ? null : statusDate.copy();
2302    dst.statusReason = statusReason == null ? null : statusReason.copy();
2303    dst.expressedBy = expressedBy == null ? null : expressedBy.copy();
2304    if (addresses != null) {
2305      dst.addresses = new ArrayList<Reference>();
2306      for (Reference i : addresses)
2307        dst.addresses.add(i.copy());
2308    }
2309    ;
2310    if (note != null) {
2311      dst.note = new ArrayList<Annotation>();
2312      for (Annotation i : note)
2313        dst.note.add(i.copy());
2314    }
2315    ;
2316    if (outcomeCode != null) {
2317      dst.outcomeCode = new ArrayList<CodeableConcept>();
2318      for (CodeableConcept i : outcomeCode)
2319        dst.outcomeCode.add(i.copy());
2320    }
2321    ;
2322    if (outcomeReference != null) {
2323      dst.outcomeReference = new ArrayList<Reference>();
2324      for (Reference i : outcomeReference)
2325        dst.outcomeReference.add(i.copy());
2326    }
2327    ;
2328  }
2329
2330  protected Goal typedCopy() {
2331    return copy();
2332  }
2333
2334  @Override
2335  public boolean equalsDeep(Base other_) {
2336    if (!super.equalsDeep(other_))
2337      return false;
2338    if (!(other_ instanceof Goal))
2339      return false;
2340    Goal o = (Goal) other_;
2341    return compareDeep(identifier, o.identifier, true) && compareDeep(lifecycleStatus, o.lifecycleStatus, true)
2342        && compareDeep(achievementStatus, o.achievementStatus, true) && compareDeep(category, o.category, true)
2343        && compareDeep(priority, o.priority, true) && compareDeep(description, o.description, true)
2344        && compareDeep(subject, o.subject, true) && compareDeep(start, o.start, true)
2345        && compareDeep(target, o.target, true) && compareDeep(statusDate, o.statusDate, true)
2346        && compareDeep(statusReason, o.statusReason, true) && compareDeep(expressedBy, o.expressedBy, true)
2347        && compareDeep(addresses, o.addresses, true) && compareDeep(note, o.note, true)
2348        && compareDeep(outcomeCode, o.outcomeCode, true) && compareDeep(outcomeReference, o.outcomeReference, true);
2349  }
2350
2351  @Override
2352  public boolean equalsShallow(Base other_) {
2353    if (!super.equalsShallow(other_))
2354      return false;
2355    if (!(other_ instanceof Goal))
2356      return false;
2357    Goal o = (Goal) other_;
2358    return compareValues(lifecycleStatus, o.lifecycleStatus, true) && compareValues(statusDate, o.statusDate, true)
2359        && compareValues(statusReason, o.statusReason, true);
2360  }
2361
2362  public boolean isEmpty() {
2363    return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, lifecycleStatus, achievementStatus,
2364        category, priority, description, subject, start, target, statusDate, statusReason, expressedBy, addresses, note,
2365        outcomeCode, outcomeReference);
2366  }
2367
2368  @Override
2369  public ResourceType getResourceType() {
2370    return ResourceType.Goal;
2371  }
2372
2373  /**
2374   * Search parameter: <b>identifier</b>
2375   * <p>
2376   * Description: <b>External Ids for this goal</b><br>
2377   * Type: <b>token</b><br>
2378   * Path: <b>Goal.identifier</b><br>
2379   * </p>
2380   */
2381  @SearchParamDefinition(name = "identifier", path = "Goal.identifier", description = "External Ids for this goal", type = "token")
2382  public static final String SP_IDENTIFIER = "identifier";
2383  /**
2384   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2385   * <p>
2386   * Description: <b>External Ids for this goal</b><br>
2387   * Type: <b>token</b><br>
2388   * Path: <b>Goal.identifier</b><br>
2389   * </p>
2390   */
2391  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2392      SP_IDENTIFIER);
2393
2394  /**
2395   * Search parameter: <b>lifecycle-status</b>
2396   * <p>
2397   * Description: <b>proposed | planned | accepted | active | on-hold | completed
2398   * | cancelled | entered-in-error | rejected</b><br>
2399   * Type: <b>token</b><br>
2400   * Path: <b>Goal.lifecycleStatus</b><br>
2401   * </p>
2402   */
2403  @SearchParamDefinition(name = "lifecycle-status", path = "Goal.lifecycleStatus", description = "proposed | planned | accepted | active | on-hold | completed | cancelled | entered-in-error | rejected", type = "token")
2404  public static final String SP_LIFECYCLE_STATUS = "lifecycle-status";
2405  /**
2406   * <b>Fluent Client</b> search parameter constant for <b>lifecycle-status</b>
2407   * <p>
2408   * Description: <b>proposed | planned | accepted | active | on-hold | completed
2409   * | cancelled | entered-in-error | rejected</b><br>
2410   * Type: <b>token</b><br>
2411   * Path: <b>Goal.lifecycleStatus</b><br>
2412   * </p>
2413   */
2414  public static final ca.uhn.fhir.rest.gclient.TokenClientParam LIFECYCLE_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2415      SP_LIFECYCLE_STATUS);
2416
2417  /**
2418   * Search parameter: <b>achievement-status</b>
2419   * <p>
2420   * Description: <b>in-progress | improving | worsening | no-change | achieved |
2421   * sustaining | not-achieved | no-progress | not-attainable</b><br>
2422   * Type: <b>token</b><br>
2423   * Path: <b>Goal.achievementStatus</b><br>
2424   * </p>
2425   */
2426  @SearchParamDefinition(name = "achievement-status", path = "Goal.achievementStatus", description = "in-progress | improving | worsening | no-change | achieved | sustaining | not-achieved | no-progress | not-attainable", type = "token")
2427  public static final String SP_ACHIEVEMENT_STATUS = "achievement-status";
2428  /**
2429   * <b>Fluent Client</b> search parameter constant for <b>achievement-status</b>
2430   * <p>
2431   * Description: <b>in-progress | improving | worsening | no-change | achieved |
2432   * sustaining | not-achieved | no-progress | not-attainable</b><br>
2433   * Type: <b>token</b><br>
2434   * Path: <b>Goal.achievementStatus</b><br>
2435   * </p>
2436   */
2437  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACHIEVEMENT_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2438      SP_ACHIEVEMENT_STATUS);
2439
2440  /**
2441   * Search parameter: <b>patient</b>
2442   * <p>
2443   * Description: <b>Who this goal is intended for</b><br>
2444   * Type: <b>reference</b><br>
2445   * Path: <b>Goal.subject</b><br>
2446   * </p>
2447   */
2448  @SearchParamDefinition(name = "patient", path = "Goal.subject.where(resolve() is Patient)", description = "Who this goal is intended for", type = "reference", providesMembershipIn = {
2449      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Patient") }, target = { Patient.class })
2450  public static final String SP_PATIENT = "patient";
2451  /**
2452   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2453   * <p>
2454   * Description: <b>Who this goal is intended for</b><br>
2455   * Type: <b>reference</b><br>
2456   * Path: <b>Goal.subject</b><br>
2457   * </p>
2458   */
2459  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2460      SP_PATIENT);
2461
2462  /**
2463   * Constant for fluent queries to be used to add include statements. Specifies
2464   * the path value of "<b>Goal:patient</b>".
2465   */
2466  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Goal:patient")
2467      .toLocked();
2468
2469  /**
2470   * Search parameter: <b>subject</b>
2471   * <p>
2472   * Description: <b>Who this goal is intended for</b><br>
2473   * Type: <b>reference</b><br>
2474   * Path: <b>Goal.subject</b><br>
2475   * </p>
2476   */
2477  @SearchParamDefinition(name = "subject", path = "Goal.subject", description = "Who this goal is intended for", type = "reference", target = {
2478      Group.class, Organization.class, Patient.class })
2479  public static final String SP_SUBJECT = "subject";
2480  /**
2481   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2482   * <p>
2483   * Description: <b>Who this goal is intended for</b><br>
2484   * Type: <b>reference</b><br>
2485   * Path: <b>Goal.subject</b><br>
2486   * </p>
2487   */
2488  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2489      SP_SUBJECT);
2490
2491  /**
2492   * Constant for fluent queries to be used to add include statements. Specifies
2493   * the path value of "<b>Goal:subject</b>".
2494   */
2495  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Goal:subject")
2496      .toLocked();
2497
2498  /**
2499   * Search parameter: <b>start-date</b>
2500   * <p>
2501   * Description: <b>When goal pursuit begins</b><br>
2502   * Type: <b>date</b><br>
2503   * Path: <b>Goal.startDate</b><br>
2504   * </p>
2505   */
2506  @SearchParamDefinition(name = "start-date", path = "(Goal.start as date)", description = "When goal pursuit begins", type = "date")
2507  public static final String SP_START_DATE = "start-date";
2508  /**
2509   * <b>Fluent Client</b> search parameter constant for <b>start-date</b>
2510   * <p>
2511   * Description: <b>When goal pursuit begins</b><br>
2512   * Type: <b>date</b><br>
2513   * Path: <b>Goal.startDate</b><br>
2514   * </p>
2515   */
2516  public static final ca.uhn.fhir.rest.gclient.DateClientParam START_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(
2517      SP_START_DATE);
2518
2519  /**
2520   * Search parameter: <b>category</b>
2521   * <p>
2522   * Description: <b>E.g. Treatment, dietary, behavioral, etc.</b><br>
2523   * Type: <b>token</b><br>
2524   * Path: <b>Goal.category</b><br>
2525   * </p>
2526   */
2527  @SearchParamDefinition(name = "category", path = "Goal.category", description = "E.g. Treatment, dietary, behavioral, etc.", type = "token")
2528  public static final String SP_CATEGORY = "category";
2529  /**
2530   * <b>Fluent Client</b> search parameter constant for <b>category</b>
2531   * <p>
2532   * Description: <b>E.g. Treatment, dietary, behavioral, etc.</b><br>
2533   * Type: <b>token</b><br>
2534   * Path: <b>Goal.category</b><br>
2535   * </p>
2536   */
2537  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2538      SP_CATEGORY);
2539
2540  /**
2541   * Search parameter: <b>target-date</b>
2542   * <p>
2543   * Description: <b>Reach goal on or before</b><br>
2544   * Type: <b>date</b><br>
2545   * Path: <b>Goal.target.dueDate</b><br>
2546   * </p>
2547   */
2548  @SearchParamDefinition(name = "target-date", path = "(Goal.target.due as date)", description = "Reach goal on or before", type = "date")
2549  public static final String SP_TARGET_DATE = "target-date";
2550  /**
2551   * <b>Fluent Client</b> search parameter constant for <b>target-date</b>
2552   * <p>
2553   * Description: <b>Reach goal on or before</b><br>
2554   * Type: <b>date</b><br>
2555   * Path: <b>Goal.target.dueDate</b><br>
2556   * </p>
2557   */
2558  public static final ca.uhn.fhir.rest.gclient.DateClientParam TARGET_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(
2559      SP_TARGET_DATE);
2560
2561}