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