001package org.hl7.fhir.r4.model;
002
003import java.math.BigDecimal;
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
035import java.util.ArrayList;
036import java.util.List;
037
038import org.hl7.fhir.exceptions.FHIRException;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.utilities.Utilities;
041
042import ca.uhn.fhir.model.api.annotation.Block;
043import ca.uhn.fhir.model.api.annotation.Child;
044import ca.uhn.fhir.model.api.annotation.Description;
045import ca.uhn.fhir.model.api.annotation.ResourceDef;
046import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
047
048/**
049 * An assessment of the likely outcome(s) for a patient or other subject as well
050 * as the likelihood of each outcome.
051 */
052@ResourceDef(name = "RiskAssessment", profile = "http://hl7.org/fhir/StructureDefinition/RiskAssessment")
053public class RiskAssessment extends DomainResource {
054
055  public enum RiskAssessmentStatus {
056    /**
057     * The existence of the observation is registered, but there is no result yet
058     * available.
059     */
060    REGISTERED,
061    /**
062     * This is an initial or interim observation: data may be incomplete or
063     * unverified.
064     */
065    PRELIMINARY,
066    /**
067     * The observation is complete and there are no further actions needed.
068     * Additional information such "released", "signed", etc would be represented
069     * using [Provenance](provenance.html) which provides not only the act but also
070     * the actors and dates and other related data. These act states would be
071     * associated with an observation status of `preliminary` until they are all
072     * completed and then a status of `final` would be applied.
073     */
074    FINAL,
075    /**
076     * Subsequent to being Final, the observation has been modified subsequent. This
077     * includes updates/new information and corrections.
078     */
079    AMENDED,
080    /**
081     * Subsequent to being Final, the observation has been modified to correct an
082     * error in the test result.
083     */
084    CORRECTED,
085    /**
086     * The observation is unavailable because the measurement was not started or not
087     * completed (also sometimes called "aborted").
088     */
089    CANCELLED,
090    /**
091     * The observation has been withdrawn following previous final release. This
092     * electronic record should never have existed, though it is possible that
093     * real-world decisions were based on it. (If real-world activity has occurred,
094     * the status should be "cancelled" rather than "entered-in-error".).
095     */
096    ENTEREDINERROR,
097    /**
098     * The authoring/source system does not know which of the status values
099     * currently applies for this observation. Note: This concept is not to be used
100     * for "other" - one of the listed statuses is presumed to apply, but the
101     * authoring/source system does not know which.
102     */
103    UNKNOWN,
104    /**
105     * added to help the parsers with the generic types
106     */
107    NULL;
108
109    public static RiskAssessmentStatus fromCode(String codeString) throws FHIRException {
110      if (codeString == null || "".equals(codeString))
111        return null;
112      if ("registered".equals(codeString))
113        return REGISTERED;
114      if ("preliminary".equals(codeString))
115        return PRELIMINARY;
116      if ("final".equals(codeString))
117        return FINAL;
118      if ("amended".equals(codeString))
119        return AMENDED;
120      if ("corrected".equals(codeString))
121        return CORRECTED;
122      if ("cancelled".equals(codeString))
123        return CANCELLED;
124      if ("entered-in-error".equals(codeString))
125        return ENTEREDINERROR;
126      if ("unknown".equals(codeString))
127        return UNKNOWN;
128      if (Configuration.isAcceptInvalidEnums())
129        return null;
130      else
131        throw new FHIRException("Unknown RiskAssessmentStatus code '" + codeString + "'");
132    }
133
134    public String toCode() {
135      switch (this) {
136      case REGISTERED:
137        return "registered";
138      case PRELIMINARY:
139        return "preliminary";
140      case FINAL:
141        return "final";
142      case AMENDED:
143        return "amended";
144      case CORRECTED:
145        return "corrected";
146      case CANCELLED:
147        return "cancelled";
148      case ENTEREDINERROR:
149        return "entered-in-error";
150      case UNKNOWN:
151        return "unknown";
152      case NULL:
153        return null;
154      default:
155        return "?";
156      }
157    }
158
159    public String getSystem() {
160      switch (this) {
161      case REGISTERED:
162        return "http://hl7.org/fhir/observation-status";
163      case PRELIMINARY:
164        return "http://hl7.org/fhir/observation-status";
165      case FINAL:
166        return "http://hl7.org/fhir/observation-status";
167      case AMENDED:
168        return "http://hl7.org/fhir/observation-status";
169      case CORRECTED:
170        return "http://hl7.org/fhir/observation-status";
171      case CANCELLED:
172        return "http://hl7.org/fhir/observation-status";
173      case ENTEREDINERROR:
174        return "http://hl7.org/fhir/observation-status";
175      case UNKNOWN:
176        return "http://hl7.org/fhir/observation-status";
177      case NULL:
178        return null;
179      default:
180        return "?";
181      }
182    }
183
184    public String getDefinition() {
185      switch (this) {
186      case REGISTERED:
187        return "The existence of the observation is registered, but there is no result yet available.";
188      case PRELIMINARY:
189        return "This is an initial or interim observation: data may be incomplete or unverified.";
190      case FINAL:
191        return "The observation is complete and there are no further actions needed. Additional information such \"released\", \"signed\", etc would be represented using [Provenance](provenance.html) which provides not only the act but also the actors and dates and other related data. These act states would be associated with an observation status of `preliminary` until they are all completed and then a status of `final` would be applied.";
192      case AMENDED:
193        return "Subsequent to being Final, the observation has been modified subsequent.  This includes updates/new information and corrections.";
194      case CORRECTED:
195        return "Subsequent to being Final, the observation has been modified to correct an error in the test result.";
196      case CANCELLED:
197        return "The observation is unavailable because the measurement was not started or not completed (also sometimes called \"aborted\").";
198      case ENTEREDINERROR:
199        return "The observation has been withdrawn following previous final release.  This electronic record should never have existed, though it is possible that real-world decisions were based on it. (If real-world activity has occurred, the status should be \"cancelled\" rather than \"entered-in-error\".).";
200      case UNKNOWN:
201        return "The authoring/source system does not know which of the status values currently applies for this observation. Note: This concept is not to be used for \"other\" - one of the listed statuses is presumed to apply, but the authoring/source system does not know which.";
202      case NULL:
203        return null;
204      default:
205        return "?";
206      }
207    }
208
209    public String getDisplay() {
210      switch (this) {
211      case REGISTERED:
212        return "Registered";
213      case PRELIMINARY:
214        return "Preliminary";
215      case FINAL:
216        return "Final";
217      case AMENDED:
218        return "Amended";
219      case CORRECTED:
220        return "Corrected";
221      case CANCELLED:
222        return "Cancelled";
223      case ENTEREDINERROR:
224        return "Entered in Error";
225      case UNKNOWN:
226        return "Unknown";
227      case NULL:
228        return null;
229      default:
230        return "?";
231      }
232    }
233  }
234
235  public static class RiskAssessmentStatusEnumFactory implements EnumFactory<RiskAssessmentStatus> {
236    public RiskAssessmentStatus fromCode(String codeString) throws IllegalArgumentException {
237      if (codeString == null || "".equals(codeString))
238        if (codeString == null || "".equals(codeString))
239          return null;
240      if ("registered".equals(codeString))
241        return RiskAssessmentStatus.REGISTERED;
242      if ("preliminary".equals(codeString))
243        return RiskAssessmentStatus.PRELIMINARY;
244      if ("final".equals(codeString))
245        return RiskAssessmentStatus.FINAL;
246      if ("amended".equals(codeString))
247        return RiskAssessmentStatus.AMENDED;
248      if ("corrected".equals(codeString))
249        return RiskAssessmentStatus.CORRECTED;
250      if ("cancelled".equals(codeString))
251        return RiskAssessmentStatus.CANCELLED;
252      if ("entered-in-error".equals(codeString))
253        return RiskAssessmentStatus.ENTEREDINERROR;
254      if ("unknown".equals(codeString))
255        return RiskAssessmentStatus.UNKNOWN;
256      throw new IllegalArgumentException("Unknown RiskAssessmentStatus code '" + codeString + "'");
257    }
258
259    public Enumeration<RiskAssessmentStatus> fromType(PrimitiveType<?> code) throws FHIRException {
260      if (code == null)
261        return null;
262      if (code.isEmpty())
263        return new Enumeration<RiskAssessmentStatus>(this, RiskAssessmentStatus.NULL, code);
264      String codeString = code.asStringValue();
265      if (codeString == null || "".equals(codeString))
266        return new Enumeration<RiskAssessmentStatus>(this, RiskAssessmentStatus.NULL, code);
267      if ("registered".equals(codeString))
268        return new Enumeration<RiskAssessmentStatus>(this, RiskAssessmentStatus.REGISTERED, code);
269      if ("preliminary".equals(codeString))
270        return new Enumeration<RiskAssessmentStatus>(this, RiskAssessmentStatus.PRELIMINARY, code);
271      if ("final".equals(codeString))
272        return new Enumeration<RiskAssessmentStatus>(this, RiskAssessmentStatus.FINAL, code);
273      if ("amended".equals(codeString))
274        return new Enumeration<RiskAssessmentStatus>(this, RiskAssessmentStatus.AMENDED, code);
275      if ("corrected".equals(codeString))
276        return new Enumeration<RiskAssessmentStatus>(this, RiskAssessmentStatus.CORRECTED, code);
277      if ("cancelled".equals(codeString))
278        return new Enumeration<RiskAssessmentStatus>(this, RiskAssessmentStatus.CANCELLED, code);
279      if ("entered-in-error".equals(codeString))
280        return new Enumeration<RiskAssessmentStatus>(this, RiskAssessmentStatus.ENTEREDINERROR, code);
281      if ("unknown".equals(codeString))
282        return new Enumeration<RiskAssessmentStatus>(this, RiskAssessmentStatus.UNKNOWN, code);
283      throw new FHIRException("Unknown RiskAssessmentStatus code '" + codeString + "'");
284    }
285
286    public String toCode(RiskAssessmentStatus code) {
287      if (code == RiskAssessmentStatus.REGISTERED)
288        return "registered";
289      if (code == RiskAssessmentStatus.PRELIMINARY)
290        return "preliminary";
291      if (code == RiskAssessmentStatus.FINAL)
292        return "final";
293      if (code == RiskAssessmentStatus.AMENDED)
294        return "amended";
295      if (code == RiskAssessmentStatus.CORRECTED)
296        return "corrected";
297      if (code == RiskAssessmentStatus.CANCELLED)
298        return "cancelled";
299      if (code == RiskAssessmentStatus.ENTEREDINERROR)
300        return "entered-in-error";
301      if (code == RiskAssessmentStatus.UNKNOWN)
302        return "unknown";
303      return "?";
304    }
305
306    public String toSystem(RiskAssessmentStatus code) {
307      return code.getSystem();
308    }
309  }
310
311  @Block()
312  public static class RiskAssessmentPredictionComponent extends BackboneElement implements IBaseBackboneElement {
313    /**
314     * One of the potential outcomes for the patient (e.g. remission, death, a
315     * particular condition).
316     */
317    @Child(name = "outcome", type = {
318        CodeableConcept.class }, order = 1, min = 0, max = 1, modifier = false, summary = false)
319    @Description(shortDefinition = "Possible outcome for the subject", formalDefinition = "One of the potential outcomes for the patient (e.g. remission, death,  a particular condition).")
320    protected CodeableConcept outcome;
321
322    /**
323     * Indicates how likely the outcome is (in the specified timeframe).
324     */
325    @Child(name = "probability", type = { DecimalType.class,
326        Range.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
327    @Description(shortDefinition = "Likelihood of specified outcome", formalDefinition = "Indicates how likely the outcome is (in the specified timeframe).")
328    protected Type probability;
329
330    /**
331     * Indicates how likely the outcome is (in the specified timeframe), expressed
332     * as a qualitative value (e.g. low, medium, or high).
333     */
334    @Child(name = "qualitativeRisk", type = {
335        CodeableConcept.class }, order = 3, min = 0, max = 1, modifier = false, summary = false)
336    @Description(shortDefinition = "Likelihood of specified outcome as a qualitative value", formalDefinition = "Indicates how likely the outcome is (in the specified timeframe), expressed as a qualitative value (e.g. low, medium, or high).")
337    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/risk-probability")
338    protected CodeableConcept qualitativeRisk;
339
340    /**
341     * Indicates the risk for this particular subject (with their specific
342     * characteristics) divided by the risk of the population in general. (Numbers
343     * greater than 1 = higher risk than the population, numbers less than 1 = lower
344     * risk.).
345     */
346    @Child(name = "relativeRisk", type = {
347        DecimalType.class }, order = 4, min = 0, max = 1, modifier = false, summary = false)
348    @Description(shortDefinition = "Relative likelihood", formalDefinition = "Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general.  (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).")
349    protected DecimalType relativeRisk;
350
351    /**
352     * Indicates the period of time or age range of the subject to which the
353     * specified probability applies.
354     */
355    @Child(name = "when", type = { Period.class,
356        Range.class }, order = 5, min = 0, max = 1, modifier = false, summary = false)
357    @Description(shortDefinition = "Timeframe or age range", formalDefinition = "Indicates the period of time or age range of the subject to which the specified probability applies.")
358    protected Type when;
359
360    /**
361     * Additional information explaining the basis for the prediction.
362     */
363    @Child(name = "rationale", type = {
364        StringType.class }, order = 6, min = 0, max = 1, modifier = false, summary = false)
365    @Description(shortDefinition = "Explanation of prediction", formalDefinition = "Additional information explaining the basis for the prediction.")
366    protected StringType rationale;
367
368    private static final long serialVersionUID = 1283401747L;
369
370    /**
371     * Constructor
372     */
373    public RiskAssessmentPredictionComponent() {
374      super();
375    }
376
377    /**
378     * @return {@link #outcome} (One of the potential outcomes for the patient (e.g.
379     *         remission, death, a particular condition).)
380     */
381    public CodeableConcept getOutcome() {
382      if (this.outcome == null)
383        if (Configuration.errorOnAutoCreate())
384          throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.outcome");
385        else if (Configuration.doAutoCreate())
386          this.outcome = new CodeableConcept(); // cc
387      return this.outcome;
388    }
389
390    public boolean hasOutcome() {
391      return this.outcome != null && !this.outcome.isEmpty();
392    }
393
394    /**
395     * @param value {@link #outcome} (One of the potential outcomes for the patient
396     *              (e.g. remission, death, a particular condition).)
397     */
398    public RiskAssessmentPredictionComponent setOutcome(CodeableConcept value) {
399      this.outcome = value;
400      return this;
401    }
402
403    /**
404     * @return {@link #probability} (Indicates how likely the outcome is (in the
405     *         specified timeframe).)
406     */
407    public Type getProbability() {
408      return this.probability;
409    }
410
411    /**
412     * @return {@link #probability} (Indicates how likely the outcome is (in the
413     *         specified timeframe).)
414     */
415    public DecimalType getProbabilityDecimalType() throws FHIRException {
416      if (this.probability == null)
417        this.probability = new DecimalType();
418      if (!(this.probability instanceof DecimalType))
419        throw new FHIRException("Type mismatch: the type DecimalType was expected, but "
420            + this.probability.getClass().getName() + " was encountered");
421      return (DecimalType) this.probability;
422    }
423
424    public boolean hasProbabilityDecimalType() {
425      return this != null && this.probability instanceof DecimalType;
426    }
427
428    /**
429     * @return {@link #probability} (Indicates how likely the outcome is (in the
430     *         specified timeframe).)
431     */
432    public Range getProbabilityRange() throws FHIRException {
433      if (this.probability == null)
434        this.probability = new Range();
435      if (!(this.probability instanceof Range))
436        throw new FHIRException("Type mismatch: the type Range was expected, but "
437            + this.probability.getClass().getName() + " was encountered");
438      return (Range) this.probability;
439    }
440
441    public boolean hasProbabilityRange() {
442      return this != null && this.probability instanceof Range;
443    }
444
445    public boolean hasProbability() {
446      return this.probability != null && !this.probability.isEmpty();
447    }
448
449    /**
450     * @param value {@link #probability} (Indicates how likely the outcome is (in
451     *              the specified timeframe).)
452     */
453    public RiskAssessmentPredictionComponent setProbability(Type value) {
454      if (value != null && !(value instanceof DecimalType || value instanceof Range))
455        throw new Error("Not the right type for RiskAssessment.prediction.probability[x]: " + value.fhirType());
456      this.probability = value;
457      return this;
458    }
459
460    /**
461     * @return {@link #qualitativeRisk} (Indicates how likely the outcome is (in the
462     *         specified timeframe), expressed as a qualitative value (e.g. low,
463     *         medium, or high).)
464     */
465    public CodeableConcept getQualitativeRisk() {
466      if (this.qualitativeRisk == null)
467        if (Configuration.errorOnAutoCreate())
468          throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.qualitativeRisk");
469        else if (Configuration.doAutoCreate())
470          this.qualitativeRisk = new CodeableConcept(); // cc
471      return this.qualitativeRisk;
472    }
473
474    public boolean hasQualitativeRisk() {
475      return this.qualitativeRisk != null && !this.qualitativeRisk.isEmpty();
476    }
477
478    /**
479     * @param value {@link #qualitativeRisk} (Indicates how likely the outcome is
480     *              (in the specified timeframe), expressed as a qualitative value
481     *              (e.g. low, medium, or high).)
482     */
483    public RiskAssessmentPredictionComponent setQualitativeRisk(CodeableConcept value) {
484      this.qualitativeRisk = value;
485      return this;
486    }
487
488    /**
489     * @return {@link #relativeRisk} (Indicates the risk for this particular subject
490     *         (with their specific characteristics) divided by the risk of the
491     *         population in general. (Numbers greater than 1 = higher risk than the
492     *         population, numbers less than 1 = lower risk.).). This is the
493     *         underlying object with id, value and extensions. The accessor
494     *         "getRelativeRisk" gives direct access to the value
495     */
496    public DecimalType getRelativeRiskElement() {
497      if (this.relativeRisk == null)
498        if (Configuration.errorOnAutoCreate())
499          throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.relativeRisk");
500        else if (Configuration.doAutoCreate())
501          this.relativeRisk = new DecimalType(); // bb
502      return this.relativeRisk;
503    }
504
505    public boolean hasRelativeRiskElement() {
506      return this.relativeRisk != null && !this.relativeRisk.isEmpty();
507    }
508
509    public boolean hasRelativeRisk() {
510      return this.relativeRisk != null && !this.relativeRisk.isEmpty();
511    }
512
513    /**
514     * @param value {@link #relativeRisk} (Indicates the risk for this particular
515     *              subject (with their specific characteristics) divided by the
516     *              risk of the population in general. (Numbers greater than 1 =
517     *              higher risk than the population, numbers less than 1 = lower
518     *              risk.).). This is the underlying object with id, value and
519     *              extensions. The accessor "getRelativeRisk" gives direct access
520     *              to the value
521     */
522    public RiskAssessmentPredictionComponent setRelativeRiskElement(DecimalType value) {
523      this.relativeRisk = value;
524      return this;
525    }
526
527    /**
528     * @return Indicates the risk for this particular subject (with their specific
529     *         characteristics) divided by the risk of the population in general.
530     *         (Numbers greater than 1 = higher risk than the population, numbers
531     *         less than 1 = lower risk.).
532     */
533    public BigDecimal getRelativeRisk() {
534      return this.relativeRisk == null ? null : this.relativeRisk.getValue();
535    }
536
537    /**
538     * @param value Indicates the risk for this particular subject (with their
539     *              specific characteristics) divided by the risk of the population
540     *              in general. (Numbers greater than 1 = higher risk than the
541     *              population, numbers less than 1 = lower risk.).
542     */
543    public RiskAssessmentPredictionComponent setRelativeRisk(BigDecimal value) {
544      if (value == null)
545        this.relativeRisk = null;
546      else {
547        if (this.relativeRisk == null)
548          this.relativeRisk = new DecimalType();
549        this.relativeRisk.setValue(value);
550      }
551      return this;
552    }
553
554    /**
555     * @param value Indicates the risk for this particular subject (with their
556     *              specific characteristics) divided by the risk of the population
557     *              in general. (Numbers greater than 1 = higher risk than the
558     *              population, numbers less than 1 = lower risk.).
559     */
560    public RiskAssessmentPredictionComponent setRelativeRisk(long value) {
561      this.relativeRisk = new DecimalType();
562      this.relativeRisk.setValue(value);
563      return this;
564    }
565
566    /**
567     * @param value Indicates the risk for this particular subject (with their
568     *              specific characteristics) divided by the risk of the population
569     *              in general. (Numbers greater than 1 = higher risk than the
570     *              population, numbers less than 1 = lower risk.).
571     */
572    public RiskAssessmentPredictionComponent setRelativeRisk(double value) {
573      this.relativeRisk = new DecimalType();
574      this.relativeRisk.setValue(value);
575      return this;
576    }
577
578    /**
579     * @return {@link #when} (Indicates the period of time or age range of the
580     *         subject to which the specified probability applies.)
581     */
582    public Type getWhen() {
583      return this.when;
584    }
585
586    /**
587     * @return {@link #when} (Indicates the period of time or age range of the
588     *         subject to which the specified probability applies.)
589     */
590    public Period getWhenPeriod() throws FHIRException {
591      if (this.when == null)
592        this.when = new Period();
593      if (!(this.when instanceof Period))
594        throw new FHIRException(
595            "Type mismatch: the type Period was expected, but " + this.when.getClass().getName() + " was encountered");
596      return (Period) this.when;
597    }
598
599    public boolean hasWhenPeriod() {
600      return this != null && this.when instanceof Period;
601    }
602
603    /**
604     * @return {@link #when} (Indicates the period of time or age range of the
605     *         subject to which the specified probability applies.)
606     */
607    public Range getWhenRange() throws FHIRException {
608      if (this.when == null)
609        this.when = new Range();
610      if (!(this.when instanceof Range))
611        throw new FHIRException(
612            "Type mismatch: the type Range was expected, but " + this.when.getClass().getName() + " was encountered");
613      return (Range) this.when;
614    }
615
616    public boolean hasWhenRange() {
617      return this != null && this.when instanceof Range;
618    }
619
620    public boolean hasWhen() {
621      return this.when != null && !this.when.isEmpty();
622    }
623
624    /**
625     * @param value {@link #when} (Indicates the period of time or age range of the
626     *              subject to which the specified probability applies.)
627     */
628    public RiskAssessmentPredictionComponent setWhen(Type value) {
629      if (value != null && !(value instanceof Period || value instanceof Range))
630        throw new Error("Not the right type for RiskAssessment.prediction.when[x]: " + value.fhirType());
631      this.when = value;
632      return this;
633    }
634
635    /**
636     * @return {@link #rationale} (Additional information explaining the basis for
637     *         the prediction.). This is the underlying object with id, value and
638     *         extensions. The accessor "getRationale" gives direct access to the
639     *         value
640     */
641    public StringType getRationaleElement() {
642      if (this.rationale == null)
643        if (Configuration.errorOnAutoCreate())
644          throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.rationale");
645        else if (Configuration.doAutoCreate())
646          this.rationale = new StringType(); // bb
647      return this.rationale;
648    }
649
650    public boolean hasRationaleElement() {
651      return this.rationale != null && !this.rationale.isEmpty();
652    }
653
654    public boolean hasRationale() {
655      return this.rationale != null && !this.rationale.isEmpty();
656    }
657
658    /**
659     * @param value {@link #rationale} (Additional information explaining the basis
660     *              for the prediction.). This is the underlying object with id,
661     *              value and extensions. The accessor "getRationale" gives direct
662     *              access to the value
663     */
664    public RiskAssessmentPredictionComponent setRationaleElement(StringType value) {
665      this.rationale = value;
666      return this;
667    }
668
669    /**
670     * @return Additional information explaining the basis for the prediction.
671     */
672    public String getRationale() {
673      return this.rationale == null ? null : this.rationale.getValue();
674    }
675
676    /**
677     * @param value Additional information explaining the basis for the prediction.
678     */
679    public RiskAssessmentPredictionComponent setRationale(String value) {
680      if (Utilities.noString(value))
681        this.rationale = null;
682      else {
683        if (this.rationale == null)
684          this.rationale = new StringType();
685        this.rationale.setValue(value);
686      }
687      return this;
688    }
689
690    protected void listChildren(List<Property> children) {
691      super.listChildren(children);
692      children.add(new Property("outcome", "CodeableConcept",
693          "One of the potential outcomes for the patient (e.g. remission, death,  a particular condition).", 0, 1,
694          outcome));
695      children.add(new Property("probability[x]", "decimal|Range",
696          "Indicates how likely the outcome is (in the specified timeframe).", 0, 1, probability));
697      children.add(new Property("qualitativeRisk", "CodeableConcept",
698          "Indicates how likely the outcome is (in the specified timeframe), expressed as a qualitative value (e.g. low, medium, or high).",
699          0, 1, qualitativeRisk));
700      children.add(new Property("relativeRisk", "decimal",
701          "Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general.  (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).",
702          0, 1, relativeRisk));
703      children.add(new Property("when[x]", "Period|Range",
704          "Indicates the period of time or age range of the subject to which the specified probability applies.", 0, 1,
705          when));
706      children.add(new Property("rationale", "string",
707          "Additional information explaining the basis for the prediction.", 0, 1, rationale));
708    }
709
710    @Override
711    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
712      switch (_hash) {
713      case -1106507950:
714        /* outcome */ return new Property("outcome", "CodeableConcept",
715            "One of the potential outcomes for the patient (e.g. remission, death,  a particular condition).", 0, 1,
716            outcome);
717      case 1430185003:
718        /* probability[x] */ return new Property("probability[x]", "decimal|Range",
719            "Indicates how likely the outcome is (in the specified timeframe).", 0, 1, probability);
720      case -1290561483:
721        /* probability */ return new Property("probability[x]", "decimal|Range",
722            "Indicates how likely the outcome is (in the specified timeframe).", 0, 1, probability);
723      case 888495452:
724        /* probabilityDecimal */ return new Property("probability[x]", "decimal|Range",
725            "Indicates how likely the outcome is (in the specified timeframe).", 0, 1, probability);
726      case 9275912:
727        /* probabilityRange */ return new Property("probability[x]", "decimal|Range",
728            "Indicates how likely the outcome is (in the specified timeframe).", 0, 1, probability);
729      case 123308730:
730        /* qualitativeRisk */ return new Property("qualitativeRisk", "CodeableConcept",
731            "Indicates how likely the outcome is (in the specified timeframe), expressed as a qualitative value (e.g. low, medium, or high).",
732            0, 1, qualitativeRisk);
733      case -70741061:
734        /* relativeRisk */ return new Property("relativeRisk", "decimal",
735            "Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general.  (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).",
736            0, 1, relativeRisk);
737      case 1312831238:
738        /* when[x] */ return new Property("when[x]", "Period|Range",
739            "Indicates the period of time or age range of the subject to which the specified probability applies.", 0,
740            1, when);
741      case 3648314:
742        /* when */ return new Property("when[x]", "Period|Range",
743            "Indicates the period of time or age range of the subject to which the specified probability applies.", 0,
744            1, when);
745      case 251476379:
746        /* whenPeriod */ return new Property("when[x]", "Period|Range",
747            "Indicates the period of time or age range of the subject to which the specified probability applies.", 0,
748            1, when);
749      case -1098542557:
750        /* whenRange */ return new Property("when[x]", "Period|Range",
751            "Indicates the period of time or age range of the subject to which the specified probability applies.", 0,
752            1, when);
753      case 345689335:
754        /* rationale */ return new Property("rationale", "string",
755            "Additional information explaining the basis for the prediction.", 0, 1, rationale);
756      default:
757        return super.getNamedProperty(_hash, _name, _checkValid);
758      }
759
760    }
761
762    @Override
763    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
764      switch (hash) {
765      case -1106507950:
766        /* outcome */ return this.outcome == null ? new Base[0] : new Base[] { this.outcome }; // CodeableConcept
767      case -1290561483:
768        /* probability */ return this.probability == null ? new Base[0] : new Base[] { this.probability }; // Type
769      case 123308730:
770        /* qualitativeRisk */ return this.qualitativeRisk == null ? new Base[0] : new Base[] { this.qualitativeRisk }; // CodeableConcept
771      case -70741061:
772        /* relativeRisk */ return this.relativeRisk == null ? new Base[0] : new Base[] { this.relativeRisk }; // DecimalType
773      case 3648314:
774        /* when */ return this.when == null ? new Base[0] : new Base[] { this.when }; // Type
775      case 345689335:
776        /* rationale */ return this.rationale == null ? new Base[0] : new Base[] { this.rationale }; // StringType
777      default:
778        return super.getProperty(hash, name, checkValid);
779      }
780
781    }
782
783    @Override
784    public Base setProperty(int hash, String name, Base value) throws FHIRException {
785      switch (hash) {
786      case -1106507950: // outcome
787        this.outcome = castToCodeableConcept(value); // CodeableConcept
788        return value;
789      case -1290561483: // probability
790        this.probability = castToType(value); // Type
791        return value;
792      case 123308730: // qualitativeRisk
793        this.qualitativeRisk = castToCodeableConcept(value); // CodeableConcept
794        return value;
795      case -70741061: // relativeRisk
796        this.relativeRisk = castToDecimal(value); // DecimalType
797        return value;
798      case 3648314: // when
799        this.when = castToType(value); // Type
800        return value;
801      case 345689335: // rationale
802        this.rationale = castToString(value); // StringType
803        return value;
804      default:
805        return super.setProperty(hash, name, value);
806      }
807
808    }
809
810    @Override
811    public Base setProperty(String name, Base value) throws FHIRException {
812      if (name.equals("outcome")) {
813        this.outcome = castToCodeableConcept(value); // CodeableConcept
814      } else if (name.equals("probability[x]")) {
815        this.probability = castToType(value); // Type
816      } else if (name.equals("qualitativeRisk")) {
817        this.qualitativeRisk = castToCodeableConcept(value); // CodeableConcept
818      } else if (name.equals("relativeRisk")) {
819        this.relativeRisk = castToDecimal(value); // DecimalType
820      } else if (name.equals("when[x]")) {
821        this.when = castToType(value); // Type
822      } else if (name.equals("rationale")) {
823        this.rationale = castToString(value); // StringType
824      } else
825        return super.setProperty(name, value);
826      return value;
827    }
828
829    @Override
830    public Base makeProperty(int hash, String name) throws FHIRException {
831      switch (hash) {
832      case -1106507950:
833        return getOutcome();
834      case 1430185003:
835        return getProbability();
836      case -1290561483:
837        return getProbability();
838      case 123308730:
839        return getQualitativeRisk();
840      case -70741061:
841        return getRelativeRiskElement();
842      case 1312831238:
843        return getWhen();
844      case 3648314:
845        return getWhen();
846      case 345689335:
847        return getRationaleElement();
848      default:
849        return super.makeProperty(hash, name);
850      }
851
852    }
853
854    @Override
855    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
856      switch (hash) {
857      case -1106507950:
858        /* outcome */ return new String[] { "CodeableConcept" };
859      case -1290561483:
860        /* probability */ return new String[] { "decimal", "Range" };
861      case 123308730:
862        /* qualitativeRisk */ return new String[] { "CodeableConcept" };
863      case -70741061:
864        /* relativeRisk */ return new String[] { "decimal" };
865      case 3648314:
866        /* when */ return new String[] { "Period", "Range" };
867      case 345689335:
868        /* rationale */ return new String[] { "string" };
869      default:
870        return super.getTypesForProperty(hash, name);
871      }
872
873    }
874
875    @Override
876    public Base addChild(String name) throws FHIRException {
877      if (name.equals("outcome")) {
878        this.outcome = new CodeableConcept();
879        return this.outcome;
880      } else if (name.equals("probabilityDecimal")) {
881        this.probability = new DecimalType();
882        return this.probability;
883      } else if (name.equals("probabilityRange")) {
884        this.probability = new Range();
885        return this.probability;
886      } else if (name.equals("qualitativeRisk")) {
887        this.qualitativeRisk = new CodeableConcept();
888        return this.qualitativeRisk;
889      } else if (name.equals("relativeRisk")) {
890        throw new FHIRException("Cannot call addChild on a singleton property RiskAssessment.relativeRisk");
891      } else if (name.equals("whenPeriod")) {
892        this.when = new Period();
893        return this.when;
894      } else if (name.equals("whenRange")) {
895        this.when = new Range();
896        return this.when;
897      } else if (name.equals("rationale")) {
898        throw new FHIRException("Cannot call addChild on a singleton property RiskAssessment.rationale");
899      } else
900        return super.addChild(name);
901    }
902
903    public RiskAssessmentPredictionComponent copy() {
904      RiskAssessmentPredictionComponent dst = new RiskAssessmentPredictionComponent();
905      copyValues(dst);
906      return dst;
907    }
908
909    public void copyValues(RiskAssessmentPredictionComponent dst) {
910      super.copyValues(dst);
911      dst.outcome = outcome == null ? null : outcome.copy();
912      dst.probability = probability == null ? null : probability.copy();
913      dst.qualitativeRisk = qualitativeRisk == null ? null : qualitativeRisk.copy();
914      dst.relativeRisk = relativeRisk == null ? null : relativeRisk.copy();
915      dst.when = when == null ? null : when.copy();
916      dst.rationale = rationale == null ? null : rationale.copy();
917    }
918
919    @Override
920    public boolean equalsDeep(Base other_) {
921      if (!super.equalsDeep(other_))
922        return false;
923      if (!(other_ instanceof RiskAssessmentPredictionComponent))
924        return false;
925      RiskAssessmentPredictionComponent o = (RiskAssessmentPredictionComponent) other_;
926      return compareDeep(outcome, o.outcome, true) && compareDeep(probability, o.probability, true)
927          && compareDeep(qualitativeRisk, o.qualitativeRisk, true) && compareDeep(relativeRisk, o.relativeRisk, true)
928          && compareDeep(when, o.when, true) && compareDeep(rationale, o.rationale, true);
929    }
930
931    @Override
932    public boolean equalsShallow(Base other_) {
933      if (!super.equalsShallow(other_))
934        return false;
935      if (!(other_ instanceof RiskAssessmentPredictionComponent))
936        return false;
937      RiskAssessmentPredictionComponent o = (RiskAssessmentPredictionComponent) other_;
938      return compareValues(relativeRisk, o.relativeRisk, true) && compareValues(rationale, o.rationale, true);
939    }
940
941    public boolean isEmpty() {
942      return super.isEmpty()
943          && ca.uhn.fhir.util.ElementUtil.isEmpty(outcome, probability, qualitativeRisk, relativeRisk, when, rationale);
944    }
945
946    public String fhirType() {
947      return "RiskAssessment.prediction";
948
949    }
950
951  }
952
953  /**
954   * Business identifier assigned to the risk assessment.
955   */
956  @Child(name = "identifier", type = {
957      Identifier.class }, order = 0, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
958  @Description(shortDefinition = "Unique identifier for the assessment", formalDefinition = "Business identifier assigned to the risk assessment.")
959  protected List<Identifier> identifier;
960
961  /**
962   * A reference to the request that is fulfilled by this risk assessment.
963   */
964  @Child(name = "basedOn", type = { Reference.class }, order = 1, min = 0, max = 1, modifier = false, summary = false)
965  @Description(shortDefinition = "Request fulfilled by this assessment", formalDefinition = "A reference to the request that is fulfilled by this risk assessment.")
966  protected Reference basedOn;
967
968  /**
969   * The actual object that is the target of the reference (A reference to the
970   * request that is fulfilled by this risk assessment.)
971   */
972  protected Resource basedOnTarget;
973
974  /**
975   * A reference to a resource that this risk assessment is part of, such as a
976   * Procedure.
977   */
978  @Child(name = "parent", type = { Reference.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
979  @Description(shortDefinition = "Part of this occurrence", formalDefinition = "A reference to a resource that this risk assessment is part of, such as a Procedure.")
980  protected Reference parent;
981
982  /**
983   * The actual object that is the target of the reference (A reference to a
984   * resource that this risk assessment is part of, such as a Procedure.)
985   */
986  protected Resource parentTarget;
987
988  /**
989   * The status of the RiskAssessment, using the same statuses as an Observation.
990   */
991  @Child(name = "status", type = { CodeType.class }, order = 3, min = 1, max = 1, modifier = false, summary = true)
992  @Description(shortDefinition = "registered | preliminary | final | amended +", formalDefinition = "The status of the RiskAssessment, using the same statuses as an Observation.")
993  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/observation-status")
994  protected Enumeration<RiskAssessmentStatus> status;
995
996  /**
997   * The algorithm, process or mechanism used to evaluate the risk.
998   */
999  @Child(name = "method", type = {
1000      CodeableConcept.class }, order = 4, min = 0, max = 1, modifier = false, summary = true)
1001  @Description(shortDefinition = "Evaluation mechanism", formalDefinition = "The algorithm, process or mechanism used to evaluate the risk.")
1002  protected CodeableConcept method;
1003
1004  /**
1005   * The type of the risk assessment performed.
1006   */
1007  @Child(name = "code", type = { CodeableConcept.class }, order = 5, min = 0, max = 1, modifier = false, summary = true)
1008  @Description(shortDefinition = "Type of assessment", formalDefinition = "The type of the risk assessment performed.")
1009  protected CodeableConcept code;
1010
1011  /**
1012   * The patient or group the risk assessment applies to.
1013   */
1014  @Child(name = "subject", type = { Patient.class,
1015      Group.class }, order = 6, min = 1, max = 1, modifier = false, summary = true)
1016  @Description(shortDefinition = "Who/what does assessment apply to?", formalDefinition = "The patient or group the risk assessment applies to.")
1017  protected Reference subject;
1018
1019  /**
1020   * The actual object that is the target of the reference (The patient or group
1021   * the risk assessment applies to.)
1022   */
1023  protected Resource subjectTarget;
1024
1025  /**
1026   * The encounter where the assessment was performed.
1027   */
1028  @Child(name = "encounter", type = { Encounter.class }, order = 7, min = 0, max = 1, modifier = false, summary = true)
1029  @Description(shortDefinition = "Where was assessment performed?", formalDefinition = "The encounter where the assessment was performed.")
1030  protected Reference encounter;
1031
1032  /**
1033   * The actual object that is the target of the reference (The encounter where
1034   * the assessment was performed.)
1035   */
1036  protected Encounter encounterTarget;
1037
1038  /**
1039   * The date (and possibly time) the risk assessment was performed.
1040   */
1041  @Child(name = "occurrence", type = { DateTimeType.class,
1042      Period.class }, order = 8, min = 0, max = 1, modifier = false, summary = true)
1043  @Description(shortDefinition = "When was assessment made?", formalDefinition = "The date (and possibly time) the risk assessment was performed.")
1044  protected Type occurrence;
1045
1046  /**
1047   * For assessments or prognosis specific to a particular condition, indicates
1048   * the condition being assessed.
1049   */
1050  @Child(name = "condition", type = { Condition.class }, order = 9, min = 0, max = 1, modifier = false, summary = true)
1051  @Description(shortDefinition = "Condition assessed", formalDefinition = "For assessments or prognosis specific to a particular condition, indicates the condition being assessed.")
1052  protected Reference condition;
1053
1054  /**
1055   * The actual object that is the target of the reference (For assessments or
1056   * prognosis specific to a particular condition, indicates the condition being
1057   * assessed.)
1058   */
1059  protected Condition conditionTarget;
1060
1061  /**
1062   * The provider or software application that performed the assessment.
1063   */
1064  @Child(name = "performer", type = { Practitioner.class, PractitionerRole.class,
1065      Device.class }, order = 10, min = 0, max = 1, modifier = false, summary = true)
1066  @Description(shortDefinition = "Who did assessment?", formalDefinition = "The provider or software application that performed the assessment.")
1067  protected Reference performer;
1068
1069  /**
1070   * The actual object that is the target of the reference (The provider or
1071   * software application that performed the assessment.)
1072   */
1073  protected Resource performerTarget;
1074
1075  /**
1076   * The reason the risk assessment was performed.
1077   */
1078  @Child(name = "reasonCode", type = {
1079      CodeableConcept.class }, order = 11, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1080  @Description(shortDefinition = "Why the assessment was necessary?", formalDefinition = "The reason the risk assessment was performed.")
1081  protected List<CodeableConcept> reasonCode;
1082
1083  /**
1084   * Resources supporting the reason the risk assessment was performed.
1085   */
1086  @Child(name = "reasonReference", type = { Condition.class, Observation.class, DiagnosticReport.class,
1087      DocumentReference.class }, order = 12, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1088  @Description(shortDefinition = "Why the assessment was necessary?", formalDefinition = "Resources supporting the reason the risk assessment was performed.")
1089  protected List<Reference> reasonReference;
1090  /**
1091   * The actual objects that are the target of the reference (Resources supporting
1092   * the reason the risk assessment was performed.)
1093   */
1094  protected List<Resource> reasonReferenceTarget;
1095
1096  /**
1097   * Indicates the source data considered as part of the assessment (for example,
1098   * FamilyHistory, Observations, Procedures, Conditions, etc.).
1099   */
1100  @Child(name = "basis", type = {
1101      Reference.class }, order = 13, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1102  @Description(shortDefinition = "Information used in assessment", formalDefinition = "Indicates the source data considered as part of the assessment (for example, FamilyHistory, Observations, Procedures, Conditions, etc.).")
1103  protected List<Reference> basis;
1104  /**
1105   * The actual objects that are the target of the reference (Indicates the source
1106   * data considered as part of the assessment (for example, FamilyHistory,
1107   * Observations, Procedures, Conditions, etc.).)
1108   */
1109  protected List<Resource> basisTarget;
1110
1111  /**
1112   * Describes the expected outcome for the subject.
1113   */
1114  @Child(name = "prediction", type = {}, order = 14, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1115  @Description(shortDefinition = "Outcome predicted", formalDefinition = "Describes the expected outcome for the subject.")
1116  protected List<RiskAssessmentPredictionComponent> prediction;
1117
1118  /**
1119   * A description of the steps that might be taken to reduce the identified
1120   * risk(s).
1121   */
1122  @Child(name = "mitigation", type = {
1123      StringType.class }, order = 15, min = 0, max = 1, modifier = false, summary = false)
1124  @Description(shortDefinition = "How to reduce risk", formalDefinition = "A description of the steps that might be taken to reduce the identified risk(s).")
1125  protected StringType mitigation;
1126
1127  /**
1128   * Additional comments about the risk assessment.
1129   */
1130  @Child(name = "note", type = {
1131      Annotation.class }, order = 16, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1132  @Description(shortDefinition = "Comments on the risk assessment", formalDefinition = "Additional comments about the risk assessment.")
1133  protected List<Annotation> note;
1134
1135  private static final long serialVersionUID = -2137260218L;
1136
1137  /**
1138   * Constructor
1139   */
1140  public RiskAssessment() {
1141    super();
1142  }
1143
1144  /**
1145   * Constructor
1146   */
1147  public RiskAssessment(Enumeration<RiskAssessmentStatus> status, Reference subject) {
1148    super();
1149    this.status = status;
1150    this.subject = subject;
1151  }
1152
1153  /**
1154   * @return {@link #identifier} (Business identifier assigned to the risk
1155   *         assessment.)
1156   */
1157  public List<Identifier> getIdentifier() {
1158    if (this.identifier == null)
1159      this.identifier = new ArrayList<Identifier>();
1160    return this.identifier;
1161  }
1162
1163  /**
1164   * @return Returns a reference to <code>this</code> for easy method chaining
1165   */
1166  public RiskAssessment setIdentifier(List<Identifier> theIdentifier) {
1167    this.identifier = theIdentifier;
1168    return this;
1169  }
1170
1171  public boolean hasIdentifier() {
1172    if (this.identifier == null)
1173      return false;
1174    for (Identifier item : this.identifier)
1175      if (!item.isEmpty())
1176        return true;
1177    return false;
1178  }
1179
1180  public Identifier addIdentifier() { // 3
1181    Identifier t = new Identifier();
1182    if (this.identifier == null)
1183      this.identifier = new ArrayList<Identifier>();
1184    this.identifier.add(t);
1185    return t;
1186  }
1187
1188  public RiskAssessment addIdentifier(Identifier t) { // 3
1189    if (t == null)
1190      return this;
1191    if (this.identifier == null)
1192      this.identifier = new ArrayList<Identifier>();
1193    this.identifier.add(t);
1194    return this;
1195  }
1196
1197  /**
1198   * @return The first repetition of repeating field {@link #identifier}, creating
1199   *         it if it does not already exist
1200   */
1201  public Identifier getIdentifierFirstRep() {
1202    if (getIdentifier().isEmpty()) {
1203      addIdentifier();
1204    }
1205    return getIdentifier().get(0);
1206  }
1207
1208  /**
1209   * @return {@link #basedOn} (A reference to the request that is fulfilled by
1210   *         this risk assessment.)
1211   */
1212  public Reference getBasedOn() {
1213    if (this.basedOn == null)
1214      if (Configuration.errorOnAutoCreate())
1215        throw new Error("Attempt to auto-create RiskAssessment.basedOn");
1216      else if (Configuration.doAutoCreate())
1217        this.basedOn = new Reference(); // cc
1218    return this.basedOn;
1219  }
1220
1221  public boolean hasBasedOn() {
1222    return this.basedOn != null && !this.basedOn.isEmpty();
1223  }
1224
1225  /**
1226   * @param value {@link #basedOn} (A reference to the request that is fulfilled
1227   *              by this risk assessment.)
1228   */
1229  public RiskAssessment setBasedOn(Reference value) {
1230    this.basedOn = value;
1231    return this;
1232  }
1233
1234  /**
1235   * @return {@link #basedOn} The actual object that is the target of the
1236   *         reference. The reference library doesn't populate this, but you can
1237   *         use it to hold the resource if you resolve it. (A reference to the
1238   *         request that is fulfilled by this risk assessment.)
1239   */
1240  public Resource getBasedOnTarget() {
1241    return this.basedOnTarget;
1242  }
1243
1244  /**
1245   * @param value {@link #basedOn} The actual object that is the target of the
1246   *              reference. The reference library doesn't use these, but you can
1247   *              use it to hold the resource if you resolve it. (A reference to
1248   *              the request that is fulfilled by this risk assessment.)
1249   */
1250  public RiskAssessment setBasedOnTarget(Resource value) {
1251    this.basedOnTarget = value;
1252    return this;
1253  }
1254
1255  /**
1256   * @return {@link #parent} (A reference to a resource that this risk assessment
1257   *         is part of, such as a Procedure.)
1258   */
1259  public Reference getParent() {
1260    if (this.parent == null)
1261      if (Configuration.errorOnAutoCreate())
1262        throw new Error("Attempt to auto-create RiskAssessment.parent");
1263      else if (Configuration.doAutoCreate())
1264        this.parent = new Reference(); // cc
1265    return this.parent;
1266  }
1267
1268  public boolean hasParent() {
1269    return this.parent != null && !this.parent.isEmpty();
1270  }
1271
1272  /**
1273   * @param value {@link #parent} (A reference to a resource that this risk
1274   *              assessment is part of, such as a Procedure.)
1275   */
1276  public RiskAssessment setParent(Reference value) {
1277    this.parent = value;
1278    return this;
1279  }
1280
1281  /**
1282   * @return {@link #parent} The actual object that is the target of the
1283   *         reference. The reference library doesn't populate this, but you can
1284   *         use it to hold the resource if you resolve it. (A reference to a
1285   *         resource that this risk assessment is part of, such as a Procedure.)
1286   */
1287  public Resource getParentTarget() {
1288    return this.parentTarget;
1289  }
1290
1291  /**
1292   * @param value {@link #parent} The actual object that is the target of the
1293   *              reference. The reference library doesn't use these, but you can
1294   *              use it to hold the resource if you resolve it. (A reference to a
1295   *              resource that this risk assessment is part of, such as a
1296   *              Procedure.)
1297   */
1298  public RiskAssessment setParentTarget(Resource value) {
1299    this.parentTarget = value;
1300    return this;
1301  }
1302
1303  /**
1304   * @return {@link #status} (The status of the RiskAssessment, using the same
1305   *         statuses as an Observation.). This is the underlying object with id,
1306   *         value and extensions. The accessor "getStatus" gives direct access to
1307   *         the value
1308   */
1309  public Enumeration<RiskAssessmentStatus> getStatusElement() {
1310    if (this.status == null)
1311      if (Configuration.errorOnAutoCreate())
1312        throw new Error("Attempt to auto-create RiskAssessment.status");
1313      else if (Configuration.doAutoCreate())
1314        this.status = new Enumeration<RiskAssessmentStatus>(new RiskAssessmentStatusEnumFactory()); // bb
1315    return this.status;
1316  }
1317
1318  public boolean hasStatusElement() {
1319    return this.status != null && !this.status.isEmpty();
1320  }
1321
1322  public boolean hasStatus() {
1323    return this.status != null && !this.status.isEmpty();
1324  }
1325
1326  /**
1327   * @param value {@link #status} (The status of the RiskAssessment, using the
1328   *              same statuses as an Observation.). This is the underlying object
1329   *              with id, value and extensions. The accessor "getStatus" gives
1330   *              direct access to the value
1331   */
1332  public RiskAssessment setStatusElement(Enumeration<RiskAssessmentStatus> value) {
1333    this.status = value;
1334    return this;
1335  }
1336
1337  /**
1338   * @return The status of the RiskAssessment, using the same statuses as an
1339   *         Observation.
1340   */
1341  public RiskAssessmentStatus getStatus() {
1342    return this.status == null ? null : this.status.getValue();
1343  }
1344
1345  /**
1346   * @param value The status of the RiskAssessment, using the same statuses as an
1347   *              Observation.
1348   */
1349  public RiskAssessment setStatus(RiskAssessmentStatus value) {
1350    if (this.status == null)
1351      this.status = new Enumeration<RiskAssessmentStatus>(new RiskAssessmentStatusEnumFactory());
1352    this.status.setValue(value);
1353    return this;
1354  }
1355
1356  /**
1357   * @return {@link #method} (The algorithm, process or mechanism used to evaluate
1358   *         the risk.)
1359   */
1360  public CodeableConcept getMethod() {
1361    if (this.method == null)
1362      if (Configuration.errorOnAutoCreate())
1363        throw new Error("Attempt to auto-create RiskAssessment.method");
1364      else if (Configuration.doAutoCreate())
1365        this.method = new CodeableConcept(); // cc
1366    return this.method;
1367  }
1368
1369  public boolean hasMethod() {
1370    return this.method != null && !this.method.isEmpty();
1371  }
1372
1373  /**
1374   * @param value {@link #method} (The algorithm, process or mechanism used to
1375   *              evaluate the risk.)
1376   */
1377  public RiskAssessment setMethod(CodeableConcept value) {
1378    this.method = value;
1379    return this;
1380  }
1381
1382  /**
1383   * @return {@link #code} (The type of the risk assessment performed.)
1384   */
1385  public CodeableConcept getCode() {
1386    if (this.code == null)
1387      if (Configuration.errorOnAutoCreate())
1388        throw new Error("Attempt to auto-create RiskAssessment.code");
1389      else if (Configuration.doAutoCreate())
1390        this.code = new CodeableConcept(); // cc
1391    return this.code;
1392  }
1393
1394  public boolean hasCode() {
1395    return this.code != null && !this.code.isEmpty();
1396  }
1397
1398  /**
1399   * @param value {@link #code} (The type of the risk assessment performed.)
1400   */
1401  public RiskAssessment setCode(CodeableConcept value) {
1402    this.code = value;
1403    return this;
1404  }
1405
1406  /**
1407   * @return {@link #subject} (The patient or group the risk assessment applies
1408   *         to.)
1409   */
1410  public Reference getSubject() {
1411    if (this.subject == null)
1412      if (Configuration.errorOnAutoCreate())
1413        throw new Error("Attempt to auto-create RiskAssessment.subject");
1414      else if (Configuration.doAutoCreate())
1415        this.subject = new Reference(); // cc
1416    return this.subject;
1417  }
1418
1419  public boolean hasSubject() {
1420    return this.subject != null && !this.subject.isEmpty();
1421  }
1422
1423  /**
1424   * @param value {@link #subject} (The patient or group the risk assessment
1425   *              applies to.)
1426   */
1427  public RiskAssessment setSubject(Reference value) {
1428    this.subject = value;
1429    return this;
1430  }
1431
1432  /**
1433   * @return {@link #subject} The actual object that is the target of the
1434   *         reference. The reference library doesn't populate this, but you can
1435   *         use it to hold the resource if you resolve it. (The patient or group
1436   *         the risk assessment applies to.)
1437   */
1438  public Resource getSubjectTarget() {
1439    return this.subjectTarget;
1440  }
1441
1442  /**
1443   * @param value {@link #subject} The actual object that is the target of the
1444   *              reference. The reference library doesn't use these, but you can
1445   *              use it to hold the resource if you resolve it. (The patient or
1446   *              group the risk assessment applies to.)
1447   */
1448  public RiskAssessment setSubjectTarget(Resource value) {
1449    this.subjectTarget = value;
1450    return this;
1451  }
1452
1453  /**
1454   * @return {@link #encounter} (The encounter where the assessment was
1455   *         performed.)
1456   */
1457  public Reference getEncounter() {
1458    if (this.encounter == null)
1459      if (Configuration.errorOnAutoCreate())
1460        throw new Error("Attempt to auto-create RiskAssessment.encounter");
1461      else if (Configuration.doAutoCreate())
1462        this.encounter = new Reference(); // cc
1463    return this.encounter;
1464  }
1465
1466  public boolean hasEncounter() {
1467    return this.encounter != null && !this.encounter.isEmpty();
1468  }
1469
1470  /**
1471   * @param value {@link #encounter} (The encounter where the assessment was
1472   *              performed.)
1473   */
1474  public RiskAssessment setEncounter(Reference value) {
1475    this.encounter = value;
1476    return this;
1477  }
1478
1479  /**
1480   * @return {@link #encounter} The actual object that is the target of the
1481   *         reference. The reference library doesn't populate this, but you can
1482   *         use it to hold the resource if you resolve it. (The encounter where
1483   *         the assessment was performed.)
1484   */
1485  public Encounter getEncounterTarget() {
1486    if (this.encounterTarget == null)
1487      if (Configuration.errorOnAutoCreate())
1488        throw new Error("Attempt to auto-create RiskAssessment.encounter");
1489      else if (Configuration.doAutoCreate())
1490        this.encounterTarget = new Encounter(); // aa
1491    return this.encounterTarget;
1492  }
1493
1494  /**
1495   * @param value {@link #encounter} The actual object that is the target of the
1496   *              reference. The reference library doesn't use these, but you can
1497   *              use it to hold the resource if you resolve it. (The encounter
1498   *              where the assessment was performed.)
1499   */
1500  public RiskAssessment setEncounterTarget(Encounter value) {
1501    this.encounterTarget = value;
1502    return this;
1503  }
1504
1505  /**
1506   * @return {@link #occurrence} (The date (and possibly time) the risk assessment
1507   *         was performed.)
1508   */
1509  public Type getOccurrence() {
1510    return this.occurrence;
1511  }
1512
1513  /**
1514   * @return {@link #occurrence} (The date (and possibly time) the risk assessment
1515   *         was performed.)
1516   */
1517  public DateTimeType getOccurrenceDateTimeType() throws FHIRException {
1518    if (this.occurrence == null)
1519      this.occurrence = new DateTimeType();
1520    if (!(this.occurrence instanceof DateTimeType))
1521      throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "
1522          + this.occurrence.getClass().getName() + " was encountered");
1523    return (DateTimeType) this.occurrence;
1524  }
1525
1526  public boolean hasOccurrenceDateTimeType() {
1527    return this != null && this.occurrence instanceof DateTimeType;
1528  }
1529
1530  /**
1531   * @return {@link #occurrence} (The date (and possibly time) the risk assessment
1532   *         was performed.)
1533   */
1534  public Period getOccurrencePeriod() throws FHIRException {
1535    if (this.occurrence == null)
1536      this.occurrence = new Period();
1537    if (!(this.occurrence instanceof Period))
1538      throw new FHIRException("Type mismatch: the type Period was expected, but " + this.occurrence.getClass().getName()
1539          + " was encountered");
1540    return (Period) this.occurrence;
1541  }
1542
1543  public boolean hasOccurrencePeriod() {
1544    return this != null && this.occurrence instanceof Period;
1545  }
1546
1547  public boolean hasOccurrence() {
1548    return this.occurrence != null && !this.occurrence.isEmpty();
1549  }
1550
1551  /**
1552   * @param value {@link #occurrence} (The date (and possibly time) the risk
1553   *              assessment was performed.)
1554   */
1555  public RiskAssessment setOccurrence(Type value) {
1556    if (value != null && !(value instanceof DateTimeType || value instanceof Period))
1557      throw new Error("Not the right type for RiskAssessment.occurrence[x]: " + value.fhirType());
1558    this.occurrence = value;
1559    return this;
1560  }
1561
1562  /**
1563   * @return {@link #condition} (For assessments or prognosis specific to a
1564   *         particular condition, indicates the condition being assessed.)
1565   */
1566  public Reference getCondition() {
1567    if (this.condition == null)
1568      if (Configuration.errorOnAutoCreate())
1569        throw new Error("Attempt to auto-create RiskAssessment.condition");
1570      else if (Configuration.doAutoCreate())
1571        this.condition = new Reference(); // cc
1572    return this.condition;
1573  }
1574
1575  public boolean hasCondition() {
1576    return this.condition != null && !this.condition.isEmpty();
1577  }
1578
1579  /**
1580   * @param value {@link #condition} (For assessments or prognosis specific to a
1581   *              particular condition, indicates the condition being assessed.)
1582   */
1583  public RiskAssessment setCondition(Reference value) {
1584    this.condition = value;
1585    return this;
1586  }
1587
1588  /**
1589   * @return {@link #condition} The actual object that is the target of the
1590   *         reference. The reference library doesn't populate this, but you can
1591   *         use it to hold the resource if you resolve it. (For assessments or
1592   *         prognosis specific to a particular condition, indicates the condition
1593   *         being assessed.)
1594   */
1595  public Condition getConditionTarget() {
1596    if (this.conditionTarget == null)
1597      if (Configuration.errorOnAutoCreate())
1598        throw new Error("Attempt to auto-create RiskAssessment.condition");
1599      else if (Configuration.doAutoCreate())
1600        this.conditionTarget = new Condition(); // aa
1601    return this.conditionTarget;
1602  }
1603
1604  /**
1605   * @param value {@link #condition} The actual object that is the target of the
1606   *              reference. The reference library doesn't use these, but you can
1607   *              use it to hold the resource if you resolve it. (For assessments
1608   *              or prognosis specific to a particular condition, indicates the
1609   *              condition being assessed.)
1610   */
1611  public RiskAssessment setConditionTarget(Condition value) {
1612    this.conditionTarget = value;
1613    return this;
1614  }
1615
1616  /**
1617   * @return {@link #performer} (The provider or software application that
1618   *         performed the assessment.)
1619   */
1620  public Reference getPerformer() {
1621    if (this.performer == null)
1622      if (Configuration.errorOnAutoCreate())
1623        throw new Error("Attempt to auto-create RiskAssessment.performer");
1624      else if (Configuration.doAutoCreate())
1625        this.performer = new Reference(); // cc
1626    return this.performer;
1627  }
1628
1629  public boolean hasPerformer() {
1630    return this.performer != null && !this.performer.isEmpty();
1631  }
1632
1633  /**
1634   * @param value {@link #performer} (The provider or software application that
1635   *              performed the assessment.)
1636   */
1637  public RiskAssessment setPerformer(Reference value) {
1638    this.performer = value;
1639    return this;
1640  }
1641
1642  /**
1643   * @return {@link #performer} The actual object that is the target of the
1644   *         reference. The reference library doesn't populate this, but you can
1645   *         use it to hold the resource if you resolve it. (The provider or
1646   *         software application that performed the assessment.)
1647   */
1648  public Resource getPerformerTarget() {
1649    return this.performerTarget;
1650  }
1651
1652  /**
1653   * @param value {@link #performer} The actual object that is the target of the
1654   *              reference. The reference library doesn't use these, but you can
1655   *              use it to hold the resource if you resolve it. (The provider or
1656   *              software application that performed the assessment.)
1657   */
1658  public RiskAssessment setPerformerTarget(Resource value) {
1659    this.performerTarget = value;
1660    return this;
1661  }
1662
1663  /**
1664   * @return {@link #reasonCode} (The reason the risk assessment was performed.)
1665   */
1666  public List<CodeableConcept> getReasonCode() {
1667    if (this.reasonCode == null)
1668      this.reasonCode = new ArrayList<CodeableConcept>();
1669    return this.reasonCode;
1670  }
1671
1672  /**
1673   * @return Returns a reference to <code>this</code> for easy method chaining
1674   */
1675  public RiskAssessment setReasonCode(List<CodeableConcept> theReasonCode) {
1676    this.reasonCode = theReasonCode;
1677    return this;
1678  }
1679
1680  public boolean hasReasonCode() {
1681    if (this.reasonCode == null)
1682      return false;
1683    for (CodeableConcept item : this.reasonCode)
1684      if (!item.isEmpty())
1685        return true;
1686    return false;
1687  }
1688
1689  public CodeableConcept addReasonCode() { // 3
1690    CodeableConcept t = new CodeableConcept();
1691    if (this.reasonCode == null)
1692      this.reasonCode = new ArrayList<CodeableConcept>();
1693    this.reasonCode.add(t);
1694    return t;
1695  }
1696
1697  public RiskAssessment addReasonCode(CodeableConcept t) { // 3
1698    if (t == null)
1699      return this;
1700    if (this.reasonCode == null)
1701      this.reasonCode = new ArrayList<CodeableConcept>();
1702    this.reasonCode.add(t);
1703    return this;
1704  }
1705
1706  /**
1707   * @return The first repetition of repeating field {@link #reasonCode}, creating
1708   *         it if it does not already exist
1709   */
1710  public CodeableConcept getReasonCodeFirstRep() {
1711    if (getReasonCode().isEmpty()) {
1712      addReasonCode();
1713    }
1714    return getReasonCode().get(0);
1715  }
1716
1717  /**
1718   * @return {@link #reasonReference} (Resources supporting the reason the risk
1719   *         assessment was performed.)
1720   */
1721  public List<Reference> getReasonReference() {
1722    if (this.reasonReference == null)
1723      this.reasonReference = new ArrayList<Reference>();
1724    return this.reasonReference;
1725  }
1726
1727  /**
1728   * @return Returns a reference to <code>this</code> for easy method chaining
1729   */
1730  public RiskAssessment setReasonReference(List<Reference> theReasonReference) {
1731    this.reasonReference = theReasonReference;
1732    return this;
1733  }
1734
1735  public boolean hasReasonReference() {
1736    if (this.reasonReference == null)
1737      return false;
1738    for (Reference item : this.reasonReference)
1739      if (!item.isEmpty())
1740        return true;
1741    return false;
1742  }
1743
1744  public Reference addReasonReference() { // 3
1745    Reference t = new Reference();
1746    if (this.reasonReference == null)
1747      this.reasonReference = new ArrayList<Reference>();
1748    this.reasonReference.add(t);
1749    return t;
1750  }
1751
1752  public RiskAssessment addReasonReference(Reference t) { // 3
1753    if (t == null)
1754      return this;
1755    if (this.reasonReference == null)
1756      this.reasonReference = new ArrayList<Reference>();
1757    this.reasonReference.add(t);
1758    return this;
1759  }
1760
1761  /**
1762   * @return The first repetition of repeating field {@link #reasonReference},
1763   *         creating it if it does not already exist
1764   */
1765  public Reference getReasonReferenceFirstRep() {
1766    if (getReasonReference().isEmpty()) {
1767      addReasonReference();
1768    }
1769    return getReasonReference().get(0);
1770  }
1771
1772  /**
1773   * @deprecated Use Reference#setResource(IBaseResource) instead
1774   */
1775  @Deprecated
1776  public List<Resource> getReasonReferenceTarget() {
1777    if (this.reasonReferenceTarget == null)
1778      this.reasonReferenceTarget = new ArrayList<Resource>();
1779    return this.reasonReferenceTarget;
1780  }
1781
1782  /**
1783   * @return {@link #basis} (Indicates the source data considered as part of the
1784   *         assessment (for example, FamilyHistory, Observations, Procedures,
1785   *         Conditions, etc.).)
1786   */
1787  public List<Reference> getBasis() {
1788    if (this.basis == null)
1789      this.basis = new ArrayList<Reference>();
1790    return this.basis;
1791  }
1792
1793  /**
1794   * @return Returns a reference to <code>this</code> for easy method chaining
1795   */
1796  public RiskAssessment setBasis(List<Reference> theBasis) {
1797    this.basis = theBasis;
1798    return this;
1799  }
1800
1801  public boolean hasBasis() {
1802    if (this.basis == null)
1803      return false;
1804    for (Reference item : this.basis)
1805      if (!item.isEmpty())
1806        return true;
1807    return false;
1808  }
1809
1810  public Reference addBasis() { // 3
1811    Reference t = new Reference();
1812    if (this.basis == null)
1813      this.basis = new ArrayList<Reference>();
1814    this.basis.add(t);
1815    return t;
1816  }
1817
1818  public RiskAssessment addBasis(Reference t) { // 3
1819    if (t == null)
1820      return this;
1821    if (this.basis == null)
1822      this.basis = new ArrayList<Reference>();
1823    this.basis.add(t);
1824    return this;
1825  }
1826
1827  /**
1828   * @return The first repetition of repeating field {@link #basis}, creating it
1829   *         if it does not already exist
1830   */
1831  public Reference getBasisFirstRep() {
1832    if (getBasis().isEmpty()) {
1833      addBasis();
1834    }
1835    return getBasis().get(0);
1836  }
1837
1838  /**
1839   * @deprecated Use Reference#setResource(IBaseResource) instead
1840   */
1841  @Deprecated
1842  public List<Resource> getBasisTarget() {
1843    if (this.basisTarget == null)
1844      this.basisTarget = new ArrayList<Resource>();
1845    return this.basisTarget;
1846  }
1847
1848  /**
1849   * @return {@link #prediction} (Describes the expected outcome for the subject.)
1850   */
1851  public List<RiskAssessmentPredictionComponent> getPrediction() {
1852    if (this.prediction == null)
1853      this.prediction = new ArrayList<RiskAssessmentPredictionComponent>();
1854    return this.prediction;
1855  }
1856
1857  /**
1858   * @return Returns a reference to <code>this</code> for easy method chaining
1859   */
1860  public RiskAssessment setPrediction(List<RiskAssessmentPredictionComponent> thePrediction) {
1861    this.prediction = thePrediction;
1862    return this;
1863  }
1864
1865  public boolean hasPrediction() {
1866    if (this.prediction == null)
1867      return false;
1868    for (RiskAssessmentPredictionComponent item : this.prediction)
1869      if (!item.isEmpty())
1870        return true;
1871    return false;
1872  }
1873
1874  public RiskAssessmentPredictionComponent addPrediction() { // 3
1875    RiskAssessmentPredictionComponent t = new RiskAssessmentPredictionComponent();
1876    if (this.prediction == null)
1877      this.prediction = new ArrayList<RiskAssessmentPredictionComponent>();
1878    this.prediction.add(t);
1879    return t;
1880  }
1881
1882  public RiskAssessment addPrediction(RiskAssessmentPredictionComponent t) { // 3
1883    if (t == null)
1884      return this;
1885    if (this.prediction == null)
1886      this.prediction = new ArrayList<RiskAssessmentPredictionComponent>();
1887    this.prediction.add(t);
1888    return this;
1889  }
1890
1891  /**
1892   * @return The first repetition of repeating field {@link #prediction}, creating
1893   *         it if it does not already exist
1894   */
1895  public RiskAssessmentPredictionComponent getPredictionFirstRep() {
1896    if (getPrediction().isEmpty()) {
1897      addPrediction();
1898    }
1899    return getPrediction().get(0);
1900  }
1901
1902  /**
1903   * @return {@link #mitigation} (A description of the steps that might be taken
1904   *         to reduce the identified risk(s).). This is the underlying object
1905   *         with id, value and extensions. The accessor "getMitigation" gives
1906   *         direct access to the value
1907   */
1908  public StringType getMitigationElement() {
1909    if (this.mitigation == null)
1910      if (Configuration.errorOnAutoCreate())
1911        throw new Error("Attempt to auto-create RiskAssessment.mitigation");
1912      else if (Configuration.doAutoCreate())
1913        this.mitigation = new StringType(); // bb
1914    return this.mitigation;
1915  }
1916
1917  public boolean hasMitigationElement() {
1918    return this.mitigation != null && !this.mitigation.isEmpty();
1919  }
1920
1921  public boolean hasMitigation() {
1922    return this.mitigation != null && !this.mitigation.isEmpty();
1923  }
1924
1925  /**
1926   * @param value {@link #mitigation} (A description of the steps that might be
1927   *              taken to reduce the identified risk(s).). This is the underlying
1928   *              object with id, value and extensions. The accessor
1929   *              "getMitigation" gives direct access to the value
1930   */
1931  public RiskAssessment setMitigationElement(StringType value) {
1932    this.mitigation = value;
1933    return this;
1934  }
1935
1936  /**
1937   * @return A description of the steps that might be taken to reduce the
1938   *         identified risk(s).
1939   */
1940  public String getMitigation() {
1941    return this.mitigation == null ? null : this.mitigation.getValue();
1942  }
1943
1944  /**
1945   * @param value A description of the steps that might be taken to reduce the
1946   *              identified risk(s).
1947   */
1948  public RiskAssessment setMitigation(String value) {
1949    if (Utilities.noString(value))
1950      this.mitigation = null;
1951    else {
1952      if (this.mitigation == null)
1953        this.mitigation = new StringType();
1954      this.mitigation.setValue(value);
1955    }
1956    return this;
1957  }
1958
1959  /**
1960   * @return {@link #note} (Additional comments about the risk assessment.)
1961   */
1962  public List<Annotation> getNote() {
1963    if (this.note == null)
1964      this.note = new ArrayList<Annotation>();
1965    return this.note;
1966  }
1967
1968  /**
1969   * @return Returns a reference to <code>this</code> for easy method chaining
1970   */
1971  public RiskAssessment setNote(List<Annotation> theNote) {
1972    this.note = theNote;
1973    return this;
1974  }
1975
1976  public boolean hasNote() {
1977    if (this.note == null)
1978      return false;
1979    for (Annotation item : this.note)
1980      if (!item.isEmpty())
1981        return true;
1982    return false;
1983  }
1984
1985  public Annotation addNote() { // 3
1986    Annotation t = new Annotation();
1987    if (this.note == null)
1988      this.note = new ArrayList<Annotation>();
1989    this.note.add(t);
1990    return t;
1991  }
1992
1993  public RiskAssessment addNote(Annotation t) { // 3
1994    if (t == null)
1995      return this;
1996    if (this.note == null)
1997      this.note = new ArrayList<Annotation>();
1998    this.note.add(t);
1999    return this;
2000  }
2001
2002  /**
2003   * @return The first repetition of repeating field {@link #note}, creating it if
2004   *         it does not already exist
2005   */
2006  public Annotation getNoteFirstRep() {
2007    if (getNote().isEmpty()) {
2008      addNote();
2009    }
2010    return getNote().get(0);
2011  }
2012
2013  protected void listChildren(List<Property> children) {
2014    super.listChildren(children);
2015    children.add(new Property("identifier", "Identifier", "Business identifier assigned to the risk assessment.", 0,
2016        java.lang.Integer.MAX_VALUE, identifier));
2017    children.add(new Property("basedOn", "Reference(Any)",
2018        "A reference to the request that is fulfilled by this risk assessment.", 0, 1, basedOn));
2019    children.add(new Property("parent", "Reference(Any)",
2020        "A reference to a resource that this risk assessment is part of, such as a Procedure.", 0, 1, parent));
2021    children.add(new Property("status", "code",
2022        "The status of the RiskAssessment, using the same statuses as an Observation.", 0, 1, status));
2023    children.add(new Property("method", "CodeableConcept",
2024        "The algorithm, process or mechanism used to evaluate the risk.", 0, 1, method));
2025    children.add(new Property("code", "CodeableConcept", "The type of the risk assessment performed.", 0, 1, code));
2026    children.add(new Property("subject", "Reference(Patient|Group)",
2027        "The patient or group the risk assessment applies to.", 0, 1, subject));
2028    children.add(new Property("encounter", "Reference(Encounter)", "The encounter where the assessment was performed.",
2029        0, 1, encounter));
2030    children.add(new Property("occurrence[x]", "dateTime|Period",
2031        "The date (and possibly time) the risk assessment was performed.", 0, 1, occurrence));
2032    children.add(new Property("condition", "Reference(Condition)",
2033        "For assessments or prognosis specific to a particular condition, indicates the condition being assessed.", 0,
2034        1, condition));
2035    children.add(new Property("performer", "Reference(Practitioner|PractitionerRole|Device)",
2036        "The provider or software application that performed the assessment.", 0, 1, performer));
2037    children.add(new Property("reasonCode", "CodeableConcept", "The reason the risk assessment was performed.", 0,
2038        java.lang.Integer.MAX_VALUE, reasonCode));
2039    children.add(new Property("reasonReference", "Reference(Condition|Observation|DiagnosticReport|DocumentReference)",
2040        "Resources supporting the reason the risk assessment was performed.", 0, java.lang.Integer.MAX_VALUE,
2041        reasonReference));
2042    children.add(new Property("basis", "Reference(Any)",
2043        "Indicates the source data considered as part of the assessment (for example, FamilyHistory, Observations, Procedures, Conditions, etc.).",
2044        0, java.lang.Integer.MAX_VALUE, basis));
2045    children.add(new Property("prediction", "", "Describes the expected outcome for the subject.", 0,
2046        java.lang.Integer.MAX_VALUE, prediction));
2047    children.add(new Property("mitigation", "string",
2048        "A description of the steps that might be taken to reduce the identified risk(s).", 0, 1, mitigation));
2049    children.add(new Property("note", "Annotation", "Additional comments about the risk assessment.", 0,
2050        java.lang.Integer.MAX_VALUE, note));
2051  }
2052
2053  @Override
2054  public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2055    switch (_hash) {
2056    case -1618432855:
2057      /* identifier */ return new Property("identifier", "Identifier",
2058          "Business identifier assigned to the risk assessment.", 0, java.lang.Integer.MAX_VALUE, identifier);
2059    case -332612366:
2060      /* basedOn */ return new Property("basedOn", "Reference(Any)",
2061          "A reference to the request that is fulfilled by this risk assessment.", 0, 1, basedOn);
2062    case -995424086:
2063      /* parent */ return new Property("parent", "Reference(Any)",
2064          "A reference to a resource that this risk assessment is part of, such as a Procedure.", 0, 1, parent);
2065    case -892481550:
2066      /* status */ return new Property("status", "code",
2067          "The status of the RiskAssessment, using the same statuses as an Observation.", 0, 1, status);
2068    case -1077554975:
2069      /* method */ return new Property("method", "CodeableConcept",
2070          "The algorithm, process or mechanism used to evaluate the risk.", 0, 1, method);
2071    case 3059181:
2072      /* code */ return new Property("code", "CodeableConcept", "The type of the risk assessment performed.", 0, 1,
2073          code);
2074    case -1867885268:
2075      /* subject */ return new Property("subject", "Reference(Patient|Group)",
2076          "The patient or group the risk assessment applies to.", 0, 1, subject);
2077    case 1524132147:
2078      /* encounter */ return new Property("encounter", "Reference(Encounter)",
2079          "The encounter where the assessment was performed.", 0, 1, encounter);
2080    case -2022646513:
2081      /* occurrence[x] */ return new Property("occurrence[x]", "dateTime|Period",
2082          "The date (and possibly time) the risk assessment was performed.", 0, 1, occurrence);
2083    case 1687874001:
2084      /* occurrence */ return new Property("occurrence[x]", "dateTime|Period",
2085          "The date (and possibly time) the risk assessment was performed.", 0, 1, occurrence);
2086    case -298443636:
2087      /* occurrenceDateTime */ return new Property("occurrence[x]", "dateTime|Period",
2088          "The date (and possibly time) the risk assessment was performed.", 0, 1, occurrence);
2089    case 1397156594:
2090      /* occurrencePeriod */ return new Property("occurrence[x]", "dateTime|Period",
2091          "The date (and possibly time) the risk assessment was performed.", 0, 1, occurrence);
2092    case -861311717:
2093      /* condition */ return new Property("condition", "Reference(Condition)",
2094          "For assessments or prognosis specific to a particular condition, indicates the condition being assessed.", 0,
2095          1, condition);
2096    case 481140686:
2097      /* performer */ return new Property("performer", "Reference(Practitioner|PractitionerRole|Device)",
2098          "The provider or software application that performed the assessment.", 0, 1, performer);
2099    case 722137681:
2100      /* reasonCode */ return new Property("reasonCode", "CodeableConcept",
2101          "The reason the risk assessment was performed.", 0, java.lang.Integer.MAX_VALUE, reasonCode);
2102    case -1146218137:
2103      /* reasonReference */ return new Property("reasonReference",
2104          "Reference(Condition|Observation|DiagnosticReport|DocumentReference)",
2105          "Resources supporting the reason the risk assessment was performed.", 0, java.lang.Integer.MAX_VALUE,
2106          reasonReference);
2107    case 93508670:
2108      /* basis */ return new Property("basis", "Reference(Any)",
2109          "Indicates the source data considered as part of the assessment (for example, FamilyHistory, Observations, Procedures, Conditions, etc.).",
2110          0, java.lang.Integer.MAX_VALUE, basis);
2111    case 1161234575:
2112      /* prediction */ return new Property("prediction", "", "Describes the expected outcome for the subject.", 0,
2113          java.lang.Integer.MAX_VALUE, prediction);
2114    case 1293793087:
2115      /* mitigation */ return new Property("mitigation", "string",
2116          "A description of the steps that might be taken to reduce the identified risk(s).", 0, 1, mitigation);
2117    case 3387378:
2118      /* note */ return new Property("note", "Annotation", "Additional comments about the risk assessment.", 0,
2119          java.lang.Integer.MAX_VALUE, note);
2120    default:
2121      return super.getNamedProperty(_hash, _name, _checkValid);
2122    }
2123
2124  }
2125
2126  @Override
2127  public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2128    switch (hash) {
2129    case -1618432855:
2130      /* identifier */ return this.identifier == null ? new Base[0]
2131          : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2132    case -332612366:
2133      /* basedOn */ return this.basedOn == null ? new Base[0] : new Base[] { this.basedOn }; // Reference
2134    case -995424086:
2135      /* parent */ return this.parent == null ? new Base[0] : new Base[] { this.parent }; // Reference
2136    case -892481550:
2137      /* status */ return this.status == null ? new Base[0] : new Base[] { this.status }; // Enumeration<RiskAssessmentStatus>
2138    case -1077554975:
2139      /* method */ return this.method == null ? new Base[0] : new Base[] { this.method }; // CodeableConcept
2140    case 3059181:
2141      /* code */ return this.code == null ? new Base[0] : new Base[] { this.code }; // CodeableConcept
2142    case -1867885268:
2143      /* subject */ return this.subject == null ? new Base[0] : new Base[] { this.subject }; // Reference
2144    case 1524132147:
2145      /* encounter */ return this.encounter == null ? new Base[0] : new Base[] { this.encounter }; // Reference
2146    case 1687874001:
2147      /* occurrence */ return this.occurrence == null ? new Base[0] : new Base[] { this.occurrence }; // Type
2148    case -861311717:
2149      /* condition */ return this.condition == null ? new Base[0] : new Base[] { this.condition }; // Reference
2150    case 481140686:
2151      /* performer */ return this.performer == null ? new Base[0] : new Base[] { this.performer }; // Reference
2152    case 722137681:
2153      /* reasonCode */ return this.reasonCode == null ? new Base[0]
2154          : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept
2155    case -1146218137:
2156      /* reasonReference */ return this.reasonReference == null ? new Base[0]
2157          : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference
2158    case 93508670:
2159      /* basis */ return this.basis == null ? new Base[0] : this.basis.toArray(new Base[this.basis.size()]); // Reference
2160    case 1161234575:
2161      /* prediction */ return this.prediction == null ? new Base[0]
2162          : this.prediction.toArray(new Base[this.prediction.size()]); // RiskAssessmentPredictionComponent
2163    case 1293793087:
2164      /* mitigation */ return this.mitigation == null ? new Base[0] : new Base[] { this.mitigation }; // StringType
2165    case 3387378:
2166      /* note */ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
2167    default:
2168      return super.getProperty(hash, name, checkValid);
2169    }
2170
2171  }
2172
2173  @Override
2174  public Base setProperty(int hash, String name, Base value) throws FHIRException {
2175    switch (hash) {
2176    case -1618432855: // identifier
2177      this.getIdentifier().add(castToIdentifier(value)); // Identifier
2178      return value;
2179    case -332612366: // basedOn
2180      this.basedOn = castToReference(value); // Reference
2181      return value;
2182    case -995424086: // parent
2183      this.parent = castToReference(value); // Reference
2184      return value;
2185    case -892481550: // status
2186      value = new RiskAssessmentStatusEnumFactory().fromType(castToCode(value));
2187      this.status = (Enumeration) value; // Enumeration<RiskAssessmentStatus>
2188      return value;
2189    case -1077554975: // method
2190      this.method = castToCodeableConcept(value); // CodeableConcept
2191      return value;
2192    case 3059181: // code
2193      this.code = castToCodeableConcept(value); // CodeableConcept
2194      return value;
2195    case -1867885268: // subject
2196      this.subject = castToReference(value); // Reference
2197      return value;
2198    case 1524132147: // encounter
2199      this.encounter = castToReference(value); // Reference
2200      return value;
2201    case 1687874001: // occurrence
2202      this.occurrence = castToType(value); // Type
2203      return value;
2204    case -861311717: // condition
2205      this.condition = castToReference(value); // Reference
2206      return value;
2207    case 481140686: // performer
2208      this.performer = castToReference(value); // Reference
2209      return value;
2210    case 722137681: // reasonCode
2211      this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept
2212      return value;
2213    case -1146218137: // reasonReference
2214      this.getReasonReference().add(castToReference(value)); // Reference
2215      return value;
2216    case 93508670: // basis
2217      this.getBasis().add(castToReference(value)); // Reference
2218      return value;
2219    case 1161234575: // prediction
2220      this.getPrediction().add((RiskAssessmentPredictionComponent) value); // RiskAssessmentPredictionComponent
2221      return value;
2222    case 1293793087: // mitigation
2223      this.mitigation = castToString(value); // StringType
2224      return value;
2225    case 3387378: // note
2226      this.getNote().add(castToAnnotation(value)); // Annotation
2227      return value;
2228    default:
2229      return super.setProperty(hash, name, value);
2230    }
2231
2232  }
2233
2234  @Override
2235  public Base setProperty(String name, Base value) throws FHIRException {
2236    if (name.equals("identifier")) {
2237      this.getIdentifier().add(castToIdentifier(value));
2238    } else if (name.equals("basedOn")) {
2239      this.basedOn = castToReference(value); // Reference
2240    } else if (name.equals("parent")) {
2241      this.parent = castToReference(value); // Reference
2242    } else if (name.equals("status")) {
2243      value = new RiskAssessmentStatusEnumFactory().fromType(castToCode(value));
2244      this.status = (Enumeration) value; // Enumeration<RiskAssessmentStatus>
2245    } else if (name.equals("method")) {
2246      this.method = castToCodeableConcept(value); // CodeableConcept
2247    } else if (name.equals("code")) {
2248      this.code = castToCodeableConcept(value); // CodeableConcept
2249    } else if (name.equals("subject")) {
2250      this.subject = castToReference(value); // Reference
2251    } else if (name.equals("encounter")) {
2252      this.encounter = castToReference(value); // Reference
2253    } else if (name.equals("occurrence[x]")) {
2254      this.occurrence = castToType(value); // Type
2255    } else if (name.equals("condition")) {
2256      this.condition = castToReference(value); // Reference
2257    } else if (name.equals("performer")) {
2258      this.performer = castToReference(value); // Reference
2259    } else if (name.equals("reasonCode")) {
2260      this.getReasonCode().add(castToCodeableConcept(value));
2261    } else if (name.equals("reasonReference")) {
2262      this.getReasonReference().add(castToReference(value));
2263    } else if (name.equals("basis")) {
2264      this.getBasis().add(castToReference(value));
2265    } else if (name.equals("prediction")) {
2266      this.getPrediction().add((RiskAssessmentPredictionComponent) value);
2267    } else if (name.equals("mitigation")) {
2268      this.mitigation = castToString(value); // StringType
2269    } else if (name.equals("note")) {
2270      this.getNote().add(castToAnnotation(value));
2271    } else
2272      return super.setProperty(name, value);
2273    return value;
2274  }
2275
2276  @Override
2277  public Base makeProperty(int hash, String name) throws FHIRException {
2278    switch (hash) {
2279    case -1618432855:
2280      return addIdentifier();
2281    case -332612366:
2282      return getBasedOn();
2283    case -995424086:
2284      return getParent();
2285    case -892481550:
2286      return getStatusElement();
2287    case -1077554975:
2288      return getMethod();
2289    case 3059181:
2290      return getCode();
2291    case -1867885268:
2292      return getSubject();
2293    case 1524132147:
2294      return getEncounter();
2295    case -2022646513:
2296      return getOccurrence();
2297    case 1687874001:
2298      return getOccurrence();
2299    case -861311717:
2300      return getCondition();
2301    case 481140686:
2302      return getPerformer();
2303    case 722137681:
2304      return addReasonCode();
2305    case -1146218137:
2306      return addReasonReference();
2307    case 93508670:
2308      return addBasis();
2309    case 1161234575:
2310      return addPrediction();
2311    case 1293793087:
2312      return getMitigationElement();
2313    case 3387378:
2314      return addNote();
2315    default:
2316      return super.makeProperty(hash, name);
2317    }
2318
2319  }
2320
2321  @Override
2322  public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2323    switch (hash) {
2324    case -1618432855:
2325      /* identifier */ return new String[] { "Identifier" };
2326    case -332612366:
2327      /* basedOn */ return new String[] { "Reference" };
2328    case -995424086:
2329      /* parent */ return new String[] { "Reference" };
2330    case -892481550:
2331      /* status */ return new String[] { "code" };
2332    case -1077554975:
2333      /* method */ return new String[] { "CodeableConcept" };
2334    case 3059181:
2335      /* code */ return new String[] { "CodeableConcept" };
2336    case -1867885268:
2337      /* subject */ return new String[] { "Reference" };
2338    case 1524132147:
2339      /* encounter */ return new String[] { "Reference" };
2340    case 1687874001:
2341      /* occurrence */ return new String[] { "dateTime", "Period" };
2342    case -861311717:
2343      /* condition */ return new String[] { "Reference" };
2344    case 481140686:
2345      /* performer */ return new String[] { "Reference" };
2346    case 722137681:
2347      /* reasonCode */ return new String[] { "CodeableConcept" };
2348    case -1146218137:
2349      /* reasonReference */ return new String[] { "Reference" };
2350    case 93508670:
2351      /* basis */ return new String[] { "Reference" };
2352    case 1161234575:
2353      /* prediction */ return new String[] {};
2354    case 1293793087:
2355      /* mitigation */ return new String[] { "string" };
2356    case 3387378:
2357      /* note */ return new String[] { "Annotation" };
2358    default:
2359      return super.getTypesForProperty(hash, name);
2360    }
2361
2362  }
2363
2364  @Override
2365  public Base addChild(String name) throws FHIRException {
2366    if (name.equals("identifier")) {
2367      return addIdentifier();
2368    } else if (name.equals("basedOn")) {
2369      this.basedOn = new Reference();
2370      return this.basedOn;
2371    } else if (name.equals("parent")) {
2372      this.parent = new Reference();
2373      return this.parent;
2374    } else if (name.equals("status")) {
2375      throw new FHIRException("Cannot call addChild on a singleton property RiskAssessment.status");
2376    } else if (name.equals("method")) {
2377      this.method = new CodeableConcept();
2378      return this.method;
2379    } else if (name.equals("code")) {
2380      this.code = new CodeableConcept();
2381      return this.code;
2382    } else if (name.equals("subject")) {
2383      this.subject = new Reference();
2384      return this.subject;
2385    } else if (name.equals("encounter")) {
2386      this.encounter = new Reference();
2387      return this.encounter;
2388    } else if (name.equals("occurrenceDateTime")) {
2389      this.occurrence = new DateTimeType();
2390      return this.occurrence;
2391    } else if (name.equals("occurrencePeriod")) {
2392      this.occurrence = new Period();
2393      return this.occurrence;
2394    } else if (name.equals("condition")) {
2395      this.condition = new Reference();
2396      return this.condition;
2397    } else if (name.equals("performer")) {
2398      this.performer = new Reference();
2399      return this.performer;
2400    } else if (name.equals("reasonCode")) {
2401      return addReasonCode();
2402    } else if (name.equals("reasonReference")) {
2403      return addReasonReference();
2404    } else if (name.equals("basis")) {
2405      return addBasis();
2406    } else if (name.equals("prediction")) {
2407      return addPrediction();
2408    } else if (name.equals("mitigation")) {
2409      throw new FHIRException("Cannot call addChild on a singleton property RiskAssessment.mitigation");
2410    } else if (name.equals("note")) {
2411      return addNote();
2412    } else
2413      return super.addChild(name);
2414  }
2415
2416  public String fhirType() {
2417    return "RiskAssessment";
2418
2419  }
2420
2421  public RiskAssessment copy() {
2422    RiskAssessment dst = new RiskAssessment();
2423    copyValues(dst);
2424    return dst;
2425  }
2426
2427  public void copyValues(RiskAssessment dst) {
2428    super.copyValues(dst);
2429    if (identifier != null) {
2430      dst.identifier = new ArrayList<Identifier>();
2431      for (Identifier i : identifier)
2432        dst.identifier.add(i.copy());
2433    }
2434    ;
2435    dst.basedOn = basedOn == null ? null : basedOn.copy();
2436    dst.parent = parent == null ? null : parent.copy();
2437    dst.status = status == null ? null : status.copy();
2438    dst.method = method == null ? null : method.copy();
2439    dst.code = code == null ? null : code.copy();
2440    dst.subject = subject == null ? null : subject.copy();
2441    dst.encounter = encounter == null ? null : encounter.copy();
2442    dst.occurrence = occurrence == null ? null : occurrence.copy();
2443    dst.condition = condition == null ? null : condition.copy();
2444    dst.performer = performer == null ? null : performer.copy();
2445    if (reasonCode != null) {
2446      dst.reasonCode = new ArrayList<CodeableConcept>();
2447      for (CodeableConcept i : reasonCode)
2448        dst.reasonCode.add(i.copy());
2449    }
2450    ;
2451    if (reasonReference != null) {
2452      dst.reasonReference = new ArrayList<Reference>();
2453      for (Reference i : reasonReference)
2454        dst.reasonReference.add(i.copy());
2455    }
2456    ;
2457    if (basis != null) {
2458      dst.basis = new ArrayList<Reference>();
2459      for (Reference i : basis)
2460        dst.basis.add(i.copy());
2461    }
2462    ;
2463    if (prediction != null) {
2464      dst.prediction = new ArrayList<RiskAssessmentPredictionComponent>();
2465      for (RiskAssessmentPredictionComponent i : prediction)
2466        dst.prediction.add(i.copy());
2467    }
2468    ;
2469    dst.mitigation = mitigation == null ? null : mitigation.copy();
2470    if (note != null) {
2471      dst.note = new ArrayList<Annotation>();
2472      for (Annotation i : note)
2473        dst.note.add(i.copy());
2474    }
2475    ;
2476  }
2477
2478  protected RiskAssessment typedCopy() {
2479    return copy();
2480  }
2481
2482  @Override
2483  public boolean equalsDeep(Base other_) {
2484    if (!super.equalsDeep(other_))
2485      return false;
2486    if (!(other_ instanceof RiskAssessment))
2487      return false;
2488    RiskAssessment o = (RiskAssessment) other_;
2489    return compareDeep(identifier, o.identifier, true) && compareDeep(basedOn, o.basedOn, true)
2490        && compareDeep(parent, o.parent, true) && compareDeep(status, o.status, true)
2491        && compareDeep(method, o.method, true) && compareDeep(code, o.code, true)
2492        && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true)
2493        && compareDeep(occurrence, o.occurrence, true) && compareDeep(condition, o.condition, true)
2494        && compareDeep(performer, o.performer, true) && compareDeep(reasonCode, o.reasonCode, true)
2495        && compareDeep(reasonReference, o.reasonReference, true) && compareDeep(basis, o.basis, true)
2496        && compareDeep(prediction, o.prediction, true) && compareDeep(mitigation, o.mitigation, true)
2497        && compareDeep(note, o.note, true);
2498  }
2499
2500  @Override
2501  public boolean equalsShallow(Base other_) {
2502    if (!super.equalsShallow(other_))
2503      return false;
2504    if (!(other_ instanceof RiskAssessment))
2505      return false;
2506    RiskAssessment o = (RiskAssessment) other_;
2507    return compareValues(status, o.status, true) && compareValues(mitigation, o.mitigation, true);
2508  }
2509
2510  public boolean isEmpty() {
2511    return super.isEmpty()
2512        && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, basedOn, parent, status, method, code, subject, encounter,
2513            occurrence, condition, performer, reasonCode, reasonReference, basis, prediction, mitigation, note);
2514  }
2515
2516  @Override
2517  public ResourceType getResourceType() {
2518    return ResourceType.RiskAssessment;
2519  }
2520
2521  /**
2522   * Search parameter: <b>date</b>
2523   * <p>
2524   * Description: <b>When was assessment made?</b><br>
2525   * Type: <b>date</b><br>
2526   * Path: <b>RiskAssessment.occurrenceDateTime</b><br>
2527   * </p>
2528   */
2529  @SearchParamDefinition(name = "date", path = "(RiskAssessment.occurrence as dateTime)", description = "When was assessment made?", type = "date")
2530  public static final String SP_DATE = "date";
2531  /**
2532   * <b>Fluent Client</b> search parameter constant for <b>date</b>
2533   * <p>
2534   * Description: <b>When was assessment made?</b><br>
2535   * Type: <b>date</b><br>
2536   * Path: <b>RiskAssessment.occurrenceDateTime</b><br>
2537   * </p>
2538   */
2539  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(
2540      SP_DATE);
2541
2542  /**
2543   * Search parameter: <b>identifier</b>
2544   * <p>
2545   * Description: <b>Unique identifier for the assessment</b><br>
2546   * Type: <b>token</b><br>
2547   * Path: <b>RiskAssessment.identifier</b><br>
2548   * </p>
2549   */
2550  @SearchParamDefinition(name = "identifier", path = "RiskAssessment.identifier", description = "Unique identifier for the assessment", type = "token")
2551  public static final String SP_IDENTIFIER = "identifier";
2552  /**
2553   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2554   * <p>
2555   * Description: <b>Unique identifier for the assessment</b><br>
2556   * Type: <b>token</b><br>
2557   * Path: <b>RiskAssessment.identifier</b><br>
2558   * </p>
2559   */
2560  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2561      SP_IDENTIFIER);
2562
2563  /**
2564   * Search parameter: <b>condition</b>
2565   * <p>
2566   * Description: <b>Condition assessed</b><br>
2567   * Type: <b>reference</b><br>
2568   * Path: <b>RiskAssessment.condition</b><br>
2569   * </p>
2570   */
2571  @SearchParamDefinition(name = "condition", path = "RiskAssessment.condition", description = "Condition assessed", type = "reference", target = {
2572      Condition.class })
2573  public static final String SP_CONDITION = "condition";
2574  /**
2575   * <b>Fluent Client</b> search parameter constant for <b>condition</b>
2576   * <p>
2577   * Description: <b>Condition assessed</b><br>
2578   * Type: <b>reference</b><br>
2579   * Path: <b>RiskAssessment.condition</b><br>
2580   * </p>
2581   */
2582  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONDITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2583      SP_CONDITION);
2584
2585  /**
2586   * Constant for fluent queries to be used to add include statements. Specifies
2587   * the path value of "<b>RiskAssessment:condition</b>".
2588   */
2589  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONDITION = new ca.uhn.fhir.model.api.Include(
2590      "RiskAssessment:condition").toLocked();
2591
2592  /**
2593   * Search parameter: <b>performer</b>
2594   * <p>
2595   * Description: <b>Who did assessment?</b><br>
2596   * Type: <b>reference</b><br>
2597   * Path: <b>RiskAssessment.performer</b><br>
2598   * </p>
2599   */
2600  @SearchParamDefinition(name = "performer", path = "RiskAssessment.performer", description = "Who did assessment?", type = "reference", providesMembershipIn = {
2601      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Device"),
2602      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Practitioner") }, target = { Device.class,
2603          Practitioner.class, PractitionerRole.class })
2604  public static final String SP_PERFORMER = "performer";
2605  /**
2606   * <b>Fluent Client</b> search parameter constant for <b>performer</b>
2607   * <p>
2608   * Description: <b>Who did assessment?</b><br>
2609   * Type: <b>reference</b><br>
2610   * Path: <b>RiskAssessment.performer</b><br>
2611   * </p>
2612   */
2613  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2614      SP_PERFORMER);
2615
2616  /**
2617   * Constant for fluent queries to be used to add include statements. Specifies
2618   * the path value of "<b>RiskAssessment:performer</b>".
2619   */
2620  public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include(
2621      "RiskAssessment:performer").toLocked();
2622
2623  /**
2624   * Search parameter: <b>method</b>
2625   * <p>
2626   * Description: <b>Evaluation mechanism</b><br>
2627   * Type: <b>token</b><br>
2628   * Path: <b>RiskAssessment.method</b><br>
2629   * </p>
2630   */
2631  @SearchParamDefinition(name = "method", path = "RiskAssessment.method", description = "Evaluation mechanism", type = "token")
2632  public static final String SP_METHOD = "method";
2633  /**
2634   * <b>Fluent Client</b> search parameter constant for <b>method</b>
2635   * <p>
2636   * Description: <b>Evaluation mechanism</b><br>
2637   * Type: <b>token</b><br>
2638   * Path: <b>RiskAssessment.method</b><br>
2639   * </p>
2640   */
2641  public static final ca.uhn.fhir.rest.gclient.TokenClientParam METHOD = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2642      SP_METHOD);
2643
2644  /**
2645   * Search parameter: <b>subject</b>
2646   * <p>
2647   * Description: <b>Who/what does assessment apply to?</b><br>
2648   * Type: <b>reference</b><br>
2649   * Path: <b>RiskAssessment.subject</b><br>
2650   * </p>
2651   */
2652  @SearchParamDefinition(name = "subject", path = "RiskAssessment.subject", description = "Who/what does assessment apply to?", type = "reference", providesMembershipIn = {
2653      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Patient") }, target = { Group.class, Patient.class })
2654  public static final String SP_SUBJECT = "subject";
2655  /**
2656   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2657   * <p>
2658   * Description: <b>Who/what does assessment apply to?</b><br>
2659   * Type: <b>reference</b><br>
2660   * Path: <b>RiskAssessment.subject</b><br>
2661   * </p>
2662   */
2663  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2664      SP_SUBJECT);
2665
2666  /**
2667   * Constant for fluent queries to be used to add include statements. Specifies
2668   * the path value of "<b>RiskAssessment:subject</b>".
2669   */
2670  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include(
2671      "RiskAssessment:subject").toLocked();
2672
2673  /**
2674   * Search parameter: <b>patient</b>
2675   * <p>
2676   * Description: <b>Who/what does assessment apply to?</b><br>
2677   * Type: <b>reference</b><br>
2678   * Path: <b>RiskAssessment.subject</b><br>
2679   * </p>
2680   */
2681  @SearchParamDefinition(name = "patient", path = "RiskAssessment.subject.where(resolve() is Patient)", description = "Who/what does assessment apply to?", type = "reference", target = {
2682      Patient.class })
2683  public static final String SP_PATIENT = "patient";
2684  /**
2685   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2686   * <p>
2687   * Description: <b>Who/what does assessment apply to?</b><br>
2688   * Type: <b>reference</b><br>
2689   * Path: <b>RiskAssessment.subject</b><br>
2690   * </p>
2691   */
2692  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2693      SP_PATIENT);
2694
2695  /**
2696   * Constant for fluent queries to be used to add include statements. Specifies
2697   * the path value of "<b>RiskAssessment:patient</b>".
2698   */
2699  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include(
2700      "RiskAssessment:patient").toLocked();
2701
2702  /**
2703   * Search parameter: <b>probability</b>
2704   * <p>
2705   * Description: <b>Likelihood of specified outcome</b><br>
2706   * Type: <b>number</b><br>
2707   * Path: <b>RiskAssessment.prediction.probability[x]</b><br>
2708   * </p>
2709   */
2710  @SearchParamDefinition(name = "probability", path = "RiskAssessment.prediction.probability", description = "Likelihood of specified outcome", type = "number")
2711  public static final String SP_PROBABILITY = "probability";
2712  /**
2713   * <b>Fluent Client</b> search parameter constant for <b>probability</b>
2714   * <p>
2715   * Description: <b>Likelihood of specified outcome</b><br>
2716   * Type: <b>number</b><br>
2717   * Path: <b>RiskAssessment.prediction.probability[x]</b><br>
2718   * </p>
2719   */
2720  public static final ca.uhn.fhir.rest.gclient.NumberClientParam PROBABILITY = new ca.uhn.fhir.rest.gclient.NumberClientParam(
2721      SP_PROBABILITY);
2722
2723  /**
2724   * Search parameter: <b>risk</b>
2725   * <p>
2726   * Description: <b>Likelihood of specified outcome as a qualitative
2727   * value</b><br>
2728   * Type: <b>token</b><br>
2729   * Path: <b>RiskAssessment.prediction.qualitativeRisk</b><br>
2730   * </p>
2731   */
2732  @SearchParamDefinition(name = "risk", path = "RiskAssessment.prediction.qualitativeRisk", description = "Likelihood of specified outcome as a qualitative value", type = "token")
2733  public static final String SP_RISK = "risk";
2734  /**
2735   * <b>Fluent Client</b> search parameter constant for <b>risk</b>
2736   * <p>
2737   * Description: <b>Likelihood of specified outcome as a qualitative
2738   * value</b><br>
2739   * Type: <b>token</b><br>
2740   * Path: <b>RiskAssessment.prediction.qualitativeRisk</b><br>
2741   * </p>
2742   */
2743  public static final ca.uhn.fhir.rest.gclient.TokenClientParam RISK = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2744      SP_RISK);
2745
2746  /**
2747   * Search parameter: <b>encounter</b>
2748   * <p>
2749   * Description: <b>Where was assessment performed?</b><br>
2750   * Type: <b>reference</b><br>
2751   * Path: <b>RiskAssessment.encounter</b><br>
2752   * </p>
2753   */
2754  @SearchParamDefinition(name = "encounter", path = "RiskAssessment.encounter", description = "Where was assessment performed?", type = "reference", target = {
2755      Encounter.class })
2756  public static final String SP_ENCOUNTER = "encounter";
2757  /**
2758   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
2759   * <p>
2760   * Description: <b>Where was assessment performed?</b><br>
2761   * Type: <b>reference</b><br>
2762   * Path: <b>RiskAssessment.encounter</b><br>
2763   * </p>
2764   */
2765  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2766      SP_ENCOUNTER);
2767
2768  /**
2769   * Constant for fluent queries to be used to add include statements. Specifies
2770   * the path value of "<b>RiskAssessment:encounter</b>".
2771   */
2772  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include(
2773      "RiskAssessment:encounter").toLocked();
2774
2775}