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