001package org.hl7.fhir.instance.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 Wed, Jul 13, 2016 05:32+1000 for FHIR v1.0.2
033import java.util.*;
034
035import org.hl7.fhir.exceptions.FHIRException;
036import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
037
038import ca.uhn.fhir.model.api.annotation.*;
039/**
040 * Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc.
041 */
042@ResourceDef(name="Goal", profile="http://hl7.org/fhir/Profile/Goal")
043public class Goal extends DomainResource {
044
045    public enum GoalStatus {
046        /**
047         * A goal is proposed for this patient
048         */
049        PROPOSED, 
050        /**
051         * A goal is planned for this patient
052         */
053        PLANNED, 
054        /**
055         * A proposed goal was accepted
056         */
057        ACCEPTED, 
058        /**
059         * A proposed goal was rejected
060         */
061        REJECTED, 
062        /**
063         * The goal is being sought but has not yet been reached.  (Also applies if goal was reached in the past but there has been regression and goal is being sought again)
064         */
065        INPROGRESS, 
066        /**
067         * The goal has been met and no further action is needed
068         */
069        ACHIEVED, 
070        /**
071         * The goal has been met, but ongoing activity is needed to sustain the goal objective
072         */
073        SUSTAINING, 
074        /**
075         * The goal remains a long term objective but is no longer being actively pursued for a temporary period of time.
076         */
077        ONHOLD, 
078        /**
079         * The goal is no longer being sought
080         */
081        CANCELLED, 
082        /**
083         * added to help the parsers
084         */
085        NULL;
086        public static GoalStatus fromCode(String codeString) throws FHIRException {
087            if (codeString == null || "".equals(codeString))
088                return null;
089        if ("proposed".equals(codeString))
090          return PROPOSED;
091        if ("planned".equals(codeString))
092          return PLANNED;
093        if ("accepted".equals(codeString))
094          return ACCEPTED;
095        if ("rejected".equals(codeString))
096          return REJECTED;
097        if ("in-progress".equals(codeString))
098          return INPROGRESS;
099        if ("achieved".equals(codeString))
100          return ACHIEVED;
101        if ("sustaining".equals(codeString))
102          return SUSTAINING;
103        if ("on-hold".equals(codeString))
104          return ONHOLD;
105        if ("cancelled".equals(codeString))
106          return CANCELLED;
107        throw new FHIRException("Unknown GoalStatus code '"+codeString+"'");
108        }
109        public String toCode() {
110          switch (this) {
111            case PROPOSED: return "proposed";
112            case PLANNED: return "planned";
113            case ACCEPTED: return "accepted";
114            case REJECTED: return "rejected";
115            case INPROGRESS: return "in-progress";
116            case ACHIEVED: return "achieved";
117            case SUSTAINING: return "sustaining";
118            case ONHOLD: return "on-hold";
119            case CANCELLED: return "cancelled";
120            default: return "?";
121          }
122        }
123        public String getSystem() {
124          switch (this) {
125            case PROPOSED: return "http://hl7.org/fhir/goal-status";
126            case PLANNED: return "http://hl7.org/fhir/goal-status";
127            case ACCEPTED: return "http://hl7.org/fhir/goal-status";
128            case REJECTED: return "http://hl7.org/fhir/goal-status";
129            case INPROGRESS: return "http://hl7.org/fhir/goal-status";
130            case ACHIEVED: return "http://hl7.org/fhir/goal-status";
131            case SUSTAINING: return "http://hl7.org/fhir/goal-status";
132            case ONHOLD: return "http://hl7.org/fhir/goal-status";
133            case CANCELLED: return "http://hl7.org/fhir/goal-status";
134            default: return "?";
135          }
136        }
137        public String getDefinition() {
138          switch (this) {
139            case PROPOSED: return "A goal is proposed for this patient";
140            case PLANNED: return "A goal is planned for this patient";
141            case ACCEPTED: return "A proposed goal was accepted";
142            case REJECTED: return "A proposed goal was rejected";
143            case INPROGRESS: return "The goal is being sought but has not yet been reached.  (Also applies if goal was reached in the past but there has been regression and goal is being sought again)";
144            case ACHIEVED: return "The goal has been met and no further action is needed";
145            case SUSTAINING: return "The goal has been met, but ongoing activity is needed to sustain the goal objective";
146            case ONHOLD: return "The goal remains a long term objective but is no longer being actively pursued for a temporary period of time.";
147            case CANCELLED: return "The goal is no longer being sought";
148            default: return "?";
149          }
150        }
151        public String getDisplay() {
152          switch (this) {
153            case PROPOSED: return "Proposed";
154            case PLANNED: return "Planned";
155            case ACCEPTED: return "Accepted";
156            case REJECTED: return "Rejected";
157            case INPROGRESS: return "In Progress";
158            case ACHIEVED: return "Achieved";
159            case SUSTAINING: return "Sustaining";
160            case ONHOLD: return "On Hold";
161            case CANCELLED: return "Cancelled";
162            default: return "?";
163          }
164        }
165    }
166
167  public static class GoalStatusEnumFactory implements EnumFactory<GoalStatus> {
168    public GoalStatus fromCode(String codeString) throws IllegalArgumentException {
169      if (codeString == null || "".equals(codeString))
170            if (codeString == null || "".equals(codeString))
171                return null;
172        if ("proposed".equals(codeString))
173          return GoalStatus.PROPOSED;
174        if ("planned".equals(codeString))
175          return GoalStatus.PLANNED;
176        if ("accepted".equals(codeString))
177          return GoalStatus.ACCEPTED;
178        if ("rejected".equals(codeString))
179          return GoalStatus.REJECTED;
180        if ("in-progress".equals(codeString))
181          return GoalStatus.INPROGRESS;
182        if ("achieved".equals(codeString))
183          return GoalStatus.ACHIEVED;
184        if ("sustaining".equals(codeString))
185          return GoalStatus.SUSTAINING;
186        if ("on-hold".equals(codeString))
187          return GoalStatus.ONHOLD;
188        if ("cancelled".equals(codeString))
189          return GoalStatus.CANCELLED;
190        throw new IllegalArgumentException("Unknown GoalStatus code '"+codeString+"'");
191        }
192        public Enumeration<GoalStatus> fromType(Base code) throws FHIRException {
193          if (code == null || code.isEmpty())
194            return null;
195          String codeString = ((PrimitiveType) code).asStringValue();
196          if (codeString == null || "".equals(codeString))
197            return null;
198        if ("proposed".equals(codeString))
199          return new Enumeration<GoalStatus>(this, GoalStatus.PROPOSED);
200        if ("planned".equals(codeString))
201          return new Enumeration<GoalStatus>(this, GoalStatus.PLANNED);
202        if ("accepted".equals(codeString))
203          return new Enumeration<GoalStatus>(this, GoalStatus.ACCEPTED);
204        if ("rejected".equals(codeString))
205          return new Enumeration<GoalStatus>(this, GoalStatus.REJECTED);
206        if ("in-progress".equals(codeString))
207          return new Enumeration<GoalStatus>(this, GoalStatus.INPROGRESS);
208        if ("achieved".equals(codeString))
209          return new Enumeration<GoalStatus>(this, GoalStatus.ACHIEVED);
210        if ("sustaining".equals(codeString))
211          return new Enumeration<GoalStatus>(this, GoalStatus.SUSTAINING);
212        if ("on-hold".equals(codeString))
213          return new Enumeration<GoalStatus>(this, GoalStatus.ONHOLD);
214        if ("cancelled".equals(codeString))
215          return new Enumeration<GoalStatus>(this, GoalStatus.CANCELLED);
216        throw new FHIRException("Unknown GoalStatus code '"+codeString+"'");
217        }
218    public String toCode(GoalStatus code) {
219      if (code == GoalStatus.PROPOSED)
220        return "proposed";
221      if (code == GoalStatus.PLANNED)
222        return "planned";
223      if (code == GoalStatus.ACCEPTED)
224        return "accepted";
225      if (code == GoalStatus.REJECTED)
226        return "rejected";
227      if (code == GoalStatus.INPROGRESS)
228        return "in-progress";
229      if (code == GoalStatus.ACHIEVED)
230        return "achieved";
231      if (code == GoalStatus.SUSTAINING)
232        return "sustaining";
233      if (code == GoalStatus.ONHOLD)
234        return "on-hold";
235      if (code == GoalStatus.CANCELLED)
236        return "cancelled";
237      return "?";
238      }
239    }
240
241    @Block()
242    public static class GoalOutcomeComponent extends BackboneElement implements IBaseBackboneElement {
243        /**
244         * Details of what's changed (or not changed).
245         */
246        @Child(name = "result", type = {CodeableConcept.class, Observation.class}, order=1, min=0, max=1, modifier=false, summary=false)
247        @Description(shortDefinition="Code or observation that resulted from goal", formalDefinition="Details of what's changed (or not changed)." )
248        protected Type result;
249
250        private static final long serialVersionUID = 1994317639L;
251
252    /*
253     * Constructor
254     */
255      public GoalOutcomeComponent() {
256        super();
257      }
258
259        /**
260         * @return {@link #result} (Details of what's changed (or not changed).)
261         */
262        public Type getResult() { 
263          return this.result;
264        }
265
266        /**
267         * @return {@link #result} (Details of what's changed (or not changed).)
268         */
269        public CodeableConcept getResultCodeableConcept() throws FHIRException { 
270          if (!(this.result instanceof CodeableConcept))
271            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.result.getClass().getName()+" was encountered");
272          return (CodeableConcept) this.result;
273        }
274
275        public boolean hasResultCodeableConcept() { 
276          return this.result instanceof CodeableConcept;
277        }
278
279        /**
280         * @return {@link #result} (Details of what's changed (or not changed).)
281         */
282        public Reference getResultReference() throws FHIRException { 
283          if (!(this.result instanceof Reference))
284            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.result.getClass().getName()+" was encountered");
285          return (Reference) this.result;
286        }
287
288        public boolean hasResultReference() { 
289          return this.result instanceof Reference;
290        }
291
292        public boolean hasResult() { 
293          return this.result != null && !this.result.isEmpty();
294        }
295
296        /**
297         * @param value {@link #result} (Details of what's changed (or not changed).)
298         */
299        public GoalOutcomeComponent setResult(Type value) { 
300          this.result = value;
301          return this;
302        }
303
304        protected void listChildren(List<Property> childrenList) {
305          super.listChildren(childrenList);
306          childrenList.add(new Property("result[x]", "CodeableConcept|Reference(Observation)", "Details of what's changed (or not changed).", 0, java.lang.Integer.MAX_VALUE, result));
307        }
308
309      @Override
310      public void setProperty(String name, Base value) throws FHIRException {
311        if (name.equals("result[x]"))
312          this.result = (Type) value; // Type
313        else
314          super.setProperty(name, value);
315      }
316
317      @Override
318      public Base addChild(String name) throws FHIRException {
319        if (name.equals("resultCodeableConcept")) {
320          this.result = new CodeableConcept();
321          return this.result;
322        }
323        else if (name.equals("resultReference")) {
324          this.result = new Reference();
325          return this.result;
326        }
327        else
328          return super.addChild(name);
329      }
330
331      public GoalOutcomeComponent copy() {
332        GoalOutcomeComponent dst = new GoalOutcomeComponent();
333        copyValues(dst);
334        dst.result = result == null ? null : result.copy();
335        return dst;
336      }
337
338      @Override
339      public boolean equalsDeep(Base other) {
340        if (!super.equalsDeep(other))
341          return false;
342        if (!(other instanceof GoalOutcomeComponent))
343          return false;
344        GoalOutcomeComponent o = (GoalOutcomeComponent) other;
345        return compareDeep(result, o.result, true);
346      }
347
348      @Override
349      public boolean equalsShallow(Base other) {
350        if (!super.equalsShallow(other))
351          return false;
352        if (!(other instanceof GoalOutcomeComponent))
353          return false;
354        GoalOutcomeComponent o = (GoalOutcomeComponent) other;
355        return true;
356      }
357
358      public boolean isEmpty() {
359        return super.isEmpty() && (result == null || result.isEmpty());
360      }
361
362  public String fhirType() {
363    return "Goal.outcome";
364
365  }
366
367  }
368
369    /**
370     * This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).
371     */
372    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
373    @Description(shortDefinition="External Ids for this goal", formalDefinition="This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." )
374    protected List<Identifier> identifier;
375
376    /**
377     * Identifies the patient, group or organization for whom the goal is being established.
378     */
379    @Child(name = "subject", type = {Patient.class, Group.class, Organization.class}, order=1, min=0, max=1, modifier=false, summary=true)
380    @Description(shortDefinition="Who this goal is intended for", formalDefinition="Identifies the patient, group or organization for whom the goal is being established." )
381    protected Reference subject;
382
383    /**
384     * The actual object that is the target of the reference (Identifies the patient, group or organization for whom the goal is being established.)
385     */
386    protected Resource subjectTarget;
387
388    /**
389     * The date or event after which the goal should begin being pursued.
390     */
391    @Child(name = "start", type = {DateType.class, CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
392    @Description(shortDefinition="When goal pursuit begins", formalDefinition="The date or event after which the goal should begin being pursued." )
393    protected Type start;
394
395    /**
396     * Indicates either the date or the duration after start by which the goal should be met.
397     */
398    @Child(name = "target", type = {DateType.class, Duration.class}, order=3, min=0, max=1, modifier=false, summary=true)
399    @Description(shortDefinition="Reach goal on or before", formalDefinition="Indicates either the date or the duration after start by which the goal should be met." )
400    protected Type target;
401
402    /**
403     * Indicates a category the goal falls within.
404     */
405    @Child(name = "category", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
406    @Description(shortDefinition="E.g. Treatment, dietary, behavioral, etc.", formalDefinition="Indicates a category the goal falls within." )
407    protected List<CodeableConcept> category;
408
409    /**
410     * Human-readable description of a specific desired objective of care.
411     */
412    @Child(name = "description", type = {StringType.class}, order=5, min=1, max=1, modifier=false, summary=true)
413    @Description(shortDefinition="What's the desired outcome?", formalDefinition="Human-readable description of a specific desired objective of care." )
414    protected StringType description;
415
416    /**
417     * Indicates whether the goal has been reached and is still considered relevant.
418     */
419    @Child(name = "status", type = {CodeType.class}, order=6, min=1, max=1, modifier=true, summary=true)
420    @Description(shortDefinition="proposed | planned | accepted | rejected | in-progress | achieved | sustaining | on-hold | cancelled", formalDefinition="Indicates whether the goal has been reached and is still considered relevant." )
421    protected Enumeration<GoalStatus> status;
422
423    /**
424     * Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc.
425     */
426    @Child(name = "statusDate", type = {DateType.class}, order=7, min=0, max=1, modifier=false, summary=true)
427    @Description(shortDefinition="When goal status took effect", formalDefinition="Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc." )
428    protected DateType statusDate;
429
430    /**
431     * Captures the reason for the current status.
432     */
433    @Child(name = "statusReason", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=false)
434    @Description(shortDefinition="Reason for current status", formalDefinition="Captures the reason for the current status." )
435    protected CodeableConcept statusReason;
436
437    /**
438     * Indicates whose goal this is - patient goal, practitioner goal, etc.
439     */
440    @Child(name = "author", type = {Patient.class, Practitioner.class, RelatedPerson.class}, order=9, min=0, max=1, modifier=false, summary=true)
441    @Description(shortDefinition="Who's responsible for creating Goal?", formalDefinition="Indicates whose goal this is - patient goal, practitioner goal, etc." )
442    protected Reference author;
443
444    /**
445     * The actual object that is the target of the reference (Indicates whose goal this is - patient goal, practitioner goal, etc.)
446     */
447    protected Resource authorTarget;
448
449    /**
450     * Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.
451     */
452    @Child(name = "priority", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=true)
453    @Description(shortDefinition="high | medium |low", formalDefinition="Identifies the mutually agreed level of importance associated with reaching/sustaining the goal." )
454    protected CodeableConcept priority;
455
456    /**
457     * The identified conditions and other health record elements that are intended to be addressed by the goal.
458     */
459    @Child(name = "addresses", type = {Condition.class, Observation.class, MedicationStatement.class, NutritionOrder.class, ProcedureRequest.class, RiskAssessment.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
460    @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." )
461    protected List<Reference> addresses;
462    /**
463     * The actual objects that are the target of the reference (The identified conditions and other health record elements that are intended to be addressed by the goal.)
464     */
465    protected List<Resource> addressesTarget;
466
467
468    /**
469     * Any comments related to the goal.
470     */
471    @Child(name = "note", type = {Annotation.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
472    @Description(shortDefinition="Comments about the goal", formalDefinition="Any comments related to the goal." )
473    protected List<Annotation> note;
474
475    /**
476     * Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved.
477     */
478    @Child(name = "outcome", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
479    @Description(shortDefinition="What was end result of goal?", formalDefinition="Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved." )
480    protected List<GoalOutcomeComponent> outcome;
481
482    private static final long serialVersionUID = 2029459056L;
483
484  /*
485   * Constructor
486   */
487    public Goal() {
488      super();
489    }
490
491  /*
492   * Constructor
493   */
494    public Goal(StringType description, Enumeration<GoalStatus> status) {
495      super();
496      this.description = description;
497      this.status = status;
498    }
499
500    /**
501     * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).)
502     */
503    public List<Identifier> getIdentifier() { 
504      if (this.identifier == null)
505        this.identifier = new ArrayList<Identifier>();
506      return this.identifier;
507    }
508
509    public boolean hasIdentifier() { 
510      if (this.identifier == null)
511        return false;
512      for (Identifier item : this.identifier)
513        if (!item.isEmpty())
514          return true;
515      return false;
516    }
517
518    /**
519     * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).)
520     */
521    // syntactic sugar
522    public Identifier addIdentifier() { //3
523      Identifier t = new Identifier();
524      if (this.identifier == null)
525        this.identifier = new ArrayList<Identifier>();
526      this.identifier.add(t);
527      return t;
528    }
529
530    // syntactic sugar
531    public Goal addIdentifier(Identifier t) { //3
532      if (t == null)
533        return this;
534      if (this.identifier == null)
535        this.identifier = new ArrayList<Identifier>();
536      this.identifier.add(t);
537      return this;
538    }
539
540    /**
541     * @return {@link #subject} (Identifies the patient, group or organization for whom the goal is being established.)
542     */
543    public Reference getSubject() { 
544      if (this.subject == null)
545        if (Configuration.errorOnAutoCreate())
546          throw new Error("Attempt to auto-create Goal.subject");
547        else if (Configuration.doAutoCreate())
548          this.subject = new Reference(); // cc
549      return this.subject;
550    }
551
552    public boolean hasSubject() { 
553      return this.subject != null && !this.subject.isEmpty();
554    }
555
556    /**
557     * @param value {@link #subject} (Identifies the patient, group or organization for whom the goal is being established.)
558     */
559    public Goal setSubject(Reference value) { 
560      this.subject = value;
561      return this;
562    }
563
564    /**
565     * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the patient, group or organization for whom the goal is being established.)
566     */
567    public Resource getSubjectTarget() { 
568      return this.subjectTarget;
569    }
570
571    /**
572     * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the patient, group or organization for whom the goal is being established.)
573     */
574    public Goal setSubjectTarget(Resource value) { 
575      this.subjectTarget = value;
576      return this;
577    }
578
579    /**
580     * @return {@link #start} (The date or event after which the goal should begin being pursued.)
581     */
582    public Type getStart() { 
583      return this.start;
584    }
585
586    /**
587     * @return {@link #start} (The date or event after which the goal should begin being pursued.)
588     */
589    public DateType getStartDateType() throws FHIRException { 
590      if (!(this.start instanceof DateType))
591        throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.start.getClass().getName()+" was encountered");
592      return (DateType) this.start;
593    }
594
595    public boolean hasStartDateType() { 
596      return this.start instanceof DateType;
597    }
598
599    /**
600     * @return {@link #start} (The date or event after which the goal should begin being pursued.)
601     */
602    public CodeableConcept getStartCodeableConcept() throws FHIRException { 
603      if (!(this.start instanceof CodeableConcept))
604        throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.start.getClass().getName()+" was encountered");
605      return (CodeableConcept) this.start;
606    }
607
608    public boolean hasStartCodeableConcept() { 
609      return this.start instanceof CodeableConcept;
610    }
611
612    public boolean hasStart() { 
613      return this.start != null && !this.start.isEmpty();
614    }
615
616    /**
617     * @param value {@link #start} (The date or event after which the goal should begin being pursued.)
618     */
619    public Goal setStart(Type value) { 
620      this.start = value;
621      return this;
622    }
623
624    /**
625     * @return {@link #target} (Indicates either the date or the duration after start by which the goal should be met.)
626     */
627    public Type getTarget() { 
628      return this.target;
629    }
630
631    /**
632     * @return {@link #target} (Indicates either the date or the duration after start by which the goal should be met.)
633     */
634    public DateType getTargetDateType() throws FHIRException { 
635      if (!(this.target instanceof DateType))
636        throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.target.getClass().getName()+" was encountered");
637      return (DateType) this.target;
638    }
639
640    public boolean hasTargetDateType() { 
641      return this.target instanceof DateType;
642    }
643
644    /**
645     * @return {@link #target} (Indicates either the date or the duration after start by which the goal should be met.)
646     */
647    public Duration getTargetDuration() throws FHIRException { 
648      if (!(this.target instanceof Duration))
649        throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.target.getClass().getName()+" was encountered");
650      return (Duration) this.target;
651    }
652
653    public boolean hasTargetDuration() { 
654      return this.target instanceof Duration;
655    }
656
657    public boolean hasTarget() { 
658      return this.target != null && !this.target.isEmpty();
659    }
660
661    /**
662     * @param value {@link #target} (Indicates either the date or the duration after start by which the goal should be met.)
663     */
664    public Goal setTarget(Type value) { 
665      this.target = value;
666      return this;
667    }
668
669    /**
670     * @return {@link #category} (Indicates a category the goal falls within.)
671     */
672    public List<CodeableConcept> getCategory() { 
673      if (this.category == null)
674        this.category = new ArrayList<CodeableConcept>();
675      return this.category;
676    }
677
678    public boolean hasCategory() { 
679      if (this.category == null)
680        return false;
681      for (CodeableConcept item : this.category)
682        if (!item.isEmpty())
683          return true;
684      return false;
685    }
686
687    /**
688     * @return {@link #category} (Indicates a category the goal falls within.)
689     */
690    // syntactic sugar
691    public CodeableConcept addCategory() { //3
692      CodeableConcept t = new CodeableConcept();
693      if (this.category == null)
694        this.category = new ArrayList<CodeableConcept>();
695      this.category.add(t);
696      return t;
697    }
698
699    // syntactic sugar
700    public Goal addCategory(CodeableConcept t) { //3
701      if (t == null)
702        return this;
703      if (this.category == null)
704        this.category = new ArrayList<CodeableConcept>();
705      this.category.add(t);
706      return this;
707    }
708
709    /**
710     * @return {@link #description} (Human-readable description of a specific desired objective of care.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
711     */
712    public StringType getDescriptionElement() { 
713      if (this.description == null)
714        if (Configuration.errorOnAutoCreate())
715          throw new Error("Attempt to auto-create Goal.description");
716        else if (Configuration.doAutoCreate())
717          this.description = new StringType(); // bb
718      return this.description;
719    }
720
721    public boolean hasDescriptionElement() { 
722      return this.description != null && !this.description.isEmpty();
723    }
724
725    public boolean hasDescription() { 
726      return this.description != null && !this.description.isEmpty();
727    }
728
729    /**
730     * @param value {@link #description} (Human-readable description of a specific desired objective of care.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
731     */
732    public Goal setDescriptionElement(StringType value) { 
733      this.description = value;
734      return this;
735    }
736
737    /**
738     * @return Human-readable description of a specific desired objective of care.
739     */
740    public String getDescription() { 
741      return this.description == null ? null : this.description.getValue();
742    }
743
744    /**
745     * @param value Human-readable description of a specific desired objective of care.
746     */
747    public Goal setDescription(String value) { 
748        if (this.description == null)
749          this.description = new StringType();
750        this.description.setValue(value);
751      return this;
752    }
753
754    /**
755     * @return {@link #status} (Indicates whether the goal has been reached and is still considered relevant.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
756     */
757    public Enumeration<GoalStatus> getStatusElement() { 
758      if (this.status == null)
759        if (Configuration.errorOnAutoCreate())
760          throw new Error("Attempt to auto-create Goal.status");
761        else if (Configuration.doAutoCreate())
762          this.status = new Enumeration<GoalStatus>(new GoalStatusEnumFactory()); // bb
763      return this.status;
764    }
765
766    public boolean hasStatusElement() { 
767      return this.status != null && !this.status.isEmpty();
768    }
769
770    public boolean hasStatus() { 
771      return this.status != null && !this.status.isEmpty();
772    }
773
774    /**
775     * @param value {@link #status} (Indicates whether the goal has been reached and is still considered relevant.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
776     */
777    public Goal setStatusElement(Enumeration<GoalStatus> value) { 
778      this.status = value;
779      return this;
780    }
781
782    /**
783     * @return Indicates whether the goal has been reached and is still considered relevant.
784     */
785    public GoalStatus getStatus() { 
786      return this.status == null ? null : this.status.getValue();
787    }
788
789    /**
790     * @param value Indicates whether the goal has been reached and is still considered relevant.
791     */
792    public Goal setStatus(GoalStatus value) { 
793        if (this.status == null)
794          this.status = new Enumeration<GoalStatus>(new GoalStatusEnumFactory());
795        this.status.setValue(value);
796      return this;
797    }
798
799    /**
800     * @return {@link #statusDate} (Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value
801     */
802    public DateType getStatusDateElement() { 
803      if (this.statusDate == null)
804        if (Configuration.errorOnAutoCreate())
805          throw new Error("Attempt to auto-create Goal.statusDate");
806        else if (Configuration.doAutoCreate())
807          this.statusDate = new DateType(); // bb
808      return this.statusDate;
809    }
810
811    public boolean hasStatusDateElement() { 
812      return this.statusDate != null && !this.statusDate.isEmpty();
813    }
814
815    public boolean hasStatusDate() { 
816      return this.statusDate != null && !this.statusDate.isEmpty();
817    }
818
819    /**
820     * @param value {@link #statusDate} (Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value
821     */
822    public Goal setStatusDateElement(DateType value) { 
823      this.statusDate = value;
824      return this;
825    }
826
827    /**
828     * @return Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc.
829     */
830    public Date getStatusDate() { 
831      return this.statusDate == null ? null : this.statusDate.getValue();
832    }
833
834    /**
835     * @param value Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc.
836     */
837    public Goal setStatusDate(Date value) { 
838      if (value == null)
839        this.statusDate = null;
840      else {
841        if (this.statusDate == null)
842          this.statusDate = new DateType();
843        this.statusDate.setValue(value);
844      }
845      return this;
846    }
847
848    /**
849     * @return {@link #statusReason} (Captures the reason for the current status.)
850     */
851    public CodeableConcept getStatusReason() { 
852      if (this.statusReason == null)
853        if (Configuration.errorOnAutoCreate())
854          throw new Error("Attempt to auto-create Goal.statusReason");
855        else if (Configuration.doAutoCreate())
856          this.statusReason = new CodeableConcept(); // cc
857      return this.statusReason;
858    }
859
860    public boolean hasStatusReason() { 
861      return this.statusReason != null && !this.statusReason.isEmpty();
862    }
863
864    /**
865     * @param value {@link #statusReason} (Captures the reason for the current status.)
866     */
867    public Goal setStatusReason(CodeableConcept value) { 
868      this.statusReason = value;
869      return this;
870    }
871
872    /**
873     * @return {@link #author} (Indicates whose goal this is - patient goal, practitioner goal, etc.)
874     */
875    public Reference getAuthor() { 
876      if (this.author == null)
877        if (Configuration.errorOnAutoCreate())
878          throw new Error("Attempt to auto-create Goal.author");
879        else if (Configuration.doAutoCreate())
880          this.author = new Reference(); // cc
881      return this.author;
882    }
883
884    public boolean hasAuthor() { 
885      return this.author != null && !this.author.isEmpty();
886    }
887
888    /**
889     * @param value {@link #author} (Indicates whose goal this is - patient goal, practitioner goal, etc.)
890     */
891    public Goal setAuthor(Reference value) { 
892      this.author = value;
893      return this;
894    }
895
896    /**
897     * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates whose goal this is - patient goal, practitioner goal, etc.)
898     */
899    public Resource getAuthorTarget() { 
900      return this.authorTarget;
901    }
902
903    /**
904     * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates whose goal this is - patient goal, practitioner goal, etc.)
905     */
906    public Goal setAuthorTarget(Resource value) { 
907      this.authorTarget = value;
908      return this;
909    }
910
911    /**
912     * @return {@link #priority} (Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.)
913     */
914    public CodeableConcept getPriority() { 
915      if (this.priority == null)
916        if (Configuration.errorOnAutoCreate())
917          throw new Error("Attempt to auto-create Goal.priority");
918        else if (Configuration.doAutoCreate())
919          this.priority = new CodeableConcept(); // cc
920      return this.priority;
921    }
922
923    public boolean hasPriority() { 
924      return this.priority != null && !this.priority.isEmpty();
925    }
926
927    /**
928     * @param value {@link #priority} (Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.)
929     */
930    public Goal setPriority(CodeableConcept value) { 
931      this.priority = value;
932      return this;
933    }
934
935    /**
936     * @return {@link #addresses} (The identified conditions and other health record elements that are intended to be addressed by the goal.)
937     */
938    public List<Reference> getAddresses() { 
939      if (this.addresses == null)
940        this.addresses = new ArrayList<Reference>();
941      return this.addresses;
942    }
943
944    public boolean hasAddresses() { 
945      if (this.addresses == null)
946        return false;
947      for (Reference item : this.addresses)
948        if (!item.isEmpty())
949          return true;
950      return false;
951    }
952
953    /**
954     * @return {@link #addresses} (The identified conditions and other health record elements that are intended to be addressed by the goal.)
955     */
956    // syntactic sugar
957    public Reference addAddresses() { //3
958      Reference t = new Reference();
959      if (this.addresses == null)
960        this.addresses = new ArrayList<Reference>();
961      this.addresses.add(t);
962      return t;
963    }
964
965    // syntactic sugar
966    public Goal addAddresses(Reference t) { //3
967      if (t == null)
968        return this;
969      if (this.addresses == null)
970        this.addresses = new ArrayList<Reference>();
971      this.addresses.add(t);
972      return this;
973    }
974
975    /**
976     * @return {@link #addresses} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The identified conditions and other health record elements that are intended to be addressed by the goal.)
977     */
978    public List<Resource> getAddressesTarget() { 
979      if (this.addressesTarget == null)
980        this.addressesTarget = new ArrayList<Resource>();
981      return this.addressesTarget;
982    }
983
984    /**
985     * @return {@link #note} (Any comments related to the goal.)
986     */
987    public List<Annotation> getNote() { 
988      if (this.note == null)
989        this.note = new ArrayList<Annotation>();
990      return this.note;
991    }
992
993    public boolean hasNote() { 
994      if (this.note == null)
995        return false;
996      for (Annotation item : this.note)
997        if (!item.isEmpty())
998          return true;
999      return false;
1000    }
1001
1002    /**
1003     * @return {@link #note} (Any comments related to the goal.)
1004     */
1005    // syntactic sugar
1006    public Annotation addNote() { //3
1007      Annotation t = new Annotation();
1008      if (this.note == null)
1009        this.note = new ArrayList<Annotation>();
1010      this.note.add(t);
1011      return t;
1012    }
1013
1014    // syntactic sugar
1015    public Goal addNote(Annotation t) { //3
1016      if (t == null)
1017        return this;
1018      if (this.note == null)
1019        this.note = new ArrayList<Annotation>();
1020      this.note.add(t);
1021      return this;
1022    }
1023
1024    /**
1025     * @return {@link #outcome} (Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved.)
1026     */
1027    public List<GoalOutcomeComponent> getOutcome() { 
1028      if (this.outcome == null)
1029        this.outcome = new ArrayList<GoalOutcomeComponent>();
1030      return this.outcome;
1031    }
1032
1033    public boolean hasOutcome() { 
1034      if (this.outcome == null)
1035        return false;
1036      for (GoalOutcomeComponent item : this.outcome)
1037        if (!item.isEmpty())
1038          return true;
1039      return false;
1040    }
1041
1042    /**
1043     * @return {@link #outcome} (Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved.)
1044     */
1045    // syntactic sugar
1046    public GoalOutcomeComponent addOutcome() { //3
1047      GoalOutcomeComponent t = new GoalOutcomeComponent();
1048      if (this.outcome == null)
1049        this.outcome = new ArrayList<GoalOutcomeComponent>();
1050      this.outcome.add(t);
1051      return t;
1052    }
1053
1054    // syntactic sugar
1055    public Goal addOutcome(GoalOutcomeComponent t) { //3
1056      if (t == null)
1057        return this;
1058      if (this.outcome == null)
1059        this.outcome = new ArrayList<GoalOutcomeComponent>();
1060      this.outcome.add(t);
1061      return this;
1062    }
1063
1064      protected void listChildren(List<Property> childrenList) {
1065        super.listChildren(childrenList);
1066        childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier));
1067        childrenList.add(new Property("subject", "Reference(Patient|Group|Organization)", "Identifies the patient, group or organization for whom the goal is being established.", 0, java.lang.Integer.MAX_VALUE, subject));
1068        childrenList.add(new Property("start[x]", "date|CodeableConcept", "The date or event after which the goal should begin being pursued.", 0, java.lang.Integer.MAX_VALUE, start));
1069        childrenList.add(new Property("target[x]", "date|Duration", "Indicates either the date or the duration after start by which the goal should be met.", 0, java.lang.Integer.MAX_VALUE, target));
1070        childrenList.add(new Property("category", "CodeableConcept", "Indicates a category the goal falls within.", 0, java.lang.Integer.MAX_VALUE, category));
1071        childrenList.add(new Property("description", "string", "Human-readable description of a specific desired objective of care.", 0, java.lang.Integer.MAX_VALUE, description));
1072        childrenList.add(new Property("status", "code", "Indicates whether the goal has been reached and is still considered relevant.", 0, java.lang.Integer.MAX_VALUE, status));
1073        childrenList.add(new Property("statusDate", "date", "Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc.", 0, java.lang.Integer.MAX_VALUE, statusDate));
1074        childrenList.add(new Property("statusReason", "CodeableConcept", "Captures the reason for the current status.", 0, java.lang.Integer.MAX_VALUE, statusReason));
1075        childrenList.add(new Property("author", "Reference(Patient|Practitioner|RelatedPerson)", "Indicates whose goal this is - patient goal, practitioner goal, etc.", 0, java.lang.Integer.MAX_VALUE, author));
1076        childrenList.add(new Property("priority", "CodeableConcept", "Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.", 0, java.lang.Integer.MAX_VALUE, priority));
1077        childrenList.add(new Property("addresses", "Reference(Condition|Observation|MedicationStatement|NutritionOrder|ProcedureRequest|RiskAssessment)", "The identified conditions and other health record elements that are intended to be addressed by the goal.", 0, java.lang.Integer.MAX_VALUE, addresses));
1078        childrenList.add(new Property("note", "Annotation", "Any comments related to the goal.", 0, java.lang.Integer.MAX_VALUE, note));
1079        childrenList.add(new Property("outcome", "", "Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved.", 0, java.lang.Integer.MAX_VALUE, outcome));
1080      }
1081
1082      @Override
1083      public void setProperty(String name, Base value) throws FHIRException {
1084        if (name.equals("identifier"))
1085          this.getIdentifier().add(castToIdentifier(value));
1086        else if (name.equals("subject"))
1087          this.subject = castToReference(value); // Reference
1088        else if (name.equals("start[x]"))
1089          this.start = (Type) value; // Type
1090        else if (name.equals("target[x]"))
1091          this.target = (Type) value; // Type
1092        else if (name.equals("category"))
1093          this.getCategory().add(castToCodeableConcept(value));
1094        else if (name.equals("description"))
1095          this.description = castToString(value); // StringType
1096        else if (name.equals("status"))
1097          this.status = new GoalStatusEnumFactory().fromType(value); // Enumeration<GoalStatus>
1098        else if (name.equals("statusDate"))
1099          this.statusDate = castToDate(value); // DateType
1100        else if (name.equals("statusReason"))
1101          this.statusReason = castToCodeableConcept(value); // CodeableConcept
1102        else if (name.equals("author"))
1103          this.author = castToReference(value); // Reference
1104        else if (name.equals("priority"))
1105          this.priority = castToCodeableConcept(value); // CodeableConcept
1106        else if (name.equals("addresses"))
1107          this.getAddresses().add(castToReference(value));
1108        else if (name.equals("note"))
1109          this.getNote().add(castToAnnotation(value));
1110        else if (name.equals("outcome"))
1111          this.getOutcome().add((GoalOutcomeComponent) value);
1112        else
1113          super.setProperty(name, value);
1114      }
1115
1116      @Override
1117      public Base addChild(String name) throws FHIRException {
1118        if (name.equals("identifier")) {
1119          return addIdentifier();
1120        }
1121        else if (name.equals("subject")) {
1122          this.subject = new Reference();
1123          return this.subject;
1124        }
1125        else if (name.equals("startDate")) {
1126          this.start = new DateType();
1127          return this.start;
1128        }
1129        else if (name.equals("startCodeableConcept")) {
1130          this.start = new CodeableConcept();
1131          return this.start;
1132        }
1133        else if (name.equals("targetDate")) {
1134          this.target = new DateType();
1135          return this.target;
1136        }
1137        else if (name.equals("targetDuration")) {
1138          this.target = new Duration();
1139          return this.target;
1140        }
1141        else if (name.equals("category")) {
1142          return addCategory();
1143        }
1144        else if (name.equals("description")) {
1145          throw new FHIRException("Cannot call addChild on a primitive type Goal.description");
1146        }
1147        else if (name.equals("status")) {
1148          throw new FHIRException("Cannot call addChild on a primitive type Goal.status");
1149        }
1150        else if (name.equals("statusDate")) {
1151          throw new FHIRException("Cannot call addChild on a primitive type Goal.statusDate");
1152        }
1153        else if (name.equals("statusReason")) {
1154          this.statusReason = new CodeableConcept();
1155          return this.statusReason;
1156        }
1157        else if (name.equals("author")) {
1158          this.author = new Reference();
1159          return this.author;
1160        }
1161        else if (name.equals("priority")) {
1162          this.priority = new CodeableConcept();
1163          return this.priority;
1164        }
1165        else if (name.equals("addresses")) {
1166          return addAddresses();
1167        }
1168        else if (name.equals("note")) {
1169          return addNote();
1170        }
1171        else if (name.equals("outcome")) {
1172          return addOutcome();
1173        }
1174        else
1175          return super.addChild(name);
1176      }
1177
1178  public String fhirType() {
1179    return "Goal";
1180
1181  }
1182
1183      public Goal copy() {
1184        Goal dst = new Goal();
1185        copyValues(dst);
1186        if (identifier != null) {
1187          dst.identifier = new ArrayList<Identifier>();
1188          for (Identifier i : identifier)
1189            dst.identifier.add(i.copy());
1190        };
1191        dst.subject = subject == null ? null : subject.copy();
1192        dst.start = start == null ? null : start.copy();
1193        dst.target = target == null ? null : target.copy();
1194        if (category != null) {
1195          dst.category = new ArrayList<CodeableConcept>();
1196          for (CodeableConcept i : category)
1197            dst.category.add(i.copy());
1198        };
1199        dst.description = description == null ? null : description.copy();
1200        dst.status = status == null ? null : status.copy();
1201        dst.statusDate = statusDate == null ? null : statusDate.copy();
1202        dst.statusReason = statusReason == null ? null : statusReason.copy();
1203        dst.author = author == null ? null : author.copy();
1204        dst.priority = priority == null ? null : priority.copy();
1205        if (addresses != null) {
1206          dst.addresses = new ArrayList<Reference>();
1207          for (Reference i : addresses)
1208            dst.addresses.add(i.copy());
1209        };
1210        if (note != null) {
1211          dst.note = new ArrayList<Annotation>();
1212          for (Annotation i : note)
1213            dst.note.add(i.copy());
1214        };
1215        if (outcome != null) {
1216          dst.outcome = new ArrayList<GoalOutcomeComponent>();
1217          for (GoalOutcomeComponent i : outcome)
1218            dst.outcome.add(i.copy());
1219        };
1220        return dst;
1221      }
1222
1223      protected Goal typedCopy() {
1224        return copy();
1225      }
1226
1227      @Override
1228      public boolean equalsDeep(Base other) {
1229        if (!super.equalsDeep(other))
1230          return false;
1231        if (!(other instanceof Goal))
1232          return false;
1233        Goal o = (Goal) other;
1234        return compareDeep(identifier, o.identifier, true) && compareDeep(subject, o.subject, true) && compareDeep(start, o.start, true)
1235           && compareDeep(target, o.target, true) && compareDeep(category, o.category, true) && compareDeep(description, o.description, true)
1236           && compareDeep(status, o.status, true) && compareDeep(statusDate, o.statusDate, true) && compareDeep(statusReason, o.statusReason, true)
1237           && compareDeep(author, o.author, true) && compareDeep(priority, o.priority, true) && compareDeep(addresses, o.addresses, true)
1238           && compareDeep(note, o.note, true) && compareDeep(outcome, o.outcome, true);
1239      }
1240
1241      @Override
1242      public boolean equalsShallow(Base other) {
1243        if (!super.equalsShallow(other))
1244          return false;
1245        if (!(other instanceof Goal))
1246          return false;
1247        Goal o = (Goal) other;
1248        return compareValues(description, o.description, true) && compareValues(status, o.status, true) && compareValues(statusDate, o.statusDate, true)
1249          ;
1250      }
1251
1252      public boolean isEmpty() {
1253        return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty())
1254           && (start == null || start.isEmpty()) && (target == null || target.isEmpty()) && (category == null || category.isEmpty())
1255           && (description == null || description.isEmpty()) && (status == null || status.isEmpty())
1256           && (statusDate == null || statusDate.isEmpty()) && (statusReason == null || statusReason.isEmpty())
1257           && (author == null || author.isEmpty()) && (priority == null || priority.isEmpty()) && (addresses == null || addresses.isEmpty())
1258           && (note == null || note.isEmpty()) && (outcome == null || outcome.isEmpty());
1259      }
1260
1261  @Override
1262  public ResourceType getResourceType() {
1263    return ResourceType.Goal;
1264   }
1265
1266  @SearchParamDefinition(name="identifier", path="Goal.identifier", description="External Ids for this goal", type="token" )
1267  public static final String SP_IDENTIFIER = "identifier";
1268  @SearchParamDefinition(name="patient", path="Goal.subject", description="Who this goal is intended for", type="reference" )
1269  public static final String SP_PATIENT = "patient";
1270  @SearchParamDefinition(name="subject", path="Goal.subject", description="Who this goal is intended for", type="reference" )
1271  public static final String SP_SUBJECT = "subject";
1272  @SearchParamDefinition(name="targetdate", path="Goal.targetDate", description="Reach goal on or before", type="date" )
1273  public static final String SP_TARGETDATE = "targetdate";
1274  @SearchParamDefinition(name="category", path="Goal.category", description="E.g. Treatment, dietary, behavioral, etc.", type="token" )
1275  public static final String SP_CATEGORY = "category";
1276  @SearchParamDefinition(name="status", path="Goal.status", description="proposed | planned | accepted | rejected | in-progress | achieved | sustaining | on-hold | cancelled", type="token" )
1277  public static final String SP_STATUS = "status";
1278
1279}
1280