001package org.hl7.fhir.dstu3.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Mon, Apr 17, 2017 17:38-0400 for FHIR v3.0.1
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import ca.uhn.fhir.model.api.annotation.ResourceDef;
038import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
039import ca.uhn.fhir.model.api.annotation.Child;
040import ca.uhn.fhir.model.api.annotation.ChildOrder;
041import ca.uhn.fhir.model.api.annotation.Description;
042import ca.uhn.fhir.model.api.annotation.Block;
043import org.hl7.fhir.instance.model.api.*;
044import org.hl7.fhir.exceptions.FHIRException;
045/**
046 * 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.
047 */
048@ResourceDef(name="ClinicalImpression", profile="http://hl7.org/fhir/Profile/ClinicalImpression")
049public class ClinicalImpression extends DomainResource {
050
051    public enum ClinicalImpressionStatus {
052        /**
053         * The assessment is still on-going and results are not yet final.
054         */
055        DRAFT, 
056        /**
057         * The assessment is done and the results are final.
058         */
059        COMPLETED, 
060        /**
061         * This assessment was never actually done and the record is erroneous (e.g. Wrong patient).
062         */
063        ENTEREDINERROR, 
064        /**
065         * added to help the parsers with the generic types
066         */
067        NULL;
068        public static ClinicalImpressionStatus fromCode(String codeString) throws FHIRException {
069            if (codeString == null || "".equals(codeString))
070                return null;
071        if ("draft".equals(codeString))
072          return DRAFT;
073        if ("completed".equals(codeString))
074          return COMPLETED;
075        if ("entered-in-error".equals(codeString))
076          return ENTEREDINERROR;
077        if (Configuration.isAcceptInvalidEnums())
078          return null;
079        else
080          throw new FHIRException("Unknown ClinicalImpressionStatus code '"+codeString+"'");
081        }
082        public String toCode() {
083          switch (this) {
084            case DRAFT: return "draft";
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 DRAFT: 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 DRAFT: 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 DRAFT: 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 ("draft".equals(codeString))
122          return ClinicalImpressionStatus.DRAFT;
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)
131            return null;
132          if (code.isEmpty())
133            return new Enumeration<ClinicalImpressionStatus>(this);
134          String codeString = ((PrimitiveType) code).asStringValue();
135          if (codeString == null || "".equals(codeString))
136            return null;
137        if ("draft".equals(codeString))
138          return new Enumeration<ClinicalImpressionStatus>(this, ClinicalImpressionStatus.DRAFT);
139        if ("completed".equals(codeString))
140          return new Enumeration<ClinicalImpressionStatus>(this, ClinicalImpressionStatus.COMPLETED);
141        if ("entered-in-error".equals(codeString))
142          return new Enumeration<ClinicalImpressionStatus>(this, ClinicalImpressionStatus.ENTEREDINERROR);
143        throw new FHIRException("Unknown ClinicalImpressionStatus code '"+codeString+"'");
144        }
145    public String toCode(ClinicalImpressionStatus code) {
146      if (code == ClinicalImpressionStatus.DRAFT)
147        return "draft";
148      if (code == ClinicalImpressionStatus.COMPLETED)
149        return "completed";
150      if (code == ClinicalImpressionStatus.ENTEREDINERROR)
151        return "entered-in-error";
152      return "?";
153      }
154    public String toSystem(ClinicalImpressionStatus code) {
155      return code.getSystem();
156      }
157    }
158
159    @Block()
160    public static class ClinicalImpressionInvestigationComponent extends BackboneElement implements IBaseBackboneElement {
161        /**
162         * 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.
163         */
164        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
165        @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." )
166        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/investigation-sets")
167        protected CodeableConcept code;
168
169        /**
170         * A record of a specific investigation that was undertaken.
171         */
172        @Child(name = "item", type = {Observation.class, QuestionnaireResponse.class, FamilyMemberHistory.class, DiagnosticReport.class, RiskAssessment.class, ImagingStudy.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
173        @Description(shortDefinition="Record of a specific investigation", formalDefinition="A record of a specific investigation that was undertaken." )
174        protected List<Reference> item;
175        /**
176         * The actual objects that are the target of the reference (A record of a specific investigation that was undertaken.)
177         */
178        protected List<Resource> itemTarget;
179
180
181        private static final long serialVersionUID = -301363326L;
182
183    /**
184     * Constructor
185     */
186      public ClinicalImpressionInvestigationComponent() {
187        super();
188      }
189
190    /**
191     * Constructor
192     */
193      public ClinicalImpressionInvestigationComponent(CodeableConcept code) {
194        super();
195        this.code = code;
196      }
197
198        /**
199         * @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.)
200         */
201        public CodeableConcept getCode() { 
202          if (this.code == null)
203            if (Configuration.errorOnAutoCreate())
204              throw new Error("Attempt to auto-create ClinicalImpressionInvestigationComponent.code");
205            else if (Configuration.doAutoCreate())
206              this.code = new CodeableConcept(); // cc
207          return this.code;
208        }
209
210        public boolean hasCode() { 
211          return this.code != null && !this.code.isEmpty();
212        }
213
214        /**
215         * @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.)
216         */
217        public ClinicalImpressionInvestigationComponent setCode(CodeableConcept value) { 
218          this.code = value;
219          return this;
220        }
221
222        /**
223         * @return {@link #item} (A record of a specific investigation that was undertaken.)
224         */
225        public List<Reference> getItem() { 
226          if (this.item == null)
227            this.item = new ArrayList<Reference>();
228          return this.item;
229        }
230
231        /**
232         * @return Returns a reference to <code>this</code> for easy method chaining
233         */
234        public ClinicalImpressionInvestigationComponent setItem(List<Reference> theItem) { 
235          this.item = theItem;
236          return this;
237        }
238
239        public boolean hasItem() { 
240          if (this.item == null)
241            return false;
242          for (Reference item : this.item)
243            if (!item.isEmpty())
244              return true;
245          return false;
246        }
247
248        public Reference addItem() { //3
249          Reference t = new Reference();
250          if (this.item == null)
251            this.item = new ArrayList<Reference>();
252          this.item.add(t);
253          return t;
254        }
255
256        public ClinicalImpressionInvestigationComponent addItem(Reference t) { //3
257          if (t == null)
258            return this;
259          if (this.item == null)
260            this.item = new ArrayList<Reference>();
261          this.item.add(t);
262          return this;
263        }
264
265        /**
266         * @return The first repetition of repeating field {@link #item}, creating it if it does not already exist
267         */
268        public Reference getItemFirstRep() { 
269          if (getItem().isEmpty()) {
270            addItem();
271          }
272          return getItem().get(0);
273        }
274
275        /**
276         * @deprecated Use Reference#setResource(IBaseResource) instead
277         */
278        @Deprecated
279        public List<Resource> getItemTarget() { 
280          if (this.itemTarget == null)
281            this.itemTarget = new ArrayList<Resource>();
282          return this.itemTarget;
283        }
284
285        protected void listChildren(List<Property> childrenList) {
286          super.listChildren(childrenList);
287          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));
288          childrenList.add(new Property("item", "Reference(Observation|QuestionnaireResponse|FamilyMemberHistory|DiagnosticReport|RiskAssessment|ImagingStudy)", "A record of a specific investigation that was undertaken.", 0, java.lang.Integer.MAX_VALUE, item));
289        }
290
291      @Override
292      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
293        switch (hash) {
294        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
295        case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // Reference
296        default: return super.getProperty(hash, name, checkValid);
297        }
298
299      }
300
301      @Override
302      public Base setProperty(int hash, String name, Base value) throws FHIRException {
303        switch (hash) {
304        case 3059181: // code
305          this.code = castToCodeableConcept(value); // CodeableConcept
306          return value;
307        case 3242771: // item
308          this.getItem().add(castToReference(value)); // Reference
309          return value;
310        default: return super.setProperty(hash, name, value);
311        }
312
313      }
314
315      @Override
316      public Base setProperty(String name, Base value) throws FHIRException {
317        if (name.equals("code")) {
318          this.code = castToCodeableConcept(value); // CodeableConcept
319        } else if (name.equals("item")) {
320          this.getItem().add(castToReference(value));
321        } else
322          return super.setProperty(name, value);
323        return value;
324      }
325
326      @Override
327      public Base makeProperty(int hash, String name) throws FHIRException {
328        switch (hash) {
329        case 3059181:  return getCode(); 
330        case 3242771:  return addItem(); 
331        default: return super.makeProperty(hash, name);
332        }
333
334      }
335
336      @Override
337      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
338        switch (hash) {
339        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
340        case 3242771: /*item*/ return new String[] {"Reference"};
341        default: return super.getTypesForProperty(hash, name);
342        }
343
344      }
345
346      @Override
347      public Base addChild(String name) throws FHIRException {
348        if (name.equals("code")) {
349          this.code = new CodeableConcept();
350          return this.code;
351        }
352        else if (name.equals("item")) {
353          return addItem();
354        }
355        else
356          return super.addChild(name);
357      }
358
359      public ClinicalImpressionInvestigationComponent copy() {
360        ClinicalImpressionInvestigationComponent dst = new ClinicalImpressionInvestigationComponent();
361        copyValues(dst);
362        dst.code = code == null ? null : code.copy();
363        if (item != null) {
364          dst.item = new ArrayList<Reference>();
365          for (Reference i : item)
366            dst.item.add(i.copy());
367        };
368        return dst;
369      }
370
371      @Override
372      public boolean equalsDeep(Base other) {
373        if (!super.equalsDeep(other))
374          return false;
375        if (!(other instanceof ClinicalImpressionInvestigationComponent))
376          return false;
377        ClinicalImpressionInvestigationComponent o = (ClinicalImpressionInvestigationComponent) other;
378        return compareDeep(code, o.code, true) && compareDeep(item, o.item, true);
379      }
380
381      @Override
382      public boolean equalsShallow(Base other) {
383        if (!super.equalsShallow(other))
384          return false;
385        if (!(other instanceof ClinicalImpressionInvestigationComponent))
386          return false;
387        ClinicalImpressionInvestigationComponent o = (ClinicalImpressionInvestigationComponent) other;
388        return true;
389      }
390
391      public boolean isEmpty() {
392        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, item);
393      }
394
395  public String fhirType() {
396    return "ClinicalImpression.investigation";
397
398  }
399
400  }
401
402    @Block()
403    public static class ClinicalImpressionFindingComponent extends BackboneElement implements IBaseBackboneElement {
404        /**
405         * Specific text, code or reference for finding or diagnosis, which may include ruled-out or resolved conditions.
406         */
407        @Child(name = "item", type = {CodeableConcept.class, Condition.class, Observation.class}, order=1, min=1, max=1, modifier=false, summary=false)
408        @Description(shortDefinition="What was found", formalDefinition="Specific text, code or reference for finding or diagnosis, which may include ruled-out or resolved conditions." )
409        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-code")
410        protected Type item;
411
412        /**
413         * Which investigations support finding or diagnosis.
414         */
415        @Child(name = "basis", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
416        @Description(shortDefinition="Which investigations support finding", formalDefinition="Which investigations support finding or diagnosis." )
417        protected StringType basis;
418
419        private static final long serialVersionUID = 1690728236L;
420
421    /**
422     * Constructor
423     */
424      public ClinicalImpressionFindingComponent() {
425        super();
426      }
427
428    /**
429     * Constructor
430     */
431      public ClinicalImpressionFindingComponent(Type item) {
432        super();
433        this.item = item;
434      }
435
436        /**
437         * @return {@link #item} (Specific text, code or reference for finding or diagnosis, which may include ruled-out or resolved conditions.)
438         */
439        public Type getItem() { 
440          return this.item;
441        }
442
443        /**
444         * @return {@link #item} (Specific text, code or reference for finding or diagnosis, which may include ruled-out or resolved conditions.)
445         */
446        public CodeableConcept getItemCodeableConcept() throws FHIRException { 
447          if (!(this.item instanceof CodeableConcept))
448            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.item.getClass().getName()+" was encountered");
449          return (CodeableConcept) this.item;
450        }
451
452        public boolean hasItemCodeableConcept() { 
453          return this.item instanceof CodeableConcept;
454        }
455
456        /**
457         * @return {@link #item} (Specific text, code or reference for finding or diagnosis, which may include ruled-out or resolved conditions.)
458         */
459        public Reference getItemReference() throws FHIRException { 
460          if (!(this.item instanceof Reference))
461            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.item.getClass().getName()+" was encountered");
462          return (Reference) this.item;
463        }
464
465        public boolean hasItemReference() { 
466          return this.item instanceof Reference;
467        }
468
469        public boolean hasItem() { 
470          return this.item != null && !this.item.isEmpty();
471        }
472
473        /**
474         * @param value {@link #item} (Specific text, code or reference for finding or diagnosis, which may include ruled-out or resolved conditions.)
475         */
476        public ClinicalImpressionFindingComponent setItem(Type value) { 
477          this.item = value;
478          return this;
479        }
480
481        /**
482         * @return {@link #basis} (Which investigations support finding or diagnosis.). This is the underlying object with id, value and extensions. The accessor "getBasis" gives direct access to the value
483         */
484        public StringType getBasisElement() { 
485          if (this.basis == null)
486            if (Configuration.errorOnAutoCreate())
487              throw new Error("Attempt to auto-create ClinicalImpressionFindingComponent.basis");
488            else if (Configuration.doAutoCreate())
489              this.basis = new StringType(); // bb
490          return this.basis;
491        }
492
493        public boolean hasBasisElement() { 
494          return this.basis != null && !this.basis.isEmpty();
495        }
496
497        public boolean hasBasis() { 
498          return this.basis != null && !this.basis.isEmpty();
499        }
500
501        /**
502         * @param value {@link #basis} (Which investigations support finding or diagnosis.). This is the underlying object with id, value and extensions. The accessor "getBasis" gives direct access to the value
503         */
504        public ClinicalImpressionFindingComponent setBasisElement(StringType value) { 
505          this.basis = value;
506          return this;
507        }
508
509        /**
510         * @return Which investigations support finding or diagnosis.
511         */
512        public String getBasis() { 
513          return this.basis == null ? null : this.basis.getValue();
514        }
515
516        /**
517         * @param value Which investigations support finding or diagnosis.
518         */
519        public ClinicalImpressionFindingComponent setBasis(String value) { 
520          if (Utilities.noString(value))
521            this.basis = null;
522          else {
523            if (this.basis == null)
524              this.basis = new StringType();
525            this.basis.setValue(value);
526          }
527          return this;
528        }
529
530        protected void listChildren(List<Property> childrenList) {
531          super.listChildren(childrenList);
532          childrenList.add(new Property("item[x]", "CodeableConcept|Reference(Condition|Observation)", "Specific text, code or reference for finding or diagnosis, which may include ruled-out or resolved conditions.", 0, java.lang.Integer.MAX_VALUE, item));
533          childrenList.add(new Property("basis", "string", "Which investigations support finding or diagnosis.", 0, java.lang.Integer.MAX_VALUE, basis));
534        }
535
536      @Override
537      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
538        switch (hash) {
539        case 3242771: /*item*/ return this.item == null ? new Base[0] : new Base[] {this.item}; // Type
540        case 93508670: /*basis*/ return this.basis == null ? new Base[0] : new Base[] {this.basis}; // StringType
541        default: return super.getProperty(hash, name, checkValid);
542        }
543
544      }
545
546      @Override
547      public Base setProperty(int hash, String name, Base value) throws FHIRException {
548        switch (hash) {
549        case 3242771: // item
550          this.item = castToType(value); // Type
551          return value;
552        case 93508670: // basis
553          this.basis = castToString(value); // StringType
554          return value;
555        default: return super.setProperty(hash, name, value);
556        }
557
558      }
559
560      @Override
561      public Base setProperty(String name, Base value) throws FHIRException {
562        if (name.equals("item[x]")) {
563          this.item = castToType(value); // Type
564        } else if (name.equals("basis")) {
565          this.basis = castToString(value); // StringType
566        } else
567          return super.setProperty(name, value);
568        return value;
569      }
570
571      @Override
572      public Base makeProperty(int hash, String name) throws FHIRException {
573        switch (hash) {
574        case 2116201613:  return getItem(); 
575        case 3242771:  return getItem(); 
576        case 93508670:  return getBasisElement();
577        default: return super.makeProperty(hash, name);
578        }
579
580      }
581
582      @Override
583      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
584        switch (hash) {
585        case 3242771: /*item*/ return new String[] {"CodeableConcept", "Reference"};
586        case 93508670: /*basis*/ return new String[] {"string"};
587        default: return super.getTypesForProperty(hash, name);
588        }
589
590      }
591
592      @Override
593      public Base addChild(String name) throws FHIRException {
594        if (name.equals("itemCodeableConcept")) {
595          this.item = new CodeableConcept();
596          return this.item;
597        }
598        else if (name.equals("itemReference")) {
599          this.item = new Reference();
600          return this.item;
601        }
602        else if (name.equals("basis")) {
603          throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.basis");
604        }
605        else
606          return super.addChild(name);
607      }
608
609      public ClinicalImpressionFindingComponent copy() {
610        ClinicalImpressionFindingComponent dst = new ClinicalImpressionFindingComponent();
611        copyValues(dst);
612        dst.item = item == null ? null : item.copy();
613        dst.basis = basis == null ? null : basis.copy();
614        return dst;
615      }
616
617      @Override
618      public boolean equalsDeep(Base other) {
619        if (!super.equalsDeep(other))
620          return false;
621        if (!(other instanceof ClinicalImpressionFindingComponent))
622          return false;
623        ClinicalImpressionFindingComponent o = (ClinicalImpressionFindingComponent) other;
624        return compareDeep(item, o.item, true) && compareDeep(basis, o.basis, true);
625      }
626
627      @Override
628      public boolean equalsShallow(Base other) {
629        if (!super.equalsShallow(other))
630          return false;
631        if (!(other instanceof ClinicalImpressionFindingComponent))
632          return false;
633        ClinicalImpressionFindingComponent o = (ClinicalImpressionFindingComponent) other;
634        return compareValues(basis, o.basis, true);
635      }
636
637      public boolean isEmpty() {
638        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(item, basis);
639      }
640
641  public String fhirType() {
642    return "ClinicalImpression.finding";
643
644  }
645
646  }
647
648    /**
649     * A unique identifier assigned to the clinical impression that remains consistent regardless of what server the impression is stored on.
650     */
651    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
652    @Description(shortDefinition="Business identifier", formalDefinition="A unique identifier assigned to the clinical impression that remains consistent regardless of what server the impression is stored on." )
653    protected List<Identifier> identifier;
654
655    /**
656     * Identifies the workflow status of the assessment.
657     */
658    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
659    @Description(shortDefinition="draft | completed | entered-in-error", formalDefinition="Identifies the workflow status of the assessment." )
660    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/clinical-impression-status")
661    protected Enumeration<ClinicalImpressionStatus> status;
662
663    /**
664     * Categorizes the type of clinical assessment performed.
665     */
666    @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
667    @Description(shortDefinition="Kind of assessment performed", formalDefinition="Categorizes the type of clinical assessment performed." )
668    protected CodeableConcept code;
669
670    /**
671     * A summary of the context and/or cause of the assessment - why / where was it performed, and what patient events/status prompted it.
672     */
673    @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
674    @Description(shortDefinition="Why/how the assessment was performed", formalDefinition="A summary of the context and/or cause of the assessment - why / where was it performed, and what patient events/status prompted it." )
675    protected StringType description;
676
677    /**
678     * The patient or group of individuals assessed as part of this record.
679     */
680    @Child(name = "subject", type = {Patient.class, Group.class}, order=4, min=1, max=1, modifier=false, summary=true)
681    @Description(shortDefinition="Patient or group assessed", formalDefinition="The patient or group of individuals assessed as part of this record." )
682    protected Reference subject;
683
684    /**
685     * The actual object that is the target of the reference (The patient or group of individuals assessed as part of this record.)
686     */
687    protected Resource subjectTarget;
688
689    /**
690     * The encounter or episode of care this impression was created as part of.
691     */
692    @Child(name = "context", type = {Encounter.class, EpisodeOfCare.class}, order=5, min=0, max=1, modifier=false, summary=true)
693    @Description(shortDefinition="Encounter or Episode created from", formalDefinition="The encounter or episode of care this impression was created as part of." )
694    protected Reference context;
695
696    /**
697     * The actual object that is the target of the reference (The encounter or episode of care this impression was created as part of.)
698     */
699    protected Resource contextTarget;
700
701    /**
702     * The point in time or period over which the subject was assessed.
703     */
704    @Child(name = "effective", type = {DateTimeType.class, Period.class}, order=6, min=0, max=1, modifier=false, summary=true)
705    @Description(shortDefinition="Time of assessment", formalDefinition="The point in time or period over which the subject was assessed." )
706    protected Type effective;
707
708    /**
709     * Indicates when the documentation of the assessment was complete.
710     */
711    @Child(name = "date", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true)
712    @Description(shortDefinition="When the assessment was documented", formalDefinition="Indicates when the documentation of the assessment was complete." )
713    protected DateTimeType date;
714
715    /**
716     * The clinician performing the assessment.
717     */
718    @Child(name = "assessor", type = {Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=true)
719    @Description(shortDefinition="The clinician performing the assessment", formalDefinition="The clinician performing the assessment." )
720    protected Reference assessor;
721
722    /**
723     * The actual object that is the target of the reference (The clinician performing the assessment.)
724     */
725    protected Practitioner assessorTarget;
726
727    /**
728     * 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.
729     */
730    @Child(name = "previous", type = {ClinicalImpression.class}, order=9, min=0, max=1, modifier=false, summary=false)
731    @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." )
732    protected Reference previous;
733
734    /**
735     * 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.)
736     */
737    protected ClinicalImpression previousTarget;
738
739    /**
740     * This a list of the relevant problems/conditions for a patient.
741     */
742    @Child(name = "problem", type = {Condition.class, AllergyIntolerance.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
743    @Description(shortDefinition="Relevant impressions of patient state", formalDefinition="This a list of the relevant problems/conditions for a patient." )
744    protected List<Reference> problem;
745    /**
746     * The actual objects that are the target of the reference (This a list of the relevant problems/conditions for a patient.)
747     */
748    protected List<Resource> problemTarget;
749
750
751    /**
752     * 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.
753     */
754    @Child(name = "investigation", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
755    @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." )
756    protected List<ClinicalImpressionInvestigationComponent> investigation;
757
758    /**
759     * Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.
760     */
761    @Child(name = "protocol", type = {UriType.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
762    @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." )
763    protected List<UriType> protocol;
764
765    /**
766     * A text summary of the investigations and the diagnosis.
767     */
768    @Child(name = "summary", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=false)
769    @Description(shortDefinition="Summary of the assessment", formalDefinition="A text summary of the investigations and the diagnosis." )
770    protected StringType summary;
771
772    /**
773     * Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.
774     */
775    @Child(name = "finding", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
776    @Description(shortDefinition="Possible or likely findings and diagnoses", formalDefinition="Specific findings or diagnoses that was considered likely or relevant to ongoing treatment." )
777    protected List<ClinicalImpressionFindingComponent> finding;
778
779    /**
780     * Estimate of likely outcome.
781     */
782    @Child(name = "prognosisCodeableConcept", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
783    @Description(shortDefinition="Estimate of likely outcome", formalDefinition="Estimate of likely outcome." )
784    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/clinicalimpression-prognosis")
785    protected List<CodeableConcept> prognosisCodeableConcept;
786
787    /**
788     * RiskAssessment expressing likely outcome.
789     */
790    @Child(name = "prognosisReference", type = {RiskAssessment.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
791    @Description(shortDefinition="RiskAssessment expressing likely outcome", formalDefinition="RiskAssessment expressing likely outcome." )
792    protected List<Reference> prognosisReference;
793    /**
794     * The actual objects that are the target of the reference (RiskAssessment expressing likely outcome.)
795     */
796    protected List<RiskAssessment> prognosisReferenceTarget;
797
798
799    /**
800     * Action taken as part of assessment procedure.
801     */
802    @Child(name = "action", type = {ReferralRequest.class, ProcedureRequest.class, Procedure.class, MedicationRequest.class, Appointment.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
803    @Description(shortDefinition="Action taken as part of assessment procedure", formalDefinition="Action taken as part of assessment procedure." )
804    protected List<Reference> action;
805    /**
806     * The actual objects that are the target of the reference (Action taken as part of assessment procedure.)
807     */
808    protected List<Resource> actionTarget;
809
810
811    /**
812     * Commentary about the impression, typically recorded after the impression itself was made, though supplemental notes by the original author could also appear.
813     */
814    @Child(name = "note", type = {Annotation.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
815    @Description(shortDefinition="Comments made about the ClinicalImpression", formalDefinition="Commentary about the impression, typically recorded after the impression itself was made, though supplemental notes by the original author could also appear." )
816    protected List<Annotation> note;
817
818    private static final long serialVersionUID = -1626670747L;
819
820  /**
821   * Constructor
822   */
823    public ClinicalImpression() {
824      super();
825    }
826
827  /**
828   * Constructor
829   */
830    public ClinicalImpression(Enumeration<ClinicalImpressionStatus> status, Reference subject) {
831      super();
832      this.status = status;
833      this.subject = subject;
834    }
835
836    /**
837     * @return {@link #identifier} (A unique identifier assigned to the clinical impression that remains consistent regardless of what server the impression is stored on.)
838     */
839    public List<Identifier> getIdentifier() { 
840      if (this.identifier == null)
841        this.identifier = new ArrayList<Identifier>();
842      return this.identifier;
843    }
844
845    /**
846     * @return Returns a reference to <code>this</code> for easy method chaining
847     */
848    public ClinicalImpression setIdentifier(List<Identifier> theIdentifier) { 
849      this.identifier = theIdentifier;
850      return this;
851    }
852
853    public boolean hasIdentifier() { 
854      if (this.identifier == null)
855        return false;
856      for (Identifier item : this.identifier)
857        if (!item.isEmpty())
858          return true;
859      return false;
860    }
861
862    public Identifier addIdentifier() { //3
863      Identifier t = new Identifier();
864      if (this.identifier == null)
865        this.identifier = new ArrayList<Identifier>();
866      this.identifier.add(t);
867      return t;
868    }
869
870    public ClinicalImpression addIdentifier(Identifier t) { //3
871      if (t == null)
872        return this;
873      if (this.identifier == null)
874        this.identifier = new ArrayList<Identifier>();
875      this.identifier.add(t);
876      return this;
877    }
878
879    /**
880     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
881     */
882    public Identifier getIdentifierFirstRep() { 
883      if (getIdentifier().isEmpty()) {
884        addIdentifier();
885      }
886      return getIdentifier().get(0);
887    }
888
889    /**
890     * @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
891     */
892    public Enumeration<ClinicalImpressionStatus> getStatusElement() { 
893      if (this.status == null)
894        if (Configuration.errorOnAutoCreate())
895          throw new Error("Attempt to auto-create ClinicalImpression.status");
896        else if (Configuration.doAutoCreate())
897          this.status = new Enumeration<ClinicalImpressionStatus>(new ClinicalImpressionStatusEnumFactory()); // bb
898      return this.status;
899    }
900
901    public boolean hasStatusElement() { 
902      return this.status != null && !this.status.isEmpty();
903    }
904
905    public boolean hasStatus() { 
906      return this.status != null && !this.status.isEmpty();
907    }
908
909    /**
910     * @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
911     */
912    public ClinicalImpression setStatusElement(Enumeration<ClinicalImpressionStatus> value) { 
913      this.status = value;
914      return this;
915    }
916
917    /**
918     * @return Identifies the workflow status of the assessment.
919     */
920    public ClinicalImpressionStatus getStatus() { 
921      return this.status == null ? null : this.status.getValue();
922    }
923
924    /**
925     * @param value Identifies the workflow status of the assessment.
926     */
927    public ClinicalImpression setStatus(ClinicalImpressionStatus value) { 
928        if (this.status == null)
929          this.status = new Enumeration<ClinicalImpressionStatus>(new ClinicalImpressionStatusEnumFactory());
930        this.status.setValue(value);
931      return this;
932    }
933
934    /**
935     * @return {@link #code} (Categorizes the type of clinical assessment performed.)
936     */
937    public CodeableConcept getCode() { 
938      if (this.code == null)
939        if (Configuration.errorOnAutoCreate())
940          throw new Error("Attempt to auto-create ClinicalImpression.code");
941        else if (Configuration.doAutoCreate())
942          this.code = new CodeableConcept(); // cc
943      return this.code;
944    }
945
946    public boolean hasCode() { 
947      return this.code != null && !this.code.isEmpty();
948    }
949
950    /**
951     * @param value {@link #code} (Categorizes the type of clinical assessment performed.)
952     */
953    public ClinicalImpression setCode(CodeableConcept value) { 
954      this.code = value;
955      return this;
956    }
957
958    /**
959     * @return {@link #description} (A summary of the context and/or cause of the assessment - why / where was it performed, and what patient events/status prompted it.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
960     */
961    public StringType getDescriptionElement() { 
962      if (this.description == null)
963        if (Configuration.errorOnAutoCreate())
964          throw new Error("Attempt to auto-create ClinicalImpression.description");
965        else if (Configuration.doAutoCreate())
966          this.description = new StringType(); // bb
967      return this.description;
968    }
969
970    public boolean hasDescriptionElement() { 
971      return this.description != null && !this.description.isEmpty();
972    }
973
974    public boolean hasDescription() { 
975      return this.description != null && !this.description.isEmpty();
976    }
977
978    /**
979     * @param value {@link #description} (A summary of the context and/or cause of the assessment - why / where was it performed, and what patient events/status prompted it.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
980     */
981    public ClinicalImpression setDescriptionElement(StringType value) { 
982      this.description = value;
983      return this;
984    }
985
986    /**
987     * @return A summary of the context and/or cause of the assessment - why / where was it performed, and what patient events/status prompted it.
988     */
989    public String getDescription() { 
990      return this.description == null ? null : this.description.getValue();
991    }
992
993    /**
994     * @param value A summary of the context and/or cause of the assessment - why / where was it performed, and what patient events/status prompted it.
995     */
996    public ClinicalImpression setDescription(String value) { 
997      if (Utilities.noString(value))
998        this.description = null;
999      else {
1000        if (this.description == null)
1001          this.description = new StringType();
1002        this.description.setValue(value);
1003      }
1004      return this;
1005    }
1006
1007    /**
1008     * @return {@link #subject} (The patient or group of individuals assessed as part of this record.)
1009     */
1010    public Reference getSubject() { 
1011      if (this.subject == null)
1012        if (Configuration.errorOnAutoCreate())
1013          throw new Error("Attempt to auto-create ClinicalImpression.subject");
1014        else if (Configuration.doAutoCreate())
1015          this.subject = new Reference(); // cc
1016      return this.subject;
1017    }
1018
1019    public boolean hasSubject() { 
1020      return this.subject != null && !this.subject.isEmpty();
1021    }
1022
1023    /**
1024     * @param value {@link #subject} (The patient or group of individuals assessed as part of this record.)
1025     */
1026    public ClinicalImpression setSubject(Reference value) { 
1027      this.subject = value;
1028      return this;
1029    }
1030
1031    /**
1032     * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient or group of individuals assessed as part of this record.)
1033     */
1034    public Resource getSubjectTarget() { 
1035      return this.subjectTarget;
1036    }
1037
1038    /**
1039     * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient or group of individuals assessed as part of this record.)
1040     */
1041    public ClinicalImpression setSubjectTarget(Resource value) { 
1042      this.subjectTarget = value;
1043      return this;
1044    }
1045
1046    /**
1047     * @return {@link #context} (The encounter or episode of care this impression was created as part of.)
1048     */
1049    public Reference getContext() { 
1050      if (this.context == null)
1051        if (Configuration.errorOnAutoCreate())
1052          throw new Error("Attempt to auto-create ClinicalImpression.context");
1053        else if (Configuration.doAutoCreate())
1054          this.context = new Reference(); // cc
1055      return this.context;
1056    }
1057
1058    public boolean hasContext() { 
1059      return this.context != null && !this.context.isEmpty();
1060    }
1061
1062    /**
1063     * @param value {@link #context} (The encounter or episode of care this impression was created as part of.)
1064     */
1065    public ClinicalImpression setContext(Reference value) { 
1066      this.context = value;
1067      return this;
1068    }
1069
1070    /**
1071     * @return {@link #context} 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 encounter or episode of care this impression was created as part of.)
1072     */
1073    public Resource getContextTarget() { 
1074      return this.contextTarget;
1075    }
1076
1077    /**
1078     * @param value {@link #context} 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 encounter or episode of care this impression was created as part of.)
1079     */
1080    public ClinicalImpression setContextTarget(Resource value) { 
1081      this.contextTarget = value;
1082      return this;
1083    }
1084
1085    /**
1086     * @return {@link #effective} (The point in time or period over which the subject was assessed.)
1087     */
1088    public Type getEffective() { 
1089      return this.effective;
1090    }
1091
1092    /**
1093     * @return {@link #effective} (The point in time or period over which the subject was assessed.)
1094     */
1095    public DateTimeType getEffectiveDateTimeType() throws FHIRException { 
1096      if (!(this.effective instanceof DateTimeType))
1097        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.effective.getClass().getName()+" was encountered");
1098      return (DateTimeType) this.effective;
1099    }
1100
1101    public boolean hasEffectiveDateTimeType() { 
1102      return this.effective instanceof DateTimeType;
1103    }
1104
1105    /**
1106     * @return {@link #effective} (The point in time or period over which the subject was assessed.)
1107     */
1108    public Period getEffectivePeriod() throws FHIRException { 
1109      if (!(this.effective instanceof Period))
1110        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.effective.getClass().getName()+" was encountered");
1111      return (Period) this.effective;
1112    }
1113
1114    public boolean hasEffectivePeriod() { 
1115      return this.effective instanceof Period;
1116    }
1117
1118    public boolean hasEffective() { 
1119      return this.effective != null && !this.effective.isEmpty();
1120    }
1121
1122    /**
1123     * @param value {@link #effective} (The point in time or period over which the subject was assessed.)
1124     */
1125    public ClinicalImpression setEffective(Type value) { 
1126      this.effective = value;
1127      return this;
1128    }
1129
1130    /**
1131     * @return {@link #date} (Indicates when the documentation of the assessment was complete.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1132     */
1133    public DateTimeType getDateElement() { 
1134      if (this.date == null)
1135        if (Configuration.errorOnAutoCreate())
1136          throw new Error("Attempt to auto-create ClinicalImpression.date");
1137        else if (Configuration.doAutoCreate())
1138          this.date = new DateTimeType(); // bb
1139      return this.date;
1140    }
1141
1142    public boolean hasDateElement() { 
1143      return this.date != null && !this.date.isEmpty();
1144    }
1145
1146    public boolean hasDate() { 
1147      return this.date != null && !this.date.isEmpty();
1148    }
1149
1150    /**
1151     * @param value {@link #date} (Indicates when the documentation of the assessment was complete.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1152     */
1153    public ClinicalImpression setDateElement(DateTimeType value) { 
1154      this.date = value;
1155      return this;
1156    }
1157
1158    /**
1159     * @return Indicates when the documentation of the assessment was complete.
1160     */
1161    public Date getDate() { 
1162      return this.date == null ? null : this.date.getValue();
1163    }
1164
1165    /**
1166     * @param value Indicates when the documentation of the assessment was complete.
1167     */
1168    public ClinicalImpression setDate(Date value) { 
1169      if (value == null)
1170        this.date = null;
1171      else {
1172        if (this.date == null)
1173          this.date = new DateTimeType();
1174        this.date.setValue(value);
1175      }
1176      return this;
1177    }
1178
1179    /**
1180     * @return {@link #assessor} (The clinician performing the assessment.)
1181     */
1182    public Reference getAssessor() { 
1183      if (this.assessor == null)
1184        if (Configuration.errorOnAutoCreate())
1185          throw new Error("Attempt to auto-create ClinicalImpression.assessor");
1186        else if (Configuration.doAutoCreate())
1187          this.assessor = new Reference(); // cc
1188      return this.assessor;
1189    }
1190
1191    public boolean hasAssessor() { 
1192      return this.assessor != null && !this.assessor.isEmpty();
1193    }
1194
1195    /**
1196     * @param value {@link #assessor} (The clinician performing the assessment.)
1197     */
1198    public ClinicalImpression setAssessor(Reference value) { 
1199      this.assessor = value;
1200      return this;
1201    }
1202
1203    /**
1204     * @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.)
1205     */
1206    public Practitioner getAssessorTarget() { 
1207      if (this.assessorTarget == null)
1208        if (Configuration.errorOnAutoCreate())
1209          throw new Error("Attempt to auto-create ClinicalImpression.assessor");
1210        else if (Configuration.doAutoCreate())
1211          this.assessorTarget = new Practitioner(); // aa
1212      return this.assessorTarget;
1213    }
1214
1215    /**
1216     * @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.)
1217     */
1218    public ClinicalImpression setAssessorTarget(Practitioner value) { 
1219      this.assessorTarget = value;
1220      return this;
1221    }
1222
1223    /**
1224     * @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.)
1225     */
1226    public Reference getPrevious() { 
1227      if (this.previous == null)
1228        if (Configuration.errorOnAutoCreate())
1229          throw new Error("Attempt to auto-create ClinicalImpression.previous");
1230        else if (Configuration.doAutoCreate())
1231          this.previous = new Reference(); // cc
1232      return this.previous;
1233    }
1234
1235    public boolean hasPrevious() { 
1236      return this.previous != null && !this.previous.isEmpty();
1237    }
1238
1239    /**
1240     * @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.)
1241     */
1242    public ClinicalImpression setPrevious(Reference value) { 
1243      this.previous = value;
1244      return this;
1245    }
1246
1247    /**
1248     * @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.)
1249     */
1250    public ClinicalImpression getPreviousTarget() { 
1251      if (this.previousTarget == null)
1252        if (Configuration.errorOnAutoCreate())
1253          throw new Error("Attempt to auto-create ClinicalImpression.previous");
1254        else if (Configuration.doAutoCreate())
1255          this.previousTarget = new ClinicalImpression(); // aa
1256      return this.previousTarget;
1257    }
1258
1259    /**
1260     * @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.)
1261     */
1262    public ClinicalImpression setPreviousTarget(ClinicalImpression value) { 
1263      this.previousTarget = value;
1264      return this;
1265    }
1266
1267    /**
1268     * @return {@link #problem} (This a list of the relevant problems/conditions for a patient.)
1269     */
1270    public List<Reference> getProblem() { 
1271      if (this.problem == null)
1272        this.problem = new ArrayList<Reference>();
1273      return this.problem;
1274    }
1275
1276    /**
1277     * @return Returns a reference to <code>this</code> for easy method chaining
1278     */
1279    public ClinicalImpression setProblem(List<Reference> theProblem) { 
1280      this.problem = theProblem;
1281      return this;
1282    }
1283
1284    public boolean hasProblem() { 
1285      if (this.problem == null)
1286        return false;
1287      for (Reference item : this.problem)
1288        if (!item.isEmpty())
1289          return true;
1290      return false;
1291    }
1292
1293    public Reference addProblem() { //3
1294      Reference t = new Reference();
1295      if (this.problem == null)
1296        this.problem = new ArrayList<Reference>();
1297      this.problem.add(t);
1298      return t;
1299    }
1300
1301    public ClinicalImpression addProblem(Reference t) { //3
1302      if (t == null)
1303        return this;
1304      if (this.problem == null)
1305        this.problem = new ArrayList<Reference>();
1306      this.problem.add(t);
1307      return this;
1308    }
1309
1310    /**
1311     * @return The first repetition of repeating field {@link #problem}, creating it if it does not already exist
1312     */
1313    public Reference getProblemFirstRep() { 
1314      if (getProblem().isEmpty()) {
1315        addProblem();
1316      }
1317      return getProblem().get(0);
1318    }
1319
1320    /**
1321     * @deprecated Use Reference#setResource(IBaseResource) instead
1322     */
1323    @Deprecated
1324    public List<Resource> getProblemTarget() { 
1325      if (this.problemTarget == null)
1326        this.problemTarget = new ArrayList<Resource>();
1327      return this.problemTarget;
1328    }
1329
1330    /**
1331     * @return {@link #investigation} (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.)
1332     */
1333    public List<ClinicalImpressionInvestigationComponent> getInvestigation() { 
1334      if (this.investigation == null)
1335        this.investigation = new ArrayList<ClinicalImpressionInvestigationComponent>();
1336      return this.investigation;
1337    }
1338
1339    /**
1340     * @return Returns a reference to <code>this</code> for easy method chaining
1341     */
1342    public ClinicalImpression setInvestigation(List<ClinicalImpressionInvestigationComponent> theInvestigation) { 
1343      this.investigation = theInvestigation;
1344      return this;
1345    }
1346
1347    public boolean hasInvestigation() { 
1348      if (this.investigation == null)
1349        return false;
1350      for (ClinicalImpressionInvestigationComponent item : this.investigation)
1351        if (!item.isEmpty())
1352          return true;
1353      return false;
1354    }
1355
1356    public ClinicalImpressionInvestigationComponent addInvestigation() { //3
1357      ClinicalImpressionInvestigationComponent t = new ClinicalImpressionInvestigationComponent();
1358      if (this.investigation == null)
1359        this.investigation = new ArrayList<ClinicalImpressionInvestigationComponent>();
1360      this.investigation.add(t);
1361      return t;
1362    }
1363
1364    public ClinicalImpression addInvestigation(ClinicalImpressionInvestigationComponent t) { //3
1365      if (t == null)
1366        return this;
1367      if (this.investigation == null)
1368        this.investigation = new ArrayList<ClinicalImpressionInvestigationComponent>();
1369      this.investigation.add(t);
1370      return this;
1371    }
1372
1373    /**
1374     * @return The first repetition of repeating field {@link #investigation}, creating it if it does not already exist
1375     */
1376    public ClinicalImpressionInvestigationComponent getInvestigationFirstRep() { 
1377      if (getInvestigation().isEmpty()) {
1378        addInvestigation();
1379      }
1380      return getInvestigation().get(0);
1381    }
1382
1383    /**
1384     * @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.)
1385     */
1386    public List<UriType> getProtocol() { 
1387      if (this.protocol == null)
1388        this.protocol = new ArrayList<UriType>();
1389      return this.protocol;
1390    }
1391
1392    /**
1393     * @return Returns a reference to <code>this</code> for easy method chaining
1394     */
1395    public ClinicalImpression setProtocol(List<UriType> theProtocol) { 
1396      this.protocol = theProtocol;
1397      return this;
1398    }
1399
1400    public boolean hasProtocol() { 
1401      if (this.protocol == null)
1402        return false;
1403      for (UriType item : this.protocol)
1404        if (!item.isEmpty())
1405          return true;
1406      return false;
1407    }
1408
1409    /**
1410     * @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.)
1411     */
1412    public UriType addProtocolElement() {//2 
1413      UriType t = new UriType();
1414      if (this.protocol == null)
1415        this.protocol = new ArrayList<UriType>();
1416      this.protocol.add(t);
1417      return t;
1418    }
1419
1420    /**
1421     * @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.)
1422     */
1423    public ClinicalImpression addProtocol(String value) { //1
1424      UriType t = new UriType();
1425      t.setValue(value);
1426      if (this.protocol == null)
1427        this.protocol = new ArrayList<UriType>();
1428      this.protocol.add(t);
1429      return this;
1430    }
1431
1432    /**
1433     * @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.)
1434     */
1435    public boolean hasProtocol(String value) { 
1436      if (this.protocol == null)
1437        return false;
1438      for (UriType v : this.protocol)
1439        if (v.equals(value)) // uri
1440          return true;
1441      return false;
1442    }
1443
1444    /**
1445     * @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
1446     */
1447    public StringType getSummaryElement() { 
1448      if (this.summary == null)
1449        if (Configuration.errorOnAutoCreate())
1450          throw new Error("Attempt to auto-create ClinicalImpression.summary");
1451        else if (Configuration.doAutoCreate())
1452          this.summary = new StringType(); // bb
1453      return this.summary;
1454    }
1455
1456    public boolean hasSummaryElement() { 
1457      return this.summary != null && !this.summary.isEmpty();
1458    }
1459
1460    public boolean hasSummary() { 
1461      return this.summary != null && !this.summary.isEmpty();
1462    }
1463
1464    /**
1465     * @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
1466     */
1467    public ClinicalImpression setSummaryElement(StringType value) { 
1468      this.summary = value;
1469      return this;
1470    }
1471
1472    /**
1473     * @return A text summary of the investigations and the diagnosis.
1474     */
1475    public String getSummary() { 
1476      return this.summary == null ? null : this.summary.getValue();
1477    }
1478
1479    /**
1480     * @param value A text summary of the investigations and the diagnosis.
1481     */
1482    public ClinicalImpression setSummary(String value) { 
1483      if (Utilities.noString(value))
1484        this.summary = null;
1485      else {
1486        if (this.summary == null)
1487          this.summary = new StringType();
1488        this.summary.setValue(value);
1489      }
1490      return this;
1491    }
1492
1493    /**
1494     * @return {@link #finding} (Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.)
1495     */
1496    public List<ClinicalImpressionFindingComponent> getFinding() { 
1497      if (this.finding == null)
1498        this.finding = new ArrayList<ClinicalImpressionFindingComponent>();
1499      return this.finding;
1500    }
1501
1502    /**
1503     * @return Returns a reference to <code>this</code> for easy method chaining
1504     */
1505    public ClinicalImpression setFinding(List<ClinicalImpressionFindingComponent> theFinding) { 
1506      this.finding = theFinding;
1507      return this;
1508    }
1509
1510    public boolean hasFinding() { 
1511      if (this.finding == null)
1512        return false;
1513      for (ClinicalImpressionFindingComponent item : this.finding)
1514        if (!item.isEmpty())
1515          return true;
1516      return false;
1517    }
1518
1519    public ClinicalImpressionFindingComponent addFinding() { //3
1520      ClinicalImpressionFindingComponent t = new ClinicalImpressionFindingComponent();
1521      if (this.finding == null)
1522        this.finding = new ArrayList<ClinicalImpressionFindingComponent>();
1523      this.finding.add(t);
1524      return t;
1525    }
1526
1527    public ClinicalImpression addFinding(ClinicalImpressionFindingComponent t) { //3
1528      if (t == null)
1529        return this;
1530      if (this.finding == null)
1531        this.finding = new ArrayList<ClinicalImpressionFindingComponent>();
1532      this.finding.add(t);
1533      return this;
1534    }
1535
1536    /**
1537     * @return The first repetition of repeating field {@link #finding}, creating it if it does not already exist
1538     */
1539    public ClinicalImpressionFindingComponent getFindingFirstRep() { 
1540      if (getFinding().isEmpty()) {
1541        addFinding();
1542      }
1543      return getFinding().get(0);
1544    }
1545
1546    /**
1547     * @return {@link #prognosisCodeableConcept} (Estimate of likely outcome.)
1548     */
1549    public List<CodeableConcept> getPrognosisCodeableConcept() { 
1550      if (this.prognosisCodeableConcept == null)
1551        this.prognosisCodeableConcept = new ArrayList<CodeableConcept>();
1552      return this.prognosisCodeableConcept;
1553    }
1554
1555    /**
1556     * @return Returns a reference to <code>this</code> for easy method chaining
1557     */
1558    public ClinicalImpression setPrognosisCodeableConcept(List<CodeableConcept> thePrognosisCodeableConcept) { 
1559      this.prognosisCodeableConcept = thePrognosisCodeableConcept;
1560      return this;
1561    }
1562
1563    public boolean hasPrognosisCodeableConcept() { 
1564      if (this.prognosisCodeableConcept == null)
1565        return false;
1566      for (CodeableConcept item : this.prognosisCodeableConcept)
1567        if (!item.isEmpty())
1568          return true;
1569      return false;
1570    }
1571
1572    public CodeableConcept addPrognosisCodeableConcept() { //3
1573      CodeableConcept t = new CodeableConcept();
1574      if (this.prognosisCodeableConcept == null)
1575        this.prognosisCodeableConcept = new ArrayList<CodeableConcept>();
1576      this.prognosisCodeableConcept.add(t);
1577      return t;
1578    }
1579
1580    public ClinicalImpression addPrognosisCodeableConcept(CodeableConcept t) { //3
1581      if (t == null)
1582        return this;
1583      if (this.prognosisCodeableConcept == null)
1584        this.prognosisCodeableConcept = new ArrayList<CodeableConcept>();
1585      this.prognosisCodeableConcept.add(t);
1586      return this;
1587    }
1588
1589    /**
1590     * @return The first repetition of repeating field {@link #prognosisCodeableConcept}, creating it if it does not already exist
1591     */
1592    public CodeableConcept getPrognosisCodeableConceptFirstRep() { 
1593      if (getPrognosisCodeableConcept().isEmpty()) {
1594        addPrognosisCodeableConcept();
1595      }
1596      return getPrognosisCodeableConcept().get(0);
1597    }
1598
1599    /**
1600     * @return {@link #prognosisReference} (RiskAssessment expressing likely outcome.)
1601     */
1602    public List<Reference> getPrognosisReference() { 
1603      if (this.prognosisReference == null)
1604        this.prognosisReference = new ArrayList<Reference>();
1605      return this.prognosisReference;
1606    }
1607
1608    /**
1609     * @return Returns a reference to <code>this</code> for easy method chaining
1610     */
1611    public ClinicalImpression setPrognosisReference(List<Reference> thePrognosisReference) { 
1612      this.prognosisReference = thePrognosisReference;
1613      return this;
1614    }
1615
1616    public boolean hasPrognosisReference() { 
1617      if (this.prognosisReference == null)
1618        return false;
1619      for (Reference item : this.prognosisReference)
1620        if (!item.isEmpty())
1621          return true;
1622      return false;
1623    }
1624
1625    public Reference addPrognosisReference() { //3
1626      Reference t = new Reference();
1627      if (this.prognosisReference == null)
1628        this.prognosisReference = new ArrayList<Reference>();
1629      this.prognosisReference.add(t);
1630      return t;
1631    }
1632
1633    public ClinicalImpression addPrognosisReference(Reference t) { //3
1634      if (t == null)
1635        return this;
1636      if (this.prognosisReference == null)
1637        this.prognosisReference = new ArrayList<Reference>();
1638      this.prognosisReference.add(t);
1639      return this;
1640    }
1641
1642    /**
1643     * @return The first repetition of repeating field {@link #prognosisReference}, creating it if it does not already exist
1644     */
1645    public Reference getPrognosisReferenceFirstRep() { 
1646      if (getPrognosisReference().isEmpty()) {
1647        addPrognosisReference();
1648      }
1649      return getPrognosisReference().get(0);
1650    }
1651
1652    /**
1653     * @deprecated Use Reference#setResource(IBaseResource) instead
1654     */
1655    @Deprecated
1656    public List<RiskAssessment> getPrognosisReferenceTarget() { 
1657      if (this.prognosisReferenceTarget == null)
1658        this.prognosisReferenceTarget = new ArrayList<RiskAssessment>();
1659      return this.prognosisReferenceTarget;
1660    }
1661
1662    /**
1663     * @deprecated Use Reference#setResource(IBaseResource) instead
1664     */
1665    @Deprecated
1666    public RiskAssessment addPrognosisReferenceTarget() { 
1667      RiskAssessment r = new RiskAssessment();
1668      if (this.prognosisReferenceTarget == null)
1669        this.prognosisReferenceTarget = new ArrayList<RiskAssessment>();
1670      this.prognosisReferenceTarget.add(r);
1671      return r;
1672    }
1673
1674    /**
1675     * @return {@link #action} (Action taken as part of assessment procedure.)
1676     */
1677    public List<Reference> getAction() { 
1678      if (this.action == null)
1679        this.action = new ArrayList<Reference>();
1680      return this.action;
1681    }
1682
1683    /**
1684     * @return Returns a reference to <code>this</code> for easy method chaining
1685     */
1686    public ClinicalImpression setAction(List<Reference> theAction) { 
1687      this.action = theAction;
1688      return this;
1689    }
1690
1691    public boolean hasAction() { 
1692      if (this.action == null)
1693        return false;
1694      for (Reference item : this.action)
1695        if (!item.isEmpty())
1696          return true;
1697      return false;
1698    }
1699
1700    public Reference addAction() { //3
1701      Reference t = new Reference();
1702      if (this.action == null)
1703        this.action = new ArrayList<Reference>();
1704      this.action.add(t);
1705      return t;
1706    }
1707
1708    public ClinicalImpression addAction(Reference t) { //3
1709      if (t == null)
1710        return this;
1711      if (this.action == null)
1712        this.action = new ArrayList<Reference>();
1713      this.action.add(t);
1714      return this;
1715    }
1716
1717    /**
1718     * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist
1719     */
1720    public Reference getActionFirstRep() { 
1721      if (getAction().isEmpty()) {
1722        addAction();
1723      }
1724      return getAction().get(0);
1725    }
1726
1727    /**
1728     * @deprecated Use Reference#setResource(IBaseResource) instead
1729     */
1730    @Deprecated
1731    public List<Resource> getActionTarget() { 
1732      if (this.actionTarget == null)
1733        this.actionTarget = new ArrayList<Resource>();
1734      return this.actionTarget;
1735    }
1736
1737    /**
1738     * @return {@link #note} (Commentary about the impression, typically recorded after the impression itself was made, though supplemental notes by the original author could also appear.)
1739     */
1740    public List<Annotation> getNote() { 
1741      if (this.note == null)
1742        this.note = new ArrayList<Annotation>();
1743      return this.note;
1744    }
1745
1746    /**
1747     * @return Returns a reference to <code>this</code> for easy method chaining
1748     */
1749    public ClinicalImpression setNote(List<Annotation> theNote) { 
1750      this.note = theNote;
1751      return this;
1752    }
1753
1754    public boolean hasNote() { 
1755      if (this.note == null)
1756        return false;
1757      for (Annotation item : this.note)
1758        if (!item.isEmpty())
1759          return true;
1760      return false;
1761    }
1762
1763    public Annotation addNote() { //3
1764      Annotation t = new Annotation();
1765      if (this.note == null)
1766        this.note = new ArrayList<Annotation>();
1767      this.note.add(t);
1768      return t;
1769    }
1770
1771    public ClinicalImpression addNote(Annotation t) { //3
1772      if (t == null)
1773        return this;
1774      if (this.note == null)
1775        this.note = new ArrayList<Annotation>();
1776      this.note.add(t);
1777      return this;
1778    }
1779
1780    /**
1781     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
1782     */
1783    public Annotation getNoteFirstRep() { 
1784      if (getNote().isEmpty()) {
1785        addNote();
1786      }
1787      return getNote().get(0);
1788    }
1789
1790      protected void listChildren(List<Property> childrenList) {
1791        super.listChildren(childrenList);
1792        childrenList.add(new Property("identifier", "Identifier", "A unique identifier assigned to the clinical impression that remains consistent regardless of what server the impression is stored on.", 0, java.lang.Integer.MAX_VALUE, identifier));
1793        childrenList.add(new Property("status", "code", "Identifies the workflow status of the assessment.", 0, java.lang.Integer.MAX_VALUE, status));
1794        childrenList.add(new Property("code", "CodeableConcept", "Categorizes the type of clinical assessment performed.", 0, java.lang.Integer.MAX_VALUE, code));
1795        childrenList.add(new Property("description", "string", "A summary of the context and/or cause of the assessment - why / where was it performed, and what patient events/status prompted it.", 0, java.lang.Integer.MAX_VALUE, description));
1796        childrenList.add(new Property("subject", "Reference(Patient|Group)", "The patient or group of individuals assessed as part of this record.", 0, java.lang.Integer.MAX_VALUE, subject));
1797        childrenList.add(new Property("context", "Reference(Encounter|EpisodeOfCare)", "The encounter or episode of care this impression was created as part of.", 0, java.lang.Integer.MAX_VALUE, context));
1798        childrenList.add(new Property("effective[x]", "dateTime|Period", "The point in time or period over which the subject was assessed.", 0, java.lang.Integer.MAX_VALUE, effective));
1799        childrenList.add(new Property("date", "dateTime", "Indicates when the documentation of the assessment was complete.", 0, java.lang.Integer.MAX_VALUE, date));
1800        childrenList.add(new Property("assessor", "Reference(Practitioner)", "The clinician performing the assessment.", 0, java.lang.Integer.MAX_VALUE, assessor));
1801        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));
1802        childrenList.add(new Property("problem", "Reference(Condition|AllergyIntolerance)", "This a list of the relevant problems/conditions for a patient.", 0, java.lang.Integer.MAX_VALUE, problem));
1803        childrenList.add(new Property("investigation", "", "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, investigation));
1804        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));
1805        childrenList.add(new Property("summary", "string", "A text summary of the investigations and the diagnosis.", 0, java.lang.Integer.MAX_VALUE, summary));
1806        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));
1807        childrenList.add(new Property("prognosisCodeableConcept", "CodeableConcept", "Estimate of likely outcome.", 0, java.lang.Integer.MAX_VALUE, prognosisCodeableConcept));
1808        childrenList.add(new Property("prognosisReference", "Reference(RiskAssessment)", "RiskAssessment expressing likely outcome.", 0, java.lang.Integer.MAX_VALUE, prognosisReference));
1809        childrenList.add(new Property("action", "Reference(ReferralRequest|ProcedureRequest|Procedure|MedicationRequest|Appointment)", "Action taken as part of assessment procedure.", 0, java.lang.Integer.MAX_VALUE, action));
1810        childrenList.add(new Property("note", "Annotation", "Commentary about the impression, typically recorded after the impression itself was made, though supplemental notes by the original author could also appear.", 0, java.lang.Integer.MAX_VALUE, note));
1811      }
1812
1813      @Override
1814      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1815        switch (hash) {
1816        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1817        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<ClinicalImpressionStatus>
1818        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
1819        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
1820        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
1821        case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // Reference
1822        case -1468651097: /*effective*/ return this.effective == null ? new Base[0] : new Base[] {this.effective}; // Type
1823        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
1824        case -373213113: /*assessor*/ return this.assessor == null ? new Base[0] : new Base[] {this.assessor}; // Reference
1825        case -1273775369: /*previous*/ return this.previous == null ? new Base[0] : new Base[] {this.previous}; // Reference
1826        case -309542241: /*problem*/ return this.problem == null ? new Base[0] : this.problem.toArray(new Base[this.problem.size()]); // Reference
1827        case 956015362: /*investigation*/ return this.investigation == null ? new Base[0] : this.investigation.toArray(new Base[this.investigation.size()]); // ClinicalImpressionInvestigationComponent
1828        case -989163880: /*protocol*/ return this.protocol == null ? new Base[0] : this.protocol.toArray(new Base[this.protocol.size()]); // UriType
1829        case -1857640538: /*summary*/ return this.summary == null ? new Base[0] : new Base[] {this.summary}; // StringType
1830        case -853173367: /*finding*/ return this.finding == null ? new Base[0] : this.finding.toArray(new Base[this.finding.size()]); // ClinicalImpressionFindingComponent
1831        case -676337953: /*prognosisCodeableConcept*/ return this.prognosisCodeableConcept == null ? new Base[0] : this.prognosisCodeableConcept.toArray(new Base[this.prognosisCodeableConcept.size()]); // CodeableConcept
1832        case -587137783: /*prognosisReference*/ return this.prognosisReference == null ? new Base[0] : this.prognosisReference.toArray(new Base[this.prognosisReference.size()]); // Reference
1833        case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // Reference
1834        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
1835        default: return super.getProperty(hash, name, checkValid);
1836        }
1837
1838      }
1839
1840      @Override
1841      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1842        switch (hash) {
1843        case -1618432855: // identifier
1844          this.getIdentifier().add(castToIdentifier(value)); // Identifier
1845          return value;
1846        case -892481550: // status
1847          value = new ClinicalImpressionStatusEnumFactory().fromType(castToCode(value));
1848          this.status = (Enumeration) value; // Enumeration<ClinicalImpressionStatus>
1849          return value;
1850        case 3059181: // code
1851          this.code = castToCodeableConcept(value); // CodeableConcept
1852          return value;
1853        case -1724546052: // description
1854          this.description = castToString(value); // StringType
1855          return value;
1856        case -1867885268: // subject
1857          this.subject = castToReference(value); // Reference
1858          return value;
1859        case 951530927: // context
1860          this.context = castToReference(value); // Reference
1861          return value;
1862        case -1468651097: // effective
1863          this.effective = castToType(value); // Type
1864          return value;
1865        case 3076014: // date
1866          this.date = castToDateTime(value); // DateTimeType
1867          return value;
1868        case -373213113: // assessor
1869          this.assessor = castToReference(value); // Reference
1870          return value;
1871        case -1273775369: // previous
1872          this.previous = castToReference(value); // Reference
1873          return value;
1874        case -309542241: // problem
1875          this.getProblem().add(castToReference(value)); // Reference
1876          return value;
1877        case 956015362: // investigation
1878          this.getInvestigation().add((ClinicalImpressionInvestigationComponent) value); // ClinicalImpressionInvestigationComponent
1879          return value;
1880        case -989163880: // protocol
1881          this.getProtocol().add(castToUri(value)); // UriType
1882          return value;
1883        case -1857640538: // summary
1884          this.summary = castToString(value); // StringType
1885          return value;
1886        case -853173367: // finding
1887          this.getFinding().add((ClinicalImpressionFindingComponent) value); // ClinicalImpressionFindingComponent
1888          return value;
1889        case -676337953: // prognosisCodeableConcept
1890          this.getPrognosisCodeableConcept().add(castToCodeableConcept(value)); // CodeableConcept
1891          return value;
1892        case -587137783: // prognosisReference
1893          this.getPrognosisReference().add(castToReference(value)); // Reference
1894          return value;
1895        case -1422950858: // action
1896          this.getAction().add(castToReference(value)); // Reference
1897          return value;
1898        case 3387378: // note
1899          this.getNote().add(castToAnnotation(value)); // Annotation
1900          return value;
1901        default: return super.setProperty(hash, name, value);
1902        }
1903
1904      }
1905
1906      @Override
1907      public Base setProperty(String name, Base value) throws FHIRException {
1908        if (name.equals("identifier")) {
1909          this.getIdentifier().add(castToIdentifier(value));
1910        } else if (name.equals("status")) {
1911          value = new ClinicalImpressionStatusEnumFactory().fromType(castToCode(value));
1912          this.status = (Enumeration) value; // Enumeration<ClinicalImpressionStatus>
1913        } else if (name.equals("code")) {
1914          this.code = castToCodeableConcept(value); // CodeableConcept
1915        } else if (name.equals("description")) {
1916          this.description = castToString(value); // StringType
1917        } else if (name.equals("subject")) {
1918          this.subject = castToReference(value); // Reference
1919        } else if (name.equals("context")) {
1920          this.context = castToReference(value); // Reference
1921        } else if (name.equals("effective[x]")) {
1922          this.effective = castToType(value); // Type
1923        } else if (name.equals("date")) {
1924          this.date = castToDateTime(value); // DateTimeType
1925        } else if (name.equals("assessor")) {
1926          this.assessor = castToReference(value); // Reference
1927        } else if (name.equals("previous")) {
1928          this.previous = castToReference(value); // Reference
1929        } else if (name.equals("problem")) {
1930          this.getProblem().add(castToReference(value));
1931        } else if (name.equals("investigation")) {
1932          this.getInvestigation().add((ClinicalImpressionInvestigationComponent) value);
1933        } else if (name.equals("protocol")) {
1934          this.getProtocol().add(castToUri(value));
1935        } else if (name.equals("summary")) {
1936          this.summary = castToString(value); // StringType
1937        } else if (name.equals("finding")) {
1938          this.getFinding().add((ClinicalImpressionFindingComponent) value);
1939        } else if (name.equals("prognosisCodeableConcept")) {
1940          this.getPrognosisCodeableConcept().add(castToCodeableConcept(value));
1941        } else if (name.equals("prognosisReference")) {
1942          this.getPrognosisReference().add(castToReference(value));
1943        } else if (name.equals("action")) {
1944          this.getAction().add(castToReference(value));
1945        } else if (name.equals("note")) {
1946          this.getNote().add(castToAnnotation(value));
1947        } else
1948          return super.setProperty(name, value);
1949        return value;
1950      }
1951
1952      @Override
1953      public Base makeProperty(int hash, String name) throws FHIRException {
1954        switch (hash) {
1955        case -1618432855:  return addIdentifier(); 
1956        case -892481550:  return getStatusElement();
1957        case 3059181:  return getCode(); 
1958        case -1724546052:  return getDescriptionElement();
1959        case -1867885268:  return getSubject(); 
1960        case 951530927:  return getContext(); 
1961        case 247104889:  return getEffective(); 
1962        case -1468651097:  return getEffective(); 
1963        case 3076014:  return getDateElement();
1964        case -373213113:  return getAssessor(); 
1965        case -1273775369:  return getPrevious(); 
1966        case -309542241:  return addProblem(); 
1967        case 956015362:  return addInvestigation(); 
1968        case -989163880:  return addProtocolElement();
1969        case -1857640538:  return getSummaryElement();
1970        case -853173367:  return addFinding(); 
1971        case -676337953:  return addPrognosisCodeableConcept(); 
1972        case -587137783:  return addPrognosisReference(); 
1973        case -1422950858:  return addAction(); 
1974        case 3387378:  return addNote(); 
1975        default: return super.makeProperty(hash, name);
1976        }
1977
1978      }
1979
1980      @Override
1981      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1982        switch (hash) {
1983        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1984        case -892481550: /*status*/ return new String[] {"code"};
1985        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1986        case -1724546052: /*description*/ return new String[] {"string"};
1987        case -1867885268: /*subject*/ return new String[] {"Reference"};
1988        case 951530927: /*context*/ return new String[] {"Reference"};
1989        case -1468651097: /*effective*/ return new String[] {"dateTime", "Period"};
1990        case 3076014: /*date*/ return new String[] {"dateTime"};
1991        case -373213113: /*assessor*/ return new String[] {"Reference"};
1992        case -1273775369: /*previous*/ return new String[] {"Reference"};
1993        case -309542241: /*problem*/ return new String[] {"Reference"};
1994        case 956015362: /*investigation*/ return new String[] {};
1995        case -989163880: /*protocol*/ return new String[] {"uri"};
1996        case -1857640538: /*summary*/ return new String[] {"string"};
1997        case -853173367: /*finding*/ return new String[] {};
1998        case -676337953: /*prognosisCodeableConcept*/ return new String[] {"CodeableConcept"};
1999        case -587137783: /*prognosisReference*/ return new String[] {"Reference"};
2000        case -1422950858: /*action*/ return new String[] {"Reference"};
2001        case 3387378: /*note*/ return new String[] {"Annotation"};
2002        default: return super.getTypesForProperty(hash, name);
2003        }
2004
2005      }
2006
2007      @Override
2008      public Base addChild(String name) throws FHIRException {
2009        if (name.equals("identifier")) {
2010          return addIdentifier();
2011        }
2012        else if (name.equals("status")) {
2013          throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.status");
2014        }
2015        else if (name.equals("code")) {
2016          this.code = new CodeableConcept();
2017          return this.code;
2018        }
2019        else if (name.equals("description")) {
2020          throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.description");
2021        }
2022        else if (name.equals("subject")) {
2023          this.subject = new Reference();
2024          return this.subject;
2025        }
2026        else if (name.equals("context")) {
2027          this.context = new Reference();
2028          return this.context;
2029        }
2030        else if (name.equals("effectiveDateTime")) {
2031          this.effective = new DateTimeType();
2032          return this.effective;
2033        }
2034        else if (name.equals("effectivePeriod")) {
2035          this.effective = new Period();
2036          return this.effective;
2037        }
2038        else if (name.equals("date")) {
2039          throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.date");
2040        }
2041        else if (name.equals("assessor")) {
2042          this.assessor = new Reference();
2043          return this.assessor;
2044        }
2045        else if (name.equals("previous")) {
2046          this.previous = new Reference();
2047          return this.previous;
2048        }
2049        else if (name.equals("problem")) {
2050          return addProblem();
2051        }
2052        else if (name.equals("investigation")) {
2053          return addInvestigation();
2054        }
2055        else if (name.equals("protocol")) {
2056          throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.protocol");
2057        }
2058        else if (name.equals("summary")) {
2059          throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.summary");
2060        }
2061        else if (name.equals("finding")) {
2062          return addFinding();
2063        }
2064        else if (name.equals("prognosisCodeableConcept")) {
2065          return addPrognosisCodeableConcept();
2066        }
2067        else if (name.equals("prognosisReference")) {
2068          return addPrognosisReference();
2069        }
2070        else if (name.equals("action")) {
2071          return addAction();
2072        }
2073        else if (name.equals("note")) {
2074          return addNote();
2075        }
2076        else
2077          return super.addChild(name);
2078      }
2079
2080  public String fhirType() {
2081    return "ClinicalImpression";
2082
2083  }
2084
2085      public ClinicalImpression copy() {
2086        ClinicalImpression dst = new ClinicalImpression();
2087        copyValues(dst);
2088        if (identifier != null) {
2089          dst.identifier = new ArrayList<Identifier>();
2090          for (Identifier i : identifier)
2091            dst.identifier.add(i.copy());
2092        };
2093        dst.status = status == null ? null : status.copy();
2094        dst.code = code == null ? null : code.copy();
2095        dst.description = description == null ? null : description.copy();
2096        dst.subject = subject == null ? null : subject.copy();
2097        dst.context = context == null ? null : context.copy();
2098        dst.effective = effective == null ? null : effective.copy();
2099        dst.date = date == null ? null : date.copy();
2100        dst.assessor = assessor == null ? null : assessor.copy();
2101        dst.previous = previous == null ? null : previous.copy();
2102        if (problem != null) {
2103          dst.problem = new ArrayList<Reference>();
2104          for (Reference i : problem)
2105            dst.problem.add(i.copy());
2106        };
2107        if (investigation != null) {
2108          dst.investigation = new ArrayList<ClinicalImpressionInvestigationComponent>();
2109          for (ClinicalImpressionInvestigationComponent i : investigation)
2110            dst.investigation.add(i.copy());
2111        };
2112        if (protocol != null) {
2113          dst.protocol = new ArrayList<UriType>();
2114          for (UriType i : protocol)
2115            dst.protocol.add(i.copy());
2116        };
2117        dst.summary = summary == null ? null : summary.copy();
2118        if (finding != null) {
2119          dst.finding = new ArrayList<ClinicalImpressionFindingComponent>();
2120          for (ClinicalImpressionFindingComponent i : finding)
2121            dst.finding.add(i.copy());
2122        };
2123        if (prognosisCodeableConcept != null) {
2124          dst.prognosisCodeableConcept = new ArrayList<CodeableConcept>();
2125          for (CodeableConcept i : prognosisCodeableConcept)
2126            dst.prognosisCodeableConcept.add(i.copy());
2127        };
2128        if (prognosisReference != null) {
2129          dst.prognosisReference = new ArrayList<Reference>();
2130          for (Reference i : prognosisReference)
2131            dst.prognosisReference.add(i.copy());
2132        };
2133        if (action != null) {
2134          dst.action = new ArrayList<Reference>();
2135          for (Reference i : action)
2136            dst.action.add(i.copy());
2137        };
2138        if (note != null) {
2139          dst.note = new ArrayList<Annotation>();
2140          for (Annotation i : note)
2141            dst.note.add(i.copy());
2142        };
2143        return dst;
2144      }
2145
2146      protected ClinicalImpression typedCopy() {
2147        return copy();
2148      }
2149
2150      @Override
2151      public boolean equalsDeep(Base other) {
2152        if (!super.equalsDeep(other))
2153          return false;
2154        if (!(other instanceof ClinicalImpression))
2155          return false;
2156        ClinicalImpression o = (ClinicalImpression) other;
2157        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(code, o.code, true)
2158           && compareDeep(description, o.description, true) && compareDeep(subject, o.subject, true) && compareDeep(context, o.context, true)
2159           && compareDeep(effective, o.effective, true) && compareDeep(date, o.date, true) && compareDeep(assessor, o.assessor, true)
2160           && compareDeep(previous, o.previous, true) && compareDeep(problem, o.problem, true) && compareDeep(investigation, o.investigation, true)
2161           && compareDeep(protocol, o.protocol, true) && compareDeep(summary, o.summary, true) && compareDeep(finding, o.finding, true)
2162           && compareDeep(prognosisCodeableConcept, o.prognosisCodeableConcept, true) && compareDeep(prognosisReference, o.prognosisReference, true)
2163           && compareDeep(action, o.action, true) && compareDeep(note, o.note, true);
2164      }
2165
2166      @Override
2167      public boolean equalsShallow(Base other) {
2168        if (!super.equalsShallow(other))
2169          return false;
2170        if (!(other instanceof ClinicalImpression))
2171          return false;
2172        ClinicalImpression o = (ClinicalImpression) other;
2173        return compareValues(status, o.status, true) && compareValues(description, o.description, true) && compareValues(date, o.date, true)
2174           && compareValues(protocol, o.protocol, true) && compareValues(summary, o.summary, true);
2175      }
2176
2177      public boolean isEmpty() {
2178        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, code
2179          , description, subject, context, effective, date, assessor, previous, problem
2180          , investigation, protocol, summary, finding, prognosisCodeableConcept, prognosisReference
2181          , action, note);
2182      }
2183
2184  @Override
2185  public ResourceType getResourceType() {
2186    return ResourceType.ClinicalImpression;
2187   }
2188
2189 /**
2190   * Search parameter: <b>date</b>
2191   * <p>
2192   * Description: <b>When the assessment was documented</b><br>
2193   * Type: <b>date</b><br>
2194   * Path: <b>ClinicalImpression.date</b><br>
2195   * </p>
2196   */
2197  @SearchParamDefinition(name="date", path="ClinicalImpression.date", description="When the assessment was documented", type="date" )
2198  public static final String SP_DATE = "date";
2199 /**
2200   * <b>Fluent Client</b> search parameter constant for <b>date</b>
2201   * <p>
2202   * Description: <b>When the assessment was documented</b><br>
2203   * Type: <b>date</b><br>
2204   * Path: <b>ClinicalImpression.date</b><br>
2205   * </p>
2206   */
2207  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
2208
2209 /**
2210   * Search parameter: <b>identifier</b>
2211   * <p>
2212   * Description: <b>Business identifier</b><br>
2213   * Type: <b>token</b><br>
2214   * Path: <b>ClinicalImpression.identifier</b><br>
2215   * </p>
2216   */
2217  @SearchParamDefinition(name="identifier", path="ClinicalImpression.identifier", description="Business identifier", type="token" )
2218  public static final String SP_IDENTIFIER = "identifier";
2219 /**
2220   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2221   * <p>
2222   * Description: <b>Business identifier</b><br>
2223   * Type: <b>token</b><br>
2224   * Path: <b>ClinicalImpression.identifier</b><br>
2225   * </p>
2226   */
2227  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2228
2229 /**
2230   * Search parameter: <b>previous</b>
2231   * <p>
2232   * Description: <b>Reference to last assessment</b><br>
2233   * Type: <b>reference</b><br>
2234   * Path: <b>ClinicalImpression.previous</b><br>
2235   * </p>
2236   */
2237  @SearchParamDefinition(name="previous", path="ClinicalImpression.previous", description="Reference to last assessment", type="reference", target={ClinicalImpression.class } )
2238  public static final String SP_PREVIOUS = "previous";
2239 /**
2240   * <b>Fluent Client</b> search parameter constant for <b>previous</b>
2241   * <p>
2242   * Description: <b>Reference to last assessment</b><br>
2243   * Type: <b>reference</b><br>
2244   * Path: <b>ClinicalImpression.previous</b><br>
2245   * </p>
2246   */
2247  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PREVIOUS = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PREVIOUS);
2248
2249/**
2250   * Constant for fluent queries to be used to add include statements. Specifies
2251   * the path value of "<b>ClinicalImpression:previous</b>".
2252   */
2253  public static final ca.uhn.fhir.model.api.Include INCLUDE_PREVIOUS = new ca.uhn.fhir.model.api.Include("ClinicalImpression:previous").toLocked();
2254
2255 /**
2256   * Search parameter: <b>finding-code</b>
2257   * <p>
2258   * Description: <b>What was found</b><br>
2259   * Type: <b>token</b><br>
2260   * Path: <b>ClinicalImpression.finding.item[x]</b><br>
2261   * </p>
2262   */
2263  @SearchParamDefinition(name="finding-code", path="ClinicalImpression.finding.item.as(CodeableConcept)", description="What was found", type="token" )
2264  public static final String SP_FINDING_CODE = "finding-code";
2265 /**
2266   * <b>Fluent Client</b> search parameter constant for <b>finding-code</b>
2267   * <p>
2268   * Description: <b>What was found</b><br>
2269   * Type: <b>token</b><br>
2270   * Path: <b>ClinicalImpression.finding.item[x]</b><br>
2271   * </p>
2272   */
2273  public static final ca.uhn.fhir.rest.gclient.TokenClientParam FINDING_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FINDING_CODE);
2274
2275 /**
2276   * Search parameter: <b>assessor</b>
2277   * <p>
2278   * Description: <b>The clinician performing the assessment</b><br>
2279   * Type: <b>reference</b><br>
2280   * Path: <b>ClinicalImpression.assessor</b><br>
2281   * </p>
2282   */
2283  @SearchParamDefinition(name="assessor", path="ClinicalImpression.assessor", description="The clinician performing the assessment", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Practitioner.class } )
2284  public static final String SP_ASSESSOR = "assessor";
2285 /**
2286   * <b>Fluent Client</b> search parameter constant for <b>assessor</b>
2287   * <p>
2288   * Description: <b>The clinician performing the assessment</b><br>
2289   * Type: <b>reference</b><br>
2290   * Path: <b>ClinicalImpression.assessor</b><br>
2291   * </p>
2292   */
2293  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ASSESSOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ASSESSOR);
2294
2295/**
2296   * Constant for fluent queries to be used to add include statements. Specifies
2297   * the path value of "<b>ClinicalImpression:assessor</b>".
2298   */
2299  public static final ca.uhn.fhir.model.api.Include INCLUDE_ASSESSOR = new ca.uhn.fhir.model.api.Include("ClinicalImpression:assessor").toLocked();
2300
2301 /**
2302   * Search parameter: <b>subject</b>
2303   * <p>
2304   * Description: <b>Patient or group assessed</b><br>
2305   * Type: <b>reference</b><br>
2306   * Path: <b>ClinicalImpression.subject</b><br>
2307   * </p>
2308   */
2309  @SearchParamDefinition(name="subject", path="ClinicalImpression.subject", description="Patient or group assessed", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Group.class, Patient.class } )
2310  public static final String SP_SUBJECT = "subject";
2311 /**
2312   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2313   * <p>
2314   * Description: <b>Patient or group assessed</b><br>
2315   * Type: <b>reference</b><br>
2316   * Path: <b>ClinicalImpression.subject</b><br>
2317   * </p>
2318   */
2319  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
2320
2321/**
2322   * Constant for fluent queries to be used to add include statements. Specifies
2323   * the path value of "<b>ClinicalImpression:subject</b>".
2324   */
2325  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("ClinicalImpression:subject").toLocked();
2326
2327 /**
2328   * Search parameter: <b>finding-ref</b>
2329   * <p>
2330   * Description: <b>What was found</b><br>
2331   * Type: <b>reference</b><br>
2332   * Path: <b>ClinicalImpression.finding.item[x]</b><br>
2333   * </p>
2334   */
2335  @SearchParamDefinition(name="finding-ref", path="ClinicalImpression.finding.item.as(Reference)", description="What was found", type="reference", target={Condition.class, Observation.class } )
2336  public static final String SP_FINDING_REF = "finding-ref";
2337 /**
2338   * <b>Fluent Client</b> search parameter constant for <b>finding-ref</b>
2339   * <p>
2340   * Description: <b>What was found</b><br>
2341   * Type: <b>reference</b><br>
2342   * Path: <b>ClinicalImpression.finding.item[x]</b><br>
2343   * </p>
2344   */
2345  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FINDING_REF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FINDING_REF);
2346
2347/**
2348   * Constant for fluent queries to be used to add include statements. Specifies
2349   * the path value of "<b>ClinicalImpression:finding-ref</b>".
2350   */
2351  public static final ca.uhn.fhir.model.api.Include INCLUDE_FINDING_REF = new ca.uhn.fhir.model.api.Include("ClinicalImpression:finding-ref").toLocked();
2352
2353 /**
2354   * Search parameter: <b>problem</b>
2355   * <p>
2356   * Description: <b>Relevant impressions of patient state</b><br>
2357   * Type: <b>reference</b><br>
2358   * Path: <b>ClinicalImpression.problem</b><br>
2359   * </p>
2360   */
2361  @SearchParamDefinition(name="problem", path="ClinicalImpression.problem", description="Relevant impressions of patient state", type="reference", target={AllergyIntolerance.class, Condition.class } )
2362  public static final String SP_PROBLEM = "problem";
2363 /**
2364   * <b>Fluent Client</b> search parameter constant for <b>problem</b>
2365   * <p>
2366   * Description: <b>Relevant impressions of patient state</b><br>
2367   * Type: <b>reference</b><br>
2368   * Path: <b>ClinicalImpression.problem</b><br>
2369   * </p>
2370   */
2371  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROBLEM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROBLEM);
2372
2373/**
2374   * Constant for fluent queries to be used to add include statements. Specifies
2375   * the path value of "<b>ClinicalImpression:problem</b>".
2376   */
2377  public static final ca.uhn.fhir.model.api.Include INCLUDE_PROBLEM = new ca.uhn.fhir.model.api.Include("ClinicalImpression:problem").toLocked();
2378
2379 /**
2380   * Search parameter: <b>patient</b>
2381   * <p>
2382   * Description: <b>Patient or group assessed</b><br>
2383   * Type: <b>reference</b><br>
2384   * Path: <b>ClinicalImpression.subject</b><br>
2385   * </p>
2386   */
2387  @SearchParamDefinition(name="patient", path="ClinicalImpression.subject", description="Patient or group assessed", type="reference", target={Patient.class } )
2388  public static final String SP_PATIENT = "patient";
2389 /**
2390   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2391   * <p>
2392   * Description: <b>Patient or group assessed</b><br>
2393   * Type: <b>reference</b><br>
2394   * Path: <b>ClinicalImpression.subject</b><br>
2395   * </p>
2396   */
2397  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2398
2399/**
2400   * Constant for fluent queries to be used to add include statements. Specifies
2401   * the path value of "<b>ClinicalImpression:patient</b>".
2402   */
2403  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ClinicalImpression:patient").toLocked();
2404
2405 /**
2406   * Search parameter: <b>context</b>
2407   * <p>
2408   * Description: <b>Encounter or Episode created from</b><br>
2409   * Type: <b>reference</b><br>
2410   * Path: <b>ClinicalImpression.context</b><br>
2411   * </p>
2412   */
2413  @SearchParamDefinition(name="context", path="ClinicalImpression.context", description="Encounter or Episode created from", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Encounter") }, target={Encounter.class, EpisodeOfCare.class } )
2414  public static final String SP_CONTEXT = "context";
2415 /**
2416   * <b>Fluent Client</b> search parameter constant for <b>context</b>
2417   * <p>
2418   * Description: <b>Encounter or Episode created from</b><br>
2419   * Type: <b>reference</b><br>
2420   * Path: <b>ClinicalImpression.context</b><br>
2421   * </p>
2422   */
2423  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONTEXT);
2424
2425/**
2426   * Constant for fluent queries to be used to add include statements. Specifies
2427   * the path value of "<b>ClinicalImpression:context</b>".
2428   */
2429  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONTEXT = new ca.uhn.fhir.model.api.Include("ClinicalImpression:context").toLocked();
2430
2431 /**
2432   * Search parameter: <b>investigation</b>
2433   * <p>
2434   * Description: <b>Record of a specific investigation</b><br>
2435   * Type: <b>reference</b><br>
2436   * Path: <b>ClinicalImpression.investigation.item</b><br>
2437   * </p>
2438   */
2439  @SearchParamDefinition(name="investigation", path="ClinicalImpression.investigation.item", description="Record of a specific investigation", type="reference", target={DiagnosticReport.class, FamilyMemberHistory.class, ImagingStudy.class, Observation.class, QuestionnaireResponse.class, RiskAssessment.class } )
2440  public static final String SP_INVESTIGATION = "investigation";
2441 /**
2442   * <b>Fluent Client</b> search parameter constant for <b>investigation</b>
2443   * <p>
2444   * Description: <b>Record of a specific investigation</b><br>
2445   * Type: <b>reference</b><br>
2446   * Path: <b>ClinicalImpression.investigation.item</b><br>
2447   * </p>
2448   */
2449  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INVESTIGATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INVESTIGATION);
2450
2451/**
2452   * Constant for fluent queries to be used to add include statements. Specifies
2453   * the path value of "<b>ClinicalImpression:investigation</b>".
2454   */
2455  public static final ca.uhn.fhir.model.api.Include INCLUDE_INVESTIGATION = new ca.uhn.fhir.model.api.Include("ClinicalImpression:investigation").toLocked();
2456
2457 /**
2458   * Search parameter: <b>action</b>
2459   * <p>
2460   * Description: <b>Action taken as part of assessment procedure</b><br>
2461   * Type: <b>reference</b><br>
2462   * Path: <b>ClinicalImpression.action</b><br>
2463   * </p>
2464   */
2465  @SearchParamDefinition(name="action", path="ClinicalImpression.action", description="Action taken as part of assessment procedure", type="reference", target={Appointment.class, MedicationRequest.class, Procedure.class, ProcedureRequest.class, ReferralRequest.class } )
2466  public static final String SP_ACTION = "action";
2467 /**
2468   * <b>Fluent Client</b> search parameter constant for <b>action</b>
2469   * <p>
2470   * Description: <b>Action taken as part of assessment procedure</b><br>
2471   * Type: <b>reference</b><br>
2472   * Path: <b>ClinicalImpression.action</b><br>
2473   * </p>
2474   */
2475  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACTION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACTION);
2476
2477/**
2478   * Constant for fluent queries to be used to add include statements. Specifies
2479   * the path value of "<b>ClinicalImpression:action</b>".
2480   */
2481  public static final ca.uhn.fhir.model.api.Include INCLUDE_ACTION = new ca.uhn.fhir.model.api.Include("ClinicalImpression:action").toLocked();
2482
2483 /**
2484   * Search parameter: <b>status</b>
2485   * <p>
2486   * Description: <b>draft | completed | entered-in-error</b><br>
2487   * Type: <b>token</b><br>
2488   * Path: <b>ClinicalImpression.status</b><br>
2489   * </p>
2490   */
2491  @SearchParamDefinition(name="status", path="ClinicalImpression.status", description="draft | completed | entered-in-error", type="token" )
2492  public static final String SP_STATUS = "status";
2493 /**
2494   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2495   * <p>
2496   * Description: <b>draft | completed | entered-in-error</b><br>
2497   * Type: <b>token</b><br>
2498   * Path: <b>ClinicalImpression.status</b><br>
2499   * </p>
2500   */
2501  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2502
2503
2504}
2505