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