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