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