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;
047import org.hl7.fhir.utilities.Utilities;
048/**
049 * A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score.
050 */
051@ResourceDef(name="ClinicalImpression", profile="http://hl7.org/fhir/Profile/ClinicalImpression")
052public class ClinicalImpression extends DomainResource {
053
054    public enum ClinicalImpressionStatus {
055        /**
056         * The assessment is still on-going and results are not yet final.
057         */
058        INPROGRESS, 
059        /**
060         * The assessment is done and the results are final.
061         */
062        COMPLETED, 
063        /**
064         * This assessment was never actually done and the record is erroneous (e.g. Wrong patient).
065         */
066        ENTEREDINERROR, 
067        /**
068         * added to help the parsers
069         */
070        NULL;
071        public static ClinicalImpressionStatus fromCode(String codeString) throws FHIRException {
072            if (codeString == null || "".equals(codeString))
073                return null;
074        if ("in-progress".equals(codeString))
075          return INPROGRESS;
076        if ("completed".equals(codeString))
077          return COMPLETED;
078        if ("entered-in-error".equals(codeString))
079          return ENTEREDINERROR;
080        throw new FHIRException("Unknown ClinicalImpressionStatus code '"+codeString+"'");
081        }
082        public String toCode() {
083          switch (this) {
084            case INPROGRESS: return "in-progress";
085            case COMPLETED: return "completed";
086            case ENTEREDINERROR: return "entered-in-error";
087            default: return "?";
088          }
089        }
090        public String getSystem() {
091          switch (this) {
092            case INPROGRESS: return "http://hl7.org/fhir/clinical-impression-status";
093            case COMPLETED: return "http://hl7.org/fhir/clinical-impression-status";
094            case ENTEREDINERROR: return "http://hl7.org/fhir/clinical-impression-status";
095            default: return "?";
096          }
097        }
098        public String getDefinition() {
099          switch (this) {
100            case INPROGRESS: return "The assessment is still on-going and results are not yet final.";
101            case COMPLETED: return "The assessment is done and the results are final.";
102            case ENTEREDINERROR: return "This assessment was never actually done and the record is erroneous (e.g. Wrong patient).";
103            default: return "?";
104          }
105        }
106        public String getDisplay() {
107          switch (this) {
108            case INPROGRESS: return "In progress";
109            case COMPLETED: return "Completed";
110            case ENTEREDINERROR: return "Entered in Error";
111            default: return "?";
112          }
113        }
114    }
115
116  public static class ClinicalImpressionStatusEnumFactory implements EnumFactory<ClinicalImpressionStatus> {
117    public ClinicalImpressionStatus fromCode(String codeString) throws IllegalArgumentException {
118      if (codeString == null || "".equals(codeString))
119            if (codeString == null || "".equals(codeString))
120                return null;
121        if ("in-progress".equals(codeString))
122          return ClinicalImpressionStatus.INPROGRESS;
123        if ("completed".equals(codeString))
124          return ClinicalImpressionStatus.COMPLETED;
125        if ("entered-in-error".equals(codeString))
126          return ClinicalImpressionStatus.ENTEREDINERROR;
127        throw new IllegalArgumentException("Unknown ClinicalImpressionStatus code '"+codeString+"'");
128        }
129        public Enumeration<ClinicalImpressionStatus> fromType(Base code) throws FHIRException {
130          if (code == null || code.isEmpty())
131            return null;
132          String codeString = ((PrimitiveType) code).asStringValue();
133          if (codeString == null || "".equals(codeString))
134            return null;
135        if ("in-progress".equals(codeString))
136          return new Enumeration<ClinicalImpressionStatus>(this, ClinicalImpressionStatus.INPROGRESS);
137        if ("completed".equals(codeString))
138          return new Enumeration<ClinicalImpressionStatus>(this, ClinicalImpressionStatus.COMPLETED);
139        if ("entered-in-error".equals(codeString))
140          return new Enumeration<ClinicalImpressionStatus>(this, ClinicalImpressionStatus.ENTEREDINERROR);
141        throw new FHIRException("Unknown ClinicalImpressionStatus code '"+codeString+"'");
142        }
143    public String toCode(ClinicalImpressionStatus code) {
144      if (code == ClinicalImpressionStatus.INPROGRESS)
145        return "in-progress";
146      if (code == ClinicalImpressionStatus.COMPLETED)
147        return "completed";
148      if (code == ClinicalImpressionStatus.ENTEREDINERROR)
149        return "entered-in-error";
150      return "?";
151      }
152    }
153
154    @Block()
155    public static class ClinicalImpressionInvestigationsComponent extends BackboneElement implements IBaseBackboneElement {
156        /**
157         * A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.
158         */
159        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
160        @Description(shortDefinition="A name/code for the set", formalDefinition="A name/code for the group (\"set\") of investigations. Typically, this will be something like \"signs\", \"symptoms\", \"clinical\", \"diagnostic\", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used." )
161        protected CodeableConcept code;
162
163        /**
164         * A record of a specific investigation that was undertaken.
165         */
166        @Child(name = "item", type = {Observation.class, QuestionnaireResponse.class, FamilyMemberHistory.class, DiagnosticReport.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
167        @Description(shortDefinition="Record of a specific investigation", formalDefinition="A record of a specific investigation that was undertaken." )
168        protected List<Reference> item;
169        /**
170         * The actual objects that are the target of the reference (A record of a specific investigation that was undertaken.)
171         */
172        protected List<Resource> itemTarget;
173
174
175        private static final long serialVersionUID = -301363326L;
176
177    /*
178     * Constructor
179     */
180      public ClinicalImpressionInvestigationsComponent() {
181        super();
182      }
183
184    /*
185     * Constructor
186     */
187      public ClinicalImpressionInvestigationsComponent(CodeableConcept code) {
188        super();
189        this.code = code;
190      }
191
192        /**
193         * @return {@link #code} (A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.)
194         */
195        public CodeableConcept getCode() { 
196          if (this.code == null)
197            if (Configuration.errorOnAutoCreate())
198              throw new Error("Attempt to auto-create ClinicalImpressionInvestigationsComponent.code");
199            else if (Configuration.doAutoCreate())
200              this.code = new CodeableConcept(); // cc
201          return this.code;
202        }
203
204        public boolean hasCode() { 
205          return this.code != null && !this.code.isEmpty();
206        }
207
208        /**
209         * @param value {@link #code} (A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.)
210         */
211        public ClinicalImpressionInvestigationsComponent setCode(CodeableConcept value) { 
212          this.code = value;
213          return this;
214        }
215
216        /**
217         * @return {@link #item} (A record of a specific investigation that was undertaken.)
218         */
219        public List<Reference> getItem() { 
220          if (this.item == null)
221            this.item = new ArrayList<Reference>();
222          return this.item;
223        }
224
225        public boolean hasItem() { 
226          if (this.item == null)
227            return false;
228          for (Reference item : this.item)
229            if (!item.isEmpty())
230              return true;
231          return false;
232        }
233
234        /**
235         * @return {@link #item} (A record of a specific investigation that was undertaken.)
236         */
237    // syntactic sugar
238        public Reference addItem() { //3
239          Reference t = new Reference();
240          if (this.item == null)
241            this.item = new ArrayList<Reference>();
242          this.item.add(t);
243          return t;
244        }
245
246    // syntactic sugar
247        public ClinicalImpressionInvestigationsComponent addItem(Reference t) { //3
248          if (t == null)
249            return this;
250          if (this.item == null)
251            this.item = new ArrayList<Reference>();
252          this.item.add(t);
253          return this;
254        }
255
256        /**
257         * @return {@link #item} (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. A record of a specific investigation that was undertaken.)
258         */
259        public List<Resource> getItemTarget() { 
260          if (this.itemTarget == null)
261            this.itemTarget = new ArrayList<Resource>();
262          return this.itemTarget;
263        }
264
265        protected void listChildren(List<Property> childrenList) {
266          super.listChildren(childrenList);
267          childrenList.add(new Property("code", "CodeableConcept", "A name/code for the group (\"set\") of investigations. Typically, this will be something like \"signs\", \"symptoms\", \"clinical\", \"diagnostic\", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.", 0, java.lang.Integer.MAX_VALUE, code));
268          childrenList.add(new Property("item", "Reference(Observation|QuestionnaireResponse|FamilyMemberHistory|DiagnosticReport)", "A record of a specific investigation that was undertaken.", 0, java.lang.Integer.MAX_VALUE, item));
269        }
270
271      @Override
272      public void setProperty(String name, Base value) throws FHIRException {
273        if (name.equals("code"))
274          this.code = castToCodeableConcept(value); // CodeableConcept
275        else if (name.equals("item"))
276          this.getItem().add(castToReference(value));
277        else
278          super.setProperty(name, value);
279      }
280
281      @Override
282      public Base addChild(String name) throws FHIRException {
283        if (name.equals("code")) {
284          this.code = new CodeableConcept();
285          return this.code;
286        }
287        else if (name.equals("item")) {
288          return addItem();
289        }
290        else
291          return super.addChild(name);
292      }
293
294      public ClinicalImpressionInvestigationsComponent copy() {
295        ClinicalImpressionInvestigationsComponent dst = new ClinicalImpressionInvestigationsComponent();
296        copyValues(dst);
297        dst.code = code == null ? null : code.copy();
298        if (item != null) {
299          dst.item = new ArrayList<Reference>();
300          for (Reference i : item)
301            dst.item.add(i.copy());
302        };
303        return dst;
304      }
305
306      @Override
307      public boolean equalsDeep(Base other) {
308        if (!super.equalsDeep(other))
309          return false;
310        if (!(other instanceof ClinicalImpressionInvestigationsComponent))
311          return false;
312        ClinicalImpressionInvestigationsComponent o = (ClinicalImpressionInvestigationsComponent) other;
313        return compareDeep(code, o.code, true) && compareDeep(item, o.item, true);
314      }
315
316      @Override
317      public boolean equalsShallow(Base other) {
318        if (!super.equalsShallow(other))
319          return false;
320        if (!(other instanceof ClinicalImpressionInvestigationsComponent))
321          return false;
322        ClinicalImpressionInvestigationsComponent o = (ClinicalImpressionInvestigationsComponent) other;
323        return true;
324      }
325
326      public boolean isEmpty() {
327        return super.isEmpty() && (code == null || code.isEmpty()) && (item == null || item.isEmpty())
328          ;
329      }
330
331  public String fhirType() {
332    return "ClinicalImpression.investigations";
333
334  }
335
336  }
337
338    @Block()
339    public static class ClinicalImpressionFindingComponent extends BackboneElement implements IBaseBackboneElement {
340        /**
341         * Specific text of code for finding or diagnosis.
342         */
343        @Child(name = "item", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
344        @Description(shortDefinition="Specific text or code for finding", formalDefinition="Specific text of code for finding or diagnosis." )
345        protected CodeableConcept item;
346
347        /**
348         * Which investigations support finding or diagnosis.
349         */
350        @Child(name = "cause", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
351        @Description(shortDefinition="Which investigations support finding", formalDefinition="Which investigations support finding or diagnosis." )
352        protected StringType cause;
353
354        private static final long serialVersionUID = -888590978L;
355
356    /*
357     * Constructor
358     */
359      public ClinicalImpressionFindingComponent() {
360        super();
361      }
362
363    /*
364     * Constructor
365     */
366      public ClinicalImpressionFindingComponent(CodeableConcept item) {
367        super();
368        this.item = item;
369      }
370
371        /**
372         * @return {@link #item} (Specific text of code for finding or diagnosis.)
373         */
374        public CodeableConcept getItem() { 
375          if (this.item == null)
376            if (Configuration.errorOnAutoCreate())
377              throw new Error("Attempt to auto-create ClinicalImpressionFindingComponent.item");
378            else if (Configuration.doAutoCreate())
379              this.item = new CodeableConcept(); // cc
380          return this.item;
381        }
382
383        public boolean hasItem() { 
384          return this.item != null && !this.item.isEmpty();
385        }
386
387        /**
388         * @param value {@link #item} (Specific text of code for finding or diagnosis.)
389         */
390        public ClinicalImpressionFindingComponent setItem(CodeableConcept value) { 
391          this.item = value;
392          return this;
393        }
394
395        /**
396         * @return {@link #cause} (Which investigations support finding or diagnosis.). This is the underlying object with id, value and extensions. The accessor "getCause" gives direct access to the value
397         */
398        public StringType getCauseElement() { 
399          if (this.cause == null)
400            if (Configuration.errorOnAutoCreate())
401              throw new Error("Attempt to auto-create ClinicalImpressionFindingComponent.cause");
402            else if (Configuration.doAutoCreate())
403              this.cause = new StringType(); // bb
404          return this.cause;
405        }
406
407        public boolean hasCauseElement() { 
408          return this.cause != null && !this.cause.isEmpty();
409        }
410
411        public boolean hasCause() { 
412          return this.cause != null && !this.cause.isEmpty();
413        }
414
415        /**
416         * @param value {@link #cause} (Which investigations support finding or diagnosis.). This is the underlying object with id, value and extensions. The accessor "getCause" gives direct access to the value
417         */
418        public ClinicalImpressionFindingComponent setCauseElement(StringType value) { 
419          this.cause = value;
420          return this;
421        }
422
423        /**
424         * @return Which investigations support finding or diagnosis.
425         */
426        public String getCause() { 
427          return this.cause == null ? null : this.cause.getValue();
428        }
429
430        /**
431         * @param value Which investigations support finding or diagnosis.
432         */
433        public ClinicalImpressionFindingComponent setCause(String value) { 
434          if (Utilities.noString(value))
435            this.cause = null;
436          else {
437            if (this.cause == null)
438              this.cause = new StringType();
439            this.cause.setValue(value);
440          }
441          return this;
442        }
443
444        protected void listChildren(List<Property> childrenList) {
445          super.listChildren(childrenList);
446          childrenList.add(new Property("item", "CodeableConcept", "Specific text of code for finding or diagnosis.", 0, java.lang.Integer.MAX_VALUE, item));
447          childrenList.add(new Property("cause", "string", "Which investigations support finding or diagnosis.", 0, java.lang.Integer.MAX_VALUE, cause));
448        }
449
450      @Override
451      public void setProperty(String name, Base value) throws FHIRException {
452        if (name.equals("item"))
453          this.item = castToCodeableConcept(value); // CodeableConcept
454        else if (name.equals("cause"))
455          this.cause = castToString(value); // StringType
456        else
457          super.setProperty(name, value);
458      }
459
460      @Override
461      public Base addChild(String name) throws FHIRException {
462        if (name.equals("item")) {
463          this.item = new CodeableConcept();
464          return this.item;
465        }
466        else if (name.equals("cause")) {
467          throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.cause");
468        }
469        else
470          return super.addChild(name);
471      }
472
473      public ClinicalImpressionFindingComponent copy() {
474        ClinicalImpressionFindingComponent dst = new ClinicalImpressionFindingComponent();
475        copyValues(dst);
476        dst.item = item == null ? null : item.copy();
477        dst.cause = cause == null ? null : cause.copy();
478        return dst;
479      }
480
481      @Override
482      public boolean equalsDeep(Base other) {
483        if (!super.equalsDeep(other))
484          return false;
485        if (!(other instanceof ClinicalImpressionFindingComponent))
486          return false;
487        ClinicalImpressionFindingComponent o = (ClinicalImpressionFindingComponent) other;
488        return compareDeep(item, o.item, true) && compareDeep(cause, o.cause, true);
489      }
490
491      @Override
492      public boolean equalsShallow(Base other) {
493        if (!super.equalsShallow(other))
494          return false;
495        if (!(other instanceof ClinicalImpressionFindingComponent))
496          return false;
497        ClinicalImpressionFindingComponent o = (ClinicalImpressionFindingComponent) other;
498        return compareValues(cause, o.cause, true);
499      }
500
501      public boolean isEmpty() {
502        return super.isEmpty() && (item == null || item.isEmpty()) && (cause == null || cause.isEmpty())
503          ;
504      }
505
506  public String fhirType() {
507    return "ClinicalImpression.finding";
508
509  }
510
511  }
512
513    @Block()
514    public static class ClinicalImpressionRuledOutComponent extends BackboneElement implements IBaseBackboneElement {
515        /**
516         * Specific text of code for diagnosis.
517         */
518        @Child(name = "item", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
519        @Description(shortDefinition="Specific text of code for diagnosis", formalDefinition="Specific text of code for diagnosis." )
520        protected CodeableConcept item;
521
522        /**
523         * Grounds for elimination.
524         */
525        @Child(name = "reason", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
526        @Description(shortDefinition="Grounds for elimination", formalDefinition="Grounds for elimination." )
527        protected StringType reason;
528
529        private static final long serialVersionUID = -1001661243L;
530
531    /*
532     * Constructor
533     */
534      public ClinicalImpressionRuledOutComponent() {
535        super();
536      }
537
538    /*
539     * Constructor
540     */
541      public ClinicalImpressionRuledOutComponent(CodeableConcept item) {
542        super();
543        this.item = item;
544      }
545
546        /**
547         * @return {@link #item} (Specific text of code for diagnosis.)
548         */
549        public CodeableConcept getItem() { 
550          if (this.item == null)
551            if (Configuration.errorOnAutoCreate())
552              throw new Error("Attempt to auto-create ClinicalImpressionRuledOutComponent.item");
553            else if (Configuration.doAutoCreate())
554              this.item = new CodeableConcept(); // cc
555          return this.item;
556        }
557
558        public boolean hasItem() { 
559          return this.item != null && !this.item.isEmpty();
560        }
561
562        /**
563         * @param value {@link #item} (Specific text of code for diagnosis.)
564         */
565        public ClinicalImpressionRuledOutComponent setItem(CodeableConcept value) { 
566          this.item = value;
567          return this;
568        }
569
570        /**
571         * @return {@link #reason} (Grounds for elimination.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value
572         */
573        public StringType getReasonElement() { 
574          if (this.reason == null)
575            if (Configuration.errorOnAutoCreate())
576              throw new Error("Attempt to auto-create ClinicalImpressionRuledOutComponent.reason");
577            else if (Configuration.doAutoCreate())
578              this.reason = new StringType(); // bb
579          return this.reason;
580        }
581
582        public boolean hasReasonElement() { 
583          return this.reason != null && !this.reason.isEmpty();
584        }
585
586        public boolean hasReason() { 
587          return this.reason != null && !this.reason.isEmpty();
588        }
589
590        /**
591         * @param value {@link #reason} (Grounds for elimination.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value
592         */
593        public ClinicalImpressionRuledOutComponent setReasonElement(StringType value) { 
594          this.reason = value;
595          return this;
596        }
597
598        /**
599         * @return Grounds for elimination.
600         */
601        public String getReason() { 
602          return this.reason == null ? null : this.reason.getValue();
603        }
604
605        /**
606         * @param value Grounds for elimination.
607         */
608        public ClinicalImpressionRuledOutComponent setReason(String value) { 
609          if (Utilities.noString(value))
610            this.reason = null;
611          else {
612            if (this.reason == null)
613              this.reason = new StringType();
614            this.reason.setValue(value);
615          }
616          return this;
617        }
618
619        protected void listChildren(List<Property> childrenList) {
620          super.listChildren(childrenList);
621          childrenList.add(new Property("item", "CodeableConcept", "Specific text of code for diagnosis.", 0, java.lang.Integer.MAX_VALUE, item));
622          childrenList.add(new Property("reason", "string", "Grounds for elimination.", 0, java.lang.Integer.MAX_VALUE, reason));
623        }
624
625      @Override
626      public void setProperty(String name, Base value) throws FHIRException {
627        if (name.equals("item"))
628          this.item = castToCodeableConcept(value); // CodeableConcept
629        else if (name.equals("reason"))
630          this.reason = castToString(value); // StringType
631        else
632          super.setProperty(name, value);
633      }
634
635      @Override
636      public Base addChild(String name) throws FHIRException {
637        if (name.equals("item")) {
638          this.item = new CodeableConcept();
639          return this.item;
640        }
641        else if (name.equals("reason")) {
642          throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.reason");
643        }
644        else
645          return super.addChild(name);
646      }
647
648      public ClinicalImpressionRuledOutComponent copy() {
649        ClinicalImpressionRuledOutComponent dst = new ClinicalImpressionRuledOutComponent();
650        copyValues(dst);
651        dst.item = item == null ? null : item.copy();
652        dst.reason = reason == null ? null : reason.copy();
653        return dst;
654      }
655
656      @Override
657      public boolean equalsDeep(Base other) {
658        if (!super.equalsDeep(other))
659          return false;
660        if (!(other instanceof ClinicalImpressionRuledOutComponent))
661          return false;
662        ClinicalImpressionRuledOutComponent o = (ClinicalImpressionRuledOutComponent) other;
663        return compareDeep(item, o.item, true) && compareDeep(reason, o.reason, true);
664      }
665
666      @Override
667      public boolean equalsShallow(Base other) {
668        if (!super.equalsShallow(other))
669          return false;
670        if (!(other instanceof ClinicalImpressionRuledOutComponent))
671          return false;
672        ClinicalImpressionRuledOutComponent o = (ClinicalImpressionRuledOutComponent) other;
673        return compareValues(reason, o.reason, true);
674      }
675
676      public boolean isEmpty() {
677        return super.isEmpty() && (item == null || item.isEmpty()) && (reason == null || reason.isEmpty())
678          ;
679      }
680
681  public String fhirType() {
682    return "ClinicalImpression.ruledOut";
683
684  }
685
686  }
687
688    /**
689     * The patient being assessed.
690     */
691    @Child(name = "patient", type = {Patient.class}, order=0, min=1, max=1, modifier=false, summary=true)
692    @Description(shortDefinition="The patient being assessed", formalDefinition="The patient being assessed." )
693    protected Reference patient;
694
695    /**
696     * The actual object that is the target of the reference (The patient being assessed.)
697     */
698    protected Patient patientTarget;
699
700    /**
701     * The clinician performing the assessment.
702     */
703    @Child(name = "assessor", type = {Practitioner.class}, order=1, min=0, max=1, modifier=false, summary=true)
704    @Description(shortDefinition="The clinician performing the assessment", formalDefinition="The clinician performing the assessment." )
705    protected Reference assessor;
706
707    /**
708     * The actual object that is the target of the reference (The clinician performing the assessment.)
709     */
710    protected Practitioner assessorTarget;
711
712    /**
713     * Identifies the workflow status of the assessment.
714     */
715    @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true)
716    @Description(shortDefinition="in-progress | completed | entered-in-error", formalDefinition="Identifies the workflow status of the assessment." )
717    protected Enumeration<ClinicalImpressionStatus> status;
718
719    /**
720     * The point in time at which the assessment was concluded (not when it was recorded).
721     */
722    @Child(name = "date", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true)
723    @Description(shortDefinition="When the assessment occurred", formalDefinition="The point in time at which the assessment was concluded (not when it was recorded)." )
724    protected DateTimeType date;
725
726    /**
727     * A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.
728     */
729    @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
730    @Description(shortDefinition="Why/how the assessment was performed", formalDefinition="A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it." )
731    protected StringType description;
732
733    /**
734     * A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.
735     */
736    @Child(name = "previous", type = {ClinicalImpression.class}, order=5, min=0, max=1, modifier=false, summary=false)
737    @Description(shortDefinition="Reference to last assessment", formalDefinition="A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes." )
738    protected Reference previous;
739
740    /**
741     * The actual object that is the target of the reference (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.)
742     */
743    protected ClinicalImpression previousTarget;
744
745    /**
746     * This a list of the general problems/conditions for a patient.
747     */
748    @Child(name = "problem", type = {Condition.class, AllergyIntolerance.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
749    @Description(shortDefinition="General assessment of patient state", formalDefinition="This a list of the general problems/conditions for a patient." )
750    protected List<Reference> problem;
751    /**
752     * The actual objects that are the target of the reference (This a list of the general problems/conditions for a patient.)
753     */
754    protected List<Resource> problemTarget;
755
756
757    /**
758     * The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.
759     */
760    @Child(name = "trigger", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false)
761    @Description(shortDefinition="Request or event that necessitated this assessment", formalDefinition="The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource." )
762    protected Type trigger;
763
764    /**
765     * One or more sets of investigations (signs, symptions, etc.). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.
766     */
767    @Child(name = "investigations", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
768    @Description(shortDefinition="One or more sets of investigations (signs, symptions, etc.)", formalDefinition="One or more sets of investigations (signs, symptions, etc.). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes." )
769    protected List<ClinicalImpressionInvestigationsComponent> investigations;
770
771    /**
772     * Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.
773     */
774    @Child(name = "protocol", type = {UriType.class}, order=9, min=0, max=1, modifier=false, summary=false)
775    @Description(shortDefinition="Clinical Protocol followed", formalDefinition="Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis." )
776    protected UriType protocol;
777
778    /**
779     * A text summary of the investigations and the diagnosis.
780     */
781    @Child(name = "summary", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false)
782    @Description(shortDefinition="Summary of the assessment", formalDefinition="A text summary of the investigations and the diagnosis." )
783    protected StringType summary;
784
785    /**
786     * Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.
787     */
788    @Child(name = "finding", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
789    @Description(shortDefinition="Possible or likely findings and diagnoses", formalDefinition="Specific findings or diagnoses that was considered likely or relevant to ongoing treatment." )
790    protected List<ClinicalImpressionFindingComponent> finding;
791
792    /**
793     * Diagnoses/conditions resolved since the last assessment.
794     */
795    @Child(name = "resolved", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
796    @Description(shortDefinition="Diagnoses/conditions resolved since previous assessment", formalDefinition="Diagnoses/conditions resolved since the last assessment." )
797    protected List<CodeableConcept> resolved;
798
799    /**
800     * Diagnosis considered not possible.
801     */
802    @Child(name = "ruledOut", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
803    @Description(shortDefinition="Diagnosis considered not possible", formalDefinition="Diagnosis considered not possible." )
804    protected List<ClinicalImpressionRuledOutComponent> ruledOut;
805
806    /**
807     * Estimate of likely outcome.
808     */
809    @Child(name = "prognosis", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false)
810    @Description(shortDefinition="Estimate of likely outcome", formalDefinition="Estimate of likely outcome." )
811    protected StringType prognosis;
812
813    /**
814     * Plan of action after assessment.
815     */
816    @Child(name = "plan", type = {CarePlan.class, Appointment.class, CommunicationRequest.class, DeviceUseRequest.class, DiagnosticOrder.class, MedicationOrder.class, NutritionOrder.class, Order.class, ProcedureRequest.class, ProcessRequest.class, ReferralRequest.class, SupplyRequest.class, VisionPrescription.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
817    @Description(shortDefinition="Plan of action after assessment", formalDefinition="Plan of action after assessment." )
818    protected List<Reference> plan;
819    /**
820     * The actual objects that are the target of the reference (Plan of action after assessment.)
821     */
822    protected List<Resource> planTarget;
823
824
825    /**
826     * Actions taken during assessment.
827     */
828    @Child(name = "action", type = {ReferralRequest.class, ProcedureRequest.class, Procedure.class, MedicationOrder.class, DiagnosticOrder.class, NutritionOrder.class, SupplyRequest.class, Appointment.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
829    @Description(shortDefinition="Actions taken during assessment", formalDefinition="Actions taken during assessment." )
830    protected List<Reference> action;
831    /**
832     * The actual objects that are the target of the reference (Actions taken during assessment.)
833     */
834    protected List<Resource> actionTarget;
835
836
837    private static final long serialVersionUID = 1650458630L;
838
839  /*
840   * Constructor
841   */
842    public ClinicalImpression() {
843      super();
844    }
845
846  /*
847   * Constructor
848   */
849    public ClinicalImpression(Reference patient, Enumeration<ClinicalImpressionStatus> status) {
850      super();
851      this.patient = patient;
852      this.status = status;
853    }
854
855    /**
856     * @return {@link #patient} (The patient being assessed.)
857     */
858    public Reference getPatient() { 
859      if (this.patient == null)
860        if (Configuration.errorOnAutoCreate())
861          throw new Error("Attempt to auto-create ClinicalImpression.patient");
862        else if (Configuration.doAutoCreate())
863          this.patient = new Reference(); // cc
864      return this.patient;
865    }
866
867    public boolean hasPatient() { 
868      return this.patient != null && !this.patient.isEmpty();
869    }
870
871    /**
872     * @param value {@link #patient} (The patient being assessed.)
873     */
874    public ClinicalImpression setPatient(Reference value) { 
875      this.patient = value;
876      return this;
877    }
878
879    /**
880     * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient being assessed.)
881     */
882    public Patient getPatientTarget() { 
883      if (this.patientTarget == null)
884        if (Configuration.errorOnAutoCreate())
885          throw new Error("Attempt to auto-create ClinicalImpression.patient");
886        else if (Configuration.doAutoCreate())
887          this.patientTarget = new Patient(); // aa
888      return this.patientTarget;
889    }
890
891    /**
892     * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient being assessed.)
893     */
894    public ClinicalImpression setPatientTarget(Patient value) { 
895      this.patientTarget = value;
896      return this;
897    }
898
899    /**
900     * @return {@link #assessor} (The clinician performing the assessment.)
901     */
902    public Reference getAssessor() { 
903      if (this.assessor == null)
904        if (Configuration.errorOnAutoCreate())
905          throw new Error("Attempt to auto-create ClinicalImpression.assessor");
906        else if (Configuration.doAutoCreate())
907          this.assessor = new Reference(); // cc
908      return this.assessor;
909    }
910
911    public boolean hasAssessor() { 
912      return this.assessor != null && !this.assessor.isEmpty();
913    }
914
915    /**
916     * @param value {@link #assessor} (The clinician performing the assessment.)
917     */
918    public ClinicalImpression setAssessor(Reference value) { 
919      this.assessor = value;
920      return this;
921    }
922
923    /**
924     * @return {@link #assessor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The clinician performing the assessment.)
925     */
926    public Practitioner getAssessorTarget() { 
927      if (this.assessorTarget == null)
928        if (Configuration.errorOnAutoCreate())
929          throw new Error("Attempt to auto-create ClinicalImpression.assessor");
930        else if (Configuration.doAutoCreate())
931          this.assessorTarget = new Practitioner(); // aa
932      return this.assessorTarget;
933    }
934
935    /**
936     * @param value {@link #assessor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The clinician performing the assessment.)
937     */
938    public ClinicalImpression setAssessorTarget(Practitioner value) { 
939      this.assessorTarget = value;
940      return this;
941    }
942
943    /**
944     * @return {@link #status} (Identifies the workflow status of the assessment.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
945     */
946    public Enumeration<ClinicalImpressionStatus> getStatusElement() { 
947      if (this.status == null)
948        if (Configuration.errorOnAutoCreate())
949          throw new Error("Attempt to auto-create ClinicalImpression.status");
950        else if (Configuration.doAutoCreate())
951          this.status = new Enumeration<ClinicalImpressionStatus>(new ClinicalImpressionStatusEnumFactory()); // bb
952      return this.status;
953    }
954
955    public boolean hasStatusElement() { 
956      return this.status != null && !this.status.isEmpty();
957    }
958
959    public boolean hasStatus() { 
960      return this.status != null && !this.status.isEmpty();
961    }
962
963    /**
964     * @param value {@link #status} (Identifies the workflow status of the assessment.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
965     */
966    public ClinicalImpression setStatusElement(Enumeration<ClinicalImpressionStatus> value) { 
967      this.status = value;
968      return this;
969    }
970
971    /**
972     * @return Identifies the workflow status of the assessment.
973     */
974    public ClinicalImpressionStatus getStatus() { 
975      return this.status == null ? null : this.status.getValue();
976    }
977
978    /**
979     * @param value Identifies the workflow status of the assessment.
980     */
981    public ClinicalImpression setStatus(ClinicalImpressionStatus value) { 
982        if (this.status == null)
983          this.status = new Enumeration<ClinicalImpressionStatus>(new ClinicalImpressionStatusEnumFactory());
984        this.status.setValue(value);
985      return this;
986    }
987
988    /**
989     * @return {@link #date} (The point in time at which the assessment was concluded (not when it was recorded).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
990     */
991    public DateTimeType getDateElement() { 
992      if (this.date == null)
993        if (Configuration.errorOnAutoCreate())
994          throw new Error("Attempt to auto-create ClinicalImpression.date");
995        else if (Configuration.doAutoCreate())
996          this.date = new DateTimeType(); // bb
997      return this.date;
998    }
999
1000    public boolean hasDateElement() { 
1001      return this.date != null && !this.date.isEmpty();
1002    }
1003
1004    public boolean hasDate() { 
1005      return this.date != null && !this.date.isEmpty();
1006    }
1007
1008    /**
1009     * @param value {@link #date} (The point in time at which the assessment was concluded (not when it was recorded).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1010     */
1011    public ClinicalImpression setDateElement(DateTimeType value) { 
1012      this.date = value;
1013      return this;
1014    }
1015
1016    /**
1017     * @return The point in time at which the assessment was concluded (not when it was recorded).
1018     */
1019    public Date getDate() { 
1020      return this.date == null ? null : this.date.getValue();
1021    }
1022
1023    /**
1024     * @param value The point in time at which the assessment was concluded (not when it was recorded).
1025     */
1026    public ClinicalImpression setDate(Date value) { 
1027      if (value == null)
1028        this.date = null;
1029      else {
1030        if (this.date == null)
1031          this.date = new DateTimeType();
1032        this.date.setValue(value);
1033      }
1034      return this;
1035    }
1036
1037    /**
1038     * @return {@link #description} (A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1039     */
1040    public StringType getDescriptionElement() { 
1041      if (this.description == null)
1042        if (Configuration.errorOnAutoCreate())
1043          throw new Error("Attempt to auto-create ClinicalImpression.description");
1044        else if (Configuration.doAutoCreate())
1045          this.description = new StringType(); // bb
1046      return this.description;
1047    }
1048
1049    public boolean hasDescriptionElement() { 
1050      return this.description != null && !this.description.isEmpty();
1051    }
1052
1053    public boolean hasDescription() { 
1054      return this.description != null && !this.description.isEmpty();
1055    }
1056
1057    /**
1058     * @param value {@link #description} (A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1059     */
1060    public ClinicalImpression setDescriptionElement(StringType value) { 
1061      this.description = value;
1062      return this;
1063    }
1064
1065    /**
1066     * @return A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.
1067     */
1068    public String getDescription() { 
1069      return this.description == null ? null : this.description.getValue();
1070    }
1071
1072    /**
1073     * @param value A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.
1074     */
1075    public ClinicalImpression setDescription(String value) { 
1076      if (Utilities.noString(value))
1077        this.description = null;
1078      else {
1079        if (this.description == null)
1080          this.description = new StringType();
1081        this.description.setValue(value);
1082      }
1083      return this;
1084    }
1085
1086    /**
1087     * @return {@link #previous} (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.)
1088     */
1089    public Reference getPrevious() { 
1090      if (this.previous == null)
1091        if (Configuration.errorOnAutoCreate())
1092          throw new Error("Attempt to auto-create ClinicalImpression.previous");
1093        else if (Configuration.doAutoCreate())
1094          this.previous = new Reference(); // cc
1095      return this.previous;
1096    }
1097
1098    public boolean hasPrevious() { 
1099      return this.previous != null && !this.previous.isEmpty();
1100    }
1101
1102    /**
1103     * @param value {@link #previous} (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.)
1104     */
1105    public ClinicalImpression setPrevious(Reference value) { 
1106      this.previous = value;
1107      return this;
1108    }
1109
1110    /**
1111     * @return {@link #previous} 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. (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.)
1112     */
1113    public ClinicalImpression getPreviousTarget() { 
1114      if (this.previousTarget == null)
1115        if (Configuration.errorOnAutoCreate())
1116          throw new Error("Attempt to auto-create ClinicalImpression.previous");
1117        else if (Configuration.doAutoCreate())
1118          this.previousTarget = new ClinicalImpression(); // aa
1119      return this.previousTarget;
1120    }
1121
1122    /**
1123     * @param value {@link #previous} 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. (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.)
1124     */
1125    public ClinicalImpression setPreviousTarget(ClinicalImpression value) { 
1126      this.previousTarget = value;
1127      return this;
1128    }
1129
1130    /**
1131     * @return {@link #problem} (This a list of the general problems/conditions for a patient.)
1132     */
1133    public List<Reference> getProblem() { 
1134      if (this.problem == null)
1135        this.problem = new ArrayList<Reference>();
1136      return this.problem;
1137    }
1138
1139    public boolean hasProblem() { 
1140      if (this.problem == null)
1141        return false;
1142      for (Reference item : this.problem)
1143        if (!item.isEmpty())
1144          return true;
1145      return false;
1146    }
1147
1148    /**
1149     * @return {@link #problem} (This a list of the general problems/conditions for a patient.)
1150     */
1151    // syntactic sugar
1152    public Reference addProblem() { //3
1153      Reference t = new Reference();
1154      if (this.problem == null)
1155        this.problem = new ArrayList<Reference>();
1156      this.problem.add(t);
1157      return t;
1158    }
1159
1160    // syntactic sugar
1161    public ClinicalImpression addProblem(Reference t) { //3
1162      if (t == null)
1163        return this;
1164      if (this.problem == null)
1165        this.problem = new ArrayList<Reference>();
1166      this.problem.add(t);
1167      return this;
1168    }
1169
1170    /**
1171     * @return {@link #problem} (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. This a list of the general problems/conditions for a patient.)
1172     */
1173    public List<Resource> getProblemTarget() { 
1174      if (this.problemTarget == null)
1175        this.problemTarget = new ArrayList<Resource>();
1176      return this.problemTarget;
1177    }
1178
1179    /**
1180     * @return {@link #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.)
1181     */
1182    public Type getTrigger() { 
1183      return this.trigger;
1184    }
1185
1186    /**
1187     * @return {@link #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.)
1188     */
1189    public CodeableConcept getTriggerCodeableConcept() throws FHIRException { 
1190      if (!(this.trigger instanceof CodeableConcept))
1191        throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.trigger.getClass().getName()+" was encountered");
1192      return (CodeableConcept) this.trigger;
1193    }
1194
1195    public boolean hasTriggerCodeableConcept() { 
1196      return this.trigger instanceof CodeableConcept;
1197    }
1198
1199    /**
1200     * @return {@link #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.)
1201     */
1202    public Reference getTriggerReference() throws FHIRException { 
1203      if (!(this.trigger instanceof Reference))
1204        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.trigger.getClass().getName()+" was encountered");
1205      return (Reference) this.trigger;
1206    }
1207
1208    public boolean hasTriggerReference() { 
1209      return this.trigger instanceof Reference;
1210    }
1211
1212    public boolean hasTrigger() { 
1213      return this.trigger != null && !this.trigger.isEmpty();
1214    }
1215
1216    /**
1217     * @param value {@link #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.)
1218     */
1219    public ClinicalImpression setTrigger(Type value) { 
1220      this.trigger = value;
1221      return this;
1222    }
1223
1224    /**
1225     * @return {@link #investigations} (One or more sets of investigations (signs, symptions, etc.). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.)
1226     */
1227    public List<ClinicalImpressionInvestigationsComponent> getInvestigations() { 
1228      if (this.investigations == null)
1229        this.investigations = new ArrayList<ClinicalImpressionInvestigationsComponent>();
1230      return this.investigations;
1231    }
1232
1233    public boolean hasInvestigations() { 
1234      if (this.investigations == null)
1235        return false;
1236      for (ClinicalImpressionInvestigationsComponent item : this.investigations)
1237        if (!item.isEmpty())
1238          return true;
1239      return false;
1240    }
1241
1242    /**
1243     * @return {@link #investigations} (One or more sets of investigations (signs, symptions, etc.). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.)
1244     */
1245    // syntactic sugar
1246    public ClinicalImpressionInvestigationsComponent addInvestigations() { //3
1247      ClinicalImpressionInvestigationsComponent t = new ClinicalImpressionInvestigationsComponent();
1248      if (this.investigations == null)
1249        this.investigations = new ArrayList<ClinicalImpressionInvestigationsComponent>();
1250      this.investigations.add(t);
1251      return t;
1252    }
1253
1254    // syntactic sugar
1255    public ClinicalImpression addInvestigations(ClinicalImpressionInvestigationsComponent t) { //3
1256      if (t == null)
1257        return this;
1258      if (this.investigations == null)
1259        this.investigations = new ArrayList<ClinicalImpressionInvestigationsComponent>();
1260      this.investigations.add(t);
1261      return this;
1262    }
1263
1264    /**
1265     * @return {@link #protocol} (Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getProtocol" gives direct access to the value
1266     */
1267    public UriType getProtocolElement() { 
1268      if (this.protocol == null)
1269        if (Configuration.errorOnAutoCreate())
1270          throw new Error("Attempt to auto-create ClinicalImpression.protocol");
1271        else if (Configuration.doAutoCreate())
1272          this.protocol = new UriType(); // bb
1273      return this.protocol;
1274    }
1275
1276    public boolean hasProtocolElement() { 
1277      return this.protocol != null && !this.protocol.isEmpty();
1278    }
1279
1280    public boolean hasProtocol() { 
1281      return this.protocol != null && !this.protocol.isEmpty();
1282    }
1283
1284    /**
1285     * @param value {@link #protocol} (Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getProtocol" gives direct access to the value
1286     */
1287    public ClinicalImpression setProtocolElement(UriType value) { 
1288      this.protocol = value;
1289      return this;
1290    }
1291
1292    /**
1293     * @return Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.
1294     */
1295    public String getProtocol() { 
1296      return this.protocol == null ? null : this.protocol.getValue();
1297    }
1298
1299    /**
1300     * @param value Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.
1301     */
1302    public ClinicalImpression setProtocol(String value) { 
1303      if (Utilities.noString(value))
1304        this.protocol = null;
1305      else {
1306        if (this.protocol == null)
1307          this.protocol = new UriType();
1308        this.protocol.setValue(value);
1309      }
1310      return this;
1311    }
1312
1313    /**
1314     * @return {@link #summary} (A text summary of the investigations and the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSummary" gives direct access to the value
1315     */
1316    public StringType getSummaryElement() { 
1317      if (this.summary == null)
1318        if (Configuration.errorOnAutoCreate())
1319          throw new Error("Attempt to auto-create ClinicalImpression.summary");
1320        else if (Configuration.doAutoCreate())
1321          this.summary = new StringType(); // bb
1322      return this.summary;
1323    }
1324
1325    public boolean hasSummaryElement() { 
1326      return this.summary != null && !this.summary.isEmpty();
1327    }
1328
1329    public boolean hasSummary() { 
1330      return this.summary != null && !this.summary.isEmpty();
1331    }
1332
1333    /**
1334     * @param value {@link #summary} (A text summary of the investigations and the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSummary" gives direct access to the value
1335     */
1336    public ClinicalImpression setSummaryElement(StringType value) { 
1337      this.summary = value;
1338      return this;
1339    }
1340
1341    /**
1342     * @return A text summary of the investigations and the diagnosis.
1343     */
1344    public String getSummary() { 
1345      return this.summary == null ? null : this.summary.getValue();
1346    }
1347
1348    /**
1349     * @param value A text summary of the investigations and the diagnosis.
1350     */
1351    public ClinicalImpression setSummary(String value) { 
1352      if (Utilities.noString(value))
1353        this.summary = null;
1354      else {
1355        if (this.summary == null)
1356          this.summary = new StringType();
1357        this.summary.setValue(value);
1358      }
1359      return this;
1360    }
1361
1362    /**
1363     * @return {@link #finding} (Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.)
1364     */
1365    public List<ClinicalImpressionFindingComponent> getFinding() { 
1366      if (this.finding == null)
1367        this.finding = new ArrayList<ClinicalImpressionFindingComponent>();
1368      return this.finding;
1369    }
1370
1371    public boolean hasFinding() { 
1372      if (this.finding == null)
1373        return false;
1374      for (ClinicalImpressionFindingComponent item : this.finding)
1375        if (!item.isEmpty())
1376          return true;
1377      return false;
1378    }
1379
1380    /**
1381     * @return {@link #finding} (Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.)
1382     */
1383    // syntactic sugar
1384    public ClinicalImpressionFindingComponent addFinding() { //3
1385      ClinicalImpressionFindingComponent t = new ClinicalImpressionFindingComponent();
1386      if (this.finding == null)
1387        this.finding = new ArrayList<ClinicalImpressionFindingComponent>();
1388      this.finding.add(t);
1389      return t;
1390    }
1391
1392    // syntactic sugar
1393    public ClinicalImpression addFinding(ClinicalImpressionFindingComponent t) { //3
1394      if (t == null)
1395        return this;
1396      if (this.finding == null)
1397        this.finding = new ArrayList<ClinicalImpressionFindingComponent>();
1398      this.finding.add(t);
1399      return this;
1400    }
1401
1402    /**
1403     * @return {@link #resolved} (Diagnoses/conditions resolved since the last assessment.)
1404     */
1405    public List<CodeableConcept> getResolved() { 
1406      if (this.resolved == null)
1407        this.resolved = new ArrayList<CodeableConcept>();
1408      return this.resolved;
1409    }
1410
1411    public boolean hasResolved() { 
1412      if (this.resolved == null)
1413        return false;
1414      for (CodeableConcept item : this.resolved)
1415        if (!item.isEmpty())
1416          return true;
1417      return false;
1418    }
1419
1420    /**
1421     * @return {@link #resolved} (Diagnoses/conditions resolved since the last assessment.)
1422     */
1423    // syntactic sugar
1424    public CodeableConcept addResolved() { //3
1425      CodeableConcept t = new CodeableConcept();
1426      if (this.resolved == null)
1427        this.resolved = new ArrayList<CodeableConcept>();
1428      this.resolved.add(t);
1429      return t;
1430    }
1431
1432    // syntactic sugar
1433    public ClinicalImpression addResolved(CodeableConcept t) { //3
1434      if (t == null)
1435        return this;
1436      if (this.resolved == null)
1437        this.resolved = new ArrayList<CodeableConcept>();
1438      this.resolved.add(t);
1439      return this;
1440    }
1441
1442    /**
1443     * @return {@link #ruledOut} (Diagnosis considered not possible.)
1444     */
1445    public List<ClinicalImpressionRuledOutComponent> getRuledOut() { 
1446      if (this.ruledOut == null)
1447        this.ruledOut = new ArrayList<ClinicalImpressionRuledOutComponent>();
1448      return this.ruledOut;
1449    }
1450
1451    public boolean hasRuledOut() { 
1452      if (this.ruledOut == null)
1453        return false;
1454      for (ClinicalImpressionRuledOutComponent item : this.ruledOut)
1455        if (!item.isEmpty())
1456          return true;
1457      return false;
1458    }
1459
1460    /**
1461     * @return {@link #ruledOut} (Diagnosis considered not possible.)
1462     */
1463    // syntactic sugar
1464    public ClinicalImpressionRuledOutComponent addRuledOut() { //3
1465      ClinicalImpressionRuledOutComponent t = new ClinicalImpressionRuledOutComponent();
1466      if (this.ruledOut == null)
1467        this.ruledOut = new ArrayList<ClinicalImpressionRuledOutComponent>();
1468      this.ruledOut.add(t);
1469      return t;
1470    }
1471
1472    // syntactic sugar
1473    public ClinicalImpression addRuledOut(ClinicalImpressionRuledOutComponent t) { //3
1474      if (t == null)
1475        return this;
1476      if (this.ruledOut == null)
1477        this.ruledOut = new ArrayList<ClinicalImpressionRuledOutComponent>();
1478      this.ruledOut.add(t);
1479      return this;
1480    }
1481
1482    /**
1483     * @return {@link #prognosis} (Estimate of likely outcome.). This is the underlying object with id, value and extensions. The accessor "getPrognosis" gives direct access to the value
1484     */
1485    public StringType getPrognosisElement() { 
1486      if (this.prognosis == null)
1487        if (Configuration.errorOnAutoCreate())
1488          throw new Error("Attempt to auto-create ClinicalImpression.prognosis");
1489        else if (Configuration.doAutoCreate())
1490          this.prognosis = new StringType(); // bb
1491      return this.prognosis;
1492    }
1493
1494    public boolean hasPrognosisElement() { 
1495      return this.prognosis != null && !this.prognosis.isEmpty();
1496    }
1497
1498    public boolean hasPrognosis() { 
1499      return this.prognosis != null && !this.prognosis.isEmpty();
1500    }
1501
1502    /**
1503     * @param value {@link #prognosis} (Estimate of likely outcome.). This is the underlying object with id, value and extensions. The accessor "getPrognosis" gives direct access to the value
1504     */
1505    public ClinicalImpression setPrognosisElement(StringType value) { 
1506      this.prognosis = value;
1507      return this;
1508    }
1509
1510    /**
1511     * @return Estimate of likely outcome.
1512     */
1513    public String getPrognosis() { 
1514      return this.prognosis == null ? null : this.prognosis.getValue();
1515    }
1516
1517    /**
1518     * @param value Estimate of likely outcome.
1519     */
1520    public ClinicalImpression setPrognosis(String value) { 
1521      if (Utilities.noString(value))
1522        this.prognosis = null;
1523      else {
1524        if (this.prognosis == null)
1525          this.prognosis = new StringType();
1526        this.prognosis.setValue(value);
1527      }
1528      return this;
1529    }
1530
1531    /**
1532     * @return {@link #plan} (Plan of action after assessment.)
1533     */
1534    public List<Reference> getPlan() { 
1535      if (this.plan == null)
1536        this.plan = new ArrayList<Reference>();
1537      return this.plan;
1538    }
1539
1540    public boolean hasPlan() { 
1541      if (this.plan == null)
1542        return false;
1543      for (Reference item : this.plan)
1544        if (!item.isEmpty())
1545          return true;
1546      return false;
1547    }
1548
1549    /**
1550     * @return {@link #plan} (Plan of action after assessment.)
1551     */
1552    // syntactic sugar
1553    public Reference addPlan() { //3
1554      Reference t = new Reference();
1555      if (this.plan == null)
1556        this.plan = new ArrayList<Reference>();
1557      this.plan.add(t);
1558      return t;
1559    }
1560
1561    // syntactic sugar
1562    public ClinicalImpression addPlan(Reference t) { //3
1563      if (t == null)
1564        return this;
1565      if (this.plan == null)
1566        this.plan = new ArrayList<Reference>();
1567      this.plan.add(t);
1568      return this;
1569    }
1570
1571    /**
1572     * @return {@link #plan} (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. Plan of action after assessment.)
1573     */
1574    public List<Resource> getPlanTarget() { 
1575      if (this.planTarget == null)
1576        this.planTarget = new ArrayList<Resource>();
1577      return this.planTarget;
1578    }
1579
1580    /**
1581     * @return {@link #action} (Actions taken during assessment.)
1582     */
1583    public List<Reference> getAction() { 
1584      if (this.action == null)
1585        this.action = new ArrayList<Reference>();
1586      return this.action;
1587    }
1588
1589    public boolean hasAction() { 
1590      if (this.action == null)
1591        return false;
1592      for (Reference item : this.action)
1593        if (!item.isEmpty())
1594          return true;
1595      return false;
1596    }
1597
1598    /**
1599     * @return {@link #action} (Actions taken during assessment.)
1600     */
1601    // syntactic sugar
1602    public Reference addAction() { //3
1603      Reference t = new Reference();
1604      if (this.action == null)
1605        this.action = new ArrayList<Reference>();
1606      this.action.add(t);
1607      return t;
1608    }
1609
1610    // syntactic sugar
1611    public ClinicalImpression addAction(Reference t) { //3
1612      if (t == null)
1613        return this;
1614      if (this.action == null)
1615        this.action = new ArrayList<Reference>();
1616      this.action.add(t);
1617      return this;
1618    }
1619
1620    /**
1621     * @return {@link #action} (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. Actions taken during assessment.)
1622     */
1623    public List<Resource> getActionTarget() { 
1624      if (this.actionTarget == null)
1625        this.actionTarget = new ArrayList<Resource>();
1626      return this.actionTarget;
1627    }
1628
1629      protected void listChildren(List<Property> childrenList) {
1630        super.listChildren(childrenList);
1631        childrenList.add(new Property("patient", "Reference(Patient)", "The patient being assessed.", 0, java.lang.Integer.MAX_VALUE, patient));
1632        childrenList.add(new Property("assessor", "Reference(Practitioner)", "The clinician performing the assessment.", 0, java.lang.Integer.MAX_VALUE, assessor));
1633        childrenList.add(new Property("status", "code", "Identifies the workflow status of the assessment.", 0, java.lang.Integer.MAX_VALUE, status));
1634        childrenList.add(new Property("date", "dateTime", "The point in time at which the assessment was concluded (not when it was recorded).", 0, java.lang.Integer.MAX_VALUE, date));
1635        childrenList.add(new Property("description", "string", "A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.", 0, java.lang.Integer.MAX_VALUE, description));
1636        childrenList.add(new Property("previous", "Reference(ClinicalImpression)", "A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.", 0, java.lang.Integer.MAX_VALUE, previous));
1637        childrenList.add(new Property("problem", "Reference(Condition|AllergyIntolerance)", "This a list of the general problems/conditions for a patient.", 0, java.lang.Integer.MAX_VALUE, problem));
1638        childrenList.add(new Property("trigger[x]", "CodeableConcept|Reference(Any)", "The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.", 0, java.lang.Integer.MAX_VALUE, trigger));
1639        childrenList.add(new Property("investigations", "", "One or more sets of investigations (signs, symptions, etc.). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.", 0, java.lang.Integer.MAX_VALUE, investigations));
1640        childrenList.add(new Property("protocol", "uri", "Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.", 0, java.lang.Integer.MAX_VALUE, protocol));
1641        childrenList.add(new Property("summary", "string", "A text summary of the investigations and the diagnosis.", 0, java.lang.Integer.MAX_VALUE, summary));
1642        childrenList.add(new Property("finding", "", "Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.", 0, java.lang.Integer.MAX_VALUE, finding));
1643        childrenList.add(new Property("resolved", "CodeableConcept", "Diagnoses/conditions resolved since the last assessment.", 0, java.lang.Integer.MAX_VALUE, resolved));
1644        childrenList.add(new Property("ruledOut", "", "Diagnosis considered not possible.", 0, java.lang.Integer.MAX_VALUE, ruledOut));
1645        childrenList.add(new Property("prognosis", "string", "Estimate of likely outcome.", 0, java.lang.Integer.MAX_VALUE, prognosis));
1646        childrenList.add(new Property("plan", "Reference(CarePlan|Appointment|CommunicationRequest|DeviceUseRequest|DiagnosticOrder|MedicationOrder|NutritionOrder|Order|ProcedureRequest|ProcessRequest|ReferralRequest|SupplyRequest|VisionPrescription)", "Plan of action after assessment.", 0, java.lang.Integer.MAX_VALUE, plan));
1647        childrenList.add(new Property("action", "Reference(ReferralRequest|ProcedureRequest|Procedure|MedicationOrder|DiagnosticOrder|NutritionOrder|SupplyRequest|Appointment)", "Actions taken during assessment.", 0, java.lang.Integer.MAX_VALUE, action));
1648      }
1649
1650      @Override
1651      public void setProperty(String name, Base value) throws FHIRException {
1652        if (name.equals("patient"))
1653          this.patient = castToReference(value); // Reference
1654        else if (name.equals("assessor"))
1655          this.assessor = castToReference(value); // Reference
1656        else if (name.equals("status"))
1657          this.status = new ClinicalImpressionStatusEnumFactory().fromType(value); // Enumeration<ClinicalImpressionStatus>
1658        else if (name.equals("date"))
1659          this.date = castToDateTime(value); // DateTimeType
1660        else if (name.equals("description"))
1661          this.description = castToString(value); // StringType
1662        else if (name.equals("previous"))
1663          this.previous = castToReference(value); // Reference
1664        else if (name.equals("problem"))
1665          this.getProblem().add(castToReference(value));
1666        else if (name.equals("trigger[x]"))
1667          this.trigger = (Type) value; // Type
1668        else if (name.equals("investigations"))
1669          this.getInvestigations().add((ClinicalImpressionInvestigationsComponent) value);
1670        else if (name.equals("protocol"))
1671          this.protocol = castToUri(value); // UriType
1672        else if (name.equals("summary"))
1673          this.summary = castToString(value); // StringType
1674        else if (name.equals("finding"))
1675          this.getFinding().add((ClinicalImpressionFindingComponent) value);
1676        else if (name.equals("resolved"))
1677          this.getResolved().add(castToCodeableConcept(value));
1678        else if (name.equals("ruledOut"))
1679          this.getRuledOut().add((ClinicalImpressionRuledOutComponent) value);
1680        else if (name.equals("prognosis"))
1681          this.prognosis = castToString(value); // StringType
1682        else if (name.equals("plan"))
1683          this.getPlan().add(castToReference(value));
1684        else if (name.equals("action"))
1685          this.getAction().add(castToReference(value));
1686        else
1687          super.setProperty(name, value);
1688      }
1689
1690      @Override
1691      public Base addChild(String name) throws FHIRException {
1692        if (name.equals("patient")) {
1693          this.patient = new Reference();
1694          return this.patient;
1695        }
1696        else if (name.equals("assessor")) {
1697          this.assessor = new Reference();
1698          return this.assessor;
1699        }
1700        else if (name.equals("status")) {
1701          throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.status");
1702        }
1703        else if (name.equals("date")) {
1704          throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.date");
1705        }
1706        else if (name.equals("description")) {
1707          throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.description");
1708        }
1709        else if (name.equals("previous")) {
1710          this.previous = new Reference();
1711          return this.previous;
1712        }
1713        else if (name.equals("problem")) {
1714          return addProblem();
1715        }
1716        else if (name.equals("triggerCodeableConcept")) {
1717          this.trigger = new CodeableConcept();
1718          return this.trigger;
1719        }
1720        else if (name.equals("triggerReference")) {
1721          this.trigger = new Reference();
1722          return this.trigger;
1723        }
1724        else if (name.equals("investigations")) {
1725          return addInvestigations();
1726        }
1727        else if (name.equals("protocol")) {
1728          throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.protocol");
1729        }
1730        else if (name.equals("summary")) {
1731          throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.summary");
1732        }
1733        else if (name.equals("finding")) {
1734          return addFinding();
1735        }
1736        else if (name.equals("resolved")) {
1737          return addResolved();
1738        }
1739        else if (name.equals("ruledOut")) {
1740          return addRuledOut();
1741        }
1742        else if (name.equals("prognosis")) {
1743          throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.prognosis");
1744        }
1745        else if (name.equals("plan")) {
1746          return addPlan();
1747        }
1748        else if (name.equals("action")) {
1749          return addAction();
1750        }
1751        else
1752          return super.addChild(name);
1753      }
1754
1755  public String fhirType() {
1756    return "ClinicalImpression";
1757
1758  }
1759
1760      public ClinicalImpression copy() {
1761        ClinicalImpression dst = new ClinicalImpression();
1762        copyValues(dst);
1763        dst.patient = patient == null ? null : patient.copy();
1764        dst.assessor = assessor == null ? null : assessor.copy();
1765        dst.status = status == null ? null : status.copy();
1766        dst.date = date == null ? null : date.copy();
1767        dst.description = description == null ? null : description.copy();
1768        dst.previous = previous == null ? null : previous.copy();
1769        if (problem != null) {
1770          dst.problem = new ArrayList<Reference>();
1771          for (Reference i : problem)
1772            dst.problem.add(i.copy());
1773        };
1774        dst.trigger = trigger == null ? null : trigger.copy();
1775        if (investigations != null) {
1776          dst.investigations = new ArrayList<ClinicalImpressionInvestigationsComponent>();
1777          for (ClinicalImpressionInvestigationsComponent i : investigations)
1778            dst.investigations.add(i.copy());
1779        };
1780        dst.protocol = protocol == null ? null : protocol.copy();
1781        dst.summary = summary == null ? null : summary.copy();
1782        if (finding != null) {
1783          dst.finding = new ArrayList<ClinicalImpressionFindingComponent>();
1784          for (ClinicalImpressionFindingComponent i : finding)
1785            dst.finding.add(i.copy());
1786        };
1787        if (resolved != null) {
1788          dst.resolved = new ArrayList<CodeableConcept>();
1789          for (CodeableConcept i : resolved)
1790            dst.resolved.add(i.copy());
1791        };
1792        if (ruledOut != null) {
1793          dst.ruledOut = new ArrayList<ClinicalImpressionRuledOutComponent>();
1794          for (ClinicalImpressionRuledOutComponent i : ruledOut)
1795            dst.ruledOut.add(i.copy());
1796        };
1797        dst.prognosis = prognosis == null ? null : prognosis.copy();
1798        if (plan != null) {
1799          dst.plan = new ArrayList<Reference>();
1800          for (Reference i : plan)
1801            dst.plan.add(i.copy());
1802        };
1803        if (action != null) {
1804          dst.action = new ArrayList<Reference>();
1805          for (Reference i : action)
1806            dst.action.add(i.copy());
1807        };
1808        return dst;
1809      }
1810
1811      protected ClinicalImpression typedCopy() {
1812        return copy();
1813      }
1814
1815      @Override
1816      public boolean equalsDeep(Base other) {
1817        if (!super.equalsDeep(other))
1818          return false;
1819        if (!(other instanceof ClinicalImpression))
1820          return false;
1821        ClinicalImpression o = (ClinicalImpression) other;
1822        return compareDeep(patient, o.patient, true) && compareDeep(assessor, o.assessor, true) && compareDeep(status, o.status, true)
1823           && compareDeep(date, o.date, true) && compareDeep(description, o.description, true) && compareDeep(previous, o.previous, true)
1824           && compareDeep(problem, o.problem, true) && compareDeep(trigger, o.trigger, true) && compareDeep(investigations, o.investigations, true)
1825           && compareDeep(protocol, o.protocol, true) && compareDeep(summary, o.summary, true) && compareDeep(finding, o.finding, true)
1826           && compareDeep(resolved, o.resolved, true) && compareDeep(ruledOut, o.ruledOut, true) && compareDeep(prognosis, o.prognosis, true)
1827           && compareDeep(plan, o.plan, true) && compareDeep(action, o.action, true);
1828      }
1829
1830      @Override
1831      public boolean equalsShallow(Base other) {
1832        if (!super.equalsShallow(other))
1833          return false;
1834        if (!(other instanceof ClinicalImpression))
1835          return false;
1836        ClinicalImpression o = (ClinicalImpression) other;
1837        return compareValues(status, o.status, true) && compareValues(date, o.date, true) && compareValues(description, o.description, true)
1838           && compareValues(protocol, o.protocol, true) && compareValues(summary, o.summary, true) && compareValues(prognosis, o.prognosis, true)
1839          ;
1840      }
1841
1842      public boolean isEmpty() {
1843        return super.isEmpty() && (patient == null || patient.isEmpty()) && (assessor == null || assessor.isEmpty())
1844           && (status == null || status.isEmpty()) && (date == null || date.isEmpty()) && (description == null || description.isEmpty())
1845           && (previous == null || previous.isEmpty()) && (problem == null || problem.isEmpty()) && (trigger == null || trigger.isEmpty())
1846           && (investigations == null || investigations.isEmpty()) && (protocol == null || protocol.isEmpty())
1847           && (summary == null || summary.isEmpty()) && (finding == null || finding.isEmpty()) && (resolved == null || resolved.isEmpty())
1848           && (ruledOut == null || ruledOut.isEmpty()) && (prognosis == null || prognosis.isEmpty())
1849           && (plan == null || plan.isEmpty()) && (action == null || action.isEmpty());
1850      }
1851
1852  @Override
1853  public ResourceType getResourceType() {
1854    return ResourceType.ClinicalImpression;
1855   }
1856
1857  @SearchParamDefinition(name="date", path="ClinicalImpression.date", description="When the assessment occurred", type="date" )
1858  public static final String SP_DATE = "date";
1859  @SearchParamDefinition(name="previous", path="ClinicalImpression.previous", description="Reference to last assessment", type="reference" )
1860  public static final String SP_PREVIOUS = "previous";
1861  @SearchParamDefinition(name="assessor", path="ClinicalImpression.assessor", description="The clinician performing the assessment", type="reference" )
1862  public static final String SP_ASSESSOR = "assessor";
1863  @SearchParamDefinition(name="trigger", path="ClinicalImpression.triggerReference", description="Request or event that necessitated this assessment", type="reference" )
1864  public static final String SP_TRIGGER = "trigger";
1865  @SearchParamDefinition(name="finding", path="ClinicalImpression.finding.item", description="Specific text or code for finding", type="token" )
1866  public static final String SP_FINDING = "finding";
1867  @SearchParamDefinition(name="ruledout", path="ClinicalImpression.ruledOut.item", description="Specific text of code for diagnosis", type="token" )
1868  public static final String SP_RULEDOUT = "ruledout";
1869  @SearchParamDefinition(name="problem", path="ClinicalImpression.problem", description="General assessment of patient state", type="reference" )
1870  public static final String SP_PROBLEM = "problem";
1871  @SearchParamDefinition(name="patient", path="ClinicalImpression.patient", description="The patient being assessed", type="reference" )
1872  public static final String SP_PATIENT = "patient";
1873  @SearchParamDefinition(name="investigation", path="ClinicalImpression.investigations.item", description="Record of a specific investigation", type="reference" )
1874  public static final String SP_INVESTIGATION = "investigation";
1875  @SearchParamDefinition(name="action", path="ClinicalImpression.action", description="Actions taken during assessment", type="reference" )
1876  public static final String SP_ACTION = "action";
1877  @SearchParamDefinition(name="trigger-code", path="ClinicalImpression.triggerCodeableConcept", description="Request or event that necessitated this assessment", type="token" )
1878  public static final String SP_TRIGGERCODE = "trigger-code";
1879  @SearchParamDefinition(name="plan", path="ClinicalImpression.plan", description="Plan of action after assessment", type="reference" )
1880  public static final String SP_PLAN = "plan";
1881  @SearchParamDefinition(name="resolved", path="ClinicalImpression.resolved", description="Diagnoses/conditions resolved since previous assessment", type="token" )
1882  public static final String SP_RESOLVED = "resolved";
1883  @SearchParamDefinition(name="status", path="ClinicalImpression.status", description="in-progress | completed | entered-in-error", type="token" )
1884  public static final String SP_STATUS = "status";
1885
1886}