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