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 Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
033import java.util.ArrayList;
034import java.util.Date;
035import java.util.List;
036
037import org.hl7.fhir.exceptions.FHIRException;
038import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
039
040import ca.uhn.fhir.model.api.annotation.Block;
041import ca.uhn.fhir.model.api.annotation.Child;
042import ca.uhn.fhir.model.api.annotation.Description;
043import ca.uhn.fhir.model.api.annotation.ResourceDef;
044import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
045
046/**
047 * A clinical condition, problem, diagnosis, or other event, situation, issue,
048 * or clinical concept that has risen to a level of concern.
049 */
050@ResourceDef(name = "Condition", profile = "http://hl7.org/fhir/StructureDefinition/Condition")
051public class Condition extends DomainResource {
052
053  @Block()
054  public static class ConditionStageComponent extends BackboneElement implements IBaseBackboneElement {
055    /**
056     * A simple summary of the stage such as "Stage 3". The determination of the
057     * stage is disease-specific.
058     */
059    @Child(name = "summary", type = {
060        CodeableConcept.class }, order = 1, min = 0, max = 1, modifier = false, summary = false)
061    @Description(shortDefinition = "Simple summary (disease specific)", formalDefinition = "A simple summary of the stage such as \"Stage 3\". The determination of the stage is disease-specific.")
062    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/condition-stage")
063    protected CodeableConcept summary;
064
065    /**
066     * Reference to a formal record of the evidence on which the staging assessment
067     * is based.
068     */
069    @Child(name = "assessment", type = { ClinicalImpression.class, DiagnosticReport.class,
070        Observation.class }, order = 2, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
071    @Description(shortDefinition = "Formal record of assessment", formalDefinition = "Reference to a formal record of the evidence on which the staging assessment is based.")
072    protected List<Reference> assessment;
073    /**
074     * The actual objects that are the target of the reference (Reference to a
075     * formal record of the evidence on which the staging assessment is based.)
076     */
077    protected List<Resource> assessmentTarget;
078
079    /**
080     * The kind of staging, such as pathological or clinical staging.
081     */
082    @Child(name = "type", type = {
083        CodeableConcept.class }, order = 3, min = 0, max = 1, modifier = false, summary = false)
084    @Description(shortDefinition = "Kind of staging", formalDefinition = "The kind of staging, such as pathological or clinical staging.")
085    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/condition-stage-type")
086    protected CodeableConcept type;
087
088    private static final long serialVersionUID = 668627986L;
089
090    /**
091     * Constructor
092     */
093    public ConditionStageComponent() {
094      super();
095    }
096
097    /**
098     * @return {@link #summary} (A simple summary of the stage such as "Stage 3".
099     *         The determination of the stage is disease-specific.)
100     */
101    public CodeableConcept getSummary() {
102      if (this.summary == null)
103        if (Configuration.errorOnAutoCreate())
104          throw new Error("Attempt to auto-create ConditionStageComponent.summary");
105        else if (Configuration.doAutoCreate())
106          this.summary = new CodeableConcept(); // cc
107      return this.summary;
108    }
109
110    public boolean hasSummary() {
111      return this.summary != null && !this.summary.isEmpty();
112    }
113
114    /**
115     * @param value {@link #summary} (A simple summary of the stage such as "Stage
116     *              3". The determination of the stage is disease-specific.)
117     */
118    public ConditionStageComponent setSummary(CodeableConcept value) {
119      this.summary = value;
120      return this;
121    }
122
123    /**
124     * @return {@link #assessment} (Reference to a formal record of the evidence on
125     *         which the staging assessment is based.)
126     */
127    public List<Reference> getAssessment() {
128      if (this.assessment == null)
129        this.assessment = new ArrayList<Reference>();
130      return this.assessment;
131    }
132
133    /**
134     * @return Returns a reference to <code>this</code> for easy method chaining
135     */
136    public ConditionStageComponent setAssessment(List<Reference> theAssessment) {
137      this.assessment = theAssessment;
138      return this;
139    }
140
141    public boolean hasAssessment() {
142      if (this.assessment == null)
143        return false;
144      for (Reference item : this.assessment)
145        if (!item.isEmpty())
146          return true;
147      return false;
148    }
149
150    public Reference addAssessment() { // 3
151      Reference t = new Reference();
152      if (this.assessment == null)
153        this.assessment = new ArrayList<Reference>();
154      this.assessment.add(t);
155      return t;
156    }
157
158    public ConditionStageComponent addAssessment(Reference t) { // 3
159      if (t == null)
160        return this;
161      if (this.assessment == null)
162        this.assessment = new ArrayList<Reference>();
163      this.assessment.add(t);
164      return this;
165    }
166
167    /**
168     * @return The first repetition of repeating field {@link #assessment}, creating
169     *         it if it does not already exist
170     */
171    public Reference getAssessmentFirstRep() {
172      if (getAssessment().isEmpty()) {
173        addAssessment();
174      }
175      return getAssessment().get(0);
176    }
177
178    /**
179     * @deprecated Use Reference#setResource(IBaseResource) instead
180     */
181    @Deprecated
182    public List<Resource> getAssessmentTarget() {
183      if (this.assessmentTarget == null)
184        this.assessmentTarget = new ArrayList<Resource>();
185      return this.assessmentTarget;
186    }
187
188    /**
189     * @return {@link #type} (The kind of staging, such as pathological or clinical
190     *         staging.)
191     */
192    public CodeableConcept getType() {
193      if (this.type == null)
194        if (Configuration.errorOnAutoCreate())
195          throw new Error("Attempt to auto-create ConditionStageComponent.type");
196        else if (Configuration.doAutoCreate())
197          this.type = new CodeableConcept(); // cc
198      return this.type;
199    }
200
201    public boolean hasType() {
202      return this.type != null && !this.type.isEmpty();
203    }
204
205    /**
206     * @param value {@link #type} (The kind of staging, such as pathological or
207     *              clinical staging.)
208     */
209    public ConditionStageComponent setType(CodeableConcept value) {
210      this.type = value;
211      return this;
212    }
213
214    protected void listChildren(List<Property> children) {
215      super.listChildren(children);
216      children.add(new Property("summary", "CodeableConcept",
217          "A simple summary of the stage such as \"Stage 3\". The determination of the stage is disease-specific.", 0,
218          1, summary));
219      children.add(new Property("assessment", "Reference(ClinicalImpression|DiagnosticReport|Observation)",
220          "Reference to a formal record of the evidence on which the staging assessment is based.", 0,
221          java.lang.Integer.MAX_VALUE, assessment));
222      children.add(new Property("type", "CodeableConcept",
223          "The kind of staging, such as pathological or clinical staging.", 0, 1, type));
224    }
225
226    @Override
227    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
228      switch (_hash) {
229      case -1857640538:
230        /* summary */ return new Property("summary", "CodeableConcept",
231            "A simple summary of the stage such as \"Stage 3\". The determination of the stage is disease-specific.", 0,
232            1, summary);
233      case 2119382722:
234        /* assessment */ return new Property("assessment", "Reference(ClinicalImpression|DiagnosticReport|Observation)",
235            "Reference to a formal record of the evidence on which the staging assessment is based.", 0,
236            java.lang.Integer.MAX_VALUE, assessment);
237      case 3575610:
238        /* type */ return new Property("type", "CodeableConcept",
239            "The kind of staging, such as pathological or clinical staging.", 0, 1, type);
240      default:
241        return super.getNamedProperty(_hash, _name, _checkValid);
242      }
243
244    }
245
246    @Override
247    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
248      switch (hash) {
249      case -1857640538:
250        /* summary */ return this.summary == null ? new Base[0] : new Base[] { this.summary }; // CodeableConcept
251      case 2119382722:
252        /* assessment */ return this.assessment == null ? new Base[0]
253            : this.assessment.toArray(new Base[this.assessment.size()]); // Reference
254      case 3575610:
255        /* type */ return this.type == null ? new Base[0] : new Base[] { this.type }; // CodeableConcept
256      default:
257        return super.getProperty(hash, name, checkValid);
258      }
259
260    }
261
262    @Override
263    public Base setProperty(int hash, String name, Base value) throws FHIRException {
264      switch (hash) {
265      case -1857640538: // summary
266        this.summary = castToCodeableConcept(value); // CodeableConcept
267        return value;
268      case 2119382722: // assessment
269        this.getAssessment().add(castToReference(value)); // Reference
270        return value;
271      case 3575610: // type
272        this.type = castToCodeableConcept(value); // CodeableConcept
273        return value;
274      default:
275        return super.setProperty(hash, name, value);
276      }
277
278    }
279
280    @Override
281    public Base setProperty(String name, Base value) throws FHIRException {
282      if (name.equals("summary")) {
283        this.summary = castToCodeableConcept(value); // CodeableConcept
284      } else if (name.equals("assessment")) {
285        this.getAssessment().add(castToReference(value));
286      } else if (name.equals("type")) {
287        this.type = castToCodeableConcept(value); // CodeableConcept
288      } else
289        return super.setProperty(name, value);
290      return value;
291    }
292
293    @Override
294    public Base makeProperty(int hash, String name) throws FHIRException {
295      switch (hash) {
296      case -1857640538:
297        return getSummary();
298      case 2119382722:
299        return addAssessment();
300      case 3575610:
301        return getType();
302      default:
303        return super.makeProperty(hash, name);
304      }
305
306    }
307
308    @Override
309    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
310      switch (hash) {
311      case -1857640538:
312        /* summary */ return new String[] { "CodeableConcept" };
313      case 2119382722:
314        /* assessment */ return new String[] { "Reference" };
315      case 3575610:
316        /* type */ return new String[] { "CodeableConcept" };
317      default:
318        return super.getTypesForProperty(hash, name);
319      }
320
321    }
322
323    @Override
324    public Base addChild(String name) throws FHIRException {
325      if (name.equals("summary")) {
326        this.summary = new CodeableConcept();
327        return this.summary;
328      } else if (name.equals("assessment")) {
329        return addAssessment();
330      } else if (name.equals("type")) {
331        this.type = new CodeableConcept();
332        return this.type;
333      } else
334        return super.addChild(name);
335    }
336
337    public ConditionStageComponent copy() {
338      ConditionStageComponent dst = new ConditionStageComponent();
339      copyValues(dst);
340      return dst;
341    }
342
343    public void copyValues(ConditionStageComponent dst) {
344      super.copyValues(dst);
345      dst.summary = summary == null ? null : summary.copy();
346      if (assessment != null) {
347        dst.assessment = new ArrayList<Reference>();
348        for (Reference i : assessment)
349          dst.assessment.add(i.copy());
350      }
351      ;
352      dst.type = type == null ? null : type.copy();
353    }
354
355    @Override
356    public boolean equalsDeep(Base other_) {
357      if (!super.equalsDeep(other_))
358        return false;
359      if (!(other_ instanceof ConditionStageComponent))
360        return false;
361      ConditionStageComponent o = (ConditionStageComponent) other_;
362      return compareDeep(summary, o.summary, true) && compareDeep(assessment, o.assessment, true)
363          && compareDeep(type, o.type, true);
364    }
365
366    @Override
367    public boolean equalsShallow(Base other_) {
368      if (!super.equalsShallow(other_))
369        return false;
370      if (!(other_ instanceof ConditionStageComponent))
371        return false;
372      ConditionStageComponent o = (ConditionStageComponent) other_;
373      return true;
374    }
375
376    public boolean isEmpty() {
377      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(summary, assessment, type);
378    }
379
380    public String fhirType() {
381      return "Condition.stage";
382
383    }
384
385  }
386
387  @Block()
388  public static class ConditionEvidenceComponent extends BackboneElement implements IBaseBackboneElement {
389    /**
390     * A manifestation or symptom that led to the recording of this condition.
391     */
392    @Child(name = "code", type = {
393        CodeableConcept.class }, order = 1, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
394    @Description(shortDefinition = "Manifestation/symptom", formalDefinition = "A manifestation or symptom that led to the recording of this condition.")
395    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/manifestation-or-symptom")
396    protected List<CodeableConcept> code;
397
398    /**
399     * Links to other relevant information, including pathology reports.
400     */
401    @Child(name = "detail", type = {
402        Reference.class }, order = 2, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
403    @Description(shortDefinition = "Supporting information found elsewhere", formalDefinition = "Links to other relevant information, including pathology reports.")
404    protected List<Reference> detail;
405    /**
406     * The actual objects that are the target of the reference (Links to other
407     * relevant information, including pathology reports.)
408     */
409    protected List<Resource> detailTarget;
410
411    private static final long serialVersionUID = 1135831276L;
412
413    /**
414     * Constructor
415     */
416    public ConditionEvidenceComponent() {
417      super();
418    }
419
420    /**
421     * @return {@link #code} (A manifestation or symptom that led to the recording
422     *         of this condition.)
423     */
424    public List<CodeableConcept> getCode() {
425      if (this.code == null)
426        this.code = new ArrayList<CodeableConcept>();
427      return this.code;
428    }
429
430    /**
431     * @return Returns a reference to <code>this</code> for easy method chaining
432     */
433    public ConditionEvidenceComponent setCode(List<CodeableConcept> theCode) {
434      this.code = theCode;
435      return this;
436    }
437
438    public boolean hasCode() {
439      if (this.code == null)
440        return false;
441      for (CodeableConcept item : this.code)
442        if (!item.isEmpty())
443          return true;
444      return false;
445    }
446
447    public CodeableConcept addCode() { // 3
448      CodeableConcept t = new CodeableConcept();
449      if (this.code == null)
450        this.code = new ArrayList<CodeableConcept>();
451      this.code.add(t);
452      return t;
453    }
454
455    public ConditionEvidenceComponent addCode(CodeableConcept t) { // 3
456      if (t == null)
457        return this;
458      if (this.code == null)
459        this.code = new ArrayList<CodeableConcept>();
460      this.code.add(t);
461      return this;
462    }
463
464    /**
465     * @return The first repetition of repeating field {@link #code}, creating it if
466     *         it does not already exist
467     */
468    public CodeableConcept getCodeFirstRep() {
469      if (getCode().isEmpty()) {
470        addCode();
471      }
472      return getCode().get(0);
473    }
474
475    /**
476     * @return {@link #detail} (Links to other relevant information, including
477     *         pathology reports.)
478     */
479    public List<Reference> getDetail() {
480      if (this.detail == null)
481        this.detail = new ArrayList<Reference>();
482      return this.detail;
483    }
484
485    /**
486     * @return Returns a reference to <code>this</code> for easy method chaining
487     */
488    public ConditionEvidenceComponent setDetail(List<Reference> theDetail) {
489      this.detail = theDetail;
490      return this;
491    }
492
493    public boolean hasDetail() {
494      if (this.detail == null)
495        return false;
496      for (Reference item : this.detail)
497        if (!item.isEmpty())
498          return true;
499      return false;
500    }
501
502    public Reference addDetail() { // 3
503      Reference t = new Reference();
504      if (this.detail == null)
505        this.detail = new ArrayList<Reference>();
506      this.detail.add(t);
507      return t;
508    }
509
510    public ConditionEvidenceComponent addDetail(Reference t) { // 3
511      if (t == null)
512        return this;
513      if (this.detail == null)
514        this.detail = new ArrayList<Reference>();
515      this.detail.add(t);
516      return this;
517    }
518
519    /**
520     * @return The first repetition of repeating field {@link #detail}, creating it
521     *         if it does not already exist
522     */
523    public Reference getDetailFirstRep() {
524      if (getDetail().isEmpty()) {
525        addDetail();
526      }
527      return getDetail().get(0);
528    }
529
530    /**
531     * @deprecated Use Reference#setResource(IBaseResource) instead
532     */
533    @Deprecated
534    public List<Resource> getDetailTarget() {
535      if (this.detailTarget == null)
536        this.detailTarget = new ArrayList<Resource>();
537      return this.detailTarget;
538    }
539
540    protected void listChildren(List<Property> children) {
541      super.listChildren(children);
542      children.add(new Property("code", "CodeableConcept",
543          "A manifestation or symptom that led to the recording of this condition.", 0, java.lang.Integer.MAX_VALUE,
544          code));
545      children.add(new Property("detail", "Reference(Any)",
546          "Links to other relevant information, including pathology reports.", 0, java.lang.Integer.MAX_VALUE, detail));
547    }
548
549    @Override
550    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
551      switch (_hash) {
552      case 3059181:
553        /* code */ return new Property("code", "CodeableConcept",
554            "A manifestation or symptom that led to the recording of this condition.", 0, java.lang.Integer.MAX_VALUE,
555            code);
556      case -1335224239:
557        /* detail */ return new Property("detail", "Reference(Any)",
558            "Links to other relevant information, including pathology reports.", 0, java.lang.Integer.MAX_VALUE,
559            detail);
560      default:
561        return super.getNamedProperty(_hash, _name, _checkValid);
562      }
563
564    }
565
566    @Override
567    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
568      switch (hash) {
569      case 3059181:
570        /* code */ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // CodeableConcept
571      case -1335224239:
572        /* detail */ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // Reference
573      default:
574        return super.getProperty(hash, name, checkValid);
575      }
576
577    }
578
579    @Override
580    public Base setProperty(int hash, String name, Base value) throws FHIRException {
581      switch (hash) {
582      case 3059181: // code
583        this.getCode().add(castToCodeableConcept(value)); // CodeableConcept
584        return value;
585      case -1335224239: // detail
586        this.getDetail().add(castToReference(value)); // Reference
587        return value;
588      default:
589        return super.setProperty(hash, name, value);
590      }
591
592    }
593
594    @Override
595    public Base setProperty(String name, Base value) throws FHIRException {
596      if (name.equals("code")) {
597        this.getCode().add(castToCodeableConcept(value));
598      } else if (name.equals("detail")) {
599        this.getDetail().add(castToReference(value));
600      } else
601        return super.setProperty(name, value);
602      return value;
603    }
604
605    @Override
606    public Base makeProperty(int hash, String name) throws FHIRException {
607      switch (hash) {
608      case 3059181:
609        return addCode();
610      case -1335224239:
611        return addDetail();
612      default:
613        return super.makeProperty(hash, name);
614      }
615
616    }
617
618    @Override
619    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
620      switch (hash) {
621      case 3059181:
622        /* code */ return new String[] { "CodeableConcept" };
623      case -1335224239:
624        /* detail */ return new String[] { "Reference" };
625      default:
626        return super.getTypesForProperty(hash, name);
627      }
628
629    }
630
631    @Override
632    public Base addChild(String name) throws FHIRException {
633      if (name.equals("code")) {
634        return addCode();
635      } else if (name.equals("detail")) {
636        return addDetail();
637      } else
638        return super.addChild(name);
639    }
640
641    public ConditionEvidenceComponent copy() {
642      ConditionEvidenceComponent dst = new ConditionEvidenceComponent();
643      copyValues(dst);
644      return dst;
645    }
646
647    public void copyValues(ConditionEvidenceComponent dst) {
648      super.copyValues(dst);
649      if (code != null) {
650        dst.code = new ArrayList<CodeableConcept>();
651        for (CodeableConcept i : code)
652          dst.code.add(i.copy());
653      }
654      ;
655      if (detail != null) {
656        dst.detail = new ArrayList<Reference>();
657        for (Reference i : detail)
658          dst.detail.add(i.copy());
659      }
660      ;
661    }
662
663    @Override
664    public boolean equalsDeep(Base other_) {
665      if (!super.equalsDeep(other_))
666        return false;
667      if (!(other_ instanceof ConditionEvidenceComponent))
668        return false;
669      ConditionEvidenceComponent o = (ConditionEvidenceComponent) other_;
670      return compareDeep(code, o.code, true) && compareDeep(detail, o.detail, true);
671    }
672
673    @Override
674    public boolean equalsShallow(Base other_) {
675      if (!super.equalsShallow(other_))
676        return false;
677      if (!(other_ instanceof ConditionEvidenceComponent))
678        return false;
679      ConditionEvidenceComponent o = (ConditionEvidenceComponent) other_;
680      return true;
681    }
682
683    public boolean isEmpty() {
684      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, detail);
685    }
686
687    public String fhirType() {
688      return "Condition.evidence";
689
690    }
691
692  }
693
694  /**
695   * Business identifiers assigned to this condition by the performer or other
696   * systems which remain constant as the resource is updated and propagates from
697   * server to server.
698   */
699  @Child(name = "identifier", type = {
700      Identifier.class }, order = 0, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
701  @Description(shortDefinition = "External Ids for this condition", formalDefinition = "Business identifiers assigned to this condition by the performer or other systems which remain constant as the resource is updated and propagates from server to server.")
702  protected List<Identifier> identifier;
703
704  /**
705   * The clinical status of the condition.
706   */
707  @Child(name = "clinicalStatus", type = {
708      CodeableConcept.class }, order = 1, min = 0, max = 1, modifier = true, summary = true)
709  @Description(shortDefinition = "active | recurrence | relapse | inactive | remission | resolved", formalDefinition = "The clinical status of the condition.")
710  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/condition-clinical")
711  protected CodeableConcept clinicalStatus;
712
713  /**
714   * The verification status to support the clinical status of the condition.
715   */
716  @Child(name = "verificationStatus", type = {
717      CodeableConcept.class }, order = 2, min = 0, max = 1, modifier = true, summary = true)
718  @Description(shortDefinition = "unconfirmed | provisional | differential | confirmed | refuted | entered-in-error", formalDefinition = "The verification status to support the clinical status of the condition.")
719  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/condition-ver-status")
720  protected CodeableConcept verificationStatus;
721
722  /**
723   * A category assigned to the condition.
724   */
725  @Child(name = "category", type = {
726      CodeableConcept.class }, order = 3, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
727  @Description(shortDefinition = "problem-list-item | encounter-diagnosis", formalDefinition = "A category assigned to the condition.")
728  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/condition-category")
729  protected List<CodeableConcept> category;
730
731  /**
732   * A subjective assessment of the severity of the condition as evaluated by the
733   * clinician.
734   */
735  @Child(name = "severity", type = {
736      CodeableConcept.class }, order = 4, min = 0, max = 1, modifier = false, summary = false)
737  @Description(shortDefinition = "Subjective severity of condition", formalDefinition = "A subjective assessment of the severity of the condition as evaluated by the clinician.")
738  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/condition-severity")
739  protected CodeableConcept severity;
740
741  /**
742   * Identification of the condition, problem or diagnosis.
743   */
744  @Child(name = "code", type = { CodeableConcept.class }, order = 5, min = 0, max = 1, modifier = false, summary = true)
745  @Description(shortDefinition = "Identification of the condition, problem or diagnosis", formalDefinition = "Identification of the condition, problem or diagnosis.")
746  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/condition-code")
747  protected CodeableConcept code;
748
749  /**
750   * The anatomical location where this condition manifests itself.
751   */
752  @Child(name = "bodySite", type = {
753      CodeableConcept.class }, order = 6, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
754  @Description(shortDefinition = "Anatomical location, if relevant", formalDefinition = "The anatomical location where this condition manifests itself.")
755  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/body-site")
756  protected List<CodeableConcept> bodySite;
757
758  /**
759   * Indicates the patient or group who the condition record is associated with.
760   */
761  @Child(name = "subject", type = { Patient.class,
762      Group.class }, order = 7, min = 1, max = 1, modifier = false, summary = true)
763  @Description(shortDefinition = "Who has the condition?", formalDefinition = "Indicates the patient or group who the condition record is associated with.")
764  protected Reference subject;
765
766  /**
767   * The actual object that is the target of the reference (Indicates the patient
768   * or group who the condition record is associated with.)
769   */
770  protected Resource subjectTarget;
771
772  /**
773   * The Encounter during which this Condition was created or to which the
774   * creation of this record is tightly associated.
775   */
776  @Child(name = "encounter", type = { Encounter.class }, order = 8, min = 0, max = 1, modifier = false, summary = true)
777  @Description(shortDefinition = "Encounter created as part of", formalDefinition = "The Encounter during which this Condition was created or to which the creation of this record is tightly associated.")
778  protected Reference encounter;
779
780  /**
781   * The actual object that is the target of the reference (The Encounter during
782   * which this Condition was created or to which the creation of this record is
783   * tightly associated.)
784   */
785  protected Encounter encounterTarget;
786
787  /**
788   * Estimated or actual date or date-time the condition began, in the opinion of
789   * the clinician.
790   */
791  @Child(name = "onset", type = { DateTimeType.class, Age.class, Period.class, Range.class,
792      StringType.class }, order = 9, min = 0, max = 1, modifier = false, summary = true)
793  @Description(shortDefinition = "Estimated or actual date,  date-time, or age", formalDefinition = "Estimated or actual date or date-time  the condition began, in the opinion of the clinician.")
794  protected Type onset;
795
796  /**
797   * The date or estimated date that the condition resolved or went into
798   * remission. This is called "abatement" because of the many overloaded
799   * connotations associated with "remission" or "resolution" - Conditions are
800   * never really resolved, but they can abate.
801   */
802  @Child(name = "abatement", type = { DateTimeType.class, Age.class, Period.class, Range.class,
803      StringType.class }, order = 10, min = 0, max = 1, modifier = false, summary = false)
804  @Description(shortDefinition = "When in resolution/remission", formalDefinition = "The date or estimated date that the condition resolved or went into remission. This is called \"abatement\" because of the many overloaded connotations associated with \"remission\" or \"resolution\" - Conditions are never really resolved, but they can abate.")
805  protected Type abatement;
806
807  /**
808   * The recordedDate represents when this particular Condition record was created
809   * in the system, which is often a system-generated date.
810   */
811  @Child(name = "recordedDate", type = {
812      DateTimeType.class }, order = 11, min = 0, max = 1, modifier = false, summary = true)
813  @Description(shortDefinition = "Date record was first recorded", formalDefinition = "The recordedDate represents when this particular Condition record was created in the system, which is often a system-generated date.")
814  protected DateTimeType recordedDate;
815
816  /**
817   * Individual who recorded the record and takes responsibility for its content.
818   */
819  @Child(name = "recorder", type = { Practitioner.class, PractitionerRole.class, Patient.class,
820      RelatedPerson.class }, order = 12, min = 0, max = 1, modifier = false, summary = true)
821  @Description(shortDefinition = "Who recorded the condition", formalDefinition = "Individual who recorded the record and takes responsibility for its content.")
822  protected Reference recorder;
823
824  /**
825   * The actual object that is the target of the reference (Individual who
826   * recorded the record and takes responsibility for its content.)
827   */
828  protected Resource recorderTarget;
829
830  /**
831   * Individual who is making the condition statement.
832   */
833  @Child(name = "asserter", type = { Practitioner.class, PractitionerRole.class, Patient.class,
834      RelatedPerson.class }, order = 13, min = 0, max = 1, modifier = false, summary = true)
835  @Description(shortDefinition = "Person who asserts this condition", formalDefinition = "Individual who is making the condition statement.")
836  protected Reference asserter;
837
838  /**
839   * The actual object that is the target of the reference (Individual who is
840   * making the condition statement.)
841   */
842  protected Resource asserterTarget;
843
844  /**
845   * Clinical stage or grade of a condition. May include formal severity
846   * assessments.
847   */
848  @Child(name = "stage", type = {}, order = 14, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
849  @Description(shortDefinition = "Stage/grade, usually assessed formally", formalDefinition = "Clinical stage or grade of a condition. May include formal severity assessments.")
850  protected List<ConditionStageComponent> stage;
851
852  /**
853   * Supporting evidence / manifestations that are the basis of the Condition's
854   * verification status, such as evidence that confirmed or refuted the
855   * condition.
856   */
857  @Child(name = "evidence", type = {}, order = 15, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
858  @Description(shortDefinition = "Supporting evidence", formalDefinition = "Supporting evidence / manifestations that are the basis of the Condition's verification status, such as evidence that confirmed or refuted the condition.")
859  protected List<ConditionEvidenceComponent> evidence;
860
861  /**
862   * Additional information about the Condition. This is a general notes/comments
863   * entry for description of the Condition, its diagnosis and prognosis.
864   */
865  @Child(name = "note", type = {
866      Annotation.class }, order = 16, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
867  @Description(shortDefinition = "Additional information about the Condition", formalDefinition = "Additional information about the Condition. This is a general notes/comments entry  for description of the Condition, its diagnosis and prognosis.")
868  protected List<Annotation> note;
869
870  private static final long serialVersionUID = 186776568L;
871
872  /**
873   * Constructor
874   */
875  public Condition() {
876    super();
877  }
878
879  /**
880   * Constructor
881   */
882  public Condition(Reference subject) {
883    super();
884    this.subject = subject;
885  }
886
887  /**
888   * @return {@link #identifier} (Business identifiers assigned to this condition
889   *         by the performer or other systems which remain constant as the
890   *         resource is updated and propagates from server to server.)
891   */
892  public List<Identifier> getIdentifier() {
893    if (this.identifier == null)
894      this.identifier = new ArrayList<Identifier>();
895    return this.identifier;
896  }
897
898  /**
899   * @return Returns a reference to <code>this</code> for easy method chaining
900   */
901  public Condition setIdentifier(List<Identifier> theIdentifier) {
902    this.identifier = theIdentifier;
903    return this;
904  }
905
906  public boolean hasIdentifier() {
907    if (this.identifier == null)
908      return false;
909    for (Identifier item : this.identifier)
910      if (!item.isEmpty())
911        return true;
912    return false;
913  }
914
915  public Identifier addIdentifier() { // 3
916    Identifier t = new Identifier();
917    if (this.identifier == null)
918      this.identifier = new ArrayList<Identifier>();
919    this.identifier.add(t);
920    return t;
921  }
922
923  public Condition addIdentifier(Identifier t) { // 3
924    if (t == null)
925      return this;
926    if (this.identifier == null)
927      this.identifier = new ArrayList<Identifier>();
928    this.identifier.add(t);
929    return this;
930  }
931
932  /**
933   * @return The first repetition of repeating field {@link #identifier}, creating
934   *         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 #clinicalStatus} (The clinical status of the condition.)
945   */
946  public CodeableConcept getClinicalStatus() {
947    if (this.clinicalStatus == null)
948      if (Configuration.errorOnAutoCreate())
949        throw new Error("Attempt to auto-create Condition.clinicalStatus");
950      else if (Configuration.doAutoCreate())
951        this.clinicalStatus = new CodeableConcept(); // cc
952    return this.clinicalStatus;
953  }
954
955  public boolean hasClinicalStatus() {
956    return this.clinicalStatus != null && !this.clinicalStatus.isEmpty();
957  }
958
959  /**
960   * @param value {@link #clinicalStatus} (The clinical status of the condition.)
961   */
962  public Condition setClinicalStatus(CodeableConcept value) {
963    this.clinicalStatus = value;
964    return this;
965  }
966
967  /**
968   * @return {@link #verificationStatus} (The verification status to support the
969   *         clinical status of the condition.)
970   */
971  public CodeableConcept getVerificationStatus() {
972    if (this.verificationStatus == null)
973      if (Configuration.errorOnAutoCreate())
974        throw new Error("Attempt to auto-create Condition.verificationStatus");
975      else if (Configuration.doAutoCreate())
976        this.verificationStatus = new CodeableConcept(); // cc
977    return this.verificationStatus;
978  }
979
980  public boolean hasVerificationStatus() {
981    return this.verificationStatus != null && !this.verificationStatus.isEmpty();
982  }
983
984  /**
985   * @param value {@link #verificationStatus} (The verification status to support
986   *              the clinical status of the condition.)
987   */
988  public Condition setVerificationStatus(CodeableConcept value) {
989    this.verificationStatus = value;
990    return this;
991  }
992
993  /**
994   * @return {@link #category} (A category assigned to the condition.)
995   */
996  public List<CodeableConcept> getCategory() {
997    if (this.category == null)
998      this.category = new ArrayList<CodeableConcept>();
999    return this.category;
1000  }
1001
1002  /**
1003   * @return Returns a reference to <code>this</code> for easy method chaining
1004   */
1005  public Condition setCategory(List<CodeableConcept> theCategory) {
1006    this.category = theCategory;
1007    return this;
1008  }
1009
1010  public boolean hasCategory() {
1011    if (this.category == null)
1012      return false;
1013    for (CodeableConcept item : this.category)
1014      if (!item.isEmpty())
1015        return true;
1016    return false;
1017  }
1018
1019  public CodeableConcept addCategory() { // 3
1020    CodeableConcept t = new CodeableConcept();
1021    if (this.category == null)
1022      this.category = new ArrayList<CodeableConcept>();
1023    this.category.add(t);
1024    return t;
1025  }
1026
1027  public Condition addCategory(CodeableConcept t) { // 3
1028    if (t == null)
1029      return this;
1030    if (this.category == null)
1031      this.category = new ArrayList<CodeableConcept>();
1032    this.category.add(t);
1033    return this;
1034  }
1035
1036  /**
1037   * @return The first repetition of repeating field {@link #category}, creating
1038   *         it if it does not already exist
1039   */
1040  public CodeableConcept getCategoryFirstRep() {
1041    if (getCategory().isEmpty()) {
1042      addCategory();
1043    }
1044    return getCategory().get(0);
1045  }
1046
1047  /**
1048   * @return {@link #severity} (A subjective assessment of the severity of the
1049   *         condition as evaluated by the clinician.)
1050   */
1051  public CodeableConcept getSeverity() {
1052    if (this.severity == null)
1053      if (Configuration.errorOnAutoCreate())
1054        throw new Error("Attempt to auto-create Condition.severity");
1055      else if (Configuration.doAutoCreate())
1056        this.severity = new CodeableConcept(); // cc
1057    return this.severity;
1058  }
1059
1060  public boolean hasSeverity() {
1061    return this.severity != null && !this.severity.isEmpty();
1062  }
1063
1064  /**
1065   * @param value {@link #severity} (A subjective assessment of the severity of
1066   *              the condition as evaluated by the clinician.)
1067   */
1068  public Condition setSeverity(CodeableConcept value) {
1069    this.severity = value;
1070    return this;
1071  }
1072
1073  /**
1074   * @return {@link #code} (Identification of the condition, problem or
1075   *         diagnosis.)
1076   */
1077  public CodeableConcept getCode() {
1078    if (this.code == null)
1079      if (Configuration.errorOnAutoCreate())
1080        throw new Error("Attempt to auto-create Condition.code");
1081      else if (Configuration.doAutoCreate())
1082        this.code = new CodeableConcept(); // cc
1083    return this.code;
1084  }
1085
1086  public boolean hasCode() {
1087    return this.code != null && !this.code.isEmpty();
1088  }
1089
1090  /**
1091   * @param value {@link #code} (Identification of the condition, problem or
1092   *              diagnosis.)
1093   */
1094  public Condition setCode(CodeableConcept value) {
1095    this.code = value;
1096    return this;
1097  }
1098
1099  /**
1100   * @return {@link #bodySite} (The anatomical location where this condition
1101   *         manifests itself.)
1102   */
1103  public List<CodeableConcept> getBodySite() {
1104    if (this.bodySite == null)
1105      this.bodySite = new ArrayList<CodeableConcept>();
1106    return this.bodySite;
1107  }
1108
1109  /**
1110   * @return Returns a reference to <code>this</code> for easy method chaining
1111   */
1112  public Condition setBodySite(List<CodeableConcept> theBodySite) {
1113    this.bodySite = theBodySite;
1114    return this;
1115  }
1116
1117  public boolean hasBodySite() {
1118    if (this.bodySite == null)
1119      return false;
1120    for (CodeableConcept item : this.bodySite)
1121      if (!item.isEmpty())
1122        return true;
1123    return false;
1124  }
1125
1126  public CodeableConcept addBodySite() { // 3
1127    CodeableConcept t = new CodeableConcept();
1128    if (this.bodySite == null)
1129      this.bodySite = new ArrayList<CodeableConcept>();
1130    this.bodySite.add(t);
1131    return t;
1132  }
1133
1134  public Condition addBodySite(CodeableConcept t) { // 3
1135    if (t == null)
1136      return this;
1137    if (this.bodySite == null)
1138      this.bodySite = new ArrayList<CodeableConcept>();
1139    this.bodySite.add(t);
1140    return this;
1141  }
1142
1143  /**
1144   * @return The first repetition of repeating field {@link #bodySite}, creating
1145   *         it if it does not already exist
1146   */
1147  public CodeableConcept getBodySiteFirstRep() {
1148    if (getBodySite().isEmpty()) {
1149      addBodySite();
1150    }
1151    return getBodySite().get(0);
1152  }
1153
1154  /**
1155   * @return {@link #subject} (Indicates the patient or group who the condition
1156   *         record is associated with.)
1157   */
1158  public Reference getSubject() {
1159    if (this.subject == null)
1160      if (Configuration.errorOnAutoCreate())
1161        throw new Error("Attempt to auto-create Condition.subject");
1162      else if (Configuration.doAutoCreate())
1163        this.subject = new Reference(); // cc
1164    return this.subject;
1165  }
1166
1167  public boolean hasSubject() {
1168    return this.subject != null && !this.subject.isEmpty();
1169  }
1170
1171  /**
1172   * @param value {@link #subject} (Indicates the patient or group who the
1173   *              condition record is associated with.)
1174   */
1175  public Condition setSubject(Reference value) {
1176    this.subject = value;
1177    return this;
1178  }
1179
1180  /**
1181   * @return {@link #subject} The actual object that is the target of the
1182   *         reference. The reference library doesn't populate this, but you can
1183   *         use it to hold the resource if you resolve it. (Indicates the patient
1184   *         or group who the condition record is associated with.)
1185   */
1186  public Resource getSubjectTarget() {
1187    return this.subjectTarget;
1188  }
1189
1190  /**
1191   * @param value {@link #subject} The actual object that is the target of the
1192   *              reference. The reference library doesn't use these, but you can
1193   *              use it to hold the resource if you resolve it. (Indicates the
1194   *              patient or group who the condition record is associated with.)
1195   */
1196  public Condition setSubjectTarget(Resource value) {
1197    this.subjectTarget = value;
1198    return this;
1199  }
1200
1201  /**
1202   * @return {@link #encounter} (The Encounter during which this Condition was
1203   *         created or to which the creation of this record is tightly
1204   *         associated.)
1205   */
1206  public Reference getEncounter() {
1207    if (this.encounter == null)
1208      if (Configuration.errorOnAutoCreate())
1209        throw new Error("Attempt to auto-create Condition.encounter");
1210      else if (Configuration.doAutoCreate())
1211        this.encounter = new Reference(); // cc
1212    return this.encounter;
1213  }
1214
1215  public boolean hasEncounter() {
1216    return this.encounter != null && !this.encounter.isEmpty();
1217  }
1218
1219  /**
1220   * @param value {@link #encounter} (The Encounter during which this Condition
1221   *              was created or to which the creation of this record is tightly
1222   *              associated.)
1223   */
1224  public Condition setEncounter(Reference value) {
1225    this.encounter = value;
1226    return this;
1227  }
1228
1229  /**
1230   * @return {@link #encounter} The actual object that is the target of the
1231   *         reference. The reference library doesn't populate this, but you can
1232   *         use it to hold the resource if you resolve it. (The Encounter during
1233   *         which this Condition was created or to which the creation of this
1234   *         record is tightly associated.)
1235   */
1236  public Encounter getEncounterTarget() {
1237    if (this.encounterTarget == null)
1238      if (Configuration.errorOnAutoCreate())
1239        throw new Error("Attempt to auto-create Condition.encounter");
1240      else if (Configuration.doAutoCreate())
1241        this.encounterTarget = new Encounter(); // aa
1242    return this.encounterTarget;
1243  }
1244
1245  /**
1246   * @param value {@link #encounter} The actual object that is the target of the
1247   *              reference. The reference library doesn't use these, but you can
1248   *              use it to hold the resource if you resolve it. (The Encounter
1249   *              during which this Condition was created or to which the creation
1250   *              of this record is tightly associated.)
1251   */
1252  public Condition setEncounterTarget(Encounter value) {
1253    this.encounterTarget = value;
1254    return this;
1255  }
1256
1257  /**
1258   * @return {@link #onset} (Estimated or actual date or date-time the condition
1259   *         began, in the opinion of the clinician.)
1260   */
1261  public Type getOnset() {
1262    return this.onset;
1263  }
1264
1265  /**
1266   * @return {@link #onset} (Estimated or actual date or date-time the condition
1267   *         began, in the opinion of the clinician.)
1268   */
1269  public DateTimeType getOnsetDateTimeType() throws FHIRException {
1270    if (this.onset == null)
1271      this.onset = new DateTimeType();
1272    if (!(this.onset instanceof DateTimeType))
1273      throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "
1274          + this.onset.getClass().getName() + " was encountered");
1275    return (DateTimeType) this.onset;
1276  }
1277
1278  public boolean hasOnsetDateTimeType() {
1279    return this != null && this.onset instanceof DateTimeType;
1280  }
1281
1282  /**
1283   * @return {@link #onset} (Estimated or actual date or date-time the condition
1284   *         began, in the opinion of the clinician.)
1285   */
1286  public Age getOnsetAge() throws FHIRException {
1287    if (this.onset == null)
1288      this.onset = new Age();
1289    if (!(this.onset instanceof Age))
1290      throw new FHIRException(
1291          "Type mismatch: the type Age was expected, but " + this.onset.getClass().getName() + " was encountered");
1292    return (Age) this.onset;
1293  }
1294
1295  public boolean hasOnsetAge() {
1296    return this != null && this.onset instanceof Age;
1297  }
1298
1299  /**
1300   * @return {@link #onset} (Estimated or actual date or date-time the condition
1301   *         began, in the opinion of the clinician.)
1302   */
1303  public Period getOnsetPeriod() throws FHIRException {
1304    if (this.onset == null)
1305      this.onset = new Period();
1306    if (!(this.onset instanceof Period))
1307      throw new FHIRException(
1308          "Type mismatch: the type Period was expected, but " + this.onset.getClass().getName() + " was encountered");
1309    return (Period) this.onset;
1310  }
1311
1312  public boolean hasOnsetPeriod() {
1313    return this != null && this.onset instanceof Period;
1314  }
1315
1316  /**
1317   * @return {@link #onset} (Estimated or actual date or date-time the condition
1318   *         began, in the opinion of the clinician.)
1319   */
1320  public Range getOnsetRange() throws FHIRException {
1321    if (this.onset == null)
1322      this.onset = new Range();
1323    if (!(this.onset instanceof Range))
1324      throw new FHIRException(
1325          "Type mismatch: the type Range was expected, but " + this.onset.getClass().getName() + " was encountered");
1326    return (Range) this.onset;
1327  }
1328
1329  public boolean hasOnsetRange() {
1330    return this != null && this.onset instanceof Range;
1331  }
1332
1333  /**
1334   * @return {@link #onset} (Estimated or actual date or date-time the condition
1335   *         began, in the opinion of the clinician.)
1336   */
1337  public StringType getOnsetStringType() throws FHIRException {
1338    if (this.onset == null)
1339      this.onset = new StringType();
1340    if (!(this.onset instanceof StringType))
1341      throw new FHIRException("Type mismatch: the type StringType was expected, but " + this.onset.getClass().getName()
1342          + " was encountered");
1343    return (StringType) this.onset;
1344  }
1345
1346  public boolean hasOnsetStringType() {
1347    return this != null && this.onset instanceof StringType;
1348  }
1349
1350  public boolean hasOnset() {
1351    return this.onset != null && !this.onset.isEmpty();
1352  }
1353
1354  /**
1355   * @param value {@link #onset} (Estimated or actual date or date-time the
1356   *              condition began, in the opinion of the clinician.)
1357   */
1358  public Condition setOnset(Type value) {
1359    if (value != null && !(value instanceof DateTimeType || value instanceof Age || value instanceof Period
1360        || value instanceof Range || value instanceof StringType))
1361      throw new Error("Not the right type for Condition.onset[x]: " + value.fhirType());
1362    this.onset = value;
1363    return this;
1364  }
1365
1366  /**
1367   * @return {@link #abatement} (The date or estimated date that the condition
1368   *         resolved or went into remission. This is called "abatement" because
1369   *         of the many overloaded connotations associated with "remission" or
1370   *         "resolution" - Conditions are never really resolved, but they can
1371   *         abate.)
1372   */
1373  public Type getAbatement() {
1374    return this.abatement;
1375  }
1376
1377  /**
1378   * @return {@link #abatement} (The date or estimated date that the condition
1379   *         resolved or went into remission. This is called "abatement" because
1380   *         of the many overloaded connotations associated with "remission" or
1381   *         "resolution" - Conditions are never really resolved, but they can
1382   *         abate.)
1383   */
1384  public DateTimeType getAbatementDateTimeType() throws FHIRException {
1385    if (this.abatement == null)
1386      this.abatement = new DateTimeType();
1387    if (!(this.abatement instanceof DateTimeType))
1388      throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "
1389          + this.abatement.getClass().getName() + " was encountered");
1390    return (DateTimeType) this.abatement;
1391  }
1392
1393  public boolean hasAbatementDateTimeType() {
1394    return this != null && this.abatement instanceof DateTimeType;
1395  }
1396
1397  /**
1398   * @return {@link #abatement} (The date or estimated date that the condition
1399   *         resolved or went into remission. This is called "abatement" because
1400   *         of the many overloaded connotations associated with "remission" or
1401   *         "resolution" - Conditions are never really resolved, but they can
1402   *         abate.)
1403   */
1404  public Age getAbatementAge() throws FHIRException {
1405    if (this.abatement == null)
1406      this.abatement = new Age();
1407    if (!(this.abatement instanceof Age))
1408      throw new FHIRException(
1409          "Type mismatch: the type Age was expected, but " + this.abatement.getClass().getName() + " was encountered");
1410    return (Age) this.abatement;
1411  }
1412
1413  public boolean hasAbatementAge() {
1414    return this != null && this.abatement instanceof Age;
1415  }
1416
1417  /**
1418   * @return {@link #abatement} (The date or estimated date that the condition
1419   *         resolved or went into remission. This is called "abatement" because
1420   *         of the many overloaded connotations associated with "remission" or
1421   *         "resolution" - Conditions are never really resolved, but they can
1422   *         abate.)
1423   */
1424  public Period getAbatementPeriod() throws FHIRException {
1425    if (this.abatement == null)
1426      this.abatement = new Period();
1427    if (!(this.abatement instanceof Period))
1428      throw new FHIRException("Type mismatch: the type Period was expected, but " + this.abatement.getClass().getName()
1429          + " was encountered");
1430    return (Period) this.abatement;
1431  }
1432
1433  public boolean hasAbatementPeriod() {
1434    return this != null && this.abatement instanceof Period;
1435  }
1436
1437  /**
1438   * @return {@link #abatement} (The date or estimated date that the condition
1439   *         resolved or went into remission. This is called "abatement" because
1440   *         of the many overloaded connotations associated with "remission" or
1441   *         "resolution" - Conditions are never really resolved, but they can
1442   *         abate.)
1443   */
1444  public Range getAbatementRange() throws FHIRException {
1445    if (this.abatement == null)
1446      this.abatement = new Range();
1447    if (!(this.abatement instanceof Range))
1448      throw new FHIRException("Type mismatch: the type Range was expected, but " + this.abatement.getClass().getName()
1449          + " was encountered");
1450    return (Range) this.abatement;
1451  }
1452
1453  public boolean hasAbatementRange() {
1454    return this != null && this.abatement instanceof Range;
1455  }
1456
1457  /**
1458   * @return {@link #abatement} (The date or estimated date that the condition
1459   *         resolved or went into remission. This is called "abatement" because
1460   *         of the many overloaded connotations associated with "remission" or
1461   *         "resolution" - Conditions are never really resolved, but they can
1462   *         abate.)
1463   */
1464  public StringType getAbatementStringType() throws FHIRException {
1465    if (this.abatement == null)
1466      this.abatement = new StringType();
1467    if (!(this.abatement instanceof StringType))
1468      throw new FHIRException("Type mismatch: the type StringType was expected, but "
1469          + this.abatement.getClass().getName() + " was encountered");
1470    return (StringType) this.abatement;
1471  }
1472
1473  public boolean hasAbatementStringType() {
1474    return this != null && this.abatement instanceof StringType;
1475  }
1476
1477  public boolean hasAbatement() {
1478    return this.abatement != null && !this.abatement.isEmpty();
1479  }
1480
1481  /**
1482   * @param value {@link #abatement} (The date or estimated date that the
1483   *              condition resolved or went into remission. This is called
1484   *              "abatement" because of the many overloaded connotations
1485   *              associated with "remission" or "resolution" - Conditions are
1486   *              never really resolved, but they can abate.)
1487   */
1488  public Condition setAbatement(Type value) {
1489    if (value != null && !(value instanceof DateTimeType || value instanceof Age || value instanceof Period
1490        || value instanceof Range || value instanceof StringType))
1491      throw new Error("Not the right type for Condition.abatement[x]: " + value.fhirType());
1492    this.abatement = value;
1493    return this;
1494  }
1495
1496  /**
1497   * @return {@link #recordedDate} (The recordedDate represents when this
1498   *         particular Condition record was created in the system, which is often
1499   *         a system-generated date.). This is the underlying object with id,
1500   *         value and extensions. The accessor "getRecordedDate" gives direct
1501   *         access to the value
1502   */
1503  public DateTimeType getRecordedDateElement() {
1504    if (this.recordedDate == null)
1505      if (Configuration.errorOnAutoCreate())
1506        throw new Error("Attempt to auto-create Condition.recordedDate");
1507      else if (Configuration.doAutoCreate())
1508        this.recordedDate = new DateTimeType(); // bb
1509    return this.recordedDate;
1510  }
1511
1512  public boolean hasRecordedDateElement() {
1513    return this.recordedDate != null && !this.recordedDate.isEmpty();
1514  }
1515
1516  public boolean hasRecordedDate() {
1517    return this.recordedDate != null && !this.recordedDate.isEmpty();
1518  }
1519
1520  /**
1521   * @param value {@link #recordedDate} (The recordedDate represents when this
1522   *              particular Condition record was created in the system, which is
1523   *              often a system-generated date.). This is the underlying object
1524   *              with id, value and extensions. The accessor "getRecordedDate"
1525   *              gives direct access to the value
1526   */
1527  public Condition setRecordedDateElement(DateTimeType value) {
1528    this.recordedDate = value;
1529    return this;
1530  }
1531
1532  /**
1533   * @return The recordedDate represents when this particular Condition record was
1534   *         created in the system, which is often a system-generated date.
1535   */
1536  public Date getRecordedDate() {
1537    return this.recordedDate == null ? null : this.recordedDate.getValue();
1538  }
1539
1540  /**
1541   * @param value The recordedDate represents when this particular Condition
1542   *              record was created in the system, which is often a
1543   *              system-generated date.
1544   */
1545  public Condition setRecordedDate(Date value) {
1546    if (value == null)
1547      this.recordedDate = null;
1548    else {
1549      if (this.recordedDate == null)
1550        this.recordedDate = new DateTimeType();
1551      this.recordedDate.setValue(value);
1552    }
1553    return this;
1554  }
1555
1556  /**
1557   * @return {@link #recorder} (Individual who recorded the record and takes
1558   *         responsibility for its content.)
1559   */
1560  public Reference getRecorder() {
1561    if (this.recorder == null)
1562      if (Configuration.errorOnAutoCreate())
1563        throw new Error("Attempt to auto-create Condition.recorder");
1564      else if (Configuration.doAutoCreate())
1565        this.recorder = new Reference(); // cc
1566    return this.recorder;
1567  }
1568
1569  public boolean hasRecorder() {
1570    return this.recorder != null && !this.recorder.isEmpty();
1571  }
1572
1573  /**
1574   * @param value {@link #recorder} (Individual who recorded the record and takes
1575   *              responsibility for its content.)
1576   */
1577  public Condition setRecorder(Reference value) {
1578    this.recorder = value;
1579    return this;
1580  }
1581
1582  /**
1583   * @return {@link #recorder} The actual object that is the target of the
1584   *         reference. The reference library doesn't populate this, but you can
1585   *         use it to hold the resource if you resolve it. (Individual who
1586   *         recorded the record and takes responsibility for its content.)
1587   */
1588  public Resource getRecorderTarget() {
1589    return this.recorderTarget;
1590  }
1591
1592  /**
1593   * @param value {@link #recorder} The actual object that is the target of the
1594   *              reference. The reference library doesn't use these, but you can
1595   *              use it to hold the resource if you resolve it. (Individual who
1596   *              recorded the record and takes responsibility for its content.)
1597   */
1598  public Condition setRecorderTarget(Resource value) {
1599    this.recorderTarget = value;
1600    return this;
1601  }
1602
1603  /**
1604   * @return {@link #asserter} (Individual who is making the condition statement.)
1605   */
1606  public Reference getAsserter() {
1607    if (this.asserter == null)
1608      if (Configuration.errorOnAutoCreate())
1609        throw new Error("Attempt to auto-create Condition.asserter");
1610      else if (Configuration.doAutoCreate())
1611        this.asserter = new Reference(); // cc
1612    return this.asserter;
1613  }
1614
1615  public boolean hasAsserter() {
1616    return this.asserter != null && !this.asserter.isEmpty();
1617  }
1618
1619  /**
1620   * @param value {@link #asserter} (Individual who is making the condition
1621   *              statement.)
1622   */
1623  public Condition setAsserter(Reference value) {
1624    this.asserter = value;
1625    return this;
1626  }
1627
1628  /**
1629   * @return {@link #asserter} The actual object that is the target of the
1630   *         reference. The reference library doesn't populate this, but you can
1631   *         use it to hold the resource if you resolve it. (Individual who is
1632   *         making the condition statement.)
1633   */
1634  public Resource getAsserterTarget() {
1635    return this.asserterTarget;
1636  }
1637
1638  /**
1639   * @param value {@link #asserter} The actual object that is the target of the
1640   *              reference. The reference library doesn't use these, but you can
1641   *              use it to hold the resource if you resolve it. (Individual who
1642   *              is making the condition statement.)
1643   */
1644  public Condition setAsserterTarget(Resource value) {
1645    this.asserterTarget = value;
1646    return this;
1647  }
1648
1649  /**
1650   * @return {@link #stage} (Clinical stage or grade of a condition. May include
1651   *         formal severity assessments.)
1652   */
1653  public List<ConditionStageComponent> getStage() {
1654    if (this.stage == null)
1655      this.stage = new ArrayList<ConditionStageComponent>();
1656    return this.stage;
1657  }
1658
1659  /**
1660   * @return Returns a reference to <code>this</code> for easy method chaining
1661   */
1662  public Condition setStage(List<ConditionStageComponent> theStage) {
1663    this.stage = theStage;
1664    return this;
1665  }
1666
1667  public boolean hasStage() {
1668    if (this.stage == null)
1669      return false;
1670    for (ConditionStageComponent item : this.stage)
1671      if (!item.isEmpty())
1672        return true;
1673    return false;
1674  }
1675
1676  public ConditionStageComponent addStage() { // 3
1677    ConditionStageComponent t = new ConditionStageComponent();
1678    if (this.stage == null)
1679      this.stage = new ArrayList<ConditionStageComponent>();
1680    this.stage.add(t);
1681    return t;
1682  }
1683
1684  public Condition addStage(ConditionStageComponent t) { // 3
1685    if (t == null)
1686      return this;
1687    if (this.stage == null)
1688      this.stage = new ArrayList<ConditionStageComponent>();
1689    this.stage.add(t);
1690    return this;
1691  }
1692
1693  /**
1694   * @return The first repetition of repeating field {@link #stage}, creating it
1695   *         if it does not already exist
1696   */
1697  public ConditionStageComponent getStageFirstRep() {
1698    if (getStage().isEmpty()) {
1699      addStage();
1700    }
1701    return getStage().get(0);
1702  }
1703
1704  /**
1705   * @return {@link #evidence} (Supporting evidence / manifestations that are the
1706   *         basis of the Condition's verification status, such as evidence that
1707   *         confirmed or refuted the condition.)
1708   */
1709  public List<ConditionEvidenceComponent> getEvidence() {
1710    if (this.evidence == null)
1711      this.evidence = new ArrayList<ConditionEvidenceComponent>();
1712    return this.evidence;
1713  }
1714
1715  /**
1716   * @return Returns a reference to <code>this</code> for easy method chaining
1717   */
1718  public Condition setEvidence(List<ConditionEvidenceComponent> theEvidence) {
1719    this.evidence = theEvidence;
1720    return this;
1721  }
1722
1723  public boolean hasEvidence() {
1724    if (this.evidence == null)
1725      return false;
1726    for (ConditionEvidenceComponent item : this.evidence)
1727      if (!item.isEmpty())
1728        return true;
1729    return false;
1730  }
1731
1732  public ConditionEvidenceComponent addEvidence() { // 3
1733    ConditionEvidenceComponent t = new ConditionEvidenceComponent();
1734    if (this.evidence == null)
1735      this.evidence = new ArrayList<ConditionEvidenceComponent>();
1736    this.evidence.add(t);
1737    return t;
1738  }
1739
1740  public Condition addEvidence(ConditionEvidenceComponent t) { // 3
1741    if (t == null)
1742      return this;
1743    if (this.evidence == null)
1744      this.evidence = new ArrayList<ConditionEvidenceComponent>();
1745    this.evidence.add(t);
1746    return this;
1747  }
1748
1749  /**
1750   * @return The first repetition of repeating field {@link #evidence}, creating
1751   *         it if it does not already exist
1752   */
1753  public ConditionEvidenceComponent getEvidenceFirstRep() {
1754    if (getEvidence().isEmpty()) {
1755      addEvidence();
1756    }
1757    return getEvidence().get(0);
1758  }
1759
1760  /**
1761   * @return {@link #note} (Additional information about the Condition. This is a
1762   *         general notes/comments entry for description of the Condition, its
1763   *         diagnosis and prognosis.)
1764   */
1765  public List<Annotation> getNote() {
1766    if (this.note == null)
1767      this.note = new ArrayList<Annotation>();
1768    return this.note;
1769  }
1770
1771  /**
1772   * @return Returns a reference to <code>this</code> for easy method chaining
1773   */
1774  public Condition setNote(List<Annotation> theNote) {
1775    this.note = theNote;
1776    return this;
1777  }
1778
1779  public boolean hasNote() {
1780    if (this.note == null)
1781      return false;
1782    for (Annotation item : this.note)
1783      if (!item.isEmpty())
1784        return true;
1785    return false;
1786  }
1787
1788  public Annotation addNote() { // 3
1789    Annotation t = new Annotation();
1790    if (this.note == null)
1791      this.note = new ArrayList<Annotation>();
1792    this.note.add(t);
1793    return t;
1794  }
1795
1796  public Condition addNote(Annotation t) { // 3
1797    if (t == null)
1798      return this;
1799    if (this.note == null)
1800      this.note = new ArrayList<Annotation>();
1801    this.note.add(t);
1802    return this;
1803  }
1804
1805  /**
1806   * @return The first repetition of repeating field {@link #note}, creating it if
1807   *         it does not already exist
1808   */
1809  public Annotation getNoteFirstRep() {
1810    if (getNote().isEmpty()) {
1811      addNote();
1812    }
1813    return getNote().get(0);
1814  }
1815
1816  protected void listChildren(List<Property> children) {
1817    super.listChildren(children);
1818    children.add(new Property("identifier", "Identifier",
1819        "Business identifiers assigned to this condition by the performer or other systems which remain constant as the resource is updated and propagates from server to server.",
1820        0, java.lang.Integer.MAX_VALUE, identifier));
1821    children.add(new Property("clinicalStatus", "CodeableConcept", "The clinical status of the condition.", 0, 1,
1822        clinicalStatus));
1823    children.add(new Property("verificationStatus", "CodeableConcept",
1824        "The verification status to support the clinical status of the condition.", 0, 1, verificationStatus));
1825    children.add(new Property("category", "CodeableConcept", "A category assigned to the condition.", 0,
1826        java.lang.Integer.MAX_VALUE, category));
1827    children.add(new Property("severity", "CodeableConcept",
1828        "A subjective assessment of the severity of the condition as evaluated by the clinician.", 0, 1, severity));
1829    children.add(
1830        new Property("code", "CodeableConcept", "Identification of the condition, problem or diagnosis.", 0, 1, code));
1831    children.add(new Property("bodySite", "CodeableConcept",
1832        "The anatomical location where this condition manifests itself.", 0, java.lang.Integer.MAX_VALUE, bodySite));
1833    children.add(new Property("subject", "Reference(Patient|Group)",
1834        "Indicates the patient or group who the condition record is associated with.", 0, 1, subject));
1835    children.add(new Property("encounter", "Reference(Encounter)",
1836        "The Encounter during which this Condition was created or to which the creation of this record is tightly associated.",
1837        0, 1, encounter));
1838    children.add(new Property("onset[x]", "dateTime|Age|Period|Range|string",
1839        "Estimated or actual date or date-time  the condition began, in the opinion of the clinician.", 0, 1, onset));
1840    children.add(new Property("abatement[x]", "dateTime|Age|Period|Range|string",
1841        "The date or estimated date that the condition resolved or went into remission. This is called \"abatement\" because of the many overloaded connotations associated with \"remission\" or \"resolution\" - Conditions are never really resolved, but they can abate.",
1842        0, 1, abatement));
1843    children.add(new Property("recordedDate", "dateTime",
1844        "The recordedDate represents when this particular Condition record was created in the system, which is often a system-generated date.",
1845        0, 1, recordedDate));
1846    children.add(new Property("recorder", "Reference(Practitioner|PractitionerRole|Patient|RelatedPerson)",
1847        "Individual who recorded the record and takes responsibility for its content.", 0, 1, recorder));
1848    children.add(new Property("asserter", "Reference(Practitioner|PractitionerRole|Patient|RelatedPerson)",
1849        "Individual who is making the condition statement.", 0, 1, asserter));
1850    children.add(
1851        new Property("stage", "", "Clinical stage or grade of a condition. May include formal severity assessments.", 0,
1852            java.lang.Integer.MAX_VALUE, stage));
1853    children.add(new Property("evidence", "",
1854        "Supporting evidence / manifestations that are the basis of the Condition's verification status, such as evidence that confirmed or refuted the condition.",
1855        0, java.lang.Integer.MAX_VALUE, evidence));
1856    children.add(new Property("note", "Annotation",
1857        "Additional information about the Condition. This is a general notes/comments entry  for description of the Condition, its diagnosis and prognosis.",
1858        0, java.lang.Integer.MAX_VALUE, note));
1859  }
1860
1861  @Override
1862  public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1863    switch (_hash) {
1864    case -1618432855:
1865      /* identifier */ return new Property("identifier", "Identifier",
1866          "Business identifiers assigned to this condition by the performer or other systems which remain constant as the resource is updated and propagates from server to server.",
1867          0, java.lang.Integer.MAX_VALUE, identifier);
1868    case -462853915:
1869      /* clinicalStatus */ return new Property("clinicalStatus", "CodeableConcept",
1870          "The clinical status of the condition.", 0, 1, clinicalStatus);
1871    case -842509843:
1872      /* verificationStatus */ return new Property("verificationStatus", "CodeableConcept",
1873          "The verification status to support the clinical status of the condition.", 0, 1, verificationStatus);
1874    case 50511102:
1875      /* category */ return new Property("category", "CodeableConcept", "A category assigned to the condition.", 0,
1876          java.lang.Integer.MAX_VALUE, category);
1877    case 1478300413:
1878      /* severity */ return new Property("severity", "CodeableConcept",
1879          "A subjective assessment of the severity of the condition as evaluated by the clinician.", 0, 1, severity);
1880    case 3059181:
1881      /* code */ return new Property("code", "CodeableConcept",
1882          "Identification of the condition, problem or diagnosis.", 0, 1, code);
1883    case 1702620169:
1884      /* bodySite */ return new Property("bodySite", "CodeableConcept",
1885          "The anatomical location where this condition manifests itself.", 0, java.lang.Integer.MAX_VALUE, bodySite);
1886    case -1867885268:
1887      /* subject */ return new Property("subject", "Reference(Patient|Group)",
1888          "Indicates the patient or group who the condition record is associated with.", 0, 1, subject);
1889    case 1524132147:
1890      /* encounter */ return new Property("encounter", "Reference(Encounter)",
1891          "The Encounter during which this Condition was created or to which the creation of this record is tightly associated.",
1892          0, 1, encounter);
1893    case -1886216323:
1894      /* onset[x] */ return new Property("onset[x]", "dateTime|Age|Period|Range|string",
1895          "Estimated or actual date or date-time  the condition began, in the opinion of the clinician.", 0, 1, onset);
1896    case 105901603:
1897      /* onset */ return new Property("onset[x]", "dateTime|Age|Period|Range|string",
1898          "Estimated or actual date or date-time  the condition began, in the opinion of the clinician.", 0, 1, onset);
1899    case -1701663010:
1900      /* onsetDateTime */ return new Property("onset[x]", "dateTime|Age|Period|Range|string",
1901          "Estimated or actual date or date-time  the condition began, in the opinion of the clinician.", 0, 1, onset);
1902    case -1886241828:
1903      /* onsetAge */ return new Property("onset[x]", "dateTime|Age|Period|Range|string",
1904          "Estimated or actual date or date-time  the condition began, in the opinion of the clinician.", 0, 1, onset);
1905    case -1545082428:
1906      /* onsetPeriod */ return new Property("onset[x]", "dateTime|Age|Period|Range|string",
1907          "Estimated or actual date or date-time  the condition began, in the opinion of the clinician.", 0, 1, onset);
1908    case -186664742:
1909      /* onsetRange */ return new Property("onset[x]", "dateTime|Age|Period|Range|string",
1910          "Estimated or actual date or date-time  the condition began, in the opinion of the clinician.", 0, 1, onset);
1911    case -1445342188:
1912      /* onsetString */ return new Property("onset[x]", "dateTime|Age|Period|Range|string",
1913          "Estimated or actual date or date-time  the condition began, in the opinion of the clinician.", 0, 1, onset);
1914    case -584196495:
1915      /* abatement[x] */ return new Property("abatement[x]", "dateTime|Age|Period|Range|string",
1916          "The date or estimated date that the condition resolved or went into remission. This is called \"abatement\" because of the many overloaded connotations associated with \"remission\" or \"resolution\" - Conditions are never really resolved, but they can abate.",
1917          0, 1, abatement);
1918    case -921554001:
1919      /* abatement */ return new Property("abatement[x]", "dateTime|Age|Period|Range|string",
1920          "The date or estimated date that the condition resolved or went into remission. This is called \"abatement\" because of the many overloaded connotations associated with \"remission\" or \"resolution\" - Conditions are never really resolved, but they can abate.",
1921          0, 1, abatement);
1922    case 44869738:
1923      /* abatementDateTime */ return new Property("abatement[x]", "dateTime|Age|Period|Range|string",
1924          "The date or estimated date that the condition resolved or went into remission. This is called \"abatement\" because of the many overloaded connotations associated with \"remission\" or \"resolution\" - Conditions are never really resolved, but they can abate.",
1925          0, 1, abatement);
1926    case -584222000:
1927      /* abatementAge */ return new Property("abatement[x]", "dateTime|Age|Period|Range|string",
1928          "The date or estimated date that the condition resolved or went into remission. This is called \"abatement\" because of the many overloaded connotations associated with \"remission\" or \"resolution\" - Conditions are never really resolved, but they can abate.",
1929          0, 1, abatement);
1930    case -922036656:
1931      /* abatementPeriod */ return new Property("abatement[x]", "dateTime|Age|Period|Range|string",
1932          "The date or estimated date that the condition resolved or went into remission. This is called \"abatement\" because of the many overloaded connotations associated with \"remission\" or \"resolution\" - Conditions are never really resolved, but they can abate.",
1933          0, 1, abatement);
1934    case 1218906830:
1935      /* abatementRange */ return new Property("abatement[x]", "dateTime|Age|Period|Range|string",
1936          "The date or estimated date that the condition resolved or went into remission. This is called \"abatement\" because of the many overloaded connotations associated with \"remission\" or \"resolution\" - Conditions are never really resolved, but they can abate.",
1937          0, 1, abatement);
1938    case -822296416:
1939      /* abatementString */ return new Property("abatement[x]", "dateTime|Age|Period|Range|string",
1940          "The date or estimated date that the condition resolved or went into remission. This is called \"abatement\" because of the many overloaded connotations associated with \"remission\" or \"resolution\" - Conditions are never really resolved, but they can abate.",
1941          0, 1, abatement);
1942    case -1952893826:
1943      /* recordedDate */ return new Property("recordedDate", "dateTime",
1944          "The recordedDate represents when this particular Condition record was created in the system, which is often a system-generated date.",
1945          0, 1, recordedDate);
1946    case -799233858:
1947      /* recorder */ return new Property("recorder", "Reference(Practitioner|PractitionerRole|Patient|RelatedPerson)",
1948          "Individual who recorded the record and takes responsibility for its content.", 0, 1, recorder);
1949    case -373242253:
1950      /* asserter */ return new Property("asserter", "Reference(Practitioner|PractitionerRole|Patient|RelatedPerson)",
1951          "Individual who is making the condition statement.", 0, 1, asserter);
1952    case 109757182:
1953      /* stage */ return new Property("stage", "",
1954          "Clinical stage or grade of a condition. May include formal severity assessments.", 0,
1955          java.lang.Integer.MAX_VALUE, stage);
1956    case 382967383:
1957      /* evidence */ return new Property("evidence", "",
1958          "Supporting evidence / manifestations that are the basis of the Condition's verification status, such as evidence that confirmed or refuted the condition.",
1959          0, java.lang.Integer.MAX_VALUE, evidence);
1960    case 3387378:
1961      /* note */ return new Property("note", "Annotation",
1962          "Additional information about the Condition. This is a general notes/comments entry  for description of the Condition, its diagnosis and prognosis.",
1963          0, java.lang.Integer.MAX_VALUE, note);
1964    default:
1965      return super.getNamedProperty(_hash, _name, _checkValid);
1966    }
1967
1968  }
1969
1970  @Override
1971  public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1972    switch (hash) {
1973    case -1618432855:
1974      /* identifier */ return this.identifier == null ? new Base[0]
1975          : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1976    case -462853915:
1977      /* clinicalStatus */ return this.clinicalStatus == null ? new Base[0] : new Base[] { this.clinicalStatus }; // CodeableConcept
1978    case -842509843:
1979      /* verificationStatus */ return this.verificationStatus == null ? new Base[0]
1980          : new Base[] { this.verificationStatus }; // CodeableConcept
1981    case 50511102:
1982      /* category */ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
1983    case 1478300413:
1984      /* severity */ return this.severity == null ? new Base[0] : new Base[] { this.severity }; // CodeableConcept
1985    case 3059181:
1986      /* code */ return this.code == null ? new Base[0] : new Base[] { this.code }; // CodeableConcept
1987    case 1702620169:
1988      /* bodySite */ return this.bodySite == null ? new Base[0] : this.bodySite.toArray(new Base[this.bodySite.size()]); // CodeableConcept
1989    case -1867885268:
1990      /* subject */ return this.subject == null ? new Base[0] : new Base[] { this.subject }; // Reference
1991    case 1524132147:
1992      /* encounter */ return this.encounter == null ? new Base[0] : new Base[] { this.encounter }; // Reference
1993    case 105901603:
1994      /* onset */ return this.onset == null ? new Base[0] : new Base[] { this.onset }; // Type
1995    case -921554001:
1996      /* abatement */ return this.abatement == null ? new Base[0] : new Base[] { this.abatement }; // Type
1997    case -1952893826:
1998      /* recordedDate */ return this.recordedDate == null ? new Base[0] : new Base[] { this.recordedDate }; // DateTimeType
1999    case -799233858:
2000      /* recorder */ return this.recorder == null ? new Base[0] : new Base[] { this.recorder }; // Reference
2001    case -373242253:
2002      /* asserter */ return this.asserter == null ? new Base[0] : new Base[] { this.asserter }; // Reference
2003    case 109757182:
2004      /* stage */ return this.stage == null ? new Base[0] : this.stage.toArray(new Base[this.stage.size()]); // ConditionStageComponent
2005    case 382967383:
2006      /* evidence */ return this.evidence == null ? new Base[0] : this.evidence.toArray(new Base[this.evidence.size()]); // ConditionEvidenceComponent
2007    case 3387378:
2008      /* note */ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
2009    default:
2010      return super.getProperty(hash, name, checkValid);
2011    }
2012
2013  }
2014
2015  @Override
2016  public Base setProperty(int hash, String name, Base value) throws FHIRException {
2017    switch (hash) {
2018    case -1618432855: // identifier
2019      this.getIdentifier().add(castToIdentifier(value)); // Identifier
2020      return value;
2021    case -462853915: // clinicalStatus
2022      this.clinicalStatus = castToCodeableConcept(value); // CodeableConcept
2023      return value;
2024    case -842509843: // verificationStatus
2025      this.verificationStatus = castToCodeableConcept(value); // CodeableConcept
2026      return value;
2027    case 50511102: // category
2028      this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept
2029      return value;
2030    case 1478300413: // severity
2031      this.severity = castToCodeableConcept(value); // CodeableConcept
2032      return value;
2033    case 3059181: // code
2034      this.code = castToCodeableConcept(value); // CodeableConcept
2035      return value;
2036    case 1702620169: // bodySite
2037      this.getBodySite().add(castToCodeableConcept(value)); // CodeableConcept
2038      return value;
2039    case -1867885268: // subject
2040      this.subject = castToReference(value); // Reference
2041      return value;
2042    case 1524132147: // encounter
2043      this.encounter = castToReference(value); // Reference
2044      return value;
2045    case 105901603: // onset
2046      this.onset = castToType(value); // Type
2047      return value;
2048    case -921554001: // abatement
2049      this.abatement = castToType(value); // Type
2050      return value;
2051    case -1952893826: // recordedDate
2052      this.recordedDate = castToDateTime(value); // DateTimeType
2053      return value;
2054    case -799233858: // recorder
2055      this.recorder = castToReference(value); // Reference
2056      return value;
2057    case -373242253: // asserter
2058      this.asserter = castToReference(value); // Reference
2059      return value;
2060    case 109757182: // stage
2061      this.getStage().add((ConditionStageComponent) value); // ConditionStageComponent
2062      return value;
2063    case 382967383: // evidence
2064      this.getEvidence().add((ConditionEvidenceComponent) value); // ConditionEvidenceComponent
2065      return value;
2066    case 3387378: // note
2067      this.getNote().add(castToAnnotation(value)); // Annotation
2068      return value;
2069    default:
2070      return super.setProperty(hash, name, value);
2071    }
2072
2073  }
2074
2075  @Override
2076  public Base setProperty(String name, Base value) throws FHIRException {
2077    if (name.equals("identifier")) {
2078      this.getIdentifier().add(castToIdentifier(value));
2079    } else if (name.equals("clinicalStatus")) {
2080      this.clinicalStatus = castToCodeableConcept(value); // CodeableConcept
2081    } else if (name.equals("verificationStatus")) {
2082      this.verificationStatus = castToCodeableConcept(value); // CodeableConcept
2083    } else if (name.equals("category")) {
2084      this.getCategory().add(castToCodeableConcept(value));
2085    } else if (name.equals("severity")) {
2086      this.severity = castToCodeableConcept(value); // CodeableConcept
2087    } else if (name.equals("code")) {
2088      this.code = castToCodeableConcept(value); // CodeableConcept
2089    } else if (name.equals("bodySite")) {
2090      this.getBodySite().add(castToCodeableConcept(value));
2091    } else if (name.equals("subject")) {
2092      this.subject = castToReference(value); // Reference
2093    } else if (name.equals("encounter")) {
2094      this.encounter = castToReference(value); // Reference
2095    } else if (name.equals("onset[x]")) {
2096      this.onset = castToType(value); // Type
2097    } else if (name.equals("abatement[x]")) {
2098      this.abatement = castToType(value); // Type
2099    } else if (name.equals("recordedDate")) {
2100      this.recordedDate = castToDateTime(value); // DateTimeType
2101    } else if (name.equals("recorder")) {
2102      this.recorder = castToReference(value); // Reference
2103    } else if (name.equals("asserter")) {
2104      this.asserter = castToReference(value); // Reference
2105    } else if (name.equals("stage")) {
2106      this.getStage().add((ConditionStageComponent) value);
2107    } else if (name.equals("evidence")) {
2108      this.getEvidence().add((ConditionEvidenceComponent) value);
2109    } else if (name.equals("note")) {
2110      this.getNote().add(castToAnnotation(value));
2111    } else
2112      return super.setProperty(name, value);
2113    return value;
2114  }
2115
2116  @Override
2117  public Base makeProperty(int hash, String name) throws FHIRException {
2118    switch (hash) {
2119    case -1618432855:
2120      return addIdentifier();
2121    case -462853915:
2122      return getClinicalStatus();
2123    case -842509843:
2124      return getVerificationStatus();
2125    case 50511102:
2126      return addCategory();
2127    case 1478300413:
2128      return getSeverity();
2129    case 3059181:
2130      return getCode();
2131    case 1702620169:
2132      return addBodySite();
2133    case -1867885268:
2134      return getSubject();
2135    case 1524132147:
2136      return getEncounter();
2137    case -1886216323:
2138      return getOnset();
2139    case 105901603:
2140      return getOnset();
2141    case -584196495:
2142      return getAbatement();
2143    case -921554001:
2144      return getAbatement();
2145    case -1952893826:
2146      return getRecordedDateElement();
2147    case -799233858:
2148      return getRecorder();
2149    case -373242253:
2150      return getAsserter();
2151    case 109757182:
2152      return addStage();
2153    case 382967383:
2154      return addEvidence();
2155    case 3387378:
2156      return addNote();
2157    default:
2158      return super.makeProperty(hash, name);
2159    }
2160
2161  }
2162
2163  @Override
2164  public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2165    switch (hash) {
2166    case -1618432855:
2167      /* identifier */ return new String[] { "Identifier" };
2168    case -462853915:
2169      /* clinicalStatus */ return new String[] { "CodeableConcept" };
2170    case -842509843:
2171      /* verificationStatus */ return new String[] { "CodeableConcept" };
2172    case 50511102:
2173      /* category */ return new String[] { "CodeableConcept" };
2174    case 1478300413:
2175      /* severity */ return new String[] { "CodeableConcept" };
2176    case 3059181:
2177      /* code */ return new String[] { "CodeableConcept" };
2178    case 1702620169:
2179      /* bodySite */ return new String[] { "CodeableConcept" };
2180    case -1867885268:
2181      /* subject */ return new String[] { "Reference" };
2182    case 1524132147:
2183      /* encounter */ return new String[] { "Reference" };
2184    case 105901603:
2185      /* onset */ return new String[] { "dateTime", "Age", "Period", "Range", "string" };
2186    case -921554001:
2187      /* abatement */ return new String[] { "dateTime", "Age", "Period", "Range", "string" };
2188    case -1952893826:
2189      /* recordedDate */ return new String[] { "dateTime" };
2190    case -799233858:
2191      /* recorder */ return new String[] { "Reference" };
2192    case -373242253:
2193      /* asserter */ return new String[] { "Reference" };
2194    case 109757182:
2195      /* stage */ return new String[] {};
2196    case 382967383:
2197      /* evidence */ return new String[] {};
2198    case 3387378:
2199      /* note */ return new String[] { "Annotation" };
2200    default:
2201      return super.getTypesForProperty(hash, name);
2202    }
2203
2204  }
2205
2206  @Override
2207  public Base addChild(String name) throws FHIRException {
2208    if (name.equals("identifier")) {
2209      return addIdentifier();
2210    } else if (name.equals("clinicalStatus")) {
2211      this.clinicalStatus = new CodeableConcept();
2212      return this.clinicalStatus;
2213    } else if (name.equals("verificationStatus")) {
2214      this.verificationStatus = new CodeableConcept();
2215      return this.verificationStatus;
2216    } else if (name.equals("category")) {
2217      return addCategory();
2218    } else if (name.equals("severity")) {
2219      this.severity = new CodeableConcept();
2220      return this.severity;
2221    } else if (name.equals("code")) {
2222      this.code = new CodeableConcept();
2223      return this.code;
2224    } else if (name.equals("bodySite")) {
2225      return addBodySite();
2226    } else if (name.equals("subject")) {
2227      this.subject = new Reference();
2228      return this.subject;
2229    } else if (name.equals("encounter")) {
2230      this.encounter = new Reference();
2231      return this.encounter;
2232    } else if (name.equals("onsetDateTime")) {
2233      this.onset = new DateTimeType();
2234      return this.onset;
2235    } else if (name.equals("onsetAge")) {
2236      this.onset = new Age();
2237      return this.onset;
2238    } else if (name.equals("onsetPeriod")) {
2239      this.onset = new Period();
2240      return this.onset;
2241    } else if (name.equals("onsetRange")) {
2242      this.onset = new Range();
2243      return this.onset;
2244    } else if (name.equals("onsetString")) {
2245      this.onset = new StringType();
2246      return this.onset;
2247    } else if (name.equals("abatementDateTime")) {
2248      this.abatement = new DateTimeType();
2249      return this.abatement;
2250    } else if (name.equals("abatementAge")) {
2251      this.abatement = new Age();
2252      return this.abatement;
2253    } else if (name.equals("abatementPeriod")) {
2254      this.abatement = new Period();
2255      return this.abatement;
2256    } else if (name.equals("abatementRange")) {
2257      this.abatement = new Range();
2258      return this.abatement;
2259    } else if (name.equals("abatementString")) {
2260      this.abatement = new StringType();
2261      return this.abatement;
2262    } else if (name.equals("recordedDate")) {
2263      throw new FHIRException("Cannot call addChild on a singleton property Condition.recordedDate");
2264    } else if (name.equals("recorder")) {
2265      this.recorder = new Reference();
2266      return this.recorder;
2267    } else if (name.equals("asserter")) {
2268      this.asserter = new Reference();
2269      return this.asserter;
2270    } else if (name.equals("stage")) {
2271      return addStage();
2272    } else if (name.equals("evidence")) {
2273      return addEvidence();
2274    } else if (name.equals("note")) {
2275      return addNote();
2276    } else
2277      return super.addChild(name);
2278  }
2279
2280  public String fhirType() {
2281    return "Condition";
2282
2283  }
2284
2285  public Condition copy() {
2286    Condition dst = new Condition();
2287    copyValues(dst);
2288    return dst;
2289  }
2290
2291  public void copyValues(Condition dst) {
2292    super.copyValues(dst);
2293    if (identifier != null) {
2294      dst.identifier = new ArrayList<Identifier>();
2295      for (Identifier i : identifier)
2296        dst.identifier.add(i.copy());
2297    }
2298    ;
2299    dst.clinicalStatus = clinicalStatus == null ? null : clinicalStatus.copy();
2300    dst.verificationStatus = verificationStatus == null ? null : verificationStatus.copy();
2301    if (category != null) {
2302      dst.category = new ArrayList<CodeableConcept>();
2303      for (CodeableConcept i : category)
2304        dst.category.add(i.copy());
2305    }
2306    ;
2307    dst.severity = severity == null ? null : severity.copy();
2308    dst.code = code == null ? null : code.copy();
2309    if (bodySite != null) {
2310      dst.bodySite = new ArrayList<CodeableConcept>();
2311      for (CodeableConcept i : bodySite)
2312        dst.bodySite.add(i.copy());
2313    }
2314    ;
2315    dst.subject = subject == null ? null : subject.copy();
2316    dst.encounter = encounter == null ? null : encounter.copy();
2317    dst.onset = onset == null ? null : onset.copy();
2318    dst.abatement = abatement == null ? null : abatement.copy();
2319    dst.recordedDate = recordedDate == null ? null : recordedDate.copy();
2320    dst.recorder = recorder == null ? null : recorder.copy();
2321    dst.asserter = asserter == null ? null : asserter.copy();
2322    if (stage != null) {
2323      dst.stage = new ArrayList<ConditionStageComponent>();
2324      for (ConditionStageComponent i : stage)
2325        dst.stage.add(i.copy());
2326    }
2327    ;
2328    if (evidence != null) {
2329      dst.evidence = new ArrayList<ConditionEvidenceComponent>();
2330      for (ConditionEvidenceComponent i : evidence)
2331        dst.evidence.add(i.copy());
2332    }
2333    ;
2334    if (note != null) {
2335      dst.note = new ArrayList<Annotation>();
2336      for (Annotation i : note)
2337        dst.note.add(i.copy());
2338    }
2339    ;
2340  }
2341
2342  protected Condition typedCopy() {
2343    return copy();
2344  }
2345
2346  @Override
2347  public boolean equalsDeep(Base other_) {
2348    if (!super.equalsDeep(other_))
2349      return false;
2350    if (!(other_ instanceof Condition))
2351      return false;
2352    Condition o = (Condition) other_;
2353    return compareDeep(identifier, o.identifier, true) && compareDeep(clinicalStatus, o.clinicalStatus, true)
2354        && compareDeep(verificationStatus, o.verificationStatus, true) && compareDeep(category, o.category, true)
2355        && compareDeep(severity, o.severity, true) && compareDeep(code, o.code, true)
2356        && compareDeep(bodySite, o.bodySite, true) && compareDeep(subject, o.subject, true)
2357        && compareDeep(encounter, o.encounter, true) && compareDeep(onset, o.onset, true)
2358        && compareDeep(abatement, o.abatement, true) && compareDeep(recordedDate, o.recordedDate, true)
2359        && compareDeep(recorder, o.recorder, true) && compareDeep(asserter, o.asserter, true)
2360        && compareDeep(stage, o.stage, true) && compareDeep(evidence, o.evidence, true)
2361        && compareDeep(note, o.note, true);
2362  }
2363
2364  @Override
2365  public boolean equalsShallow(Base other_) {
2366    if (!super.equalsShallow(other_))
2367      return false;
2368    if (!(other_ instanceof Condition))
2369      return false;
2370    Condition o = (Condition) other_;
2371    return compareValues(recordedDate, o.recordedDate, true);
2372  }
2373
2374  public boolean isEmpty() {
2375    return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, clinicalStatus, verificationStatus,
2376        category, severity, code, bodySite, subject, encounter, onset, abatement, recordedDate, recorder, asserter,
2377        stage, evidence, note);
2378  }
2379
2380  @Override
2381  public ResourceType getResourceType() {
2382    return ResourceType.Condition;
2383  }
2384
2385  /**
2386   * Search parameter: <b>severity</b>
2387   * <p>
2388   * Description: <b>The severity of the condition</b><br>
2389   * Type: <b>token</b><br>
2390   * Path: <b>Condition.severity</b><br>
2391   * </p>
2392   */
2393  @SearchParamDefinition(name = "severity", path = "Condition.severity", description = "The severity of the condition", type = "token")
2394  public static final String SP_SEVERITY = "severity";
2395  /**
2396   * <b>Fluent Client</b> search parameter constant for <b>severity</b>
2397   * <p>
2398   * Description: <b>The severity of the condition</b><br>
2399   * Type: <b>token</b><br>
2400   * Path: <b>Condition.severity</b><br>
2401   * </p>
2402   */
2403  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SEVERITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2404      SP_SEVERITY);
2405
2406  /**
2407   * Search parameter: <b>evidence-detail</b>
2408   * <p>
2409   * Description: <b>Supporting information found elsewhere</b><br>
2410   * Type: <b>reference</b><br>
2411   * Path: <b>Condition.evidence.detail</b><br>
2412   * </p>
2413   */
2414  @SearchParamDefinition(name = "evidence-detail", path = "Condition.evidence.detail", description = "Supporting information found elsewhere", type = "reference")
2415  public static final String SP_EVIDENCE_DETAIL = "evidence-detail";
2416  /**
2417   * <b>Fluent Client</b> search parameter constant for <b>evidence-detail</b>
2418   * <p>
2419   * Description: <b>Supporting information found elsewhere</b><br>
2420   * Type: <b>reference</b><br>
2421   * Path: <b>Condition.evidence.detail</b><br>
2422   * </p>
2423   */
2424  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam EVIDENCE_DETAIL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2425      SP_EVIDENCE_DETAIL);
2426
2427  /**
2428   * Constant for fluent queries to be used to add include statements. Specifies
2429   * the path value of "<b>Condition:evidence-detail</b>".
2430   */
2431  public static final ca.uhn.fhir.model.api.Include INCLUDE_EVIDENCE_DETAIL = new ca.uhn.fhir.model.api.Include(
2432      "Condition:evidence-detail").toLocked();
2433
2434  /**
2435   * Search parameter: <b>identifier</b>
2436   * <p>
2437   * Description: <b>A unique identifier of the condition record</b><br>
2438   * Type: <b>token</b><br>
2439   * Path: <b>Condition.identifier</b><br>
2440   * </p>
2441   */
2442  @SearchParamDefinition(name = "identifier", path = "Condition.identifier", description = "A unique identifier of the condition record", type = "token")
2443  public static final String SP_IDENTIFIER = "identifier";
2444  /**
2445   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2446   * <p>
2447   * Description: <b>A unique identifier of the condition record</b><br>
2448   * Type: <b>token</b><br>
2449   * Path: <b>Condition.identifier</b><br>
2450   * </p>
2451   */
2452  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2453      SP_IDENTIFIER);
2454
2455  /**
2456   * Search parameter: <b>onset-info</b>
2457   * <p>
2458   * Description: <b>Onsets as a string</b><br>
2459   * Type: <b>string</b><br>
2460   * Path: <b>Condition.onset[x]</b><br>
2461   * </p>
2462   */
2463  @SearchParamDefinition(name = "onset-info", path = "Condition.onset.as(string)", description = "Onsets as a string", type = "string")
2464  public static final String SP_ONSET_INFO = "onset-info";
2465  /**
2466   * <b>Fluent Client</b> search parameter constant for <b>onset-info</b>
2467   * <p>
2468   * Description: <b>Onsets as a string</b><br>
2469   * Type: <b>string</b><br>
2470   * Path: <b>Condition.onset[x]</b><br>
2471   * </p>
2472   */
2473  public static final ca.uhn.fhir.rest.gclient.StringClientParam ONSET_INFO = new ca.uhn.fhir.rest.gclient.StringClientParam(
2474      SP_ONSET_INFO);
2475
2476  /**
2477   * Search parameter: <b>recorded-date</b>
2478   * <p>
2479   * Description: <b>Date record was first recorded</b><br>
2480   * Type: <b>date</b><br>
2481   * Path: <b>Condition.recordedDate</b><br>
2482   * </p>
2483   */
2484  @SearchParamDefinition(name = "recorded-date", path = "Condition.recordedDate", description = "Date record was first recorded", type = "date")
2485  public static final String SP_RECORDED_DATE = "recorded-date";
2486  /**
2487   * <b>Fluent Client</b> search parameter constant for <b>recorded-date</b>
2488   * <p>
2489   * Description: <b>Date record was first recorded</b><br>
2490   * Type: <b>date</b><br>
2491   * Path: <b>Condition.recordedDate</b><br>
2492   * </p>
2493   */
2494  public static final ca.uhn.fhir.rest.gclient.DateClientParam RECORDED_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(
2495      SP_RECORDED_DATE);
2496
2497  /**
2498   * Search parameter: <b>code</b>
2499   * <p>
2500   * Description: <b>Code for the condition</b><br>
2501   * Type: <b>token</b><br>
2502   * Path: <b>Condition.code</b><br>
2503   * </p>
2504   */
2505  @SearchParamDefinition(name = "code", path = "Condition.code", description = "Code for the condition", type = "token")
2506  public static final String SP_CODE = "code";
2507  /**
2508   * <b>Fluent Client</b> search parameter constant for <b>code</b>
2509   * <p>
2510   * Description: <b>Code for the condition</b><br>
2511   * Type: <b>token</b><br>
2512   * Path: <b>Condition.code</b><br>
2513   * </p>
2514   */
2515  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2516      SP_CODE);
2517
2518  /**
2519   * Search parameter: <b>evidence</b>
2520   * <p>
2521   * Description: <b>Manifestation/symptom</b><br>
2522   * Type: <b>token</b><br>
2523   * Path: <b>Condition.evidence.code</b><br>
2524   * </p>
2525   */
2526  @SearchParamDefinition(name = "evidence", path = "Condition.evidence.code", description = "Manifestation/symptom", type = "token")
2527  public static final String SP_EVIDENCE = "evidence";
2528  /**
2529   * <b>Fluent Client</b> search parameter constant for <b>evidence</b>
2530   * <p>
2531   * Description: <b>Manifestation/symptom</b><br>
2532   * Type: <b>token</b><br>
2533   * Path: <b>Condition.evidence.code</b><br>
2534   * </p>
2535   */
2536  public static final ca.uhn.fhir.rest.gclient.TokenClientParam EVIDENCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2537      SP_EVIDENCE);
2538
2539  /**
2540   * Search parameter: <b>subject</b>
2541   * <p>
2542   * Description: <b>Who has the condition?</b><br>
2543   * Type: <b>reference</b><br>
2544   * Path: <b>Condition.subject</b><br>
2545   * </p>
2546   */
2547  @SearchParamDefinition(name = "subject", path = "Condition.subject", description = "Who has the condition?", type = "reference", target = {
2548      Group.class, Patient.class })
2549  public static final String SP_SUBJECT = "subject";
2550  /**
2551   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2552   * <p>
2553   * Description: <b>Who has the condition?</b><br>
2554   * Type: <b>reference</b><br>
2555   * Path: <b>Condition.subject</b><br>
2556   * </p>
2557   */
2558  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2559      SP_SUBJECT);
2560
2561  /**
2562   * Constant for fluent queries to be used to add include statements. Specifies
2563   * the path value of "<b>Condition:subject</b>".
2564   */
2565  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include(
2566      "Condition:subject").toLocked();
2567
2568  /**
2569   * Search parameter: <b>verification-status</b>
2570   * <p>
2571   * Description: <b>unconfirmed | provisional | differential | confirmed |
2572   * refuted | entered-in-error</b><br>
2573   * Type: <b>token</b><br>
2574   * Path: <b>Condition.verificationStatus</b><br>
2575   * </p>
2576   */
2577  @SearchParamDefinition(name = "verification-status", path = "Condition.verificationStatus", description = "unconfirmed | provisional | differential | confirmed | refuted | entered-in-error", type = "token")
2578  public static final String SP_VERIFICATION_STATUS = "verification-status";
2579  /**
2580   * <b>Fluent Client</b> search parameter constant for <b>verification-status</b>
2581   * <p>
2582   * Description: <b>unconfirmed | provisional | differential | confirmed |
2583   * refuted | entered-in-error</b><br>
2584   * Type: <b>token</b><br>
2585   * Path: <b>Condition.verificationStatus</b><br>
2586   * </p>
2587   */
2588  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERIFICATION_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2589      SP_VERIFICATION_STATUS);
2590
2591  /**
2592   * Search parameter: <b>clinical-status</b>
2593   * <p>
2594   * Description: <b>The clinical status of the condition</b><br>
2595   * Type: <b>token</b><br>
2596   * Path: <b>Condition.clinicalStatus</b><br>
2597   * </p>
2598   */
2599  @SearchParamDefinition(name = "clinical-status", path = "Condition.clinicalStatus", description = "The clinical status of the condition", type = "token")
2600  public static final String SP_CLINICAL_STATUS = "clinical-status";
2601  /**
2602   * <b>Fluent Client</b> search parameter constant for <b>clinical-status</b>
2603   * <p>
2604   * Description: <b>The clinical status of the condition</b><br>
2605   * Type: <b>token</b><br>
2606   * Path: <b>Condition.clinicalStatus</b><br>
2607   * </p>
2608   */
2609  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CLINICAL_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2610      SP_CLINICAL_STATUS);
2611
2612  /**
2613   * Search parameter: <b>encounter</b>
2614   * <p>
2615   * Description: <b>Encounter created as part of</b><br>
2616   * Type: <b>reference</b><br>
2617   * Path: <b>Condition.encounter</b><br>
2618   * </p>
2619   */
2620  @SearchParamDefinition(name = "encounter", path = "Condition.encounter", description = "Encounter created as part of", type = "reference", providesMembershipIn = {
2621      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Encounter") }, target = { Encounter.class })
2622  public static final String SP_ENCOUNTER = "encounter";
2623  /**
2624   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
2625   * <p>
2626   * Description: <b>Encounter created as part of</b><br>
2627   * Type: <b>reference</b><br>
2628   * Path: <b>Condition.encounter</b><br>
2629   * </p>
2630   */
2631  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2632      SP_ENCOUNTER);
2633
2634  /**
2635   * Constant for fluent queries to be used to add include statements. Specifies
2636   * the path value of "<b>Condition:encounter</b>".
2637   */
2638  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include(
2639      "Condition:encounter").toLocked();
2640
2641  /**
2642   * Search parameter: <b>onset-date</b>
2643   * <p>
2644   * Description: <b>Date related onsets (dateTime and Period)</b><br>
2645   * Type: <b>date</b><br>
2646   * Path: <b>Condition.onset[x]</b><br>
2647   * </p>
2648   */
2649  @SearchParamDefinition(name = "onset-date", path = "Condition.onset.as(dateTime) | Condition.onset.as(Period)", description = "Date related onsets (dateTime and Period)", type = "date")
2650  public static final String SP_ONSET_DATE = "onset-date";
2651  /**
2652   * <b>Fluent Client</b> search parameter constant for <b>onset-date</b>
2653   * <p>
2654   * Description: <b>Date related onsets (dateTime and Period)</b><br>
2655   * Type: <b>date</b><br>
2656   * Path: <b>Condition.onset[x]</b><br>
2657   * </p>
2658   */
2659  public static final ca.uhn.fhir.rest.gclient.DateClientParam ONSET_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(
2660      SP_ONSET_DATE);
2661
2662  /**
2663   * Search parameter: <b>abatement-date</b>
2664   * <p>
2665   * Description: <b>Date-related abatements (dateTime and period)</b><br>
2666   * Type: <b>date</b><br>
2667   * Path: <b>Condition.abatement[x]</b><br>
2668   * </p>
2669   */
2670  @SearchParamDefinition(name = "abatement-date", path = "Condition.abatement.as(dateTime) | Condition.abatement.as(Period)", description = "Date-related abatements (dateTime and period)", type = "date")
2671  public static final String SP_ABATEMENT_DATE = "abatement-date";
2672  /**
2673   * <b>Fluent Client</b> search parameter constant for <b>abatement-date</b>
2674   * <p>
2675   * Description: <b>Date-related abatements (dateTime and period)</b><br>
2676   * Type: <b>date</b><br>
2677   * Path: <b>Condition.abatement[x]</b><br>
2678   * </p>
2679   */
2680  public static final ca.uhn.fhir.rest.gclient.DateClientParam ABATEMENT_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(
2681      SP_ABATEMENT_DATE);
2682
2683  /**
2684   * Search parameter: <b>asserter</b>
2685   * <p>
2686   * Description: <b>Person who asserts this condition</b><br>
2687   * Type: <b>reference</b><br>
2688   * Path: <b>Condition.asserter</b><br>
2689   * </p>
2690   */
2691  @SearchParamDefinition(name = "asserter", path = "Condition.asserter", description = "Person who asserts this condition", type = "reference", providesMembershipIn = {
2692      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Patient"),
2693      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Practitioner"),
2694      @ca.uhn.fhir.model.api.annotation.Compartment(name = "RelatedPerson") }, target = { Patient.class,
2695          Practitioner.class, PractitionerRole.class, RelatedPerson.class })
2696  public static final String SP_ASSERTER = "asserter";
2697  /**
2698   * <b>Fluent Client</b> search parameter constant for <b>asserter</b>
2699   * <p>
2700   * Description: <b>Person who asserts this condition</b><br>
2701   * Type: <b>reference</b><br>
2702   * Path: <b>Condition.asserter</b><br>
2703   * </p>
2704   */
2705  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ASSERTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2706      SP_ASSERTER);
2707
2708  /**
2709   * Constant for fluent queries to be used to add include statements. Specifies
2710   * the path value of "<b>Condition:asserter</b>".
2711   */
2712  public static final ca.uhn.fhir.model.api.Include INCLUDE_ASSERTER = new ca.uhn.fhir.model.api.Include(
2713      "Condition:asserter").toLocked();
2714
2715  /**
2716   * Search parameter: <b>stage</b>
2717   * <p>
2718   * Description: <b>Simple summary (disease specific)</b><br>
2719   * Type: <b>token</b><br>
2720   * Path: <b>Condition.stage.summary</b><br>
2721   * </p>
2722   */
2723  @SearchParamDefinition(name = "stage", path = "Condition.stage.summary", description = "Simple summary (disease specific)", type = "token")
2724  public static final String SP_STAGE = "stage";
2725  /**
2726   * <b>Fluent Client</b> search parameter constant for <b>stage</b>
2727   * <p>
2728   * Description: <b>Simple summary (disease specific)</b><br>
2729   * Type: <b>token</b><br>
2730   * Path: <b>Condition.stage.summary</b><br>
2731   * </p>
2732   */
2733  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STAGE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2734      SP_STAGE);
2735
2736  /**
2737   * Search parameter: <b>abatement-string</b>
2738   * <p>
2739   * Description: <b>Abatement as a string</b><br>
2740   * Type: <b>string</b><br>
2741   * Path: <b>Condition.abatement[x]</b><br>
2742   * </p>
2743   */
2744  @SearchParamDefinition(name = "abatement-string", path = "Condition.abatement.as(string)", description = "Abatement as a string", type = "string")
2745  public static final String SP_ABATEMENT_STRING = "abatement-string";
2746  /**
2747   * <b>Fluent Client</b> search parameter constant for <b>abatement-string</b>
2748   * <p>
2749   * Description: <b>Abatement as a string</b><br>
2750   * Type: <b>string</b><br>
2751   * Path: <b>Condition.abatement[x]</b><br>
2752   * </p>
2753   */
2754  public static final ca.uhn.fhir.rest.gclient.StringClientParam ABATEMENT_STRING = new ca.uhn.fhir.rest.gclient.StringClientParam(
2755      SP_ABATEMENT_STRING);
2756
2757  /**
2758   * Search parameter: <b>patient</b>
2759   * <p>
2760   * Description: <b>Who has the condition?</b><br>
2761   * Type: <b>reference</b><br>
2762   * Path: <b>Condition.subject</b><br>
2763   * </p>
2764   */
2765  @SearchParamDefinition(name = "patient", path = "Condition.subject.where(resolve() is Patient)", description = "Who has the condition?", type = "reference", providesMembershipIn = {
2766      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Patient") }, target = { Patient.class })
2767  public static final String SP_PATIENT = "patient";
2768  /**
2769   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2770   * <p>
2771   * Description: <b>Who has the condition?</b><br>
2772   * Type: <b>reference</b><br>
2773   * Path: <b>Condition.subject</b><br>
2774   * </p>
2775   */
2776  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2777      SP_PATIENT);
2778
2779  /**
2780   * Constant for fluent queries to be used to add include statements. Specifies
2781   * the path value of "<b>Condition:patient</b>".
2782   */
2783  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include(
2784      "Condition:patient").toLocked();
2785
2786  /**
2787   * Search parameter: <b>onset-age</b>
2788   * <p>
2789   * Description: <b>Onsets as age or age range</b><br>
2790   * Type: <b>quantity</b><br>
2791   * Path: <b>Condition.onset[x]</b><br>
2792   * </p>
2793   */
2794  @SearchParamDefinition(name = "onset-age", path = "Condition.onset.as(Age) | Condition.onset.as(Range)", description = "Onsets as age or age range", type = "quantity")
2795  public static final String SP_ONSET_AGE = "onset-age";
2796  /**
2797   * <b>Fluent Client</b> search parameter constant for <b>onset-age</b>
2798   * <p>
2799   * Description: <b>Onsets as age or age range</b><br>
2800   * Type: <b>quantity</b><br>
2801   * Path: <b>Condition.onset[x]</b><br>
2802   * </p>
2803   */
2804  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam ONSET_AGE = new ca.uhn.fhir.rest.gclient.QuantityClientParam(
2805      SP_ONSET_AGE);
2806
2807  /**
2808   * Search parameter: <b>abatement-age</b>
2809   * <p>
2810   * Description: <b>Abatement as age or age range</b><br>
2811   * Type: <b>quantity</b><br>
2812   * Path: <b>Condition.abatement[x]</b><br>
2813   * </p>
2814   */
2815  @SearchParamDefinition(name = "abatement-age", path = "Condition.abatement.as(Age) | Condition.abatement.as(Range)", description = "Abatement as age or age range", type = "quantity")
2816  public static final String SP_ABATEMENT_AGE = "abatement-age";
2817  /**
2818   * <b>Fluent Client</b> search parameter constant for <b>abatement-age</b>
2819   * <p>
2820   * Description: <b>Abatement as age or age range</b><br>
2821   * Type: <b>quantity</b><br>
2822   * Path: <b>Condition.abatement[x]</b><br>
2823   * </p>
2824   */
2825  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam ABATEMENT_AGE = new ca.uhn.fhir.rest.gclient.QuantityClientParam(
2826      SP_ABATEMENT_AGE);
2827
2828  /**
2829   * Search parameter: <b>category</b>
2830   * <p>
2831   * Description: <b>The category of the condition</b><br>
2832   * Type: <b>token</b><br>
2833   * Path: <b>Condition.category</b><br>
2834   * </p>
2835   */
2836  @SearchParamDefinition(name = "category", path = "Condition.category", description = "The category of the condition", type = "token")
2837  public static final String SP_CATEGORY = "category";
2838  /**
2839   * <b>Fluent Client</b> search parameter constant for <b>category</b>
2840   * <p>
2841   * Description: <b>The category of the condition</b><br>
2842   * Type: <b>token</b><br>
2843   * Path: <b>Condition.category</b><br>
2844   * </p>
2845   */
2846  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2847      SP_CATEGORY);
2848
2849  /**
2850   * Search parameter: <b>body-site</b>
2851   * <p>
2852   * Description: <b>Anatomical location, if relevant</b><br>
2853   * Type: <b>token</b><br>
2854   * Path: <b>Condition.bodySite</b><br>
2855   * </p>
2856   */
2857  @SearchParamDefinition(name = "body-site", path = "Condition.bodySite", description = "Anatomical location, if relevant", type = "token")
2858  public static final String SP_BODY_SITE = "body-site";
2859  /**
2860   * <b>Fluent Client</b> search parameter constant for <b>body-site</b>
2861   * <p>
2862   * Description: <b>Anatomical location, if relevant</b><br>
2863   * Type: <b>token</b><br>
2864   * Path: <b>Condition.bodySite</b><br>
2865   * </p>
2866   */
2867  public static final ca.uhn.fhir.rest.gclient.TokenClientParam BODY_SITE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2868      SP_BODY_SITE);
2869
2870}