001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Fri, Jul 15, 2022 11:20+1000 for FHIR v5.0.0-snapshot2
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import java.math.*;
038import org.hl7.fhir.utilities.Utilities;
039import org.hl7.fhir.r5.model.Enumerations.*;
040import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
041import org.hl7.fhir.exceptions.FHIRException;
042import org.hl7.fhir.instance.model.api.ICompositeType;
043import ca.uhn.fhir.model.api.annotation.ResourceDef;
044import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
045import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
046import ca.uhn.fhir.model.api.annotation.Child;
047import ca.uhn.fhir.model.api.annotation.ChildOrder;
048import ca.uhn.fhir.model.api.annotation.Description;
049import ca.uhn.fhir.model.api.annotation.Block;
050
051/**
052 * An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.
053 */
054@ResourceDef(name="RiskAssessment", profile="http://hl7.org/fhir/StructureDefinition/RiskAssessment")
055public class RiskAssessment extends DomainResource {
056
057    @Block()
058    public static class RiskAssessmentPredictionComponent extends BackboneElement implements IBaseBackboneElement {
059        /**
060         * One of the potential outcomes for the patient (e.g. remission, death,  a particular condition).
061         */
062        @Child(name = "outcome", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
063        @Description(shortDefinition="Possible outcome for the subject", formalDefinition="One of the potential outcomes for the patient (e.g. remission, death,  a particular condition)." )
064        protected CodeableConcept outcome;
065
066        /**
067         * Indicates how likely the outcome is (in the specified timeframe).
068         */
069        @Child(name = "probability", type = {DecimalType.class, Range.class}, order=2, min=0, max=1, modifier=false, summary=false)
070        @Description(shortDefinition="Likelihood of specified outcome", formalDefinition="Indicates how likely the outcome is (in the specified timeframe)." )
071        protected DataType probability;
072
073        /**
074         * Indicates how likely the outcome is (in the specified timeframe), expressed as a qualitative value (e.g. low, medium, or high).
075         */
076        @Child(name = "qualitativeRisk", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
077        @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)." )
078        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/risk-probability")
079        protected CodeableConcept qualitativeRisk;
080
081        /**
082         * 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.).
083         */
084        @Child(name = "relativeRisk", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=false)
085        @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.)." )
086        protected DecimalType relativeRisk;
087
088        /**
089         * Indicates the period of time or age range of the subject to which the specified probability applies.
090         */
091        @Child(name = "when", type = {Period.class, Range.class}, order=5, min=0, max=1, modifier=false, summary=false)
092        @Description(shortDefinition="Timeframe or age range", formalDefinition="Indicates the period of time or age range of the subject to which the specified probability applies." )
093        protected DataType when;
094
095        /**
096         * Additional information explaining the basis for the prediction.
097         */
098        @Child(name = "rationale", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
099        @Description(shortDefinition="Explanation of prediction", formalDefinition="Additional information explaining the basis for the prediction." )
100        protected StringType rationale;
101
102        private static final long serialVersionUID = -1559504257L;
103
104    /**
105     * Constructor
106     */
107      public RiskAssessmentPredictionComponent() {
108        super();
109      }
110
111        /**
112         * @return {@link #outcome} (One of the potential outcomes for the patient (e.g. remission, death,  a particular condition).)
113         */
114        public CodeableConcept getOutcome() { 
115          if (this.outcome == null)
116            if (Configuration.errorOnAutoCreate())
117              throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.outcome");
118            else if (Configuration.doAutoCreate())
119              this.outcome = new CodeableConcept(); // cc
120          return this.outcome;
121        }
122
123        public boolean hasOutcome() { 
124          return this.outcome != null && !this.outcome.isEmpty();
125        }
126
127        /**
128         * @param value {@link #outcome} (One of the potential outcomes for the patient (e.g. remission, death,  a particular condition).)
129         */
130        public RiskAssessmentPredictionComponent setOutcome(CodeableConcept value) { 
131          this.outcome = value;
132          return this;
133        }
134
135        /**
136         * @return {@link #probability} (Indicates how likely the outcome is (in the specified timeframe).)
137         */
138        public DataType getProbability() { 
139          return this.probability;
140        }
141
142        /**
143         * @return {@link #probability} (Indicates how likely the outcome is (in the specified timeframe).)
144         */
145        public DecimalType getProbabilityDecimalType() throws FHIRException { 
146          if (this.probability == null)
147            this.probability = new DecimalType();
148          if (!(this.probability instanceof DecimalType))
149            throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.probability.getClass().getName()+" was encountered");
150          return (DecimalType) this.probability;
151        }
152
153        public boolean hasProbabilityDecimalType() { 
154          return this != null && this.probability instanceof DecimalType;
155        }
156
157        /**
158         * @return {@link #probability} (Indicates how likely the outcome is (in the specified timeframe).)
159         */
160        public Range getProbabilityRange() throws FHIRException { 
161          if (this.probability == null)
162            this.probability = new Range();
163          if (!(this.probability instanceof Range))
164            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.probability.getClass().getName()+" was encountered");
165          return (Range) this.probability;
166        }
167
168        public boolean hasProbabilityRange() { 
169          return this != null && this.probability instanceof Range;
170        }
171
172        public boolean hasProbability() { 
173          return this.probability != null && !this.probability.isEmpty();
174        }
175
176        /**
177         * @param value {@link #probability} (Indicates how likely the outcome is (in the specified timeframe).)
178         */
179        public RiskAssessmentPredictionComponent setProbability(DataType value) { 
180          if (value != null && !(value instanceof DecimalType || value instanceof Range))
181            throw new Error("Not the right type for RiskAssessment.prediction.probability[x]: "+value.fhirType());
182          this.probability = value;
183          return this;
184        }
185
186        /**
187         * @return {@link #qualitativeRisk} (Indicates how likely the outcome is (in the specified timeframe), expressed as a qualitative value (e.g. low, medium, or high).)
188         */
189        public CodeableConcept getQualitativeRisk() { 
190          if (this.qualitativeRisk == null)
191            if (Configuration.errorOnAutoCreate())
192              throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.qualitativeRisk");
193            else if (Configuration.doAutoCreate())
194              this.qualitativeRisk = new CodeableConcept(); // cc
195          return this.qualitativeRisk;
196        }
197
198        public boolean hasQualitativeRisk() { 
199          return this.qualitativeRisk != null && !this.qualitativeRisk.isEmpty();
200        }
201
202        /**
203         * @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).)
204         */
205        public RiskAssessmentPredictionComponent setQualitativeRisk(CodeableConcept value) { 
206          this.qualitativeRisk = value;
207          return this;
208        }
209
210        /**
211         * @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
212         */
213        public DecimalType getRelativeRiskElement() { 
214          if (this.relativeRisk == null)
215            if (Configuration.errorOnAutoCreate())
216              throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.relativeRisk");
217            else if (Configuration.doAutoCreate())
218              this.relativeRisk = new DecimalType(); // bb
219          return this.relativeRisk;
220        }
221
222        public boolean hasRelativeRiskElement() { 
223          return this.relativeRisk != null && !this.relativeRisk.isEmpty();
224        }
225
226        public boolean hasRelativeRisk() { 
227          return this.relativeRisk != null && !this.relativeRisk.isEmpty();
228        }
229
230        /**
231         * @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
232         */
233        public RiskAssessmentPredictionComponent setRelativeRiskElement(DecimalType value) { 
234          this.relativeRisk = value;
235          return this;
236        }
237
238        /**
239         * @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.).
240         */
241        public BigDecimal getRelativeRisk() { 
242          return this.relativeRisk == null ? null : this.relativeRisk.getValue();
243        }
244
245        /**
246         * @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.).
247         */
248        public RiskAssessmentPredictionComponent setRelativeRisk(BigDecimal value) { 
249          if (value == null)
250            this.relativeRisk = null;
251          else {
252            if (this.relativeRisk == null)
253              this.relativeRisk = new DecimalType();
254            this.relativeRisk.setValue(value);
255          }
256          return this;
257        }
258
259        /**
260         * @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.).
261         */
262        public RiskAssessmentPredictionComponent setRelativeRisk(long value) { 
263              this.relativeRisk = new DecimalType();
264            this.relativeRisk.setValue(value);
265          return this;
266        }
267
268        /**
269         * @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.).
270         */
271        public RiskAssessmentPredictionComponent setRelativeRisk(double value) { 
272              this.relativeRisk = new DecimalType();
273            this.relativeRisk.setValue(value);
274          return this;
275        }
276
277        /**
278         * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.)
279         */
280        public DataType getWhen() { 
281          return this.when;
282        }
283
284        /**
285         * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.)
286         */
287        public Period getWhenPeriod() throws FHIRException { 
288          if (this.when == null)
289            this.when = new Period();
290          if (!(this.when instanceof Period))
291            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.when.getClass().getName()+" was encountered");
292          return (Period) this.when;
293        }
294
295        public boolean hasWhenPeriod() { 
296          return this != null && this.when instanceof Period;
297        }
298
299        /**
300         * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.)
301         */
302        public Range getWhenRange() throws FHIRException { 
303          if (this.when == null)
304            this.when = new Range();
305          if (!(this.when instanceof Range))
306            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.when.getClass().getName()+" was encountered");
307          return (Range) this.when;
308        }
309
310        public boolean hasWhenRange() { 
311          return this != null && this.when instanceof Range;
312        }
313
314        public boolean hasWhen() { 
315          return this.when != null && !this.when.isEmpty();
316        }
317
318        /**
319         * @param value {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.)
320         */
321        public RiskAssessmentPredictionComponent setWhen(DataType value) { 
322          if (value != null && !(value instanceof Period || value instanceof Range))
323            throw new Error("Not the right type for RiskAssessment.prediction.when[x]: "+value.fhirType());
324          this.when = value;
325          return this;
326        }
327
328        /**
329         * @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
330         */
331        public StringType getRationaleElement() { 
332          if (this.rationale == null)
333            if (Configuration.errorOnAutoCreate())
334              throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.rationale");
335            else if (Configuration.doAutoCreate())
336              this.rationale = new StringType(); // bb
337          return this.rationale;
338        }
339
340        public boolean hasRationaleElement() { 
341          return this.rationale != null && !this.rationale.isEmpty();
342        }
343
344        public boolean hasRationale() { 
345          return this.rationale != null && !this.rationale.isEmpty();
346        }
347
348        /**
349         * @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
350         */
351        public RiskAssessmentPredictionComponent setRationaleElement(StringType value) { 
352          this.rationale = value;
353          return this;
354        }
355
356        /**
357         * @return Additional information explaining the basis for the prediction.
358         */
359        public String getRationale() { 
360          return this.rationale == null ? null : this.rationale.getValue();
361        }
362
363        /**
364         * @param value Additional information explaining the basis for the prediction.
365         */
366        public RiskAssessmentPredictionComponent setRationale(String value) { 
367          if (Utilities.noString(value))
368            this.rationale = null;
369          else {
370            if (this.rationale == null)
371              this.rationale = new StringType();
372            this.rationale.setValue(value);
373          }
374          return this;
375        }
376
377        protected void listChildren(List<Property> children) {
378          super.listChildren(children);
379          children.add(new Property("outcome", "CodeableConcept", "One of the potential outcomes for the patient (e.g. remission, death,  a particular condition).", 0, 1, outcome));
380          children.add(new Property("probability[x]", "decimal|Range", "Indicates how likely the outcome is (in the specified timeframe).", 0, 1, probability));
381          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));
382          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));
383          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));
384          children.add(new Property("rationale", "string", "Additional information explaining the basis for the prediction.", 0, 1, rationale));
385        }
386
387        @Override
388        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
389          switch (_hash) {
390          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);
391          case 1430185003: /*probability[x]*/  return new Property("probability[x]", "decimal|Range", "Indicates how likely the outcome is (in the specified timeframe).", 0, 1, probability);
392          case -1290561483: /*probability*/  return new Property("probability[x]", "decimal|Range", "Indicates how likely the outcome is (in the specified timeframe).", 0, 1, probability);
393          case 888495452: /*probabilityDecimal*/  return new Property("probability[x]", "decimal", "Indicates how likely the outcome is (in the specified timeframe).", 0, 1, probability);
394          case 9275912: /*probabilityRange*/  return new Property("probability[x]", "Range", "Indicates how likely the outcome is (in the specified timeframe).", 0, 1, probability);
395          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);
396          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);
397          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);
398          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);
399          case 251476379: /*whenPeriod*/  return new Property("when[x]", "Period", "Indicates the period of time or age range of the subject to which the specified probability applies.", 0, 1, when);
400          case -1098542557: /*whenRange*/  return new Property("when[x]", "Range", "Indicates the period of time or age range of the subject to which the specified probability applies.", 0, 1, when);
401          case 345689335: /*rationale*/  return new Property("rationale", "string", "Additional information explaining the basis for the prediction.", 0, 1, rationale);
402          default: return super.getNamedProperty(_hash, _name, _checkValid);
403          }
404
405        }
406
407      @Override
408      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
409        switch (hash) {
410        case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept
411        case -1290561483: /*probability*/ return this.probability == null ? new Base[0] : new Base[] {this.probability}; // DataType
412        case 123308730: /*qualitativeRisk*/ return this.qualitativeRisk == null ? new Base[0] : new Base[] {this.qualitativeRisk}; // CodeableConcept
413        case -70741061: /*relativeRisk*/ return this.relativeRisk == null ? new Base[0] : new Base[] {this.relativeRisk}; // DecimalType
414        case 3648314: /*when*/ return this.when == null ? new Base[0] : new Base[] {this.when}; // DataType
415        case 345689335: /*rationale*/ return this.rationale == null ? new Base[0] : new Base[] {this.rationale}; // StringType
416        default: return super.getProperty(hash, name, checkValid);
417        }
418
419      }
420
421      @Override
422      public Base setProperty(int hash, String name, Base value) throws FHIRException {
423        switch (hash) {
424        case -1106507950: // outcome
425          this.outcome = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
426          return value;
427        case -1290561483: // probability
428          this.probability = TypeConvertor.castToType(value); // DataType
429          return value;
430        case 123308730: // qualitativeRisk
431          this.qualitativeRisk = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
432          return value;
433        case -70741061: // relativeRisk
434          this.relativeRisk = TypeConvertor.castToDecimal(value); // DecimalType
435          return value;
436        case 3648314: // when
437          this.when = TypeConvertor.castToType(value); // DataType
438          return value;
439        case 345689335: // rationale
440          this.rationale = TypeConvertor.castToString(value); // StringType
441          return value;
442        default: return super.setProperty(hash, name, value);
443        }
444
445      }
446
447      @Override
448      public Base setProperty(String name, Base value) throws FHIRException {
449        if (name.equals("outcome")) {
450          this.outcome = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
451        } else if (name.equals("probability[x]")) {
452          this.probability = TypeConvertor.castToType(value); // DataType
453        } else if (name.equals("qualitativeRisk")) {
454          this.qualitativeRisk = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
455        } else if (name.equals("relativeRisk")) {
456          this.relativeRisk = TypeConvertor.castToDecimal(value); // DecimalType
457        } else if (name.equals("when[x]")) {
458          this.when = TypeConvertor.castToType(value); // DataType
459        } else if (name.equals("rationale")) {
460          this.rationale = TypeConvertor.castToString(value); // StringType
461        } else
462          return super.setProperty(name, value);
463        return value;
464      }
465
466      @Override
467      public Base makeProperty(int hash, String name) throws FHIRException {
468        switch (hash) {
469        case -1106507950:  return getOutcome();
470        case 1430185003:  return getProbability();
471        case -1290561483:  return getProbability();
472        case 123308730:  return getQualitativeRisk();
473        case -70741061:  return getRelativeRiskElement();
474        case 1312831238:  return getWhen();
475        case 3648314:  return getWhen();
476        case 345689335:  return getRationaleElement();
477        default: return super.makeProperty(hash, name);
478        }
479
480      }
481
482      @Override
483      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
484        switch (hash) {
485        case -1106507950: /*outcome*/ return new String[] {"CodeableConcept"};
486        case -1290561483: /*probability*/ return new String[] {"decimal", "Range"};
487        case 123308730: /*qualitativeRisk*/ return new String[] {"CodeableConcept"};
488        case -70741061: /*relativeRisk*/ return new String[] {"decimal"};
489        case 3648314: /*when*/ return new String[] {"Period", "Range"};
490        case 345689335: /*rationale*/ return new String[] {"string"};
491        default: return super.getTypesForProperty(hash, name);
492        }
493
494      }
495
496      @Override
497      public Base addChild(String name) throws FHIRException {
498        if (name.equals("outcome")) {
499          this.outcome = new CodeableConcept();
500          return this.outcome;
501        }
502        else if (name.equals("probabilityDecimal")) {
503          this.probability = new DecimalType();
504          return this.probability;
505        }
506        else if (name.equals("probabilityRange")) {
507          this.probability = new Range();
508          return this.probability;
509        }
510        else if (name.equals("qualitativeRisk")) {
511          this.qualitativeRisk = new CodeableConcept();
512          return this.qualitativeRisk;
513        }
514        else if (name.equals("relativeRisk")) {
515          throw new FHIRException("Cannot call addChild on a primitive type RiskAssessment.prediction.relativeRisk");
516        }
517        else if (name.equals("whenPeriod")) {
518          this.when = new Period();
519          return this.when;
520        }
521        else if (name.equals("whenRange")) {
522          this.when = new Range();
523          return this.when;
524        }
525        else if (name.equals("rationale")) {
526          throw new FHIRException("Cannot call addChild on a primitive type RiskAssessment.prediction.rationale");
527        }
528        else
529          return super.addChild(name);
530      }
531
532      public RiskAssessmentPredictionComponent copy() {
533        RiskAssessmentPredictionComponent dst = new RiskAssessmentPredictionComponent();
534        copyValues(dst);
535        return dst;
536      }
537
538      public void copyValues(RiskAssessmentPredictionComponent dst) {
539        super.copyValues(dst);
540        dst.outcome = outcome == null ? null : outcome.copy();
541        dst.probability = probability == null ? null : probability.copy();
542        dst.qualitativeRisk = qualitativeRisk == null ? null : qualitativeRisk.copy();
543        dst.relativeRisk = relativeRisk == null ? null : relativeRisk.copy();
544        dst.when = when == null ? null : when.copy();
545        dst.rationale = rationale == null ? null : rationale.copy();
546      }
547
548      @Override
549      public boolean equalsDeep(Base other_) {
550        if (!super.equalsDeep(other_))
551          return false;
552        if (!(other_ instanceof RiskAssessmentPredictionComponent))
553          return false;
554        RiskAssessmentPredictionComponent o = (RiskAssessmentPredictionComponent) other_;
555        return compareDeep(outcome, o.outcome, true) && compareDeep(probability, o.probability, true) && compareDeep(qualitativeRisk, o.qualitativeRisk, true)
556           && compareDeep(relativeRisk, o.relativeRisk, true) && compareDeep(when, o.when, true) && compareDeep(rationale, o.rationale, true)
557          ;
558      }
559
560      @Override
561      public boolean equalsShallow(Base other_) {
562        if (!super.equalsShallow(other_))
563          return false;
564        if (!(other_ instanceof RiskAssessmentPredictionComponent))
565          return false;
566        RiskAssessmentPredictionComponent o = (RiskAssessmentPredictionComponent) other_;
567        return compareValues(relativeRisk, o.relativeRisk, true) && compareValues(rationale, o.rationale, true)
568          ;
569      }
570
571      public boolean isEmpty() {
572        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(outcome, probability, qualitativeRisk
573          , relativeRisk, when, rationale);
574      }
575
576  public String fhirType() {
577    return "RiskAssessment.prediction";
578
579  }
580
581  }
582
583    /**
584     * Business identifier assigned to the risk assessment.
585     */
586    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
587    @Description(shortDefinition="Unique identifier for the assessment", formalDefinition="Business identifier assigned to the risk assessment." )
588    protected List<Identifier> identifier;
589
590    /**
591     * A reference to the request that is fulfilled by this risk assessment.
592     */
593    @Child(name = "basedOn", type = {Reference.class}, order=1, min=0, max=1, modifier=false, summary=false)
594    @Description(shortDefinition="Request fulfilled by this assessment", formalDefinition="A reference to the request that is fulfilled by this risk assessment." )
595    protected Reference basedOn;
596
597    /**
598     * A reference to a resource that this risk assessment is part of, such as a Procedure.
599     */
600    @Child(name = "parent", type = {Reference.class}, order=2, min=0, max=1, modifier=false, summary=false)
601    @Description(shortDefinition="Part of this occurrence", formalDefinition="A reference to a resource that this risk assessment is part of, such as a Procedure." )
602    protected Reference parent;
603
604    /**
605     * The status of the RiskAssessment, using the same statuses as an Observation.
606     */
607    @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=true)
608    @Description(shortDefinition="registered | preliminary | final | amended +", formalDefinition="The status of the RiskAssessment, using the same statuses as an Observation." )
609    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/observation-status")
610    protected Enumeration<ObservationStatus> status;
611
612    /**
613     * The algorithm, process or mechanism used to evaluate the risk.
614     */
615    @Child(name = "method", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true)
616    @Description(shortDefinition="Evaluation mechanism", formalDefinition="The algorithm, process or mechanism used to evaluate the risk." )
617    protected CodeableConcept method;
618
619    /**
620     * The type of the risk assessment performed.
621     */
622    @Child(name = "code", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true)
623    @Description(shortDefinition="Type of assessment", formalDefinition="The type of the risk assessment performed." )
624    protected CodeableConcept code;
625
626    /**
627     * The patient or group the risk assessment applies to.
628     */
629    @Child(name = "subject", type = {Patient.class, Group.class}, order=6, min=1, max=1, modifier=false, summary=true)
630    @Description(shortDefinition="Who/what does assessment apply to?", formalDefinition="The patient or group the risk assessment applies to." )
631    protected Reference subject;
632
633    /**
634     * The encounter where the assessment was performed.
635     */
636    @Child(name = "encounter", type = {Encounter.class}, order=7, min=0, max=1, modifier=false, summary=true)
637    @Description(shortDefinition="Where was assessment performed?", formalDefinition="The encounter where the assessment was performed." )
638    protected Reference encounter;
639
640    /**
641     * The date (and possibly time) the risk assessment was performed.
642     */
643    @Child(name = "occurrence", type = {DateTimeType.class, Period.class}, order=8, min=0, max=1, modifier=false, summary=true)
644    @Description(shortDefinition="When was assessment made?", formalDefinition="The date (and possibly time) the risk assessment was performed." )
645    protected DataType occurrence;
646
647    /**
648     * For assessments or prognosis specific to a particular condition, indicates the condition being assessed.
649     */
650    @Child(name = "condition", type = {Condition.class}, order=9, min=0, max=1, modifier=false, summary=true)
651    @Description(shortDefinition="Condition assessed", formalDefinition="For assessments or prognosis specific to a particular condition, indicates the condition being assessed." )
652    protected Reference condition;
653
654    /**
655     * The provider, patient, related person, or software application that performed the assessment.
656     */
657    @Child(name = "performer", type = {Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class, Device.class}, order=10, min=0, max=1, modifier=false, summary=true)
658    @Description(shortDefinition="Who did assessment?", formalDefinition="The provider, patient, related person, or software application that performed the assessment." )
659    protected Reference performer;
660
661    /**
662     * The reason the risk assessment was performed.
663     */
664    @Child(name = "reason", type = {CodeableReference.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
665    @Description(shortDefinition="Why the assessment was necessary?", formalDefinition="The reason the risk assessment was performed." )
666    protected List<CodeableReference> reason;
667
668    /**
669     * Indicates the source data considered as part of the assessment (for example, FamilyHistory, Observations, Procedures, Conditions, etc.).
670     */
671    @Child(name = "basis", type = {Reference.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
672    @Description(shortDefinition="Information used in assessment", formalDefinition="Indicates the source data considered as part of the assessment (for example, FamilyHistory, Observations, Procedures, Conditions, etc.)." )
673    protected List<Reference> basis;
674
675    /**
676     * Describes the expected outcome for the subject.
677     */
678    @Child(name = "prediction", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
679    @Description(shortDefinition="Outcome predicted", formalDefinition="Describes the expected outcome for the subject." )
680    protected List<RiskAssessmentPredictionComponent> prediction;
681
682    /**
683     * A description of the steps that might be taken to reduce the identified risk(s).
684     */
685    @Child(name = "mitigation", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false)
686    @Description(shortDefinition="How to reduce risk", formalDefinition="A description of the steps that might be taken to reduce the identified risk(s)." )
687    protected StringType mitigation;
688
689    /**
690     * Additional comments about the risk assessment.
691     */
692    @Child(name = "note", type = {Annotation.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
693    @Description(shortDefinition="Comments on the risk assessment", formalDefinition="Additional comments about the risk assessment." )
694    protected List<Annotation> note;
695
696    private static final long serialVersionUID = 1076114228L;
697
698  /**
699   * Constructor
700   */
701    public RiskAssessment() {
702      super();
703    }
704
705  /**
706   * Constructor
707   */
708    public RiskAssessment(ObservationStatus status, Reference subject) {
709      super();
710      this.setStatus(status);
711      this.setSubject(subject);
712    }
713
714    /**
715     * @return {@link #identifier} (Business identifier assigned to the risk assessment.)
716     */
717    public List<Identifier> getIdentifier() { 
718      if (this.identifier == null)
719        this.identifier = new ArrayList<Identifier>();
720      return this.identifier;
721    }
722
723    /**
724     * @return Returns a reference to <code>this</code> for easy method chaining
725     */
726    public RiskAssessment setIdentifier(List<Identifier> theIdentifier) { 
727      this.identifier = theIdentifier;
728      return this;
729    }
730
731    public boolean hasIdentifier() { 
732      if (this.identifier == null)
733        return false;
734      for (Identifier item : this.identifier)
735        if (!item.isEmpty())
736          return true;
737      return false;
738    }
739
740    public Identifier addIdentifier() { //3
741      Identifier t = new Identifier();
742      if (this.identifier == null)
743        this.identifier = new ArrayList<Identifier>();
744      this.identifier.add(t);
745      return t;
746    }
747
748    public RiskAssessment addIdentifier(Identifier t) { //3
749      if (t == null)
750        return this;
751      if (this.identifier == null)
752        this.identifier = new ArrayList<Identifier>();
753      this.identifier.add(t);
754      return this;
755    }
756
757    /**
758     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
759     */
760    public Identifier getIdentifierFirstRep() { 
761      if (getIdentifier().isEmpty()) {
762        addIdentifier();
763      }
764      return getIdentifier().get(0);
765    }
766
767    /**
768     * @return {@link #basedOn} (A reference to the request that is fulfilled by this risk assessment.)
769     */
770    public Reference getBasedOn() { 
771      if (this.basedOn == null)
772        if (Configuration.errorOnAutoCreate())
773          throw new Error("Attempt to auto-create RiskAssessment.basedOn");
774        else if (Configuration.doAutoCreate())
775          this.basedOn = new Reference(); // cc
776      return this.basedOn;
777    }
778
779    public boolean hasBasedOn() { 
780      return this.basedOn != null && !this.basedOn.isEmpty();
781    }
782
783    /**
784     * @param value {@link #basedOn} (A reference to the request that is fulfilled by this risk assessment.)
785     */
786    public RiskAssessment setBasedOn(Reference value) { 
787      this.basedOn = value;
788      return this;
789    }
790
791    /**
792     * @return {@link #parent} (A reference to a resource that this risk assessment is part of, such as a Procedure.)
793     */
794    public Reference getParent() { 
795      if (this.parent == null)
796        if (Configuration.errorOnAutoCreate())
797          throw new Error("Attempt to auto-create RiskAssessment.parent");
798        else if (Configuration.doAutoCreate())
799          this.parent = new Reference(); // cc
800      return this.parent;
801    }
802
803    public boolean hasParent() { 
804      return this.parent != null && !this.parent.isEmpty();
805    }
806
807    /**
808     * @param value {@link #parent} (A reference to a resource that this risk assessment is part of, such as a Procedure.)
809     */
810    public RiskAssessment setParent(Reference value) { 
811      this.parent = value;
812      return this;
813    }
814
815    /**
816     * @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
817     */
818    public Enumeration<ObservationStatus> getStatusElement() { 
819      if (this.status == null)
820        if (Configuration.errorOnAutoCreate())
821          throw new Error("Attempt to auto-create RiskAssessment.status");
822        else if (Configuration.doAutoCreate())
823          this.status = new Enumeration<ObservationStatus>(new ObservationStatusEnumFactory()); // bb
824      return this.status;
825    }
826
827    public boolean hasStatusElement() { 
828      return this.status != null && !this.status.isEmpty();
829    }
830
831    public boolean hasStatus() { 
832      return this.status != null && !this.status.isEmpty();
833    }
834
835    /**
836     * @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
837     */
838    public RiskAssessment setStatusElement(Enumeration<ObservationStatus> value) { 
839      this.status = value;
840      return this;
841    }
842
843    /**
844     * @return The status of the RiskAssessment, using the same statuses as an Observation.
845     */
846    public ObservationStatus getStatus() { 
847      return this.status == null ? null : this.status.getValue();
848    }
849
850    /**
851     * @param value The status of the RiskAssessment, using the same statuses as an Observation.
852     */
853    public RiskAssessment setStatus(ObservationStatus value) { 
854        if (this.status == null)
855          this.status = new Enumeration<ObservationStatus>(new ObservationStatusEnumFactory());
856        this.status.setValue(value);
857      return this;
858    }
859
860    /**
861     * @return {@link #method} (The algorithm, process or mechanism used to evaluate the risk.)
862     */
863    public CodeableConcept getMethod() { 
864      if (this.method == null)
865        if (Configuration.errorOnAutoCreate())
866          throw new Error("Attempt to auto-create RiskAssessment.method");
867        else if (Configuration.doAutoCreate())
868          this.method = new CodeableConcept(); // cc
869      return this.method;
870    }
871
872    public boolean hasMethod() { 
873      return this.method != null && !this.method.isEmpty();
874    }
875
876    /**
877     * @param value {@link #method} (The algorithm, process or mechanism used to evaluate the risk.)
878     */
879    public RiskAssessment setMethod(CodeableConcept value) { 
880      this.method = value;
881      return this;
882    }
883
884    /**
885     * @return {@link #code} (The type of the risk assessment performed.)
886     */
887    public CodeableConcept getCode() { 
888      if (this.code == null)
889        if (Configuration.errorOnAutoCreate())
890          throw new Error("Attempt to auto-create RiskAssessment.code");
891        else if (Configuration.doAutoCreate())
892          this.code = new CodeableConcept(); // cc
893      return this.code;
894    }
895
896    public boolean hasCode() { 
897      return this.code != null && !this.code.isEmpty();
898    }
899
900    /**
901     * @param value {@link #code} (The type of the risk assessment performed.)
902     */
903    public RiskAssessment setCode(CodeableConcept value) { 
904      this.code = value;
905      return this;
906    }
907
908    /**
909     * @return {@link #subject} (The patient or group the risk assessment applies to.)
910     */
911    public Reference getSubject() { 
912      if (this.subject == null)
913        if (Configuration.errorOnAutoCreate())
914          throw new Error("Attempt to auto-create RiskAssessment.subject");
915        else if (Configuration.doAutoCreate())
916          this.subject = new Reference(); // cc
917      return this.subject;
918    }
919
920    public boolean hasSubject() { 
921      return this.subject != null && !this.subject.isEmpty();
922    }
923
924    /**
925     * @param value {@link #subject} (The patient or group the risk assessment applies to.)
926     */
927    public RiskAssessment setSubject(Reference value) { 
928      this.subject = value;
929      return this;
930    }
931
932    /**
933     * @return {@link #encounter} (The encounter where the assessment was performed.)
934     */
935    public Reference getEncounter() { 
936      if (this.encounter == null)
937        if (Configuration.errorOnAutoCreate())
938          throw new Error("Attempt to auto-create RiskAssessment.encounter");
939        else if (Configuration.doAutoCreate())
940          this.encounter = new Reference(); // cc
941      return this.encounter;
942    }
943
944    public boolean hasEncounter() { 
945      return this.encounter != null && !this.encounter.isEmpty();
946    }
947
948    /**
949     * @param value {@link #encounter} (The encounter where the assessment was performed.)
950     */
951    public RiskAssessment setEncounter(Reference value) { 
952      this.encounter = value;
953      return this;
954    }
955
956    /**
957     * @return {@link #occurrence} (The date (and possibly time) the risk assessment was performed.)
958     */
959    public DataType getOccurrence() { 
960      return this.occurrence;
961    }
962
963    /**
964     * @return {@link #occurrence} (The date (and possibly time) the risk assessment was performed.)
965     */
966    public DateTimeType getOccurrenceDateTimeType() throws FHIRException { 
967      if (this.occurrence == null)
968        this.occurrence = new DateTimeType();
969      if (!(this.occurrence instanceof DateTimeType))
970        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.occurrence.getClass().getName()+" was encountered");
971      return (DateTimeType) this.occurrence;
972    }
973
974    public boolean hasOccurrenceDateTimeType() { 
975      return this != null && this.occurrence instanceof DateTimeType;
976    }
977
978    /**
979     * @return {@link #occurrence} (The date (and possibly time) the risk assessment was performed.)
980     */
981    public Period getOccurrencePeriod() throws FHIRException { 
982      if (this.occurrence == null)
983        this.occurrence = new Period();
984      if (!(this.occurrence instanceof Period))
985        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.occurrence.getClass().getName()+" was encountered");
986      return (Period) this.occurrence;
987    }
988
989    public boolean hasOccurrencePeriod() { 
990      return this != null && this.occurrence instanceof Period;
991    }
992
993    public boolean hasOccurrence() { 
994      return this.occurrence != null && !this.occurrence.isEmpty();
995    }
996
997    /**
998     * @param value {@link #occurrence} (The date (and possibly time) the risk assessment was performed.)
999     */
1000    public RiskAssessment setOccurrence(DataType value) { 
1001      if (value != null && !(value instanceof DateTimeType || value instanceof Period))
1002        throw new Error("Not the right type for RiskAssessment.occurrence[x]: "+value.fhirType());
1003      this.occurrence = value;
1004      return this;
1005    }
1006
1007    /**
1008     * @return {@link #condition} (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.)
1009     */
1010    public Reference getCondition() { 
1011      if (this.condition == null)
1012        if (Configuration.errorOnAutoCreate())
1013          throw new Error("Attempt to auto-create RiskAssessment.condition");
1014        else if (Configuration.doAutoCreate())
1015          this.condition = new Reference(); // cc
1016      return this.condition;
1017    }
1018
1019    public boolean hasCondition() { 
1020      return this.condition != null && !this.condition.isEmpty();
1021    }
1022
1023    /**
1024     * @param value {@link #condition} (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.)
1025     */
1026    public RiskAssessment setCondition(Reference value) { 
1027      this.condition = value;
1028      return this;
1029    }
1030
1031    /**
1032     * @return {@link #performer} (The provider, patient, related person, or software application that performed the assessment.)
1033     */
1034    public Reference getPerformer() { 
1035      if (this.performer == null)
1036        if (Configuration.errorOnAutoCreate())
1037          throw new Error("Attempt to auto-create RiskAssessment.performer");
1038        else if (Configuration.doAutoCreate())
1039          this.performer = new Reference(); // cc
1040      return this.performer;
1041    }
1042
1043    public boolean hasPerformer() { 
1044      return this.performer != null && !this.performer.isEmpty();
1045    }
1046
1047    /**
1048     * @param value {@link #performer} (The provider, patient, related person, or software application that performed the assessment.)
1049     */
1050    public RiskAssessment setPerformer(Reference value) { 
1051      this.performer = value;
1052      return this;
1053    }
1054
1055    /**
1056     * @return {@link #reason} (The reason the risk assessment was performed.)
1057     */
1058    public List<CodeableReference> getReason() { 
1059      if (this.reason == null)
1060        this.reason = new ArrayList<CodeableReference>();
1061      return this.reason;
1062    }
1063
1064    /**
1065     * @return Returns a reference to <code>this</code> for easy method chaining
1066     */
1067    public RiskAssessment setReason(List<CodeableReference> theReason) { 
1068      this.reason = theReason;
1069      return this;
1070    }
1071
1072    public boolean hasReason() { 
1073      if (this.reason == null)
1074        return false;
1075      for (CodeableReference item : this.reason)
1076        if (!item.isEmpty())
1077          return true;
1078      return false;
1079    }
1080
1081    public CodeableReference addReason() { //3
1082      CodeableReference t = new CodeableReference();
1083      if (this.reason == null)
1084        this.reason = new ArrayList<CodeableReference>();
1085      this.reason.add(t);
1086      return t;
1087    }
1088
1089    public RiskAssessment addReason(CodeableReference t) { //3
1090      if (t == null)
1091        return this;
1092      if (this.reason == null)
1093        this.reason = new ArrayList<CodeableReference>();
1094      this.reason.add(t);
1095      return this;
1096    }
1097
1098    /**
1099     * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist {3}
1100     */
1101    public CodeableReference getReasonFirstRep() { 
1102      if (getReason().isEmpty()) {
1103        addReason();
1104      }
1105      return getReason().get(0);
1106    }
1107
1108    /**
1109     * @return {@link #basis} (Indicates the source data considered as part of the assessment (for example, FamilyHistory, Observations, Procedures, Conditions, etc.).)
1110     */
1111    public List<Reference> getBasis() { 
1112      if (this.basis == null)
1113        this.basis = new ArrayList<Reference>();
1114      return this.basis;
1115    }
1116
1117    /**
1118     * @return Returns a reference to <code>this</code> for easy method chaining
1119     */
1120    public RiskAssessment setBasis(List<Reference> theBasis) { 
1121      this.basis = theBasis;
1122      return this;
1123    }
1124
1125    public boolean hasBasis() { 
1126      if (this.basis == null)
1127        return false;
1128      for (Reference item : this.basis)
1129        if (!item.isEmpty())
1130          return true;
1131      return false;
1132    }
1133
1134    public Reference addBasis() { //3
1135      Reference t = new Reference();
1136      if (this.basis == null)
1137        this.basis = new ArrayList<Reference>();
1138      this.basis.add(t);
1139      return t;
1140    }
1141
1142    public RiskAssessment addBasis(Reference t) { //3
1143      if (t == null)
1144        return this;
1145      if (this.basis == null)
1146        this.basis = new ArrayList<Reference>();
1147      this.basis.add(t);
1148      return this;
1149    }
1150
1151    /**
1152     * @return The first repetition of repeating field {@link #basis}, creating it if it does not already exist {3}
1153     */
1154    public Reference getBasisFirstRep() { 
1155      if (getBasis().isEmpty()) {
1156        addBasis();
1157      }
1158      return getBasis().get(0);
1159    }
1160
1161    /**
1162     * @return {@link #prediction} (Describes the expected outcome for the subject.)
1163     */
1164    public List<RiskAssessmentPredictionComponent> getPrediction() { 
1165      if (this.prediction == null)
1166        this.prediction = new ArrayList<RiskAssessmentPredictionComponent>();
1167      return this.prediction;
1168    }
1169
1170    /**
1171     * @return Returns a reference to <code>this</code> for easy method chaining
1172     */
1173    public RiskAssessment setPrediction(List<RiskAssessmentPredictionComponent> thePrediction) { 
1174      this.prediction = thePrediction;
1175      return this;
1176    }
1177
1178    public boolean hasPrediction() { 
1179      if (this.prediction == null)
1180        return false;
1181      for (RiskAssessmentPredictionComponent item : this.prediction)
1182        if (!item.isEmpty())
1183          return true;
1184      return false;
1185    }
1186
1187    public RiskAssessmentPredictionComponent addPrediction() { //3
1188      RiskAssessmentPredictionComponent t = new RiskAssessmentPredictionComponent();
1189      if (this.prediction == null)
1190        this.prediction = new ArrayList<RiskAssessmentPredictionComponent>();
1191      this.prediction.add(t);
1192      return t;
1193    }
1194
1195    public RiskAssessment addPrediction(RiskAssessmentPredictionComponent t) { //3
1196      if (t == null)
1197        return this;
1198      if (this.prediction == null)
1199        this.prediction = new ArrayList<RiskAssessmentPredictionComponent>();
1200      this.prediction.add(t);
1201      return this;
1202    }
1203
1204    /**
1205     * @return The first repetition of repeating field {@link #prediction}, creating it if it does not already exist {3}
1206     */
1207    public RiskAssessmentPredictionComponent getPredictionFirstRep() { 
1208      if (getPrediction().isEmpty()) {
1209        addPrediction();
1210      }
1211      return getPrediction().get(0);
1212    }
1213
1214    /**
1215     * @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
1216     */
1217    public StringType getMitigationElement() { 
1218      if (this.mitigation == null)
1219        if (Configuration.errorOnAutoCreate())
1220          throw new Error("Attempt to auto-create RiskAssessment.mitigation");
1221        else if (Configuration.doAutoCreate())
1222          this.mitigation = new StringType(); // bb
1223      return this.mitigation;
1224    }
1225
1226    public boolean hasMitigationElement() { 
1227      return this.mitigation != null && !this.mitigation.isEmpty();
1228    }
1229
1230    public boolean hasMitigation() { 
1231      return this.mitigation != null && !this.mitigation.isEmpty();
1232    }
1233
1234    /**
1235     * @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
1236     */
1237    public RiskAssessment setMitigationElement(StringType value) { 
1238      this.mitigation = value;
1239      return this;
1240    }
1241
1242    /**
1243     * @return A description of the steps that might be taken to reduce the identified risk(s).
1244     */
1245    public String getMitigation() { 
1246      return this.mitigation == null ? null : this.mitigation.getValue();
1247    }
1248
1249    /**
1250     * @param value A description of the steps that might be taken to reduce the identified risk(s).
1251     */
1252    public RiskAssessment setMitigation(String value) { 
1253      if (Utilities.noString(value))
1254        this.mitigation = null;
1255      else {
1256        if (this.mitigation == null)
1257          this.mitigation = new StringType();
1258        this.mitigation.setValue(value);
1259      }
1260      return this;
1261    }
1262
1263    /**
1264     * @return {@link #note} (Additional comments about the risk assessment.)
1265     */
1266    public List<Annotation> getNote() { 
1267      if (this.note == null)
1268        this.note = new ArrayList<Annotation>();
1269      return this.note;
1270    }
1271
1272    /**
1273     * @return Returns a reference to <code>this</code> for easy method chaining
1274     */
1275    public RiskAssessment setNote(List<Annotation> theNote) { 
1276      this.note = theNote;
1277      return this;
1278    }
1279
1280    public boolean hasNote() { 
1281      if (this.note == null)
1282        return false;
1283      for (Annotation item : this.note)
1284        if (!item.isEmpty())
1285          return true;
1286      return false;
1287    }
1288
1289    public Annotation addNote() { //3
1290      Annotation t = new Annotation();
1291      if (this.note == null)
1292        this.note = new ArrayList<Annotation>();
1293      this.note.add(t);
1294      return t;
1295    }
1296
1297    public RiskAssessment addNote(Annotation t) { //3
1298      if (t == null)
1299        return this;
1300      if (this.note == null)
1301        this.note = new ArrayList<Annotation>();
1302      this.note.add(t);
1303      return this;
1304    }
1305
1306    /**
1307     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
1308     */
1309    public Annotation getNoteFirstRep() { 
1310      if (getNote().isEmpty()) {
1311        addNote();
1312      }
1313      return getNote().get(0);
1314    }
1315
1316      protected void listChildren(List<Property> children) {
1317        super.listChildren(children);
1318        children.add(new Property("identifier", "Identifier", "Business identifier assigned to the risk assessment.", 0, java.lang.Integer.MAX_VALUE, identifier));
1319        children.add(new Property("basedOn", "Reference(Any)", "A reference to the request that is fulfilled by this risk assessment.", 0, 1, basedOn));
1320        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));
1321        children.add(new Property("status", "code", "The status of the RiskAssessment, using the same statuses as an Observation.", 0, 1, status));
1322        children.add(new Property("method", "CodeableConcept", "The algorithm, process or mechanism used to evaluate the risk.", 0, 1, method));
1323        children.add(new Property("code", "CodeableConcept", "The type of the risk assessment performed.", 0, 1, code));
1324        children.add(new Property("subject", "Reference(Patient|Group)", "The patient or group the risk assessment applies to.", 0, 1, subject));
1325        children.add(new Property("encounter", "Reference(Encounter)", "The encounter where the assessment was performed.", 0, 1, encounter));
1326        children.add(new Property("occurrence[x]", "dateTime|Period", "The date (and possibly time) the risk assessment was performed.", 0, 1, occurrence));
1327        children.add(new Property("condition", "Reference(Condition)", "For assessments or prognosis specific to a particular condition, indicates the condition being assessed.", 0, 1, condition));
1328        children.add(new Property("performer", "Reference(Patient|Practitioner|PractitionerRole|RelatedPerson|Device)", "The provider, patient, related person, or software application that performed the assessment.", 0, 1, performer));
1329        children.add(new Property("reason", "CodeableReference(Condition|Observation|DiagnosticReport|DocumentReference)", "The reason the risk assessment was performed.", 0, java.lang.Integer.MAX_VALUE, reason));
1330        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));
1331        children.add(new Property("prediction", "", "Describes the expected outcome for the subject.", 0, java.lang.Integer.MAX_VALUE, prediction));
1332        children.add(new Property("mitigation", "string", "A description of the steps that might be taken to reduce the identified risk(s).", 0, 1, mitigation));
1333        children.add(new Property("note", "Annotation", "Additional comments about the risk assessment.", 0, java.lang.Integer.MAX_VALUE, note));
1334      }
1335
1336      @Override
1337      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1338        switch (_hash) {
1339        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Business identifier assigned to the risk assessment.", 0, java.lang.Integer.MAX_VALUE, identifier);
1340        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(Any)", "A reference to the request that is fulfilled by this risk assessment.", 0, 1, basedOn);
1341        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);
1342        case -892481550: /*status*/  return new Property("status", "code", "The status of the RiskAssessment, using the same statuses as an Observation.", 0, 1, status);
1343        case -1077554975: /*method*/  return new Property("method", "CodeableConcept", "The algorithm, process or mechanism used to evaluate the risk.", 0, 1, method);
1344        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "The type of the risk assessment performed.", 0, 1, code);
1345        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group)", "The patient or group the risk assessment applies to.", 0, 1, subject);
1346        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "The encounter where the assessment was performed.", 0, 1, encounter);
1347        case -2022646513: /*occurrence[x]*/  return new Property("occurrence[x]", "dateTime|Period", "The date (and possibly time) the risk assessment was performed.", 0, 1, occurrence);
1348        case 1687874001: /*occurrence*/  return new Property("occurrence[x]", "dateTime|Period", "The date (and possibly time) the risk assessment was performed.", 0, 1, occurrence);
1349        case -298443636: /*occurrenceDateTime*/  return new Property("occurrence[x]", "dateTime", "The date (and possibly time) the risk assessment was performed.", 0, 1, occurrence);
1350        case 1397156594: /*occurrencePeriod*/  return new Property("occurrence[x]", "Period", "The date (and possibly time) the risk assessment was performed.", 0, 1, occurrence);
1351        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);
1352        case 481140686: /*performer*/  return new Property("performer", "Reference(Patient|Practitioner|PractitionerRole|RelatedPerson|Device)", "The provider, patient, related person, or software application that performed the assessment.", 0, 1, performer);
1353        case -934964668: /*reason*/  return new Property("reason", "CodeableReference(Condition|Observation|DiagnosticReport|DocumentReference)", "The reason the risk assessment was performed.", 0, java.lang.Integer.MAX_VALUE, reason);
1354        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);
1355        case 1161234575: /*prediction*/  return new Property("prediction", "", "Describes the expected outcome for the subject.", 0, java.lang.Integer.MAX_VALUE, prediction);
1356        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);
1357        case 3387378: /*note*/  return new Property("note", "Annotation", "Additional comments about the risk assessment.", 0, java.lang.Integer.MAX_VALUE, note);
1358        default: return super.getNamedProperty(_hash, _name, _checkValid);
1359        }
1360
1361      }
1362
1363      @Override
1364      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1365        switch (hash) {
1366        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1367        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : new Base[] {this.basedOn}; // Reference
1368        case -995424086: /*parent*/ return this.parent == null ? new Base[0] : new Base[] {this.parent}; // Reference
1369        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<ObservationStatus>
1370        case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept
1371        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
1372        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
1373        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
1374        case 1687874001: /*occurrence*/ return this.occurrence == null ? new Base[0] : new Base[] {this.occurrence}; // DataType
1375        case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // Reference
1376        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference
1377        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableReference
1378        case 93508670: /*basis*/ return this.basis == null ? new Base[0] : this.basis.toArray(new Base[this.basis.size()]); // Reference
1379        case 1161234575: /*prediction*/ return this.prediction == null ? new Base[0] : this.prediction.toArray(new Base[this.prediction.size()]); // RiskAssessmentPredictionComponent
1380        case 1293793087: /*mitigation*/ return this.mitigation == null ? new Base[0] : new Base[] {this.mitigation}; // StringType
1381        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
1382        default: return super.getProperty(hash, name, checkValid);
1383        }
1384
1385      }
1386
1387      @Override
1388      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1389        switch (hash) {
1390        case -1618432855: // identifier
1391          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1392          return value;
1393        case -332612366: // basedOn
1394          this.basedOn = TypeConvertor.castToReference(value); // Reference
1395          return value;
1396        case -995424086: // parent
1397          this.parent = TypeConvertor.castToReference(value); // Reference
1398          return value;
1399        case -892481550: // status
1400          value = new ObservationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1401          this.status = (Enumeration) value; // Enumeration<ObservationStatus>
1402          return value;
1403        case -1077554975: // method
1404          this.method = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1405          return value;
1406        case 3059181: // code
1407          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1408          return value;
1409        case -1867885268: // subject
1410          this.subject = TypeConvertor.castToReference(value); // Reference
1411          return value;
1412        case 1524132147: // encounter
1413          this.encounter = TypeConvertor.castToReference(value); // Reference
1414          return value;
1415        case 1687874001: // occurrence
1416          this.occurrence = TypeConvertor.castToType(value); // DataType
1417          return value;
1418        case -861311717: // condition
1419          this.condition = TypeConvertor.castToReference(value); // Reference
1420          return value;
1421        case 481140686: // performer
1422          this.performer = TypeConvertor.castToReference(value); // Reference
1423          return value;
1424        case -934964668: // reason
1425          this.getReason().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
1426          return value;
1427        case 93508670: // basis
1428          this.getBasis().add(TypeConvertor.castToReference(value)); // Reference
1429          return value;
1430        case 1161234575: // prediction
1431          this.getPrediction().add((RiskAssessmentPredictionComponent) value); // RiskAssessmentPredictionComponent
1432          return value;
1433        case 1293793087: // mitigation
1434          this.mitigation = TypeConvertor.castToString(value); // StringType
1435          return value;
1436        case 3387378: // note
1437          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
1438          return value;
1439        default: return super.setProperty(hash, name, value);
1440        }
1441
1442      }
1443
1444      @Override
1445      public Base setProperty(String name, Base value) throws FHIRException {
1446        if (name.equals("identifier")) {
1447          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
1448        } else if (name.equals("basedOn")) {
1449          this.basedOn = TypeConvertor.castToReference(value); // Reference
1450        } else if (name.equals("parent")) {
1451          this.parent = TypeConvertor.castToReference(value); // Reference
1452        } else if (name.equals("status")) {
1453          value = new ObservationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1454          this.status = (Enumeration) value; // Enumeration<ObservationStatus>
1455        } else if (name.equals("method")) {
1456          this.method = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1457        } else if (name.equals("code")) {
1458          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1459        } else if (name.equals("subject")) {
1460          this.subject = TypeConvertor.castToReference(value); // Reference
1461        } else if (name.equals("encounter")) {
1462          this.encounter = TypeConvertor.castToReference(value); // Reference
1463        } else if (name.equals("occurrence[x]")) {
1464          this.occurrence = TypeConvertor.castToType(value); // DataType
1465        } else if (name.equals("condition")) {
1466          this.condition = TypeConvertor.castToReference(value); // Reference
1467        } else if (name.equals("performer")) {
1468          this.performer = TypeConvertor.castToReference(value); // Reference
1469        } else if (name.equals("reason")) {
1470          this.getReason().add(TypeConvertor.castToCodeableReference(value));
1471        } else if (name.equals("basis")) {
1472          this.getBasis().add(TypeConvertor.castToReference(value));
1473        } else if (name.equals("prediction")) {
1474          this.getPrediction().add((RiskAssessmentPredictionComponent) value);
1475        } else if (name.equals("mitigation")) {
1476          this.mitigation = TypeConvertor.castToString(value); // StringType
1477        } else if (name.equals("note")) {
1478          this.getNote().add(TypeConvertor.castToAnnotation(value));
1479        } else
1480          return super.setProperty(name, value);
1481        return value;
1482      }
1483
1484      @Override
1485      public Base makeProperty(int hash, String name) throws FHIRException {
1486        switch (hash) {
1487        case -1618432855:  return addIdentifier(); 
1488        case -332612366:  return getBasedOn();
1489        case -995424086:  return getParent();
1490        case -892481550:  return getStatusElement();
1491        case -1077554975:  return getMethod();
1492        case 3059181:  return getCode();
1493        case -1867885268:  return getSubject();
1494        case 1524132147:  return getEncounter();
1495        case -2022646513:  return getOccurrence();
1496        case 1687874001:  return getOccurrence();
1497        case -861311717:  return getCondition();
1498        case 481140686:  return getPerformer();
1499        case -934964668:  return addReason(); 
1500        case 93508670:  return addBasis(); 
1501        case 1161234575:  return addPrediction(); 
1502        case 1293793087:  return getMitigationElement();
1503        case 3387378:  return addNote(); 
1504        default: return super.makeProperty(hash, name);
1505        }
1506
1507      }
1508
1509      @Override
1510      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1511        switch (hash) {
1512        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1513        case -332612366: /*basedOn*/ return new String[] {"Reference"};
1514        case -995424086: /*parent*/ return new String[] {"Reference"};
1515        case -892481550: /*status*/ return new String[] {"code"};
1516        case -1077554975: /*method*/ return new String[] {"CodeableConcept"};
1517        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1518        case -1867885268: /*subject*/ return new String[] {"Reference"};
1519        case 1524132147: /*encounter*/ return new String[] {"Reference"};
1520        case 1687874001: /*occurrence*/ return new String[] {"dateTime", "Period"};
1521        case -861311717: /*condition*/ return new String[] {"Reference"};
1522        case 481140686: /*performer*/ return new String[] {"Reference"};
1523        case -934964668: /*reason*/ return new String[] {"CodeableReference"};
1524        case 93508670: /*basis*/ return new String[] {"Reference"};
1525        case 1161234575: /*prediction*/ return new String[] {};
1526        case 1293793087: /*mitigation*/ return new String[] {"string"};
1527        case 3387378: /*note*/ return new String[] {"Annotation"};
1528        default: return super.getTypesForProperty(hash, name);
1529        }
1530
1531      }
1532
1533      @Override
1534      public Base addChild(String name) throws FHIRException {
1535        if (name.equals("identifier")) {
1536          return addIdentifier();
1537        }
1538        else if (name.equals("basedOn")) {
1539          this.basedOn = new Reference();
1540          return this.basedOn;
1541        }
1542        else if (name.equals("parent")) {
1543          this.parent = new Reference();
1544          return this.parent;
1545        }
1546        else if (name.equals("status")) {
1547          throw new FHIRException("Cannot call addChild on a primitive type RiskAssessment.status");
1548        }
1549        else if (name.equals("method")) {
1550          this.method = new CodeableConcept();
1551          return this.method;
1552        }
1553        else if (name.equals("code")) {
1554          this.code = new CodeableConcept();
1555          return this.code;
1556        }
1557        else if (name.equals("subject")) {
1558          this.subject = new Reference();
1559          return this.subject;
1560        }
1561        else if (name.equals("encounter")) {
1562          this.encounter = new Reference();
1563          return this.encounter;
1564        }
1565        else if (name.equals("occurrenceDateTime")) {
1566          this.occurrence = new DateTimeType();
1567          return this.occurrence;
1568        }
1569        else if (name.equals("occurrencePeriod")) {
1570          this.occurrence = new Period();
1571          return this.occurrence;
1572        }
1573        else if (name.equals("condition")) {
1574          this.condition = new Reference();
1575          return this.condition;
1576        }
1577        else if (name.equals("performer")) {
1578          this.performer = new Reference();
1579          return this.performer;
1580        }
1581        else if (name.equals("reason")) {
1582          return addReason();
1583        }
1584        else if (name.equals("basis")) {
1585          return addBasis();
1586        }
1587        else if (name.equals("prediction")) {
1588          return addPrediction();
1589        }
1590        else if (name.equals("mitigation")) {
1591          throw new FHIRException("Cannot call addChild on a primitive type RiskAssessment.mitigation");
1592        }
1593        else if (name.equals("note")) {
1594          return addNote();
1595        }
1596        else
1597          return super.addChild(name);
1598      }
1599
1600  public String fhirType() {
1601    return "RiskAssessment";
1602
1603  }
1604
1605      public RiskAssessment copy() {
1606        RiskAssessment dst = new RiskAssessment();
1607        copyValues(dst);
1608        return dst;
1609      }
1610
1611      public void copyValues(RiskAssessment dst) {
1612        super.copyValues(dst);
1613        if (identifier != null) {
1614          dst.identifier = new ArrayList<Identifier>();
1615          for (Identifier i : identifier)
1616            dst.identifier.add(i.copy());
1617        };
1618        dst.basedOn = basedOn == null ? null : basedOn.copy();
1619        dst.parent = parent == null ? null : parent.copy();
1620        dst.status = status == null ? null : status.copy();
1621        dst.method = method == null ? null : method.copy();
1622        dst.code = code == null ? null : code.copy();
1623        dst.subject = subject == null ? null : subject.copy();
1624        dst.encounter = encounter == null ? null : encounter.copy();
1625        dst.occurrence = occurrence == null ? null : occurrence.copy();
1626        dst.condition = condition == null ? null : condition.copy();
1627        dst.performer = performer == null ? null : performer.copy();
1628        if (reason != null) {
1629          dst.reason = new ArrayList<CodeableReference>();
1630          for (CodeableReference i : reason)
1631            dst.reason.add(i.copy());
1632        };
1633        if (basis != null) {
1634          dst.basis = new ArrayList<Reference>();
1635          for (Reference i : basis)
1636            dst.basis.add(i.copy());
1637        };
1638        if (prediction != null) {
1639          dst.prediction = new ArrayList<RiskAssessmentPredictionComponent>();
1640          for (RiskAssessmentPredictionComponent i : prediction)
1641            dst.prediction.add(i.copy());
1642        };
1643        dst.mitigation = mitigation == null ? null : mitigation.copy();
1644        if (note != null) {
1645          dst.note = new ArrayList<Annotation>();
1646          for (Annotation i : note)
1647            dst.note.add(i.copy());
1648        };
1649      }
1650
1651      protected RiskAssessment typedCopy() {
1652        return copy();
1653      }
1654
1655      @Override
1656      public boolean equalsDeep(Base other_) {
1657        if (!super.equalsDeep(other_))
1658          return false;
1659        if (!(other_ instanceof RiskAssessment))
1660          return false;
1661        RiskAssessment o = (RiskAssessment) other_;
1662        return compareDeep(identifier, o.identifier, true) && compareDeep(basedOn, o.basedOn, true) && compareDeep(parent, o.parent, true)
1663           && compareDeep(status, o.status, true) && compareDeep(method, o.method, true) && compareDeep(code, o.code, true)
1664           && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true) && compareDeep(occurrence, o.occurrence, true)
1665           && compareDeep(condition, o.condition, true) && compareDeep(performer, o.performer, true) && compareDeep(reason, o.reason, true)
1666           && compareDeep(basis, o.basis, true) && compareDeep(prediction, o.prediction, true) && compareDeep(mitigation, o.mitigation, true)
1667           && compareDeep(note, o.note, true);
1668      }
1669
1670      @Override
1671      public boolean equalsShallow(Base other_) {
1672        if (!super.equalsShallow(other_))
1673          return false;
1674        if (!(other_ instanceof RiskAssessment))
1675          return false;
1676        RiskAssessment o = (RiskAssessment) other_;
1677        return compareValues(status, o.status, true) && compareValues(mitigation, o.mitigation, true);
1678      }
1679
1680      public boolean isEmpty() {
1681        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, basedOn, parent
1682          , status, method, code, subject, encounter, occurrence, condition, performer
1683          , reason, basis, prediction, mitigation, note);
1684      }
1685
1686  @Override
1687  public ResourceType getResourceType() {
1688    return ResourceType.RiskAssessment;
1689   }
1690
1691 /**
1692   * Search parameter: <b>condition</b>
1693   * <p>
1694   * Description: <b>Condition assessed</b><br>
1695   * Type: <b>reference</b><br>
1696   * Path: <b>RiskAssessment.condition</b><br>
1697   * </p>
1698   */
1699  @SearchParamDefinition(name="condition", path="RiskAssessment.condition", description="Condition assessed", type="reference", target={Condition.class } )
1700  public static final String SP_CONDITION = "condition";
1701 /**
1702   * <b>Fluent Client</b> search parameter constant for <b>condition</b>
1703   * <p>
1704   * Description: <b>Condition assessed</b><br>
1705   * Type: <b>reference</b><br>
1706   * Path: <b>RiskAssessment.condition</b><br>
1707   * </p>
1708   */
1709  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONDITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONDITION);
1710
1711/**
1712   * Constant for fluent queries to be used to add include statements. Specifies
1713   * the path value of "<b>RiskAssessment:condition</b>".
1714   */
1715  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONDITION = new ca.uhn.fhir.model.api.Include("RiskAssessment:condition").toLocked();
1716
1717 /**
1718   * Search parameter: <b>method</b>
1719   * <p>
1720   * Description: <b>Evaluation mechanism</b><br>
1721   * Type: <b>token</b><br>
1722   * Path: <b>RiskAssessment.method</b><br>
1723   * </p>
1724   */
1725  @SearchParamDefinition(name="method", path="RiskAssessment.method", description="Evaluation mechanism", type="token" )
1726  public static final String SP_METHOD = "method";
1727 /**
1728   * <b>Fluent Client</b> search parameter constant for <b>method</b>
1729   * <p>
1730   * Description: <b>Evaluation mechanism</b><br>
1731   * Type: <b>token</b><br>
1732   * Path: <b>RiskAssessment.method</b><br>
1733   * </p>
1734   */
1735  public static final ca.uhn.fhir.rest.gclient.TokenClientParam METHOD = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_METHOD);
1736
1737 /**
1738   * Search parameter: <b>performer</b>
1739   * <p>
1740   * Description: <b>Who did assessment?</b><br>
1741   * Type: <b>reference</b><br>
1742   * Path: <b>RiskAssessment.performer</b><br>
1743   * </p>
1744   */
1745  @SearchParamDefinition(name="performer", path="RiskAssessment.performer", description="Who did assessment?", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={Device.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
1746  public static final String SP_PERFORMER = "performer";
1747 /**
1748   * <b>Fluent Client</b> search parameter constant for <b>performer</b>
1749   * <p>
1750   * Description: <b>Who did assessment?</b><br>
1751   * Type: <b>reference</b><br>
1752   * Path: <b>RiskAssessment.performer</b><br>
1753   * </p>
1754   */
1755  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER);
1756
1757/**
1758   * Constant for fluent queries to be used to add include statements. Specifies
1759   * the path value of "<b>RiskAssessment:performer</b>".
1760   */
1761  public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("RiskAssessment:performer").toLocked();
1762
1763 /**
1764   * Search parameter: <b>probability</b>
1765   * <p>
1766   * Description: <b>Likelihood of specified outcome</b><br>
1767   * Type: <b>number</b><br>
1768   * Path: <b>RiskAssessment.prediction.probability</b><br>
1769   * </p>
1770   */
1771  @SearchParamDefinition(name="probability", path="RiskAssessment.prediction.probability", description="Likelihood of specified outcome", type="number" )
1772  public static final String SP_PROBABILITY = "probability";
1773 /**
1774   * <b>Fluent Client</b> search parameter constant for <b>probability</b>
1775   * <p>
1776   * Description: <b>Likelihood of specified outcome</b><br>
1777   * Type: <b>number</b><br>
1778   * Path: <b>RiskAssessment.prediction.probability</b><br>
1779   * </p>
1780   */
1781  public static final ca.uhn.fhir.rest.gclient.NumberClientParam PROBABILITY = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_PROBABILITY);
1782
1783 /**
1784   * Search parameter: <b>risk</b>
1785   * <p>
1786   * Description: <b>Likelihood of specified outcome as a qualitative value</b><br>
1787   * Type: <b>token</b><br>
1788   * Path: <b>RiskAssessment.prediction.qualitativeRisk</b><br>
1789   * </p>
1790   */
1791  @SearchParamDefinition(name="risk", path="RiskAssessment.prediction.qualitativeRisk", description="Likelihood of specified outcome as a qualitative value", type="token" )
1792  public static final String SP_RISK = "risk";
1793 /**
1794   * <b>Fluent Client</b> search parameter constant for <b>risk</b>
1795   * <p>
1796   * Description: <b>Likelihood of specified outcome as a qualitative value</b><br>
1797   * Type: <b>token</b><br>
1798   * Path: <b>RiskAssessment.prediction.qualitativeRisk</b><br>
1799   * </p>
1800   */
1801  public static final ca.uhn.fhir.rest.gclient.TokenClientParam RISK = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RISK);
1802
1803 /**
1804   * Search parameter: <b>subject</b>
1805   * <p>
1806   * Description: <b>Who/what does assessment apply to?</b><br>
1807   * Type: <b>reference</b><br>
1808   * Path: <b>RiskAssessment.subject</b><br>
1809   * </p>
1810   */
1811  @SearchParamDefinition(name="subject", path="RiskAssessment.subject", description="Who/what does assessment apply to?", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Group.class, Patient.class } )
1812  public static final String SP_SUBJECT = "subject";
1813 /**
1814   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
1815   * <p>
1816   * Description: <b>Who/what does assessment apply to?</b><br>
1817   * Type: <b>reference</b><br>
1818   * Path: <b>RiskAssessment.subject</b><br>
1819   * </p>
1820   */
1821  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
1822
1823/**
1824   * Constant for fluent queries to be used to add include statements. Specifies
1825   * the path value of "<b>RiskAssessment:subject</b>".
1826   */
1827  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("RiskAssessment:subject").toLocked();
1828
1829 /**
1830   * Search parameter: <b>date</b>
1831   * <p>
1832   * Description: <b>Multiple Resources: 
1833
1834* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
1835* [CarePlan](careplan.html): Time period plan covers
1836* [CareTeam](careteam.html): A date within the coverage time period.
1837* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
1838* [Composition](composition.html): Composition editing time
1839* [Consent](consent.html): When consent was agreed to
1840* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
1841* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted
1842* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
1843* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
1844* [Flag](flag.html): Time period when flag is active
1845* [Immunization](immunization.html): Vaccination  (non)-Administration Date
1846* [List](list.html): When the list was prepared
1847* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period
1848* [Procedure](procedure.html): When the procedure occurred or is occurring
1849* [RiskAssessment](riskassessment.html): When was assessment made?
1850* [SupplyRequest](supplyrequest.html): When the request was made
1851</b><br>
1852   * Type: <b>date</b><br>
1853   * Path: <b>AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective | Procedure.occurrence | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn</b><br>
1854   * </p>
1855   */
1856  @SearchParamDefinition(name="date", path="AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective | Procedure.occurrence | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded\r\n* [CarePlan](careplan.html): Time period plan covers\r\n* [CareTeam](careteam.html): A date within the coverage time period.\r\n* [ClinicalImpression](clinicalimpression.html): When the assessment was documented\r\n* [Composition](composition.html): Composition editing time\r\n* [Consent](consent.html): When consent was agreed to\r\n* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report\r\n* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted\r\n* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period\r\n* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated\r\n* [Flag](flag.html): Time period when flag is active\r\n* [Immunization](immunization.html): Vaccination  (non)-Administration Date\r\n* [List](list.html): When the list was prepared\r\n* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period\r\n* [Procedure](procedure.html): When the procedure occurred or is occurring\r\n* [RiskAssessment](riskassessment.html): When was assessment made?\r\n* [SupplyRequest](supplyrequest.html): When the request was made\r\n", type="date" )
1857  public static final String SP_DATE = "date";
1858 /**
1859   * <b>Fluent Client</b> search parameter constant for <b>date</b>
1860   * <p>
1861   * Description: <b>Multiple Resources: 
1862
1863* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
1864* [CarePlan](careplan.html): Time period plan covers
1865* [CareTeam](careteam.html): A date within the coverage time period.
1866* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
1867* [Composition](composition.html): Composition editing time
1868* [Consent](consent.html): When consent was agreed to
1869* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
1870* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted
1871* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
1872* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
1873* [Flag](flag.html): Time period when flag is active
1874* [Immunization](immunization.html): Vaccination  (non)-Administration Date
1875* [List](list.html): When the list was prepared
1876* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period
1877* [Procedure](procedure.html): When the procedure occurred or is occurring
1878* [RiskAssessment](riskassessment.html): When was assessment made?
1879* [SupplyRequest](supplyrequest.html): When the request was made
1880</b><br>
1881   * Type: <b>date</b><br>
1882   * Path: <b>AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective | Procedure.occurrence | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn</b><br>
1883   * </p>
1884   */
1885  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
1886
1887 /**
1888   * Search parameter: <b>encounter</b>
1889   * <p>
1890   * Description: <b>Multiple Resources: 
1891
1892* [Composition](composition.html): Context of the Composition
1893* [DeviceRequest](devicerequest.html): Encounter during which request was created
1894* [DiagnosticReport](diagnosticreport.html): The Encounter when the order was made
1895* [Flag](flag.html): Alert relevant during encounter
1896* [List](list.html): Context in which list created
1897* [NutritionOrder](nutritionorder.html): Return nutrition orders with this encounter identifier
1898* [Observation](observation.html): Encounter related to the observation
1899* [Procedure](procedure.html): The Encounter during which this Procedure was created
1900* [RiskAssessment](riskassessment.html): Where was assessment performed?
1901* [ServiceRequest](servicerequest.html): An encounter in which this request is made
1902* [VisionPrescription](visionprescription.html): Return prescriptions with this encounter identifier
1903</b><br>
1904   * Type: <b>reference</b><br>
1905   * Path: <b>Composition.encounter | DeviceRequest.encounter | DiagnosticReport.encounter | Flag.encounter | List.encounter | NutritionOrder.encounter | Observation.encounter | Procedure.encounter | RiskAssessment.encounter | ServiceRequest.encounter | VisionPrescription.encounter</b><br>
1906   * </p>
1907   */
1908  @SearchParamDefinition(name="encounter", path="Composition.encounter | DeviceRequest.encounter | DiagnosticReport.encounter | Flag.encounter | List.encounter | NutritionOrder.encounter | Observation.encounter | Procedure.encounter | RiskAssessment.encounter | ServiceRequest.encounter | VisionPrescription.encounter", description="Multiple Resources: \r\n\r\n* [Composition](composition.html): Context of the Composition\r\n* [DeviceRequest](devicerequest.html): Encounter during which request was created\r\n* [DiagnosticReport](diagnosticreport.html): The Encounter when the order was made\r\n* [Flag](flag.html): Alert relevant during encounter\r\n* [List](list.html): Context in which list created\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this encounter identifier\r\n* [Observation](observation.html): Encounter related to the observation\r\n* [Procedure](procedure.html): The Encounter during which this Procedure was created\r\n* [RiskAssessment](riskassessment.html): Where was assessment performed?\r\n* [ServiceRequest](servicerequest.html): An encounter in which this request is made\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this encounter identifier\r\n", type="reference", target={Encounter.class } )
1909  public static final String SP_ENCOUNTER = "encounter";
1910 /**
1911   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
1912   * <p>
1913   * Description: <b>Multiple Resources: 
1914
1915* [Composition](composition.html): Context of the Composition
1916* [DeviceRequest](devicerequest.html): Encounter during which request was created
1917* [DiagnosticReport](diagnosticreport.html): The Encounter when the order was made
1918* [Flag](flag.html): Alert relevant during encounter
1919* [List](list.html): Context in which list created
1920* [NutritionOrder](nutritionorder.html): Return nutrition orders with this encounter identifier
1921* [Observation](observation.html): Encounter related to the observation
1922* [Procedure](procedure.html): The Encounter during which this Procedure was created
1923* [RiskAssessment](riskassessment.html): Where was assessment performed?
1924* [ServiceRequest](servicerequest.html): An encounter in which this request is made
1925* [VisionPrescription](visionprescription.html): Return prescriptions with this encounter identifier
1926</b><br>
1927   * Type: <b>reference</b><br>
1928   * Path: <b>Composition.encounter | DeviceRequest.encounter | DiagnosticReport.encounter | Flag.encounter | List.encounter | NutritionOrder.encounter | Observation.encounter | Procedure.encounter | RiskAssessment.encounter | ServiceRequest.encounter | VisionPrescription.encounter</b><br>
1929   * </p>
1930   */
1931  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
1932
1933/**
1934   * Constant for fluent queries to be used to add include statements. Specifies
1935   * the path value of "<b>RiskAssessment:encounter</b>".
1936   */
1937  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("RiskAssessment:encounter").toLocked();
1938
1939 /**
1940   * Search parameter: <b>identifier</b>
1941   * <p>
1942   * Description: <b>Multiple Resources: 
1943
1944* [AllergyIntolerance](allergyintolerance.html): External ids for this item
1945* [CarePlan](careplan.html): External Ids for this plan
1946* [CareTeam](careteam.html): External Ids for this team
1947* [Composition](composition.html): Version-independent identifier for the Composition
1948* [Condition](condition.html): A unique identifier of the condition record
1949* [Consent](consent.html): Identifier for this record (external references)
1950* [DetectedIssue](detectedissue.html): Unique id for the detected issue
1951* [DeviceRequest](devicerequest.html): Business identifier for request/order
1952* [DiagnosticReport](diagnosticreport.html): An identifier for the report
1953* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
1954* [DocumentReference](documentreference.html): Identifier of the attachment binary
1955* [Encounter](encounter.html): Identifier(s) by which this encounter is known
1956* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
1957* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
1958* [Goal](goal.html): External Ids for this goal
1959* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
1960* [Immunization](immunization.html): Business identifier
1961* [List](list.html): Business identifier
1962* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
1963* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
1964* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
1965* [MedicationUsage](medicationusage.html): Return statements with this external identifier
1966* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
1967* [Observation](observation.html): The unique id for a particular observation
1968* [Procedure](procedure.html): A unique identifier for a procedure
1969* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
1970* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
1971* [SupplyDelivery](supplydelivery.html): External identifier
1972* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
1973* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
1974</b><br>
1975   * Type: <b>token</b><br>
1976   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
1977   * </p>
1978   */
1979  @SearchParamDefinition(name="identifier", path="AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): External ids for this item\r\n* [CarePlan](careplan.html): External Ids for this plan\r\n* [CareTeam](careteam.html): External Ids for this team\r\n* [Composition](composition.html): Version-independent identifier for the Composition\r\n* [Condition](condition.html): A unique identifier of the condition record\r\n* [Consent](consent.html): Identifier for this record (external references)\r\n* [DetectedIssue](detectedissue.html): Unique id for the detected issue\r\n* [DeviceRequest](devicerequest.html): Business identifier for request/order\r\n* [DiagnosticReport](diagnosticreport.html): An identifier for the report\r\n* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents\r\n* [DocumentReference](documentreference.html): Identifier of the attachment binary\r\n* [Encounter](encounter.html): Identifier(s) by which this encounter is known\r\n* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier\r\n* [Goal](goal.html): External Ids for this goal\r\n* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID\r\n* [Immunization](immunization.html): Business identifier\r\n* [List](list.html): Business identifier\r\n* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier\r\n* [MedicationUsage](medicationusage.html): Return statements with this external identifier\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier\r\n* [Observation](observation.html): The unique id for a particular observation\r\n* [Procedure](procedure.html): A unique identifier for a procedure\r\n* [RiskAssessment](riskassessment.html): Unique identifier for the assessment\r\n* [ServiceRequest](servicerequest.html): Identifiers assigned to this order\r\n* [SupplyDelivery](supplydelivery.html): External identifier\r\n* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier\r\n", type="token" )
1980  public static final String SP_IDENTIFIER = "identifier";
1981 /**
1982   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1983   * <p>
1984   * Description: <b>Multiple Resources: 
1985
1986* [AllergyIntolerance](allergyintolerance.html): External ids for this item
1987* [CarePlan](careplan.html): External Ids for this plan
1988* [CareTeam](careteam.html): External Ids for this team
1989* [Composition](composition.html): Version-independent identifier for the Composition
1990* [Condition](condition.html): A unique identifier of the condition record
1991* [Consent](consent.html): Identifier for this record (external references)
1992* [DetectedIssue](detectedissue.html): Unique id for the detected issue
1993* [DeviceRequest](devicerequest.html): Business identifier for request/order
1994* [DiagnosticReport](diagnosticreport.html): An identifier for the report
1995* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
1996* [DocumentReference](documentreference.html): Identifier of the attachment binary
1997* [Encounter](encounter.html): Identifier(s) by which this encounter is known
1998* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
1999* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
2000* [Goal](goal.html): External Ids for this goal
2001* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
2002* [Immunization](immunization.html): Business identifier
2003* [List](list.html): Business identifier
2004* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
2005* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
2006* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
2007* [MedicationUsage](medicationusage.html): Return statements with this external identifier
2008* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
2009* [Observation](observation.html): The unique id for a particular observation
2010* [Procedure](procedure.html): A unique identifier for a procedure
2011* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
2012* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
2013* [SupplyDelivery](supplydelivery.html): External identifier
2014* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
2015* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
2016</b><br>
2017   * Type: <b>token</b><br>
2018   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
2019   * </p>
2020   */
2021  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2022
2023 /**
2024   * Search parameter: <b>patient</b>
2025   * <p>
2026   * Description: <b>Multiple Resources: 
2027
2028* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
2029* [CarePlan](careplan.html): Who the care plan is for
2030* [CareTeam](careteam.html): Who care team is for
2031* [ClinicalImpression](clinicalimpression.html): Patient assessed
2032* [Composition](composition.html): Who and/or what the composition is about
2033* [Condition](condition.html): Who has the condition?
2034* [Consent](consent.html): Who the consent applies to
2035* [DetectedIssue](detectedissue.html): Associated patient
2036* [DeviceRequest](devicerequest.html): Individual the service is ordered for
2037* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
2038* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2039* [DocumentManifest](documentmanifest.html): The subject of the set of documents
2040* [DocumentReference](documentreference.html): Who/what is the subject of the document
2041* [Encounter](encounter.html): The patient present at the encounter
2042* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2043* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2044* [Flag](flag.html): The identity of a subject to list flags for
2045* [Goal](goal.html): Who this goal is intended for
2046* [ImagingStudy](imagingstudy.html): Who the study is about
2047* [Immunization](immunization.html): The patient for the vaccination record
2048* [List](list.html): If all resources have the same subject
2049* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2050* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2051* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2052* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
2053* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement
2054* [Observation](observation.html): The subject that the observation is about (if patient)
2055* [Procedure](procedure.html): Search by subject - a patient
2056* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2057* [ServiceRequest](servicerequest.html): Search by subject - a patient
2058* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2059* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2060</b><br>
2061   * Type: <b>reference</b><br>
2062   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient</b><br>
2063   * </p>
2064   */
2065  @SearchParamDefinition(name="patient", path="AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for\r\n* [CarePlan](careplan.html): Who the care plan is for\r\n* [CareTeam](careteam.html): Who care team is for\r\n* [ClinicalImpression](clinicalimpression.html): Patient assessed\r\n* [Composition](composition.html): Who and/or what the composition is about\r\n* [Condition](condition.html): Who has the condition?\r\n* [Consent](consent.html): Who the consent applies to\r\n* [DetectedIssue](detectedissue.html): Associated patient\r\n* [DeviceRequest](devicerequest.html): Individual the service is ordered for\r\n* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device\r\n* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient\r\n* [DocumentManifest](documentmanifest.html): The subject of the set of documents\r\n* [DocumentReference](documentreference.html): Who/what is the subject of the document\r\n* [Encounter](encounter.html): The patient present at the encounter\r\n* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care\r\n* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for\r\n* [Flag](flag.html): The identity of a subject to list flags for\r\n* [Goal](goal.html): Who this goal is intended for\r\n* [ImagingStudy](imagingstudy.html): Who the study is about\r\n* [Immunization](immunization.html): The patient for the vaccination record\r\n* [List](list.html): If all resources have the same subject\r\n* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for\r\n* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for\r\n* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient\r\n* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.\r\n* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement\r\n* [Observation](observation.html): The subject that the observation is about (if patient)\r\n* [Procedure](procedure.html): Search by subject - a patient\r\n* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?\r\n* [ServiceRequest](servicerequest.html): Search by subject - a patient\r\n* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied\r\n* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for\r\n", type="reference", target={Patient.class } )
2066  public static final String SP_PATIENT = "patient";
2067 /**
2068   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2069   * <p>
2070   * Description: <b>Multiple Resources: 
2071
2072* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
2073* [CarePlan](careplan.html): Who the care plan is for
2074* [CareTeam](careteam.html): Who care team is for
2075* [ClinicalImpression](clinicalimpression.html): Patient assessed
2076* [Composition](composition.html): Who and/or what the composition is about
2077* [Condition](condition.html): Who has the condition?
2078* [Consent](consent.html): Who the consent applies to
2079* [DetectedIssue](detectedissue.html): Associated patient
2080* [DeviceRequest](devicerequest.html): Individual the service is ordered for
2081* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
2082* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2083* [DocumentManifest](documentmanifest.html): The subject of the set of documents
2084* [DocumentReference](documentreference.html): Who/what is the subject of the document
2085* [Encounter](encounter.html): The patient present at the encounter
2086* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2087* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2088* [Flag](flag.html): The identity of a subject to list flags for
2089* [Goal](goal.html): Who this goal is intended for
2090* [ImagingStudy](imagingstudy.html): Who the study is about
2091* [Immunization](immunization.html): The patient for the vaccination record
2092* [List](list.html): If all resources have the same subject
2093* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2094* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2095* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2096* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
2097* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement
2098* [Observation](observation.html): The subject that the observation is about (if patient)
2099* [Procedure](procedure.html): Search by subject - a patient
2100* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2101* [ServiceRequest](servicerequest.html): Search by subject - a patient
2102* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2103* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2104</b><br>
2105   * Type: <b>reference</b><br>
2106   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient</b><br>
2107   * </p>
2108   */
2109  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2110
2111/**
2112   * Constant for fluent queries to be used to add include statements. Specifies
2113   * the path value of "<b>RiskAssessment:patient</b>".
2114   */
2115  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("RiskAssessment:patient").toLocked();
2116
2117
2118}
2119