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