001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import ca.uhn.fhir.model.api.annotation.ResourceDef;
038import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
039import ca.uhn.fhir.model.api.annotation.Child;
040import ca.uhn.fhir.model.api.annotation.ChildOrder;
041import ca.uhn.fhir.model.api.annotation.Description;
042import ca.uhn.fhir.model.api.annotation.Block;
043import org.hl7.fhir.instance.model.api.*;
044import org.hl7.fhir.exceptions.FHIRException;
045/**
046 * Measurements and simple assertions made about a patient, device or other subject.
047 */
048@ResourceDef(name="Observation", profile="http://hl7.org/fhir/Profile/Observation")
049public class Observation extends DomainResource {
050
051    public enum ObservationStatus {
052        /**
053         * The existence of the observation is registered, but there is no result yet available.
054         */
055        REGISTERED, 
056        /**
057         * This is an initial or interim observation: data may be incomplete or unverified.
058         */
059        PRELIMINARY, 
060        /**
061         * The observation is complete.
062         */
063        FINAL, 
064        /**
065         * Subsequent to being Final, the observation has been modified subsequent.  This includes updates/new information and corrections.
066         */
067        AMENDED, 
068        /**
069         * Subsequent to being Final, the observation has been modified to correct an error in the test result.
070         */
071        CORRECTED, 
072        /**
073         * The observation is unavailable because the measurement was not started or not completed (also sometimes called "aborted").
074         */
075        CANCELLED, 
076        /**
077         * 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".)
078         */
079        ENTEREDINERROR, 
080        /**
081         * The authoring system does not know which of the status values currently applies for this request. Note: This concept is not to be used for "other" - one of the listed statuses is presumed to apply, but the authoring system does not know which.
082         */
083        UNKNOWN, 
084        /**
085         * added to help the parsers with the generic types
086         */
087        NULL;
088        public static ObservationStatus fromCode(String codeString) throws FHIRException {
089            if (codeString == null || "".equals(codeString))
090                return null;
091        if ("registered".equals(codeString))
092          return REGISTERED;
093        if ("preliminary".equals(codeString))
094          return PRELIMINARY;
095        if ("final".equals(codeString))
096          return FINAL;
097        if ("amended".equals(codeString))
098          return AMENDED;
099        if ("corrected".equals(codeString))
100          return CORRECTED;
101        if ("cancelled".equals(codeString))
102          return CANCELLED;
103        if ("entered-in-error".equals(codeString))
104          return ENTEREDINERROR;
105        if ("unknown".equals(codeString))
106          return UNKNOWN;
107        if (Configuration.isAcceptInvalidEnums())
108          return null;
109        else
110          throw new FHIRException("Unknown ObservationStatus code '"+codeString+"'");
111        }
112        public String toCode() {
113          switch (this) {
114            case REGISTERED: return "registered";
115            case PRELIMINARY: return "preliminary";
116            case FINAL: return "final";
117            case AMENDED: return "amended";
118            case CORRECTED: return "corrected";
119            case CANCELLED: return "cancelled";
120            case ENTEREDINERROR: return "entered-in-error";
121            case UNKNOWN: return "unknown";
122            default: return "?";
123          }
124        }
125        public String getSystem() {
126          switch (this) {
127            case REGISTERED: return "http://hl7.org/fhir/observation-status";
128            case PRELIMINARY: return "http://hl7.org/fhir/observation-status";
129            case FINAL: return "http://hl7.org/fhir/observation-status";
130            case AMENDED: return "http://hl7.org/fhir/observation-status";
131            case CORRECTED: return "http://hl7.org/fhir/observation-status";
132            case CANCELLED: return "http://hl7.org/fhir/observation-status";
133            case ENTEREDINERROR: return "http://hl7.org/fhir/observation-status";
134            case UNKNOWN: return "http://hl7.org/fhir/observation-status";
135            default: return "?";
136          }
137        }
138        public String getDefinition() {
139          switch (this) {
140            case REGISTERED: return "The existence of the observation is registered, but there is no result yet available.";
141            case PRELIMINARY: return "This is an initial or interim observation: data may be incomplete or unverified.";
142            case FINAL: return "The observation is complete.";
143            case AMENDED: return "Subsequent to being Final, the observation has been modified subsequent.  This includes updates/new information and corrections.";
144            case CORRECTED: return "Subsequent to being Final, the observation has been modified to correct an error in the test result.";
145            case CANCELLED: return "The observation is unavailable because the measurement was not started or not completed (also sometimes called \"aborted\").";
146            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\".)";
147            case UNKNOWN: return "The authoring system does not know which of the status values currently applies for this request. Note: This concept is not to be used for \"other\" - one of the listed statuses is presumed to apply, but the authoring system does not know which.";
148            default: return "?";
149          }
150        }
151        public String getDisplay() {
152          switch (this) {
153            case REGISTERED: return "Registered";
154            case PRELIMINARY: return "Preliminary";
155            case FINAL: return "Final";
156            case AMENDED: return "Amended";
157            case CORRECTED: return "Corrected";
158            case CANCELLED: return "Cancelled";
159            case ENTEREDINERROR: return "Entered in Error";
160            case UNKNOWN: return "Unknown";
161            default: return "?";
162          }
163        }
164    }
165
166  public static class ObservationStatusEnumFactory implements EnumFactory<ObservationStatus> {
167    public ObservationStatus fromCode(String codeString) throws IllegalArgumentException {
168      if (codeString == null || "".equals(codeString))
169            if (codeString == null || "".equals(codeString))
170                return null;
171        if ("registered".equals(codeString))
172          return ObservationStatus.REGISTERED;
173        if ("preliminary".equals(codeString))
174          return ObservationStatus.PRELIMINARY;
175        if ("final".equals(codeString))
176          return ObservationStatus.FINAL;
177        if ("amended".equals(codeString))
178          return ObservationStatus.AMENDED;
179        if ("corrected".equals(codeString))
180          return ObservationStatus.CORRECTED;
181        if ("cancelled".equals(codeString))
182          return ObservationStatus.CANCELLED;
183        if ("entered-in-error".equals(codeString))
184          return ObservationStatus.ENTEREDINERROR;
185        if ("unknown".equals(codeString))
186          return ObservationStatus.UNKNOWN;
187        throw new IllegalArgumentException("Unknown ObservationStatus code '"+codeString+"'");
188        }
189        public Enumeration<ObservationStatus> fromType(Base code) throws FHIRException {
190          if (code == null)
191            return null;
192          if (code.isEmpty())
193            return new Enumeration<ObservationStatus>(this);
194          String codeString = ((PrimitiveType) code).asStringValue();
195          if (codeString == null || "".equals(codeString))
196            return null;
197        if ("registered".equals(codeString))
198          return new Enumeration<ObservationStatus>(this, ObservationStatus.REGISTERED);
199        if ("preliminary".equals(codeString))
200          return new Enumeration<ObservationStatus>(this, ObservationStatus.PRELIMINARY);
201        if ("final".equals(codeString))
202          return new Enumeration<ObservationStatus>(this, ObservationStatus.FINAL);
203        if ("amended".equals(codeString))
204          return new Enumeration<ObservationStatus>(this, ObservationStatus.AMENDED);
205        if ("corrected".equals(codeString))
206          return new Enumeration<ObservationStatus>(this, ObservationStatus.CORRECTED);
207        if ("cancelled".equals(codeString))
208          return new Enumeration<ObservationStatus>(this, ObservationStatus.CANCELLED);
209        if ("entered-in-error".equals(codeString))
210          return new Enumeration<ObservationStatus>(this, ObservationStatus.ENTEREDINERROR);
211        if ("unknown".equals(codeString))
212          return new Enumeration<ObservationStatus>(this, ObservationStatus.UNKNOWN);
213        throw new FHIRException("Unknown ObservationStatus code '"+codeString+"'");
214        }
215    public String toCode(ObservationStatus code) {
216      if (code == ObservationStatus.REGISTERED)
217        return "registered";
218      if (code == ObservationStatus.PRELIMINARY)
219        return "preliminary";
220      if (code == ObservationStatus.FINAL)
221        return "final";
222      if (code == ObservationStatus.AMENDED)
223        return "amended";
224      if (code == ObservationStatus.CORRECTED)
225        return "corrected";
226      if (code == ObservationStatus.CANCELLED)
227        return "cancelled";
228      if (code == ObservationStatus.ENTEREDINERROR)
229        return "entered-in-error";
230      if (code == ObservationStatus.UNKNOWN)
231        return "unknown";
232      return "?";
233      }
234    public String toSystem(ObservationStatus code) {
235      return code.getSystem();
236      }
237    }
238
239    @Block()
240    public static class ObservationReferenceRangeComponent extends BackboneElement implements IBaseBackboneElement {
241        /**
242         * The value of the low bound of the reference range.  The low bound of the reference range endpoint is inclusive of the value (e.g.  reference range is >=5 - <=9). If the low bound is omitted,  it is assumed to be meaningless (e.g. reference range is <=2.3).
243         */
244        @Child(name = "low", type = {SimpleQuantity.class}, order=1, min=0, max=1, modifier=false, summary=false)
245        @Description(shortDefinition="Low Range, if relevant", formalDefinition="The value of the low bound of the reference range.  The low bound of the reference range endpoint is inclusive of the value (e.g.  reference range is >=5 - <=9). If the low bound is omitted,  it is assumed to be meaningless (e.g. reference range is <=2.3)." )
246        protected SimpleQuantity low;
247
248        /**
249         * The value of the high bound of the reference range.  The high bound of the reference range endpoint is inclusive of the value (e.g.  reference range is >=5 - <=9). If the high bound is omitted,  it is assumed to be meaningless (e.g. reference range is >= 2.3).
250         */
251        @Child(name = "high", type = {SimpleQuantity.class}, order=2, min=0, max=1, modifier=false, summary=false)
252        @Description(shortDefinition="High Range, if relevant", formalDefinition="The value of the high bound of the reference range.  The high bound of the reference range endpoint is inclusive of the value (e.g.  reference range is >=5 - <=9). If the high bound is omitted,  it is assumed to be meaningless (e.g. reference range is >= 2.3)." )
253        protected SimpleQuantity high;
254
255        /**
256         * Codes to indicate the what part of the targeted reference population it applies to. For example, the normal or therapeutic range.
257         */
258        @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
259        @Description(shortDefinition="Reference range qualifier", formalDefinition="Codes to indicate the what part of the targeted reference population it applies to. For example, the normal or therapeutic range." )
260        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/referencerange-meaning")
261        protected CodeableConcept type;
262
263        /**
264         * Codes to indicate the target population this reference range applies to.  For example, a reference range may be based on the normal population or a particular sex or race.
265         */
266        @Child(name = "appliesTo", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
267        @Description(shortDefinition="Reference range population", formalDefinition="Codes to indicate the target population this reference range applies to.  For example, a reference range may be based on the normal population or a particular sex or race." )
268        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/referencerange-appliesto")
269        protected List<CodeableConcept> appliesTo;
270
271        /**
272         * The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.
273         */
274        @Child(name = "age", type = {Range.class}, order=5, min=0, max=1, modifier=false, summary=false)
275        @Description(shortDefinition="Applicable age range, if relevant", formalDefinition="The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so." )
276        protected Range age;
277
278        /**
279         * Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation.  An example would be a reference value of "Negative" or a list or table of "normals".
280         */
281        @Child(name = "text", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
282        @Description(shortDefinition="Text based reference range in an observation", formalDefinition="Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation.  An example would be a reference value of \"Negative\" or a list or table of \"normals\"." )
283        protected StringType text;
284
285        private static final long serialVersionUID = -955638831L;
286
287    /**
288     * Constructor
289     */
290      public ObservationReferenceRangeComponent() {
291        super();
292      }
293
294        /**
295         * @return {@link #low} (The value of the low bound of the reference range.  The low bound of the reference range endpoint is inclusive of the value (e.g.  reference range is >=5 - <=9). If the low bound is omitted,  it is assumed to be meaningless (e.g. reference range is <=2.3).)
296         */
297        public SimpleQuantity getLow() { 
298          if (this.low == null)
299            if (Configuration.errorOnAutoCreate())
300              throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.low");
301            else if (Configuration.doAutoCreate())
302              this.low = new SimpleQuantity(); // cc
303          return this.low;
304        }
305
306        public boolean hasLow() { 
307          return this.low != null && !this.low.isEmpty();
308        }
309
310        /**
311         * @param value {@link #low} (The value of the low bound of the reference range.  The low bound of the reference range endpoint is inclusive of the value (e.g.  reference range is >=5 - <=9). If the low bound is omitted,  it is assumed to be meaningless (e.g. reference range is <=2.3).)
312         */
313        public ObservationReferenceRangeComponent setLow(SimpleQuantity value) { 
314          this.low = value;
315          return this;
316        }
317
318        /**
319         * @return {@link #high} (The value of the high bound of the reference range.  The high bound of the reference range endpoint is inclusive of the value (e.g.  reference range is >=5 - <=9). If the high bound is omitted,  it is assumed to be meaningless (e.g. reference range is >= 2.3).)
320         */
321        public SimpleQuantity getHigh() { 
322          if (this.high == null)
323            if (Configuration.errorOnAutoCreate())
324              throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.high");
325            else if (Configuration.doAutoCreate())
326              this.high = new SimpleQuantity(); // cc
327          return this.high;
328        }
329
330        public boolean hasHigh() { 
331          return this.high != null && !this.high.isEmpty();
332        }
333
334        /**
335         * @param value {@link #high} (The value of the high bound of the reference range.  The high bound of the reference range endpoint is inclusive of the value (e.g.  reference range is >=5 - <=9). If the high bound is omitted,  it is assumed to be meaningless (e.g. reference range is >= 2.3).)
336         */
337        public ObservationReferenceRangeComponent setHigh(SimpleQuantity value) { 
338          this.high = value;
339          return this;
340        }
341
342        /**
343         * @return {@link #type} (Codes to indicate the what part of the targeted reference population it applies to. For example, the normal or therapeutic range.)
344         */
345        public CodeableConcept getType() { 
346          if (this.type == null)
347            if (Configuration.errorOnAutoCreate())
348              throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.type");
349            else if (Configuration.doAutoCreate())
350              this.type = new CodeableConcept(); // cc
351          return this.type;
352        }
353
354        public boolean hasType() { 
355          return this.type != null && !this.type.isEmpty();
356        }
357
358        /**
359         * @param value {@link #type} (Codes to indicate the what part of the targeted reference population it applies to. For example, the normal or therapeutic range.)
360         */
361        public ObservationReferenceRangeComponent setType(CodeableConcept value) { 
362          this.type = value;
363          return this;
364        }
365
366        /**
367         * @return {@link #appliesTo} (Codes to indicate the target population this reference range applies to.  For example, a reference range may be based on the normal population or a particular sex or race.)
368         */
369        public List<CodeableConcept> getAppliesTo() { 
370          if (this.appliesTo == null)
371            this.appliesTo = new ArrayList<CodeableConcept>();
372          return this.appliesTo;
373        }
374
375        /**
376         * @return Returns a reference to <code>this</code> for easy method chaining
377         */
378        public ObservationReferenceRangeComponent setAppliesTo(List<CodeableConcept> theAppliesTo) { 
379          this.appliesTo = theAppliesTo;
380          return this;
381        }
382
383        public boolean hasAppliesTo() { 
384          if (this.appliesTo == null)
385            return false;
386          for (CodeableConcept item : this.appliesTo)
387            if (!item.isEmpty())
388              return true;
389          return false;
390        }
391
392        public CodeableConcept addAppliesTo() { //3
393          CodeableConcept t = new CodeableConcept();
394          if (this.appliesTo == null)
395            this.appliesTo = new ArrayList<CodeableConcept>();
396          this.appliesTo.add(t);
397          return t;
398        }
399
400        public ObservationReferenceRangeComponent addAppliesTo(CodeableConcept t) { //3
401          if (t == null)
402            return this;
403          if (this.appliesTo == null)
404            this.appliesTo = new ArrayList<CodeableConcept>();
405          this.appliesTo.add(t);
406          return this;
407        }
408
409        /**
410         * @return The first repetition of repeating field {@link #appliesTo}, creating it if it does not already exist
411         */
412        public CodeableConcept getAppliesToFirstRep() { 
413          if (getAppliesTo().isEmpty()) {
414            addAppliesTo();
415          }
416          return getAppliesTo().get(0);
417        }
418
419        /**
420         * @return {@link #age} (The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.)
421         */
422        public Range getAge() { 
423          if (this.age == null)
424            if (Configuration.errorOnAutoCreate())
425              throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.age");
426            else if (Configuration.doAutoCreate())
427              this.age = new Range(); // cc
428          return this.age;
429        }
430
431        public boolean hasAge() { 
432          return this.age != null && !this.age.isEmpty();
433        }
434
435        /**
436         * @param value {@link #age} (The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.)
437         */
438        public ObservationReferenceRangeComponent setAge(Range value) { 
439          this.age = value;
440          return this;
441        }
442
443        /**
444         * @return {@link #text} (Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation.  An example would be a reference value of "Negative" or a list or table of "normals".). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
445         */
446        public StringType getTextElement() { 
447          if (this.text == null)
448            if (Configuration.errorOnAutoCreate())
449              throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.text");
450            else if (Configuration.doAutoCreate())
451              this.text = new StringType(); // bb
452          return this.text;
453        }
454
455        public boolean hasTextElement() { 
456          return this.text != null && !this.text.isEmpty();
457        }
458
459        public boolean hasText() { 
460          return this.text != null && !this.text.isEmpty();
461        }
462
463        /**
464         * @param value {@link #text} (Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation.  An example would be a reference value of "Negative" or a list or table of "normals".). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
465         */
466        public ObservationReferenceRangeComponent setTextElement(StringType value) { 
467          this.text = value;
468          return this;
469        }
470
471        /**
472         * @return Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation.  An example would be a reference value of "Negative" or a list or table of "normals".
473         */
474        public String getText() { 
475          return this.text == null ? null : this.text.getValue();
476        }
477
478        /**
479         * @param value Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation.  An example would be a reference value of "Negative" or a list or table of "normals".
480         */
481        public ObservationReferenceRangeComponent setText(String value) { 
482          if (Utilities.noString(value))
483            this.text = null;
484          else {
485            if (this.text == null)
486              this.text = new StringType();
487            this.text.setValue(value);
488          }
489          return this;
490        }
491
492        protected void listChildren(List<Property> children) {
493          super.listChildren(children);
494          children.add(new Property("low", "SimpleQuantity", "The value of the low bound of the reference range.  The low bound of the reference range endpoint is inclusive of the value (e.g.  reference range is >=5 - <=9). If the low bound is omitted,  it is assumed to be meaningless (e.g. reference range is <=2.3).", 0, 1, low));
495          children.add(new Property("high", "SimpleQuantity", "The value of the high bound of the reference range.  The high bound of the reference range endpoint is inclusive of the value (e.g.  reference range is >=5 - <=9). If the high bound is omitted,  it is assumed to be meaningless (e.g. reference range is >= 2.3).", 0, 1, high));
496          children.add(new Property("type", "CodeableConcept", "Codes to indicate the what part of the targeted reference population it applies to. For example, the normal or therapeutic range.", 0, 1, type));
497          children.add(new Property("appliesTo", "CodeableConcept", "Codes to indicate the target population this reference range applies to.  For example, a reference range may be based on the normal population or a particular sex or race.", 0, java.lang.Integer.MAX_VALUE, appliesTo));
498          children.add(new Property("age", "Range", "The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.", 0, 1, age));
499          children.add(new Property("text", "string", "Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation.  An example would be a reference value of \"Negative\" or a list or table of \"normals\".", 0, 1, text));
500        }
501
502        @Override
503        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
504          switch (_hash) {
505          case 107348: /*low*/  return new Property("low", "SimpleQuantity", "The value of the low bound of the reference range.  The low bound of the reference range endpoint is inclusive of the value (e.g.  reference range is >=5 - <=9). If the low bound is omitted,  it is assumed to be meaningless (e.g. reference range is <=2.3).", 0, 1, low);
506          case 3202466: /*high*/  return new Property("high", "SimpleQuantity", "The value of the high bound of the reference range.  The high bound of the reference range endpoint is inclusive of the value (e.g.  reference range is >=5 - <=9). If the high bound is omitted,  it is assumed to be meaningless (e.g. reference range is >= 2.3).", 0, 1, high);
507          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Codes to indicate the what part of the targeted reference population it applies to. For example, the normal or therapeutic range.", 0, 1, type);
508          case -2089924569: /*appliesTo*/  return new Property("appliesTo", "CodeableConcept", "Codes to indicate the target population this reference range applies to.  For example, a reference range may be based on the normal population or a particular sex or race.", 0, java.lang.Integer.MAX_VALUE, appliesTo);
509          case 96511: /*age*/  return new Property("age", "Range", "The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.", 0, 1, age);
510          case 3556653: /*text*/  return new Property("text", "string", "Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation.  An example would be a reference value of \"Negative\" or a list or table of \"normals\".", 0, 1, text);
511          default: return super.getNamedProperty(_hash, _name, _checkValid);
512          }
513
514        }
515
516      @Override
517      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
518        switch (hash) {
519        case 107348: /*low*/ return this.low == null ? new Base[0] : new Base[] {this.low}; // SimpleQuantity
520        case 3202466: /*high*/ return this.high == null ? new Base[0] : new Base[] {this.high}; // SimpleQuantity
521        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
522        case -2089924569: /*appliesTo*/ return this.appliesTo == null ? new Base[0] : this.appliesTo.toArray(new Base[this.appliesTo.size()]); // CodeableConcept
523        case 96511: /*age*/ return this.age == null ? new Base[0] : new Base[] {this.age}; // Range
524        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
525        default: return super.getProperty(hash, name, checkValid);
526        }
527
528      }
529
530      @Override
531      public Base setProperty(int hash, String name, Base value) throws FHIRException {
532        switch (hash) {
533        case 107348: // low
534          this.low = castToSimpleQuantity(value); // SimpleQuantity
535          return value;
536        case 3202466: // high
537          this.high = castToSimpleQuantity(value); // SimpleQuantity
538          return value;
539        case 3575610: // type
540          this.type = castToCodeableConcept(value); // CodeableConcept
541          return value;
542        case -2089924569: // appliesTo
543          this.getAppliesTo().add(castToCodeableConcept(value)); // CodeableConcept
544          return value;
545        case 96511: // age
546          this.age = castToRange(value); // Range
547          return value;
548        case 3556653: // text
549          this.text = castToString(value); // StringType
550          return value;
551        default: return super.setProperty(hash, name, value);
552        }
553
554      }
555
556      @Override
557      public Base setProperty(String name, Base value) throws FHIRException {
558        if (name.equals("low")) {
559          this.low = castToSimpleQuantity(value); // SimpleQuantity
560        } else if (name.equals("high")) {
561          this.high = castToSimpleQuantity(value); // SimpleQuantity
562        } else if (name.equals("type")) {
563          this.type = castToCodeableConcept(value); // CodeableConcept
564        } else if (name.equals("appliesTo")) {
565          this.getAppliesTo().add(castToCodeableConcept(value));
566        } else if (name.equals("age")) {
567          this.age = castToRange(value); // Range
568        } else if (name.equals("text")) {
569          this.text = castToString(value); // StringType
570        } else
571          return super.setProperty(name, value);
572        return value;
573      }
574
575      @Override
576      public Base makeProperty(int hash, String name) throws FHIRException {
577        switch (hash) {
578        case 107348:  return getLow(); 
579        case 3202466:  return getHigh(); 
580        case 3575610:  return getType(); 
581        case -2089924569:  return addAppliesTo(); 
582        case 96511:  return getAge(); 
583        case 3556653:  return getTextElement();
584        default: return super.makeProperty(hash, name);
585        }
586
587      }
588
589      @Override
590      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
591        switch (hash) {
592        case 107348: /*low*/ return new String[] {"SimpleQuantity"};
593        case 3202466: /*high*/ return new String[] {"SimpleQuantity"};
594        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
595        case -2089924569: /*appliesTo*/ return new String[] {"CodeableConcept"};
596        case 96511: /*age*/ return new String[] {"Range"};
597        case 3556653: /*text*/ return new String[] {"string"};
598        default: return super.getTypesForProperty(hash, name);
599        }
600
601      }
602
603      @Override
604      public Base addChild(String name) throws FHIRException {
605        if (name.equals("low")) {
606          this.low = new SimpleQuantity();
607          return this.low;
608        }
609        else if (name.equals("high")) {
610          this.high = new SimpleQuantity();
611          return this.high;
612        }
613        else if (name.equals("type")) {
614          this.type = new CodeableConcept();
615          return this.type;
616        }
617        else if (name.equals("appliesTo")) {
618          return addAppliesTo();
619        }
620        else if (name.equals("age")) {
621          this.age = new Range();
622          return this.age;
623        }
624        else if (name.equals("text")) {
625          throw new FHIRException("Cannot call addChild on a primitive type Observation.text");
626        }
627        else
628          return super.addChild(name);
629      }
630
631      public ObservationReferenceRangeComponent copy() {
632        ObservationReferenceRangeComponent dst = new ObservationReferenceRangeComponent();
633        copyValues(dst);
634        dst.low = low == null ? null : low.copy();
635        dst.high = high == null ? null : high.copy();
636        dst.type = type == null ? null : type.copy();
637        if (appliesTo != null) {
638          dst.appliesTo = new ArrayList<CodeableConcept>();
639          for (CodeableConcept i : appliesTo)
640            dst.appliesTo.add(i.copy());
641        };
642        dst.age = age == null ? null : age.copy();
643        dst.text = text == null ? null : text.copy();
644        return dst;
645      }
646
647      @Override
648      public boolean equalsDeep(Base other_) {
649        if (!super.equalsDeep(other_))
650          return false;
651        if (!(other_ instanceof ObservationReferenceRangeComponent))
652          return false;
653        ObservationReferenceRangeComponent o = (ObservationReferenceRangeComponent) other_;
654        return compareDeep(low, o.low, true) && compareDeep(high, o.high, true) && compareDeep(type, o.type, true)
655           && compareDeep(appliesTo, o.appliesTo, true) && compareDeep(age, o.age, true) && compareDeep(text, o.text, true)
656          ;
657      }
658
659      @Override
660      public boolean equalsShallow(Base other_) {
661        if (!super.equalsShallow(other_))
662          return false;
663        if (!(other_ instanceof ObservationReferenceRangeComponent))
664          return false;
665        ObservationReferenceRangeComponent o = (ObservationReferenceRangeComponent) other_;
666        return compareValues(text, o.text, true);
667      }
668
669      public boolean isEmpty() {
670        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(low, high, type, appliesTo
671          , age, text);
672      }
673
674  public String fhirType() {
675    return "Observation.referenceRange";
676
677  }
678
679  }
680
681    @Block()
682    public static class ObservationComponentComponent extends BackboneElement implements IBaseBackboneElement {
683        /**
684         * Describes what was observed. Sometimes this is called the observation "code".
685         */
686        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
687        @Description(shortDefinition="Type of component observation (code / type)", formalDefinition="Describes what was observed. Sometimes this is called the observation \"code\"." )
688        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/observation-codes")
689        protected CodeableConcept code;
690
691        /**
692         * The information determined as a result of making the observation, if the information has a simple value.
693         */
694        @Child(name = "value", type = {Quantity.class, CodeableConcept.class, StringType.class, BooleanType.class, IntegerType.class, Range.class, Ratio.class, SampledData.class, TimeType.class, DateTimeType.class, Period.class}, order=2, min=0, max=1, modifier=false, summary=true)
695        @Description(shortDefinition="Actual component result", formalDefinition="The information determined as a result of making the observation, if the information has a simple value." )
696        protected Type value;
697
698        /**
699         * Provides a reason why the expected value in the element Observation.component.value[x] is missing.
700         */
701        @Child(name = "dataAbsentReason", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
702        @Description(shortDefinition="Why the component result is missing", formalDefinition="Provides a reason why the expected value in the element Observation.component.value[x] is missing." )
703        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/data-absent-reason")
704        protected CodeableConcept dataAbsentReason;
705
706        /**
707         * The assessment made based on the result of the observation.  Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag.
708         */
709        @Child(name = "interpretation", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false)
710        @Description(shortDefinition="High, low, normal, etc.", formalDefinition="The assessment made based on the result of the observation.  Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag." )
711        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/observation-interpretation")
712        protected CodeableConcept interpretation;
713
714        /**
715         * Guidance on how to interpret the value by comparison to a normal or recommended range.
716         */
717        @Child(name = "referenceRange", type = {ObservationReferenceRangeComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
718        @Description(shortDefinition="Provides guide for interpretation of component result", formalDefinition="Guidance on how to interpret the value by comparison to a normal or recommended range." )
719        protected List<ObservationReferenceRangeComponent> referenceRange;
720
721        private static final long serialVersionUID = -846379911L;
722
723    /**
724     * Constructor
725     */
726      public ObservationComponentComponent() {
727        super();
728      }
729
730    /**
731     * Constructor
732     */
733      public ObservationComponentComponent(CodeableConcept code) {
734        super();
735        this.code = code;
736      }
737
738        /**
739         * @return {@link #code} (Describes what was observed. Sometimes this is called the observation "code".)
740         */
741        public CodeableConcept getCode() { 
742          if (this.code == null)
743            if (Configuration.errorOnAutoCreate())
744              throw new Error("Attempt to auto-create ObservationComponentComponent.code");
745            else if (Configuration.doAutoCreate())
746              this.code = new CodeableConcept(); // cc
747          return this.code;
748        }
749
750        public boolean hasCode() { 
751          return this.code != null && !this.code.isEmpty();
752        }
753
754        /**
755         * @param value {@link #code} (Describes what was observed. Sometimes this is called the observation "code".)
756         */
757        public ObservationComponentComponent setCode(CodeableConcept value) { 
758          this.code = value;
759          return this;
760        }
761
762        /**
763         * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
764         */
765        public Type getValue() { 
766          return this.value;
767        }
768
769        /**
770         * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
771         */
772        public Quantity getValueQuantity() throws FHIRException { 
773          if (this.value == null)
774            return null;
775          if (!(this.value instanceof Quantity))
776            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
777          return (Quantity) this.value;
778        }
779
780        public boolean hasValueQuantity() { 
781          return this != null && this.value instanceof Quantity;
782        }
783
784        /**
785         * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
786         */
787        public CodeableConcept getValueCodeableConcept() throws FHIRException { 
788          if (this.value == null)
789            return null;
790          if (!(this.value instanceof CodeableConcept))
791            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered");
792          return (CodeableConcept) this.value;
793        }
794
795        public boolean hasValueCodeableConcept() { 
796          return this != null && this.value instanceof CodeableConcept;
797        }
798
799        /**
800         * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
801         */
802        public StringType getValueStringType() throws FHIRException { 
803          if (this.value == null)
804            return null;
805          if (!(this.value instanceof StringType))
806            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered");
807          return (StringType) this.value;
808        }
809
810        public boolean hasValueStringType() { 
811          return this != null && this.value instanceof StringType;
812        }
813
814        /**
815         * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
816         */
817        public BooleanType getValueBooleanType() throws FHIRException { 
818          if (this.value == null)
819            return null;
820          if (!(this.value instanceof BooleanType))
821            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
822          return (BooleanType) this.value;
823        }
824
825        public boolean hasValueBooleanType() { 
826          return this != null && this.value instanceof BooleanType;
827        }
828
829        /**
830         * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
831         */
832        public IntegerType getValueIntegerType() throws FHIRException { 
833          if (this.value == null)
834            return null;
835          if (!(this.value instanceof IntegerType))
836            throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered");
837          return (IntegerType) this.value;
838        }
839
840        public boolean hasValueIntegerType() { 
841          return this != null && this.value instanceof IntegerType;
842        }
843
844        /**
845         * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
846         */
847        public Range getValueRange() throws FHIRException { 
848          if (this.value == null)
849            return null;
850          if (!(this.value instanceof Range))
851            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered");
852          return (Range) this.value;
853        }
854
855        public boolean hasValueRange() { 
856          return this != null && this.value instanceof Range;
857        }
858
859        /**
860         * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
861         */
862        public Ratio getValueRatio() throws FHIRException { 
863          if (this.value == null)
864            return null;
865          if (!(this.value instanceof Ratio))
866            throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.value.getClass().getName()+" was encountered");
867          return (Ratio) this.value;
868        }
869
870        public boolean hasValueRatio() { 
871          return this != null && this.value instanceof Ratio;
872        }
873
874        /**
875         * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
876         */
877        public SampledData getValueSampledData() throws FHIRException { 
878          if (this.value == null)
879            return null;
880          if (!(this.value instanceof SampledData))
881            throw new FHIRException("Type mismatch: the type SampledData was expected, but "+this.value.getClass().getName()+" was encountered");
882          return (SampledData) this.value;
883        }
884
885        public boolean hasValueSampledData() { 
886          return this != null && this.value instanceof SampledData;
887        }
888
889        /**
890         * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
891         */
892        public TimeType getValueTimeType() throws FHIRException { 
893          if (this.value == null)
894            return null;
895          if (!(this.value instanceof TimeType))
896            throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered");
897          return (TimeType) this.value;
898        }
899
900        public boolean hasValueTimeType() { 
901          return this != null && this.value instanceof TimeType;
902        }
903
904        /**
905         * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
906         */
907        public DateTimeType getValueDateTimeType() throws FHIRException { 
908          if (this.value == null)
909            return null;
910          if (!(this.value instanceof DateTimeType))
911            throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered");
912          return (DateTimeType) this.value;
913        }
914
915        public boolean hasValueDateTimeType() { 
916          return this != null && this.value instanceof DateTimeType;
917        }
918
919        /**
920         * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
921         */
922        public Period getValuePeriod() throws FHIRException { 
923          if (this.value == null)
924            return null;
925          if (!(this.value instanceof Period))
926            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered");
927          return (Period) this.value;
928        }
929
930        public boolean hasValuePeriod() { 
931          return this != null && this.value instanceof Period;
932        }
933
934        public boolean hasValue() { 
935          return this.value != null && !this.value.isEmpty();
936        }
937
938        /**
939         * @param value {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
940         */
941        public ObservationComponentComponent setValue(Type value) { 
942          if (value != null && !(value instanceof Quantity || value instanceof CodeableConcept || value instanceof StringType || value instanceof BooleanType || value instanceof IntegerType || value instanceof Range || value instanceof Ratio || value instanceof SampledData || value instanceof TimeType || value instanceof DateTimeType || value instanceof Period))
943            throw new Error("Not the right type for Observation.component.value[x]: "+value.fhirType());
944          this.value = value;
945          return this;
946        }
947
948        /**
949         * @return {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.component.value[x] is missing.)
950         */
951        public CodeableConcept getDataAbsentReason() { 
952          if (this.dataAbsentReason == null)
953            if (Configuration.errorOnAutoCreate())
954              throw new Error("Attempt to auto-create ObservationComponentComponent.dataAbsentReason");
955            else if (Configuration.doAutoCreate())
956              this.dataAbsentReason = new CodeableConcept(); // cc
957          return this.dataAbsentReason;
958        }
959
960        public boolean hasDataAbsentReason() { 
961          return this.dataAbsentReason != null && !this.dataAbsentReason.isEmpty();
962        }
963
964        /**
965         * @param value {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.component.value[x] is missing.)
966         */
967        public ObservationComponentComponent setDataAbsentReason(CodeableConcept value) { 
968          this.dataAbsentReason = value;
969          return this;
970        }
971
972        /**
973         * @return {@link #interpretation} (The assessment made based on the result of the observation.  Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag.)
974         */
975        public CodeableConcept getInterpretation() { 
976          if (this.interpretation == null)
977            if (Configuration.errorOnAutoCreate())
978              throw new Error("Attempt to auto-create ObservationComponentComponent.interpretation");
979            else if (Configuration.doAutoCreate())
980              this.interpretation = new CodeableConcept(); // cc
981          return this.interpretation;
982        }
983
984        public boolean hasInterpretation() { 
985          return this.interpretation != null && !this.interpretation.isEmpty();
986        }
987
988        /**
989         * @param value {@link #interpretation} (The assessment made based on the result of the observation.  Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag.)
990         */
991        public ObservationComponentComponent setInterpretation(CodeableConcept value) { 
992          this.interpretation = value;
993          return this;
994        }
995
996        /**
997         * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.)
998         */
999        public List<ObservationReferenceRangeComponent> getReferenceRange() { 
1000          if (this.referenceRange == null)
1001            this.referenceRange = new ArrayList<ObservationReferenceRangeComponent>();
1002          return this.referenceRange;
1003        }
1004
1005        /**
1006         * @return Returns a reference to <code>this</code> for easy method chaining
1007         */
1008        public ObservationComponentComponent setReferenceRange(List<ObservationReferenceRangeComponent> theReferenceRange) { 
1009          this.referenceRange = theReferenceRange;
1010          return this;
1011        }
1012
1013        public boolean hasReferenceRange() { 
1014          if (this.referenceRange == null)
1015            return false;
1016          for (ObservationReferenceRangeComponent item : this.referenceRange)
1017            if (!item.isEmpty())
1018              return true;
1019          return false;
1020        }
1021
1022        public ObservationReferenceRangeComponent addReferenceRange() { //3
1023          ObservationReferenceRangeComponent t = new ObservationReferenceRangeComponent();
1024          if (this.referenceRange == null)
1025            this.referenceRange = new ArrayList<ObservationReferenceRangeComponent>();
1026          this.referenceRange.add(t);
1027          return t;
1028        }
1029
1030        public ObservationComponentComponent addReferenceRange(ObservationReferenceRangeComponent t) { //3
1031          if (t == null)
1032            return this;
1033          if (this.referenceRange == null)
1034            this.referenceRange = new ArrayList<ObservationReferenceRangeComponent>();
1035          this.referenceRange.add(t);
1036          return this;
1037        }
1038
1039        /**
1040         * @return The first repetition of repeating field {@link #referenceRange}, creating it if it does not already exist
1041         */
1042        public ObservationReferenceRangeComponent getReferenceRangeFirstRep() { 
1043          if (getReferenceRange().isEmpty()) {
1044            addReferenceRange();
1045          }
1046          return getReferenceRange().get(0);
1047        }
1048
1049        protected void listChildren(List<Property> children) {
1050          super.listChildren(children);
1051          children.add(new Property("code", "CodeableConcept", "Describes what was observed. Sometimes this is called the observation \"code\".", 0, 1, code));
1052          children.add(new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value));
1053          children.add(new Property("dataAbsentReason", "CodeableConcept", "Provides a reason why the expected value in the element Observation.component.value[x] is missing.", 0, 1, dataAbsentReason));
1054          children.add(new Property("interpretation", "CodeableConcept", "The assessment made based on the result of the observation.  Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag.", 0, 1, interpretation));
1055          children.add(new Property("referenceRange", "@Observation.referenceRange", "Guidance on how to interpret the value by comparison to a normal or recommended range.", 0, java.lang.Integer.MAX_VALUE, referenceRange));
1056        }
1057
1058        @Override
1059        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1060          switch (_hash) {
1061          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "Describes what was observed. Sometimes this is called the observation \"code\".", 0, 1, code);
1062          case -1410166417: /*value[x]*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
1063          case 111972721: /*value*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
1064          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
1065          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
1066          case -1424603934: /*valueString*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
1067          case 733421943: /*valueBoolean*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
1068          case -1668204915: /*valueInteger*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
1069          case 2030761548: /*valueRange*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
1070          case 2030767386: /*valueRatio*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
1071          case -962229101: /*valueSampledData*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
1072          case -765708322: /*valueTime*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
1073          case 1047929900: /*valueDateTime*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
1074          case -1524344174: /*valuePeriod*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
1075          case 1034315687: /*dataAbsentReason*/  return new Property("dataAbsentReason", "CodeableConcept", "Provides a reason why the expected value in the element Observation.component.value[x] is missing.", 0, 1, dataAbsentReason);
1076          case -297950712: /*interpretation*/  return new Property("interpretation", "CodeableConcept", "The assessment made based on the result of the observation.  Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag.", 0, 1, interpretation);
1077          case -1912545102: /*referenceRange*/  return new Property("referenceRange", "@Observation.referenceRange", "Guidance on how to interpret the value by comparison to a normal or recommended range.", 0, java.lang.Integer.MAX_VALUE, referenceRange);
1078          default: return super.getNamedProperty(_hash, _name, _checkValid);
1079          }
1080
1081        }
1082
1083      @Override
1084      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1085        switch (hash) {
1086        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
1087        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type
1088        case 1034315687: /*dataAbsentReason*/ return this.dataAbsentReason == null ? new Base[0] : new Base[] {this.dataAbsentReason}; // CodeableConcept
1089        case -297950712: /*interpretation*/ return this.interpretation == null ? new Base[0] : new Base[] {this.interpretation}; // CodeableConcept
1090        case -1912545102: /*referenceRange*/ return this.referenceRange == null ? new Base[0] : this.referenceRange.toArray(new Base[this.referenceRange.size()]); // ObservationReferenceRangeComponent
1091        default: return super.getProperty(hash, name, checkValid);
1092        }
1093
1094      }
1095
1096      @Override
1097      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1098        switch (hash) {
1099        case 3059181: // code
1100          this.code = castToCodeableConcept(value); // CodeableConcept
1101          return value;
1102        case 111972721: // value
1103          this.value = castToType(value); // Type
1104          return value;
1105        case 1034315687: // dataAbsentReason
1106          this.dataAbsentReason = castToCodeableConcept(value); // CodeableConcept
1107          return value;
1108        case -297950712: // interpretation
1109          this.interpretation = castToCodeableConcept(value); // CodeableConcept
1110          return value;
1111        case -1912545102: // referenceRange
1112          this.getReferenceRange().add((ObservationReferenceRangeComponent) value); // ObservationReferenceRangeComponent
1113          return value;
1114        default: return super.setProperty(hash, name, value);
1115        }
1116
1117      }
1118
1119      @Override
1120      public Base setProperty(String name, Base value) throws FHIRException {
1121        if (name.equals("code")) {
1122          this.code = castToCodeableConcept(value); // CodeableConcept
1123        } else if (name.equals("value[x]")) {
1124          this.value = castToType(value); // Type
1125        } else if (name.equals("dataAbsentReason")) {
1126          this.dataAbsentReason = castToCodeableConcept(value); // CodeableConcept
1127        } else if (name.equals("interpretation")) {
1128          this.interpretation = castToCodeableConcept(value); // CodeableConcept
1129        } else if (name.equals("referenceRange")) {
1130          this.getReferenceRange().add((ObservationReferenceRangeComponent) value);
1131        } else
1132          return super.setProperty(name, value);
1133        return value;
1134      }
1135
1136      @Override
1137      public Base makeProperty(int hash, String name) throws FHIRException {
1138        switch (hash) {
1139        case 3059181:  return getCode(); 
1140        case -1410166417:  return getValue(); 
1141        case 111972721:  return getValue(); 
1142        case 1034315687:  return getDataAbsentReason(); 
1143        case -297950712:  return getInterpretation(); 
1144        case -1912545102:  return addReferenceRange(); 
1145        default: return super.makeProperty(hash, name);
1146        }
1147
1148      }
1149
1150      @Override
1151      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1152        switch (hash) {
1153        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1154        case 111972721: /*value*/ return new String[] {"Quantity", "CodeableConcept", "string", "boolean", "integer", "Range", "Ratio", "SampledData", "time", "dateTime", "Period"};
1155        case 1034315687: /*dataAbsentReason*/ return new String[] {"CodeableConcept"};
1156        case -297950712: /*interpretation*/ return new String[] {"CodeableConcept"};
1157        case -1912545102: /*referenceRange*/ return new String[] {"@Observation.referenceRange"};
1158        default: return super.getTypesForProperty(hash, name);
1159        }
1160
1161      }
1162
1163      @Override
1164      public Base addChild(String name) throws FHIRException {
1165        if (name.equals("code")) {
1166          this.code = new CodeableConcept();
1167          return this.code;
1168        }
1169        else if (name.equals("valueQuantity")) {
1170          this.value = new Quantity();
1171          return this.value;
1172        }
1173        else if (name.equals("valueCodeableConcept")) {
1174          this.value = new CodeableConcept();
1175          return this.value;
1176        }
1177        else if (name.equals("valueString")) {
1178          this.value = new StringType();
1179          return this.value;
1180        }
1181        else if (name.equals("valueBoolean")) {
1182          this.value = new BooleanType();
1183          return this.value;
1184        }
1185        else if (name.equals("valueInteger")) {
1186          this.value = new IntegerType();
1187          return this.value;
1188        }
1189        else if (name.equals("valueRange")) {
1190          this.value = new Range();
1191          return this.value;
1192        }
1193        else if (name.equals("valueRatio")) {
1194          this.value = new Ratio();
1195          return this.value;
1196        }
1197        else if (name.equals("valueSampledData")) {
1198          this.value = new SampledData();
1199          return this.value;
1200        }
1201        else if (name.equals("valueTime")) {
1202          this.value = new TimeType();
1203          return this.value;
1204        }
1205        else if (name.equals("valueDateTime")) {
1206          this.value = new DateTimeType();
1207          return this.value;
1208        }
1209        else if (name.equals("valuePeriod")) {
1210          this.value = new Period();
1211          return this.value;
1212        }
1213        else if (name.equals("dataAbsentReason")) {
1214          this.dataAbsentReason = new CodeableConcept();
1215          return this.dataAbsentReason;
1216        }
1217        else if (name.equals("interpretation")) {
1218          this.interpretation = new CodeableConcept();
1219          return this.interpretation;
1220        }
1221        else if (name.equals("referenceRange")) {
1222          return addReferenceRange();
1223        }
1224        else
1225          return super.addChild(name);
1226      }
1227
1228      public ObservationComponentComponent copy() {
1229        ObservationComponentComponent dst = new ObservationComponentComponent();
1230        copyValues(dst);
1231        dst.code = code == null ? null : code.copy();
1232        dst.value = value == null ? null : value.copy();
1233        dst.dataAbsentReason = dataAbsentReason == null ? null : dataAbsentReason.copy();
1234        dst.interpretation = interpretation == null ? null : interpretation.copy();
1235        if (referenceRange != null) {
1236          dst.referenceRange = new ArrayList<ObservationReferenceRangeComponent>();
1237          for (ObservationReferenceRangeComponent i : referenceRange)
1238            dst.referenceRange.add(i.copy());
1239        };
1240        return dst;
1241      }
1242
1243      @Override
1244      public boolean equalsDeep(Base other_) {
1245        if (!super.equalsDeep(other_))
1246          return false;
1247        if (!(other_ instanceof ObservationComponentComponent))
1248          return false;
1249        ObservationComponentComponent o = (ObservationComponentComponent) other_;
1250        return compareDeep(code, o.code, true) && compareDeep(value, o.value, true) && compareDeep(dataAbsentReason, o.dataAbsentReason, true)
1251           && compareDeep(interpretation, o.interpretation, true) && compareDeep(referenceRange, o.referenceRange, true)
1252          ;
1253      }
1254
1255      @Override
1256      public boolean equalsShallow(Base other_) {
1257        if (!super.equalsShallow(other_))
1258          return false;
1259        if (!(other_ instanceof ObservationComponentComponent))
1260          return false;
1261        ObservationComponentComponent o = (ObservationComponentComponent) other_;
1262        return true;
1263      }
1264
1265      public boolean isEmpty() {
1266        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, value, dataAbsentReason
1267          , interpretation, referenceRange);
1268      }
1269
1270  public String fhirType() {
1271    return "Observation.component";
1272
1273  }
1274
1275  }
1276
1277    /**
1278     * A unique identifier assigned to this observation.
1279     */
1280    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1281    @Description(shortDefinition="Business Identifier for observation", formalDefinition="A unique identifier assigned to this observation." )
1282    protected List<Identifier> identifier;
1283
1284    /**
1285     * A plan, proposal or order that is fulfilled in whole or in part by this event.
1286     */
1287    @Child(name = "basedOn", type = {CarePlan.class, DeviceRequest.class, ImmunizationRecommendation.class, MedicationRequest.class, NutritionOrder.class, ServiceRequest.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1288    @Description(shortDefinition="Fulfills plan, proposal or order", formalDefinition="A plan, proposal or order that is fulfilled in whole or in part by this event." )
1289    protected List<Reference> basedOn;
1290    /**
1291     * The actual objects that are the target of the reference (A plan, proposal or order that is fulfilled in whole or in part by this event.)
1292     */
1293    protected List<Resource> basedOnTarget;
1294
1295
1296    /**
1297     * A larger event of which this particular Observation is a component or step.  For example,  an observation as part of a procedure.
1298     */
1299    @Child(name = "partOf", type = {MedicationAdministration.class, MedicationDispense.class, MedicationStatement.class, Procedure.class, Immunization.class, ImagingStudy.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1300    @Description(shortDefinition="Part of referenced event", formalDefinition="A larger event of which this particular Observation is a component or step.  For example,  an observation as part of a procedure." )
1301    protected List<Reference> partOf;
1302    /**
1303     * The actual objects that are the target of the reference (A larger event of which this particular Observation is a component or step.  For example,  an observation as part of a procedure.)
1304     */
1305    protected List<Resource> partOfTarget;
1306
1307
1308    /**
1309     * The status of the result value.
1310     */
1311    @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true)
1312    @Description(shortDefinition="registered | preliminary | final | amended +", formalDefinition="The status of the result value." )
1313    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/observation-status")
1314    protected Enumeration<ObservationStatus> status;
1315
1316    /**
1317     * A code that classifies the general type of observation being made.
1318     */
1319    @Child(name = "category", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1320    @Description(shortDefinition="Classification of  type of observation", formalDefinition="A code that classifies the general type of observation being made." )
1321    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/observation-category")
1322    protected List<CodeableConcept> category;
1323
1324    /**
1325     * Describes what was observed. Sometimes this is called the observation "name".
1326     */
1327    @Child(name = "code", type = {CodeableConcept.class}, order=5, min=1, max=1, modifier=false, summary=true)
1328    @Description(shortDefinition="Type of observation (code / type)", formalDefinition="Describes what was observed. Sometimes this is called the observation \"name\"." )
1329    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/observation-codes")
1330    protected CodeableConcept code;
1331
1332    /**
1333     * The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed.  Comments: Indirect characteristics may be those of a specimen, fetus, donor,  other observer (for example a relative or EMT), or any observation made about the subject.
1334     */
1335    @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class}, order=6, min=0, max=1, modifier=false, summary=true)
1336    @Description(shortDefinition="Who and/or what this is about", formalDefinition="The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed.  Comments: Indirect characteristics may be those of a specimen, fetus, donor,  other observer (for example a relative or EMT), or any observation made about the subject." )
1337    protected Reference subject;
1338
1339    /**
1340     * The actual object that is the target of the reference (The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed.  Comments: Indirect characteristics may be those of a specimen, fetus, donor,  other observer (for example a relative or EMT), or any observation made about the subject.)
1341     */
1342    protected Resource subjectTarget;
1343
1344    /**
1345     * The actual focus of an observation when it is not the patient of record.  The focus is point of attention when the observation representing something  or someone associated with the patient.  It could be  a  spouse or parent, a fetus or donor.  The focus of an observation could be an existing condition,  an intervention, the subject's diet,  another observation of the subject,  or a body structure such as tumor or implanted device.   An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.
1346     */
1347    @Child(name = "focus", type = {Reference.class}, order=7, min=0, max=1, modifier=false, summary=true)
1348    @Description(shortDefinition="The \"focal point\" of the observation", formalDefinition="The actual focus of an observation when it is not the patient of record.  The focus is point of attention when the observation representing something  or someone associated with the patient.  It could be  a  spouse or parent, a fetus or donor.  The focus of an observation could be an existing condition,  an intervention, the subject's diet,  another observation of the subject,  or a body structure such as tumor or implanted device.   An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus." )
1349    protected Reference focus;
1350
1351    /**
1352     * The actual object that is the target of the reference (The actual focus of an observation when it is not the patient of record.  The focus is point of attention when the observation representing something  or someone associated with the patient.  It could be  a  spouse or parent, a fetus or donor.  The focus of an observation could be an existing condition,  an intervention, the subject's diet,  another observation of the subject,  or a body structure such as tumor or implanted device.   An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.)
1353     */
1354    protected Resource focusTarget;
1355
1356    /**
1357     * The healthcare event  (e.g. a patient and healthcare provider interaction) during which this observation is made.
1358     */
1359    @Child(name = "context", type = {Encounter.class, EpisodeOfCare.class}, order=8, min=0, max=1, modifier=false, summary=false)
1360    @Description(shortDefinition="Healthcare event during which this observation is made", formalDefinition="The healthcare event  (e.g. a patient and healthcare provider interaction) during which this observation is made." )
1361    protected Reference context;
1362
1363    /**
1364     * The actual object that is the target of the reference (The healthcare event  (e.g. a patient and healthcare provider interaction) during which this observation is made.)
1365     */
1366    protected Resource contextTarget;
1367
1368    /**
1369     * The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.
1370     */
1371    @Child(name = "effective", type = {DateTimeType.class, Period.class, Timing.class}, order=9, min=0, max=1, modifier=false, summary=true)
1372    @Description(shortDefinition="Clinically relevant time/time-period for observation", formalDefinition="The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the \"physiologically relevant time\". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself." )
1373    protected Type effective;
1374
1375    /**
1376     * The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified.
1377     */
1378    @Child(name = "issued", type = {InstantType.class}, order=10, min=0, max=1, modifier=false, summary=true)
1379    @Description(shortDefinition="Date/Time this version was made available", formalDefinition="The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified." )
1380    protected InstantType issued;
1381
1382    /**
1383     * Who was responsible for asserting the observed value as "true".
1384     */
1385    @Child(name = "performer", type = {Practitioner.class, PractitionerRole.class, Organization.class, CareTeam.class, Patient.class, RelatedPerson.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1386    @Description(shortDefinition="Who is responsible for the observation", formalDefinition="Who was responsible for asserting the observed value as \"true\"." )
1387    protected List<Reference> performer;
1388    /**
1389     * The actual objects that are the target of the reference (Who was responsible for asserting the observed value as "true".)
1390     */
1391    protected List<Resource> performerTarget;
1392
1393
1394    /**
1395     * The information determined as a result of making the observation, if the information has a simple value.
1396     */
1397    @Child(name = "value", type = {Quantity.class, CodeableConcept.class, StringType.class, BooleanType.class, IntegerType.class, Range.class, Ratio.class, SampledData.class, TimeType.class, DateTimeType.class, Period.class}, order=12, min=0, max=1, modifier=false, summary=true)
1398    @Description(shortDefinition="Actual result", formalDefinition="The information determined as a result of making the observation, if the information has a simple value." )
1399    protected Type value;
1400
1401    /**
1402     * Provides a reason why the expected value in the element Observation.value[x] is missing.
1403     */
1404    @Child(name = "dataAbsentReason", type = {CodeableConcept.class}, order=13, min=0, max=1, modifier=false, summary=false)
1405    @Description(shortDefinition="Why the result is missing", formalDefinition="Provides a reason why the expected value in the element Observation.value[x] is missing." )
1406    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/data-absent-reason")
1407    protected CodeableConcept dataAbsentReason;
1408
1409    /**
1410     * The assessment made based on the result of the observation.  Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag.
1411     */
1412    @Child(name = "interpretation", type = {CodeableConcept.class}, order=14, min=0, max=1, modifier=false, summary=false)
1413    @Description(shortDefinition="High, low, normal, etc.", formalDefinition="The assessment made based on the result of the observation.  Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag." )
1414    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/observation-interpretation")
1415    protected CodeableConcept interpretation;
1416
1417    /**
1418     * May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.
1419     */
1420    @Child(name = "comment", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=false)
1421    @Description(shortDefinition="Comments about result", formalDefinition="May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result." )
1422    protected StringType comment;
1423
1424    /**
1425     * Indicates the site on the subject's body where the observation was made (i.e. the target site).
1426     */
1427    @Child(name = "bodySite", type = {CodeableConcept.class}, order=16, min=0, max=1, modifier=false, summary=false)
1428    @Description(shortDefinition="Observed body part", formalDefinition="Indicates the site on the subject's body where the observation was made (i.e. the target site)." )
1429    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/body-site")
1430    protected CodeableConcept bodySite;
1431
1432    /**
1433     * Indicates the mechanism used to perform the observation.
1434     */
1435    @Child(name = "method", type = {CodeableConcept.class}, order=17, min=0, max=1, modifier=false, summary=false)
1436    @Description(shortDefinition="How it was done", formalDefinition="Indicates the mechanism used to perform the observation." )
1437    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/observation-methods")
1438    protected CodeableConcept method;
1439
1440    /**
1441     * The specimen that was used when this observation was made.
1442     */
1443    @Child(name = "specimen", type = {Specimen.class}, order=18, min=0, max=1, modifier=false, summary=false)
1444    @Description(shortDefinition="Specimen used for this observation", formalDefinition="The specimen that was used when this observation was made." )
1445    protected Reference specimen;
1446
1447    /**
1448     * The actual object that is the target of the reference (The specimen that was used when this observation was made.)
1449     */
1450    protected Specimen specimenTarget;
1451
1452    /**
1453     * The device used to generate the observation data.
1454     */
1455    @Child(name = "device", type = {Device.class, DeviceComponent.class, DeviceMetric.class}, order=19, min=0, max=1, modifier=false, summary=false)
1456    @Description(shortDefinition="(Measurement) Device", formalDefinition="The device used to generate the observation data." )
1457    protected Reference device;
1458
1459    /**
1460     * The actual object that is the target of the reference (The device used to generate the observation data.)
1461     */
1462    protected Resource deviceTarget;
1463
1464    /**
1465     * Guidance on how to interpret the value by comparison to a normal or recommended range.
1466     */
1467    @Child(name = "referenceRange", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1468    @Description(shortDefinition="Provides guide for interpretation", formalDefinition="Guidance on how to interpret the value by comparison to a normal or recommended range." )
1469    protected List<ObservationReferenceRangeComponent> referenceRange;
1470
1471    /**
1472     * This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group.
1473     */
1474    @Child(name = "hasMember", type = {Observation.class, QuestionnaireResponse.class, Sequence.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1475    @Description(shortDefinition="Related resource that belongs to the Observation group", formalDefinition="This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group." )
1476    protected List<Reference> hasMember;
1477    /**
1478     * The actual objects that are the target of the reference (This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group.)
1479     */
1480    protected List<Resource> hasMemberTarget;
1481
1482
1483    /**
1484     * The target resource that represents a measurement from which this observation value is derived. For example, a calculated anion gap or a fetal measurement based on an ultrasound image.
1485     */
1486    @Child(name = "derivedFrom", type = {DocumentReference.class, ImagingStudy.class, Media.class, QuestionnaireResponse.class, Observation.class, Sequence.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1487    @Description(shortDefinition="Related measurements the observation is made from", formalDefinition="The target resource that represents a measurement from which this observation value is derived. For example, a calculated anion gap or a fetal measurement based on an ultrasound image." )
1488    protected List<Reference> derivedFrom;
1489    /**
1490     * The actual objects that are the target of the reference (The target resource that represents a measurement from which this observation value is derived. For example, a calculated anion gap or a fetal measurement based on an ultrasound image.)
1491     */
1492    protected List<Resource> derivedFromTarget;
1493
1494
1495    /**
1496     * Some observations have multiple component observations.  These component observations are expressed as separate code value pairs that share the same attributes.  Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations.
1497     */
1498    @Child(name = "component", type = {}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1499    @Description(shortDefinition="Component results", formalDefinition="Some observations have multiple component observations.  These component observations are expressed as separate code value pairs that share the same attributes.  Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations." )
1500    protected List<ObservationComponentComponent> component;
1501
1502    private static final long serialVersionUID = 479448059L;
1503
1504  /**
1505   * Constructor
1506   */
1507    public Observation() {
1508      super();
1509    }
1510
1511  /**
1512   * Constructor
1513   */
1514    public Observation(Enumeration<ObservationStatus> status, CodeableConcept code) {
1515      super();
1516      this.status = status;
1517      this.code = code;
1518    }
1519
1520    /**
1521     * @return {@link #identifier} (A unique identifier assigned to this observation.)
1522     */
1523    public List<Identifier> getIdentifier() { 
1524      if (this.identifier == null)
1525        this.identifier = new ArrayList<Identifier>();
1526      return this.identifier;
1527    }
1528
1529    /**
1530     * @return Returns a reference to <code>this</code> for easy method chaining
1531     */
1532    public Observation setIdentifier(List<Identifier> theIdentifier) { 
1533      this.identifier = theIdentifier;
1534      return this;
1535    }
1536
1537    public boolean hasIdentifier() { 
1538      if (this.identifier == null)
1539        return false;
1540      for (Identifier item : this.identifier)
1541        if (!item.isEmpty())
1542          return true;
1543      return false;
1544    }
1545
1546    public Identifier addIdentifier() { //3
1547      Identifier t = new Identifier();
1548      if (this.identifier == null)
1549        this.identifier = new ArrayList<Identifier>();
1550      this.identifier.add(t);
1551      return t;
1552    }
1553
1554    public Observation addIdentifier(Identifier t) { //3
1555      if (t == null)
1556        return this;
1557      if (this.identifier == null)
1558        this.identifier = new ArrayList<Identifier>();
1559      this.identifier.add(t);
1560      return this;
1561    }
1562
1563    /**
1564     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
1565     */
1566    public Identifier getIdentifierFirstRep() { 
1567      if (getIdentifier().isEmpty()) {
1568        addIdentifier();
1569      }
1570      return getIdentifier().get(0);
1571    }
1572
1573    /**
1574     * @return {@link #basedOn} (A plan, proposal or order that is fulfilled in whole or in part by this event.)
1575     */
1576    public List<Reference> getBasedOn() { 
1577      if (this.basedOn == null)
1578        this.basedOn = new ArrayList<Reference>();
1579      return this.basedOn;
1580    }
1581
1582    /**
1583     * @return Returns a reference to <code>this</code> for easy method chaining
1584     */
1585    public Observation setBasedOn(List<Reference> theBasedOn) { 
1586      this.basedOn = theBasedOn;
1587      return this;
1588    }
1589
1590    public boolean hasBasedOn() { 
1591      if (this.basedOn == null)
1592        return false;
1593      for (Reference item : this.basedOn)
1594        if (!item.isEmpty())
1595          return true;
1596      return false;
1597    }
1598
1599    public Reference addBasedOn() { //3
1600      Reference t = new Reference();
1601      if (this.basedOn == null)
1602        this.basedOn = new ArrayList<Reference>();
1603      this.basedOn.add(t);
1604      return t;
1605    }
1606
1607    public Observation addBasedOn(Reference t) { //3
1608      if (t == null)
1609        return this;
1610      if (this.basedOn == null)
1611        this.basedOn = new ArrayList<Reference>();
1612      this.basedOn.add(t);
1613      return this;
1614    }
1615
1616    /**
1617     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist
1618     */
1619    public Reference getBasedOnFirstRep() { 
1620      if (getBasedOn().isEmpty()) {
1621        addBasedOn();
1622      }
1623      return getBasedOn().get(0);
1624    }
1625
1626    /**
1627     * @deprecated Use Reference#setResource(IBaseResource) instead
1628     */
1629    @Deprecated
1630    public List<Resource> getBasedOnTarget() { 
1631      if (this.basedOnTarget == null)
1632        this.basedOnTarget = new ArrayList<Resource>();
1633      return this.basedOnTarget;
1634    }
1635
1636    /**
1637     * @return {@link #partOf} (A larger event of which this particular Observation is a component or step.  For example,  an observation as part of a procedure.)
1638     */
1639    public List<Reference> getPartOf() { 
1640      if (this.partOf == null)
1641        this.partOf = new ArrayList<Reference>();
1642      return this.partOf;
1643    }
1644
1645    /**
1646     * @return Returns a reference to <code>this</code> for easy method chaining
1647     */
1648    public Observation setPartOf(List<Reference> thePartOf) { 
1649      this.partOf = thePartOf;
1650      return this;
1651    }
1652
1653    public boolean hasPartOf() { 
1654      if (this.partOf == null)
1655        return false;
1656      for (Reference item : this.partOf)
1657        if (!item.isEmpty())
1658          return true;
1659      return false;
1660    }
1661
1662    public Reference addPartOf() { //3
1663      Reference t = new Reference();
1664      if (this.partOf == null)
1665        this.partOf = new ArrayList<Reference>();
1666      this.partOf.add(t);
1667      return t;
1668    }
1669
1670    public Observation addPartOf(Reference t) { //3
1671      if (t == null)
1672        return this;
1673      if (this.partOf == null)
1674        this.partOf = new ArrayList<Reference>();
1675      this.partOf.add(t);
1676      return this;
1677    }
1678
1679    /**
1680     * @return The first repetition of repeating field {@link #partOf}, creating it if it does not already exist
1681     */
1682    public Reference getPartOfFirstRep() { 
1683      if (getPartOf().isEmpty()) {
1684        addPartOf();
1685      }
1686      return getPartOf().get(0);
1687    }
1688
1689    /**
1690     * @deprecated Use Reference#setResource(IBaseResource) instead
1691     */
1692    @Deprecated
1693    public List<Resource> getPartOfTarget() { 
1694      if (this.partOfTarget == null)
1695        this.partOfTarget = new ArrayList<Resource>();
1696      return this.partOfTarget;
1697    }
1698
1699    /**
1700     * @return {@link #status} (The status of the result value.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1701     */
1702    public Enumeration<ObservationStatus> getStatusElement() { 
1703      if (this.status == null)
1704        if (Configuration.errorOnAutoCreate())
1705          throw new Error("Attempt to auto-create Observation.status");
1706        else if (Configuration.doAutoCreate())
1707          this.status = new Enumeration<ObservationStatus>(new ObservationStatusEnumFactory()); // bb
1708      return this.status;
1709    }
1710
1711    public boolean hasStatusElement() { 
1712      return this.status != null && !this.status.isEmpty();
1713    }
1714
1715    public boolean hasStatus() { 
1716      return this.status != null && !this.status.isEmpty();
1717    }
1718
1719    /**
1720     * @param value {@link #status} (The status of the result value.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1721     */
1722    public Observation setStatusElement(Enumeration<ObservationStatus> value) { 
1723      this.status = value;
1724      return this;
1725    }
1726
1727    /**
1728     * @return The status of the result value.
1729     */
1730    public ObservationStatus getStatus() { 
1731      return this.status == null ? null : this.status.getValue();
1732    }
1733
1734    /**
1735     * @param value The status of the result value.
1736     */
1737    public Observation setStatus(ObservationStatus value) { 
1738        if (this.status == null)
1739          this.status = new Enumeration<ObservationStatus>(new ObservationStatusEnumFactory());
1740        this.status.setValue(value);
1741      return this;
1742    }
1743
1744    /**
1745     * @return {@link #category} (A code that classifies the general type of observation being made.)
1746     */
1747    public List<CodeableConcept> getCategory() { 
1748      if (this.category == null)
1749        this.category = new ArrayList<CodeableConcept>();
1750      return this.category;
1751    }
1752
1753    /**
1754     * @return Returns a reference to <code>this</code> for easy method chaining
1755     */
1756    public Observation setCategory(List<CodeableConcept> theCategory) { 
1757      this.category = theCategory;
1758      return this;
1759    }
1760
1761    public boolean hasCategory() { 
1762      if (this.category == null)
1763        return false;
1764      for (CodeableConcept item : this.category)
1765        if (!item.isEmpty())
1766          return true;
1767      return false;
1768    }
1769
1770    public CodeableConcept addCategory() { //3
1771      CodeableConcept t = new CodeableConcept();
1772      if (this.category == null)
1773        this.category = new ArrayList<CodeableConcept>();
1774      this.category.add(t);
1775      return t;
1776    }
1777
1778    public Observation addCategory(CodeableConcept t) { //3
1779      if (t == null)
1780        return this;
1781      if (this.category == null)
1782        this.category = new ArrayList<CodeableConcept>();
1783      this.category.add(t);
1784      return this;
1785    }
1786
1787    /**
1788     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist
1789     */
1790    public CodeableConcept getCategoryFirstRep() { 
1791      if (getCategory().isEmpty()) {
1792        addCategory();
1793      }
1794      return getCategory().get(0);
1795    }
1796
1797    /**
1798     * @return {@link #code} (Describes what was observed. Sometimes this is called the observation "name".)
1799     */
1800    public CodeableConcept getCode() { 
1801      if (this.code == null)
1802        if (Configuration.errorOnAutoCreate())
1803          throw new Error("Attempt to auto-create Observation.code");
1804        else if (Configuration.doAutoCreate())
1805          this.code = new CodeableConcept(); // cc
1806      return this.code;
1807    }
1808
1809    public boolean hasCode() { 
1810      return this.code != null && !this.code.isEmpty();
1811    }
1812
1813    /**
1814     * @param value {@link #code} (Describes what was observed. Sometimes this is called the observation "name".)
1815     */
1816    public Observation setCode(CodeableConcept value) { 
1817      this.code = value;
1818      return this;
1819    }
1820
1821    /**
1822     * @return {@link #subject} (The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed.  Comments: Indirect characteristics may be those of a specimen, fetus, donor,  other observer (for example a relative or EMT), or any observation made about the subject.)
1823     */
1824    public Reference getSubject() { 
1825      if (this.subject == null)
1826        if (Configuration.errorOnAutoCreate())
1827          throw new Error("Attempt to auto-create Observation.subject");
1828        else if (Configuration.doAutoCreate())
1829          this.subject = new Reference(); // cc
1830      return this.subject;
1831    }
1832
1833    public boolean hasSubject() { 
1834      return this.subject != null && !this.subject.isEmpty();
1835    }
1836
1837    /**
1838     * @param value {@link #subject} (The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed.  Comments: Indirect characteristics may be those of a specimen, fetus, donor,  other observer (for example a relative or EMT), or any observation made about the subject.)
1839     */
1840    public Observation setSubject(Reference value) { 
1841      this.subject = value;
1842      return this;
1843    }
1844
1845    /**
1846     * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed.  Comments: Indirect characteristics may be those of a specimen, fetus, donor,  other observer (for example a relative or EMT), or any observation made about the subject.)
1847     */
1848    public Resource getSubjectTarget() { 
1849      return this.subjectTarget;
1850    }
1851
1852    /**
1853     * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed.  Comments: Indirect characteristics may be those of a specimen, fetus, donor,  other observer (for example a relative or EMT), or any observation made about the subject.)
1854     */
1855    public Observation setSubjectTarget(Resource value) { 
1856      this.subjectTarget = value;
1857      return this;
1858    }
1859
1860    /**
1861     * @return {@link #focus} (The actual focus of an observation when it is not the patient of record.  The focus is point of attention when the observation representing something  or someone associated with the patient.  It could be  a  spouse or parent, a fetus or donor.  The focus of an observation could be an existing condition,  an intervention, the subject's diet,  another observation of the subject,  or a body structure such as tumor or implanted device.   An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.)
1862     */
1863    public Reference getFocus() { 
1864      if (this.focus == null)
1865        if (Configuration.errorOnAutoCreate())
1866          throw new Error("Attempt to auto-create Observation.focus");
1867        else if (Configuration.doAutoCreate())
1868          this.focus = new Reference(); // cc
1869      return this.focus;
1870    }
1871
1872    public boolean hasFocus() { 
1873      return this.focus != null && !this.focus.isEmpty();
1874    }
1875
1876    /**
1877     * @param value {@link #focus} (The actual focus of an observation when it is not the patient of record.  The focus is point of attention when the observation representing something  or someone associated with the patient.  It could be  a  spouse or parent, a fetus or donor.  The focus of an observation could be an existing condition,  an intervention, the subject's diet,  another observation of the subject,  or a body structure such as tumor or implanted device.   An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.)
1878     */
1879    public Observation setFocus(Reference value) { 
1880      this.focus = value;
1881      return this;
1882    }
1883
1884    /**
1885     * @return {@link #focus} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The actual focus of an observation when it is not the patient of record.  The focus is point of attention when the observation representing something  or someone associated with the patient.  It could be  a  spouse or parent, a fetus or donor.  The focus of an observation could be an existing condition,  an intervention, the subject's diet,  another observation of the subject,  or a body structure such as tumor or implanted device.   An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.)
1886     */
1887    public Resource getFocusTarget() { 
1888      return this.focusTarget;
1889    }
1890
1891    /**
1892     * @param value {@link #focus} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The actual focus of an observation when it is not the patient of record.  The focus is point of attention when the observation representing something  or someone associated with the patient.  It could be  a  spouse or parent, a fetus or donor.  The focus of an observation could be an existing condition,  an intervention, the subject's diet,  another observation of the subject,  or a body structure such as tumor or implanted device.   An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.)
1893     */
1894    public Observation setFocusTarget(Resource value) { 
1895      this.focusTarget = value;
1896      return this;
1897    }
1898
1899    /**
1900     * @return {@link #context} (The healthcare event  (e.g. a patient and healthcare provider interaction) during which this observation is made.)
1901     */
1902    public Reference getContext() { 
1903      if (this.context == null)
1904        if (Configuration.errorOnAutoCreate())
1905          throw new Error("Attempt to auto-create Observation.context");
1906        else if (Configuration.doAutoCreate())
1907          this.context = new Reference(); // cc
1908      return this.context;
1909    }
1910
1911    public boolean hasContext() { 
1912      return this.context != null && !this.context.isEmpty();
1913    }
1914
1915    /**
1916     * @param value {@link #context} (The healthcare event  (e.g. a patient and healthcare provider interaction) during which this observation is made.)
1917     */
1918    public Observation setContext(Reference value) { 
1919      this.context = value;
1920      return this;
1921    }
1922
1923    /**
1924     * @return {@link #context} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The healthcare event  (e.g. a patient and healthcare provider interaction) during which this observation is made.)
1925     */
1926    public Resource getContextTarget() { 
1927      return this.contextTarget;
1928    }
1929
1930    /**
1931     * @param value {@link #context} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The healthcare event  (e.g. a patient and healthcare provider interaction) during which this observation is made.)
1932     */
1933    public Observation setContextTarget(Resource value) { 
1934      this.contextTarget = value;
1935      return this;
1936    }
1937
1938    /**
1939     * @return {@link #effective} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.)
1940     */
1941    public Type getEffective() { 
1942      return this.effective;
1943    }
1944
1945    /**
1946     * @return {@link #effective} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.)
1947     */
1948    public DateTimeType getEffectiveDateTimeType() throws FHIRException { 
1949      if (this.effective == null)
1950        return null;
1951      if (!(this.effective instanceof DateTimeType))
1952        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.effective.getClass().getName()+" was encountered");
1953      return (DateTimeType) this.effective;
1954    }
1955
1956    public boolean hasEffectiveDateTimeType() { 
1957      return this != null && this.effective instanceof DateTimeType;
1958    }
1959
1960    /**
1961     * @return {@link #effective} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.)
1962     */
1963    public Period getEffectivePeriod() throws FHIRException { 
1964      if (this.effective == null)
1965        return null;
1966      if (!(this.effective instanceof Period))
1967        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.effective.getClass().getName()+" was encountered");
1968      return (Period) this.effective;
1969    }
1970
1971    public boolean hasEffectivePeriod() { 
1972      return this != null && this.effective instanceof Period;
1973    }
1974
1975    /**
1976     * @return {@link #effective} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.)
1977     */
1978    public Timing getEffectiveTiming() throws FHIRException { 
1979      if (this.effective == null)
1980        return null;
1981      if (!(this.effective instanceof Timing))
1982        throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.effective.getClass().getName()+" was encountered");
1983      return (Timing) this.effective;
1984    }
1985
1986    public boolean hasEffectiveTiming() { 
1987      return this != null && this.effective instanceof Timing;
1988    }
1989
1990    public boolean hasEffective() { 
1991      return this.effective != null && !this.effective.isEmpty();
1992    }
1993
1994    /**
1995     * @param value {@link #effective} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.)
1996     */
1997    public Observation setEffective(Type value) { 
1998      if (value != null && !(value instanceof DateTimeType || value instanceof Period || value instanceof Timing))
1999        throw new Error("Not the right type for Observation.effective[x]: "+value.fhirType());
2000      this.effective = value;
2001      return this;
2002    }
2003
2004    /**
2005     * @return {@link #issued} (The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value
2006     */
2007    public InstantType getIssuedElement() { 
2008      if (this.issued == null)
2009        if (Configuration.errorOnAutoCreate())
2010          throw new Error("Attempt to auto-create Observation.issued");
2011        else if (Configuration.doAutoCreate())
2012          this.issued = new InstantType(); // bb
2013      return this.issued;
2014    }
2015
2016    public boolean hasIssuedElement() { 
2017      return this.issued != null && !this.issued.isEmpty();
2018    }
2019
2020    public boolean hasIssued() { 
2021      return this.issued != null && !this.issued.isEmpty();
2022    }
2023
2024    /**
2025     * @param value {@link #issued} (The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value
2026     */
2027    public Observation setIssuedElement(InstantType value) { 
2028      this.issued = value;
2029      return this;
2030    }
2031
2032    /**
2033     * @return The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified.
2034     */
2035    public Date getIssued() { 
2036      return this.issued == null ? null : this.issued.getValue();
2037    }
2038
2039    /**
2040     * @param value The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified.
2041     */
2042    public Observation setIssued(Date value) { 
2043      if (value == null)
2044        this.issued = null;
2045      else {
2046        if (this.issued == null)
2047          this.issued = new InstantType();
2048        this.issued.setValue(value);
2049      }
2050      return this;
2051    }
2052
2053    /**
2054     * @return {@link #performer} (Who was responsible for asserting the observed value as "true".)
2055     */
2056    public List<Reference> getPerformer() { 
2057      if (this.performer == null)
2058        this.performer = new ArrayList<Reference>();
2059      return this.performer;
2060    }
2061
2062    /**
2063     * @return Returns a reference to <code>this</code> for easy method chaining
2064     */
2065    public Observation setPerformer(List<Reference> thePerformer) { 
2066      this.performer = thePerformer;
2067      return this;
2068    }
2069
2070    public boolean hasPerformer() { 
2071      if (this.performer == null)
2072        return false;
2073      for (Reference item : this.performer)
2074        if (!item.isEmpty())
2075          return true;
2076      return false;
2077    }
2078
2079    public Reference addPerformer() { //3
2080      Reference t = new Reference();
2081      if (this.performer == null)
2082        this.performer = new ArrayList<Reference>();
2083      this.performer.add(t);
2084      return t;
2085    }
2086
2087    public Observation addPerformer(Reference t) { //3
2088      if (t == null)
2089        return this;
2090      if (this.performer == null)
2091        this.performer = new ArrayList<Reference>();
2092      this.performer.add(t);
2093      return this;
2094    }
2095
2096    /**
2097     * @return The first repetition of repeating field {@link #performer}, creating it if it does not already exist
2098     */
2099    public Reference getPerformerFirstRep() { 
2100      if (getPerformer().isEmpty()) {
2101        addPerformer();
2102      }
2103      return getPerformer().get(0);
2104    }
2105
2106    /**
2107     * @deprecated Use Reference#setResource(IBaseResource) instead
2108     */
2109    @Deprecated
2110    public List<Resource> getPerformerTarget() { 
2111      if (this.performerTarget == null)
2112        this.performerTarget = new ArrayList<Resource>();
2113      return this.performerTarget;
2114    }
2115
2116    /**
2117     * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
2118     */
2119    public Type getValue() { 
2120      return this.value;
2121    }
2122
2123    /**
2124     * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
2125     */
2126    public Quantity getValueQuantity() throws FHIRException { 
2127      if (this.value == null)
2128        return null;
2129      if (!(this.value instanceof Quantity))
2130        throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
2131      return (Quantity) this.value;
2132    }
2133
2134    public boolean hasValueQuantity() { 
2135      return this != null && this.value instanceof Quantity;
2136    }
2137
2138    /**
2139     * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
2140     */
2141    public CodeableConcept getValueCodeableConcept() throws FHIRException { 
2142      if (this.value == null)
2143        return null;
2144      if (!(this.value instanceof CodeableConcept))
2145        throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered");
2146      return (CodeableConcept) this.value;
2147    }
2148
2149    public boolean hasValueCodeableConcept() { 
2150      return this != null && this.value instanceof CodeableConcept;
2151    }
2152
2153    /**
2154     * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
2155     */
2156    public StringType getValueStringType() throws FHIRException { 
2157      if (this.value == null)
2158        return null;
2159      if (!(this.value instanceof StringType))
2160        throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered");
2161      return (StringType) this.value;
2162    }
2163
2164    public boolean hasValueStringType() { 
2165      return this != null && this.value instanceof StringType;
2166    }
2167
2168    /**
2169     * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
2170     */
2171    public BooleanType getValueBooleanType() throws FHIRException { 
2172      if (this.value == null)
2173        return null;
2174      if (!(this.value instanceof BooleanType))
2175        throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
2176      return (BooleanType) this.value;
2177    }
2178
2179    public boolean hasValueBooleanType() { 
2180      return this != null && this.value instanceof BooleanType;
2181    }
2182
2183    /**
2184     * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
2185     */
2186    public IntegerType getValueIntegerType() throws FHIRException { 
2187      if (this.value == null)
2188        return null;
2189      if (!(this.value instanceof IntegerType))
2190        throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered");
2191      return (IntegerType) this.value;
2192    }
2193
2194    public boolean hasValueIntegerType() { 
2195      return this != null && this.value instanceof IntegerType;
2196    }
2197
2198    /**
2199     * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
2200     */
2201    public Range getValueRange() throws FHIRException { 
2202      if (this.value == null)
2203        return null;
2204      if (!(this.value instanceof Range))
2205        throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered");
2206      return (Range) this.value;
2207    }
2208
2209    public boolean hasValueRange() { 
2210      return this != null && this.value instanceof Range;
2211    }
2212
2213    /**
2214     * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
2215     */
2216    public Ratio getValueRatio() throws FHIRException { 
2217      if (this.value == null)
2218        return null;
2219      if (!(this.value instanceof Ratio))
2220        throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.value.getClass().getName()+" was encountered");
2221      return (Ratio) this.value;
2222    }
2223
2224    public boolean hasValueRatio() { 
2225      return this != null && this.value instanceof Ratio;
2226    }
2227
2228    /**
2229     * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
2230     */
2231    public SampledData getValueSampledData() throws FHIRException { 
2232      if (this.value == null)
2233        return null;
2234      if (!(this.value instanceof SampledData))
2235        throw new FHIRException("Type mismatch: the type SampledData was expected, but "+this.value.getClass().getName()+" was encountered");
2236      return (SampledData) this.value;
2237    }
2238
2239    public boolean hasValueSampledData() { 
2240      return this != null && this.value instanceof SampledData;
2241    }
2242
2243    /**
2244     * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
2245     */
2246    public TimeType getValueTimeType() throws FHIRException { 
2247      if (this.value == null)
2248        return null;
2249      if (!(this.value instanceof TimeType))
2250        throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered");
2251      return (TimeType) this.value;
2252    }
2253
2254    public boolean hasValueTimeType() { 
2255      return this != null && this.value instanceof TimeType;
2256    }
2257
2258    /**
2259     * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
2260     */
2261    public DateTimeType getValueDateTimeType() throws FHIRException { 
2262      if (this.value == null)
2263        return null;
2264      if (!(this.value instanceof DateTimeType))
2265        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered");
2266      return (DateTimeType) this.value;
2267    }
2268
2269    public boolean hasValueDateTimeType() { 
2270      return this != null && this.value instanceof DateTimeType;
2271    }
2272
2273    /**
2274     * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
2275     */
2276    public Period getValuePeriod() throws FHIRException { 
2277      if (this.value == null)
2278        return null;
2279      if (!(this.value instanceof Period))
2280        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered");
2281      return (Period) this.value;
2282    }
2283
2284    public boolean hasValuePeriod() { 
2285      return this != null && this.value instanceof Period;
2286    }
2287
2288    public boolean hasValue() { 
2289      return this.value != null && !this.value.isEmpty();
2290    }
2291
2292    /**
2293     * @param value {@link #value} (The information determined as a result of making the observation, if the information has a simple value.)
2294     */
2295    public Observation setValue(Type value) { 
2296      if (value != null && !(value instanceof Quantity || value instanceof CodeableConcept || value instanceof StringType || value instanceof BooleanType || value instanceof IntegerType || value instanceof Range || value instanceof Ratio || value instanceof SampledData || value instanceof TimeType || value instanceof DateTimeType || value instanceof Period))
2297        throw new Error("Not the right type for Observation.value[x]: "+value.fhirType());
2298      this.value = value;
2299      return this;
2300    }
2301
2302    /**
2303     * @return {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.)
2304     */
2305    public CodeableConcept getDataAbsentReason() { 
2306      if (this.dataAbsentReason == null)
2307        if (Configuration.errorOnAutoCreate())
2308          throw new Error("Attempt to auto-create Observation.dataAbsentReason");
2309        else if (Configuration.doAutoCreate())
2310          this.dataAbsentReason = new CodeableConcept(); // cc
2311      return this.dataAbsentReason;
2312    }
2313
2314    public boolean hasDataAbsentReason() { 
2315      return this.dataAbsentReason != null && !this.dataAbsentReason.isEmpty();
2316    }
2317
2318    /**
2319     * @param value {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.)
2320     */
2321    public Observation setDataAbsentReason(CodeableConcept value) { 
2322      this.dataAbsentReason = value;
2323      return this;
2324    }
2325
2326    /**
2327     * @return {@link #interpretation} (The assessment made based on the result of the observation.  Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag.)
2328     */
2329    public CodeableConcept getInterpretation() { 
2330      if (this.interpretation == null)
2331        if (Configuration.errorOnAutoCreate())
2332          throw new Error("Attempt to auto-create Observation.interpretation");
2333        else if (Configuration.doAutoCreate())
2334          this.interpretation = new CodeableConcept(); // cc
2335      return this.interpretation;
2336    }
2337
2338    public boolean hasInterpretation() { 
2339      return this.interpretation != null && !this.interpretation.isEmpty();
2340    }
2341
2342    /**
2343     * @param value {@link #interpretation} (The assessment made based on the result of the observation.  Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag.)
2344     */
2345    public Observation setInterpretation(CodeableConcept value) { 
2346      this.interpretation = value;
2347      return this;
2348    }
2349
2350    /**
2351     * @return {@link #comment} (May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
2352     */
2353    public StringType getCommentElement() { 
2354      if (this.comment == null)
2355        if (Configuration.errorOnAutoCreate())
2356          throw new Error("Attempt to auto-create Observation.comment");
2357        else if (Configuration.doAutoCreate())
2358          this.comment = new StringType(); // bb
2359      return this.comment;
2360    }
2361
2362    public boolean hasCommentElement() { 
2363      return this.comment != null && !this.comment.isEmpty();
2364    }
2365
2366    public boolean hasComment() { 
2367      return this.comment != null && !this.comment.isEmpty();
2368    }
2369
2370    /**
2371     * @param value {@link #comment} (May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
2372     */
2373    public Observation setCommentElement(StringType value) { 
2374      this.comment = value;
2375      return this;
2376    }
2377
2378    /**
2379     * @return May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.
2380     */
2381    public String getComment() { 
2382      return this.comment == null ? null : this.comment.getValue();
2383    }
2384
2385    /**
2386     * @param value May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.
2387     */
2388    public Observation setComment(String value) { 
2389      if (Utilities.noString(value))
2390        this.comment = null;
2391      else {
2392        if (this.comment == null)
2393          this.comment = new StringType();
2394        this.comment.setValue(value);
2395      }
2396      return this;
2397    }
2398
2399    /**
2400     * @return {@link #bodySite} (Indicates the site on the subject's body where the observation was made (i.e. the target site).)
2401     */
2402    public CodeableConcept getBodySite() { 
2403      if (this.bodySite == null)
2404        if (Configuration.errorOnAutoCreate())
2405          throw new Error("Attempt to auto-create Observation.bodySite");
2406        else if (Configuration.doAutoCreate())
2407          this.bodySite = new CodeableConcept(); // cc
2408      return this.bodySite;
2409    }
2410
2411    public boolean hasBodySite() { 
2412      return this.bodySite != null && !this.bodySite.isEmpty();
2413    }
2414
2415    /**
2416     * @param value {@link #bodySite} (Indicates the site on the subject's body where the observation was made (i.e. the target site).)
2417     */
2418    public Observation setBodySite(CodeableConcept value) { 
2419      this.bodySite = value;
2420      return this;
2421    }
2422
2423    /**
2424     * @return {@link #method} (Indicates the mechanism used to perform the observation.)
2425     */
2426    public CodeableConcept getMethod() { 
2427      if (this.method == null)
2428        if (Configuration.errorOnAutoCreate())
2429          throw new Error("Attempt to auto-create Observation.method");
2430        else if (Configuration.doAutoCreate())
2431          this.method = new CodeableConcept(); // cc
2432      return this.method;
2433    }
2434
2435    public boolean hasMethod() { 
2436      return this.method != null && !this.method.isEmpty();
2437    }
2438
2439    /**
2440     * @param value {@link #method} (Indicates the mechanism used to perform the observation.)
2441     */
2442    public Observation setMethod(CodeableConcept value) { 
2443      this.method = value;
2444      return this;
2445    }
2446
2447    /**
2448     * @return {@link #specimen} (The specimen that was used when this observation was made.)
2449     */
2450    public Reference getSpecimen() { 
2451      if (this.specimen == null)
2452        if (Configuration.errorOnAutoCreate())
2453          throw new Error("Attempt to auto-create Observation.specimen");
2454        else if (Configuration.doAutoCreate())
2455          this.specimen = new Reference(); // cc
2456      return this.specimen;
2457    }
2458
2459    public boolean hasSpecimen() { 
2460      return this.specimen != null && !this.specimen.isEmpty();
2461    }
2462
2463    /**
2464     * @param value {@link #specimen} (The specimen that was used when this observation was made.)
2465     */
2466    public Observation setSpecimen(Reference value) { 
2467      this.specimen = value;
2468      return this;
2469    }
2470
2471    /**
2472     * @return {@link #specimen} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The specimen that was used when this observation was made.)
2473     */
2474    public Specimen getSpecimenTarget() { 
2475      if (this.specimenTarget == null)
2476        if (Configuration.errorOnAutoCreate())
2477          throw new Error("Attempt to auto-create Observation.specimen");
2478        else if (Configuration.doAutoCreate())
2479          this.specimenTarget = new Specimen(); // aa
2480      return this.specimenTarget;
2481    }
2482
2483    /**
2484     * @param value {@link #specimen} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The specimen that was used when this observation was made.)
2485     */
2486    public Observation setSpecimenTarget(Specimen value) { 
2487      this.specimenTarget = value;
2488      return this;
2489    }
2490
2491    /**
2492     * @return {@link #device} (The device used to generate the observation data.)
2493     */
2494    public Reference getDevice() { 
2495      if (this.device == null)
2496        if (Configuration.errorOnAutoCreate())
2497          throw new Error("Attempt to auto-create Observation.device");
2498        else if (Configuration.doAutoCreate())
2499          this.device = new Reference(); // cc
2500      return this.device;
2501    }
2502
2503    public boolean hasDevice() { 
2504      return this.device != null && !this.device.isEmpty();
2505    }
2506
2507    /**
2508     * @param value {@link #device} (The device used to generate the observation data.)
2509     */
2510    public Observation setDevice(Reference value) { 
2511      this.device = value;
2512      return this;
2513    }
2514
2515    /**
2516     * @return {@link #device} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The device used to generate the observation data.)
2517     */
2518    public Resource getDeviceTarget() { 
2519      return this.deviceTarget;
2520    }
2521
2522    /**
2523     * @param value {@link #device} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The device used to generate the observation data.)
2524     */
2525    public Observation setDeviceTarget(Resource value) { 
2526      this.deviceTarget = value;
2527      return this;
2528    }
2529
2530    /**
2531     * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.)
2532     */
2533    public List<ObservationReferenceRangeComponent> getReferenceRange() { 
2534      if (this.referenceRange == null)
2535        this.referenceRange = new ArrayList<ObservationReferenceRangeComponent>();
2536      return this.referenceRange;
2537    }
2538
2539    /**
2540     * @return Returns a reference to <code>this</code> for easy method chaining
2541     */
2542    public Observation setReferenceRange(List<ObservationReferenceRangeComponent> theReferenceRange) { 
2543      this.referenceRange = theReferenceRange;
2544      return this;
2545    }
2546
2547    public boolean hasReferenceRange() { 
2548      if (this.referenceRange == null)
2549        return false;
2550      for (ObservationReferenceRangeComponent item : this.referenceRange)
2551        if (!item.isEmpty())
2552          return true;
2553      return false;
2554    }
2555
2556    public ObservationReferenceRangeComponent addReferenceRange() { //3
2557      ObservationReferenceRangeComponent t = new ObservationReferenceRangeComponent();
2558      if (this.referenceRange == null)
2559        this.referenceRange = new ArrayList<ObservationReferenceRangeComponent>();
2560      this.referenceRange.add(t);
2561      return t;
2562    }
2563
2564    public Observation addReferenceRange(ObservationReferenceRangeComponent t) { //3
2565      if (t == null)
2566        return this;
2567      if (this.referenceRange == null)
2568        this.referenceRange = new ArrayList<ObservationReferenceRangeComponent>();
2569      this.referenceRange.add(t);
2570      return this;
2571    }
2572
2573    /**
2574     * @return The first repetition of repeating field {@link #referenceRange}, creating it if it does not already exist
2575     */
2576    public ObservationReferenceRangeComponent getReferenceRangeFirstRep() { 
2577      if (getReferenceRange().isEmpty()) {
2578        addReferenceRange();
2579      }
2580      return getReferenceRange().get(0);
2581    }
2582
2583    /**
2584     * @return {@link #hasMember} (This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group.)
2585     */
2586    public List<Reference> getHasMember() { 
2587      if (this.hasMember == null)
2588        this.hasMember = new ArrayList<Reference>();
2589      return this.hasMember;
2590    }
2591
2592    /**
2593     * @return Returns a reference to <code>this</code> for easy method chaining
2594     */
2595    public Observation setHasMember(List<Reference> theHasMember) { 
2596      this.hasMember = theHasMember;
2597      return this;
2598    }
2599
2600    public boolean hasHasMember() { 
2601      if (this.hasMember == null)
2602        return false;
2603      for (Reference item : this.hasMember)
2604        if (!item.isEmpty())
2605          return true;
2606      return false;
2607    }
2608
2609    public Reference addHasMember() { //3
2610      Reference t = new Reference();
2611      if (this.hasMember == null)
2612        this.hasMember = new ArrayList<Reference>();
2613      this.hasMember.add(t);
2614      return t;
2615    }
2616
2617    public Observation addHasMember(Reference t) { //3
2618      if (t == null)
2619        return this;
2620      if (this.hasMember == null)
2621        this.hasMember = new ArrayList<Reference>();
2622      this.hasMember.add(t);
2623      return this;
2624    }
2625
2626    /**
2627     * @return The first repetition of repeating field {@link #hasMember}, creating it if it does not already exist
2628     */
2629    public Reference getHasMemberFirstRep() { 
2630      if (getHasMember().isEmpty()) {
2631        addHasMember();
2632      }
2633      return getHasMember().get(0);
2634    }
2635
2636    /**
2637     * @deprecated Use Reference#setResource(IBaseResource) instead
2638     */
2639    @Deprecated
2640    public List<Resource> getHasMemberTarget() { 
2641      if (this.hasMemberTarget == null)
2642        this.hasMemberTarget = new ArrayList<Resource>();
2643      return this.hasMemberTarget;
2644    }
2645
2646    /**
2647     * @return {@link #derivedFrom} (The target resource that represents a measurement from which this observation value is derived. For example, a calculated anion gap or a fetal measurement based on an ultrasound image.)
2648     */
2649    public List<Reference> getDerivedFrom() { 
2650      if (this.derivedFrom == null)
2651        this.derivedFrom = new ArrayList<Reference>();
2652      return this.derivedFrom;
2653    }
2654
2655    /**
2656     * @return Returns a reference to <code>this</code> for easy method chaining
2657     */
2658    public Observation setDerivedFrom(List<Reference> theDerivedFrom) { 
2659      this.derivedFrom = theDerivedFrom;
2660      return this;
2661    }
2662
2663    public boolean hasDerivedFrom() { 
2664      if (this.derivedFrom == null)
2665        return false;
2666      for (Reference item : this.derivedFrom)
2667        if (!item.isEmpty())
2668          return true;
2669      return false;
2670    }
2671
2672    public Reference addDerivedFrom() { //3
2673      Reference t = new Reference();
2674      if (this.derivedFrom == null)
2675        this.derivedFrom = new ArrayList<Reference>();
2676      this.derivedFrom.add(t);
2677      return t;
2678    }
2679
2680    public Observation addDerivedFrom(Reference t) { //3
2681      if (t == null)
2682        return this;
2683      if (this.derivedFrom == null)
2684        this.derivedFrom = new ArrayList<Reference>();
2685      this.derivedFrom.add(t);
2686      return this;
2687    }
2688
2689    /**
2690     * @return The first repetition of repeating field {@link #derivedFrom}, creating it if it does not already exist
2691     */
2692    public Reference getDerivedFromFirstRep() { 
2693      if (getDerivedFrom().isEmpty()) {
2694        addDerivedFrom();
2695      }
2696      return getDerivedFrom().get(0);
2697    }
2698
2699    /**
2700     * @deprecated Use Reference#setResource(IBaseResource) instead
2701     */
2702    @Deprecated
2703    public List<Resource> getDerivedFromTarget() { 
2704      if (this.derivedFromTarget == null)
2705        this.derivedFromTarget = new ArrayList<Resource>();
2706      return this.derivedFromTarget;
2707    }
2708
2709    /**
2710     * @return {@link #component} (Some observations have multiple component observations.  These component observations are expressed as separate code value pairs that share the same attributes.  Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations.)
2711     */
2712    public List<ObservationComponentComponent> getComponent() { 
2713      if (this.component == null)
2714        this.component = new ArrayList<ObservationComponentComponent>();
2715      return this.component;
2716    }
2717
2718    /**
2719     * @return Returns a reference to <code>this</code> for easy method chaining
2720     */
2721    public Observation setComponent(List<ObservationComponentComponent> theComponent) { 
2722      this.component = theComponent;
2723      return this;
2724    }
2725
2726    public boolean hasComponent() { 
2727      if (this.component == null)
2728        return false;
2729      for (ObservationComponentComponent item : this.component)
2730        if (!item.isEmpty())
2731          return true;
2732      return false;
2733    }
2734
2735    public ObservationComponentComponent addComponent() { //3
2736      ObservationComponentComponent t = new ObservationComponentComponent();
2737      if (this.component == null)
2738        this.component = new ArrayList<ObservationComponentComponent>();
2739      this.component.add(t);
2740      return t;
2741    }
2742
2743    public Observation addComponent(ObservationComponentComponent t) { //3
2744      if (t == null)
2745        return this;
2746      if (this.component == null)
2747        this.component = new ArrayList<ObservationComponentComponent>();
2748      this.component.add(t);
2749      return this;
2750    }
2751
2752    /**
2753     * @return The first repetition of repeating field {@link #component}, creating it if it does not already exist
2754     */
2755    public ObservationComponentComponent getComponentFirstRep() { 
2756      if (getComponent().isEmpty()) {
2757        addComponent();
2758      }
2759      return getComponent().get(0);
2760    }
2761
2762      protected void listChildren(List<Property> children) {
2763        super.listChildren(children);
2764        children.add(new Property("identifier", "Identifier", "A unique identifier assigned to this observation.", 0, java.lang.Integer.MAX_VALUE, identifier));
2765        children.add(new Property("basedOn", "Reference(CarePlan|DeviceRequest|ImmunizationRecommendation|MedicationRequest|NutritionOrder|ServiceRequest)", "A plan, proposal or order that is fulfilled in whole or in part by this event.", 0, java.lang.Integer.MAX_VALUE, basedOn));
2766        children.add(new Property("partOf", "Reference(MedicationAdministration|MedicationDispense|MedicationStatement|Procedure|Immunization|ImagingStudy)", "A larger event of which this particular Observation is a component or step.  For example,  an observation as part of a procedure.", 0, java.lang.Integer.MAX_VALUE, partOf));
2767        children.add(new Property("status", "code", "The status of the result value.", 0, 1, status));
2768        children.add(new Property("category", "CodeableConcept", "A code that classifies the general type of observation being made.", 0, java.lang.Integer.MAX_VALUE, category));
2769        children.add(new Property("code", "CodeableConcept", "Describes what was observed. Sometimes this is called the observation \"name\".", 0, 1, code));
2770        children.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed.  Comments: Indirect characteristics may be those of a specimen, fetus, donor,  other observer (for example a relative or EMT), or any observation made about the subject.", 0, 1, subject));
2771        children.add(new Property("focus", "Reference(Any)", "The actual focus of an observation when it is not the patient of record.  The focus is point of attention when the observation representing something  or someone associated with the patient.  It could be  a  spouse or parent, a fetus or donor.  The focus of an observation could be an existing condition,  an intervention, the subject's diet,  another observation of the subject,  or a body structure such as tumor or implanted device.   An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.", 0, 1, focus));
2772        children.add(new Property("context", "Reference(Encounter|EpisodeOfCare)", "The healthcare event  (e.g. a patient and healthcare provider interaction) during which this observation is made.", 0, 1, context));
2773        children.add(new Property("effective[x]", "dateTime|Period|Timing", "The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the \"physiologically relevant time\". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.", 0, 1, effective));
2774        children.add(new Property("issued", "instant", "The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified.", 0, 1, issued));
2775        children.add(new Property("performer", "Reference(Practitioner|PractitionerRole|Organization|CareTeam|Patient|RelatedPerson)", "Who was responsible for asserting the observed value as \"true\".", 0, java.lang.Integer.MAX_VALUE, performer));
2776        children.add(new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value));
2777        children.add(new Property("dataAbsentReason", "CodeableConcept", "Provides a reason why the expected value in the element Observation.value[x] is missing.", 0, 1, dataAbsentReason));
2778        children.add(new Property("interpretation", "CodeableConcept", "The assessment made based on the result of the observation.  Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag.", 0, 1, interpretation));
2779        children.add(new Property("comment", "string", "May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.", 0, 1, comment));
2780        children.add(new Property("bodySite", "CodeableConcept", "Indicates the site on the subject's body where the observation was made (i.e. the target site).", 0, 1, bodySite));
2781        children.add(new Property("method", "CodeableConcept", "Indicates the mechanism used to perform the observation.", 0, 1, method));
2782        children.add(new Property("specimen", "Reference(Specimen)", "The specimen that was used when this observation was made.", 0, 1, specimen));
2783        children.add(new Property("device", "Reference(Device|DeviceComponent|DeviceMetric)", "The device used to generate the observation data.", 0, 1, device));
2784        children.add(new Property("referenceRange", "", "Guidance on how to interpret the value by comparison to a normal or recommended range.", 0, java.lang.Integer.MAX_VALUE, referenceRange));
2785        children.add(new Property("hasMember", "Reference(Observation|QuestionnaireResponse|Sequence)", "This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group.", 0, java.lang.Integer.MAX_VALUE, hasMember));
2786        children.add(new Property("derivedFrom", "Reference(DocumentReference|ImagingStudy|Media|QuestionnaireResponse|Observation|Sequence)", "The target resource that represents a measurement from which this observation value is derived. For example, a calculated anion gap or a fetal measurement based on an ultrasound image.", 0, java.lang.Integer.MAX_VALUE, derivedFrom));
2787        children.add(new Property("component", "", "Some observations have multiple component observations.  These component observations are expressed as separate code value pairs that share the same attributes.  Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations.", 0, java.lang.Integer.MAX_VALUE, component));
2788      }
2789
2790      @Override
2791      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2792        switch (_hash) {
2793        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A unique identifier assigned to this observation.", 0, java.lang.Integer.MAX_VALUE, identifier);
2794        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(CarePlan|DeviceRequest|ImmunizationRecommendation|MedicationRequest|NutritionOrder|ServiceRequest)", "A plan, proposal or order that is fulfilled in whole or in part by this event.", 0, java.lang.Integer.MAX_VALUE, basedOn);
2795        case -995410646: /*partOf*/  return new Property("partOf", "Reference(MedicationAdministration|MedicationDispense|MedicationStatement|Procedure|Immunization|ImagingStudy)", "A larger event of which this particular Observation is a component or step.  For example,  an observation as part of a procedure.", 0, java.lang.Integer.MAX_VALUE, partOf);
2796        case -892481550: /*status*/  return new Property("status", "code", "The status of the result value.", 0, 1, status);
2797        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "A code that classifies the general type of observation being made.", 0, java.lang.Integer.MAX_VALUE, category);
2798        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "Describes what was observed. Sometimes this is called the observation \"name\".", 0, 1, code);
2799        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group|Device|Location)", "The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed.  Comments: Indirect characteristics may be those of a specimen, fetus, donor,  other observer (for example a relative or EMT), or any observation made about the subject.", 0, 1, subject);
2800        case 97604824: /*focus*/  return new Property("focus", "Reference(Any)", "The actual focus of an observation when it is not the patient of record.  The focus is point of attention when the observation representing something  or someone associated with the patient.  It could be  a  spouse or parent, a fetus or donor.  The focus of an observation could be an existing condition,  an intervention, the subject's diet,  another observation of the subject,  or a body structure such as tumor or implanted device.   An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.", 0, 1, focus);
2801        case 951530927: /*context*/  return new Property("context", "Reference(Encounter|EpisodeOfCare)", "The healthcare event  (e.g. a patient and healthcare provider interaction) during which this observation is made.", 0, 1, context);
2802        case 247104889: /*effective[x]*/  return new Property("effective[x]", "dateTime|Period|Timing", "The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the \"physiologically relevant time\". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.", 0, 1, effective);
2803        case -1468651097: /*effective*/  return new Property("effective[x]", "dateTime|Period|Timing", "The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the \"physiologically relevant time\". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.", 0, 1, effective);
2804        case -275306910: /*effectiveDateTime*/  return new Property("effective[x]", "dateTime|Period|Timing", "The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the \"physiologically relevant time\". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.", 0, 1, effective);
2805        case -403934648: /*effectivePeriod*/  return new Property("effective[x]", "dateTime|Period|Timing", "The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the \"physiologically relevant time\". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.", 0, 1, effective);
2806        case -285872943: /*effectiveTiming*/  return new Property("effective[x]", "dateTime|Period|Timing", "The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the \"physiologically relevant time\". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.", 0, 1, effective);
2807        case -1179159893: /*issued*/  return new Property("issued", "instant", "The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified.", 0, 1, issued);
2808        case 481140686: /*performer*/  return new Property("performer", "Reference(Practitioner|PractitionerRole|Organization|CareTeam|Patient|RelatedPerson)", "Who was responsible for asserting the observed value as \"true\".", 0, java.lang.Integer.MAX_VALUE, performer);
2809        case -1410166417: /*value[x]*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
2810        case 111972721: /*value*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
2811        case -2029823716: /*valueQuantity*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
2812        case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
2813        case -1424603934: /*valueString*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
2814        case 733421943: /*valueBoolean*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
2815        case -1668204915: /*valueInteger*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
2816        case 2030761548: /*valueRange*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
2817        case 2030767386: /*valueRatio*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
2818        case -962229101: /*valueSampledData*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
2819        case -765708322: /*valueTime*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
2820        case 1047929900: /*valueDateTime*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
2821        case -1524344174: /*valuePeriod*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Ratio|SampledData|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, 1, value);
2822        case 1034315687: /*dataAbsentReason*/  return new Property("dataAbsentReason", "CodeableConcept", "Provides a reason why the expected value in the element Observation.value[x] is missing.", 0, 1, dataAbsentReason);
2823        case -297950712: /*interpretation*/  return new Property("interpretation", "CodeableConcept", "The assessment made based on the result of the observation.  Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag.", 0, 1, interpretation);
2824        case 950398559: /*comment*/  return new Property("comment", "string", "May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result.", 0, 1, comment);
2825        case 1702620169: /*bodySite*/  return new Property("bodySite", "CodeableConcept", "Indicates the site on the subject's body where the observation was made (i.e. the target site).", 0, 1, bodySite);
2826        case -1077554975: /*method*/  return new Property("method", "CodeableConcept", "Indicates the mechanism used to perform the observation.", 0, 1, method);
2827        case -2132868344: /*specimen*/  return new Property("specimen", "Reference(Specimen)", "The specimen that was used when this observation was made.", 0, 1, specimen);
2828        case -1335157162: /*device*/  return new Property("device", "Reference(Device|DeviceComponent|DeviceMetric)", "The device used to generate the observation data.", 0, 1, device);
2829        case -1912545102: /*referenceRange*/  return new Property("referenceRange", "", "Guidance on how to interpret the value by comparison to a normal or recommended range.", 0, java.lang.Integer.MAX_VALUE, referenceRange);
2830        case -458019372: /*hasMember*/  return new Property("hasMember", "Reference(Observation|QuestionnaireResponse|Sequence)", "This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group.", 0, java.lang.Integer.MAX_VALUE, hasMember);
2831        case 1077922663: /*derivedFrom*/  return new Property("derivedFrom", "Reference(DocumentReference|ImagingStudy|Media|QuestionnaireResponse|Observation|Sequence)", "The target resource that represents a measurement from which this observation value is derived. For example, a calculated anion gap or a fetal measurement based on an ultrasound image.", 0, java.lang.Integer.MAX_VALUE, derivedFrom);
2832        case -1399907075: /*component*/  return new Property("component", "", "Some observations have multiple component observations.  These component observations are expressed as separate code value pairs that share the same attributes.  Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations.", 0, java.lang.Integer.MAX_VALUE, component);
2833        default: return super.getNamedProperty(_hash, _name, _checkValid);
2834        }
2835
2836      }
2837
2838      @Override
2839      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2840        switch (hash) {
2841        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2842        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
2843        case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference
2844        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<ObservationStatus>
2845        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
2846        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
2847        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
2848        case 97604824: /*focus*/ return this.focus == null ? new Base[0] : new Base[] {this.focus}; // Reference
2849        case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // Reference
2850        case -1468651097: /*effective*/ return this.effective == null ? new Base[0] : new Base[] {this.effective}; // Type
2851        case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // InstantType
2852        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // Reference
2853        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type
2854        case 1034315687: /*dataAbsentReason*/ return this.dataAbsentReason == null ? new Base[0] : new Base[] {this.dataAbsentReason}; // CodeableConcept
2855        case -297950712: /*interpretation*/ return this.interpretation == null ? new Base[0] : new Base[] {this.interpretation}; // CodeableConcept
2856        case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType
2857        case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // CodeableConcept
2858        case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept
2859        case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : new Base[] {this.specimen}; // Reference
2860        case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference
2861        case -1912545102: /*referenceRange*/ return this.referenceRange == null ? new Base[0] : this.referenceRange.toArray(new Base[this.referenceRange.size()]); // ObservationReferenceRangeComponent
2862        case -458019372: /*hasMember*/ return this.hasMember == null ? new Base[0] : this.hasMember.toArray(new Base[this.hasMember.size()]); // Reference
2863        case 1077922663: /*derivedFrom*/ return this.derivedFrom == null ? new Base[0] : this.derivedFrom.toArray(new Base[this.derivedFrom.size()]); // Reference
2864        case -1399907075: /*component*/ return this.component == null ? new Base[0] : this.component.toArray(new Base[this.component.size()]); // ObservationComponentComponent
2865        default: return super.getProperty(hash, name, checkValid);
2866        }
2867
2868      }
2869
2870      @Override
2871      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2872        switch (hash) {
2873        case -1618432855: // identifier
2874          this.getIdentifier().add(castToIdentifier(value)); // Identifier
2875          return value;
2876        case -332612366: // basedOn
2877          this.getBasedOn().add(castToReference(value)); // Reference
2878          return value;
2879        case -995410646: // partOf
2880          this.getPartOf().add(castToReference(value)); // Reference
2881          return value;
2882        case -892481550: // status
2883          value = new ObservationStatusEnumFactory().fromType(castToCode(value));
2884          this.status = (Enumeration) value; // Enumeration<ObservationStatus>
2885          return value;
2886        case 50511102: // category
2887          this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept
2888          return value;
2889        case 3059181: // code
2890          this.code = castToCodeableConcept(value); // CodeableConcept
2891          return value;
2892        case -1867885268: // subject
2893          this.subject = castToReference(value); // Reference
2894          return value;
2895        case 97604824: // focus
2896          this.focus = castToReference(value); // Reference
2897          return value;
2898        case 951530927: // context
2899          this.context = castToReference(value); // Reference
2900          return value;
2901        case -1468651097: // effective
2902          this.effective = castToType(value); // Type
2903          return value;
2904        case -1179159893: // issued
2905          this.issued = castToInstant(value); // InstantType
2906          return value;
2907        case 481140686: // performer
2908          this.getPerformer().add(castToReference(value)); // Reference
2909          return value;
2910        case 111972721: // value
2911          this.value = castToType(value); // Type
2912          return value;
2913        case 1034315687: // dataAbsentReason
2914          this.dataAbsentReason = castToCodeableConcept(value); // CodeableConcept
2915          return value;
2916        case -297950712: // interpretation
2917          this.interpretation = castToCodeableConcept(value); // CodeableConcept
2918          return value;
2919        case 950398559: // comment
2920          this.comment = castToString(value); // StringType
2921          return value;
2922        case 1702620169: // bodySite
2923          this.bodySite = castToCodeableConcept(value); // CodeableConcept
2924          return value;
2925        case -1077554975: // method
2926          this.method = castToCodeableConcept(value); // CodeableConcept
2927          return value;
2928        case -2132868344: // specimen
2929          this.specimen = castToReference(value); // Reference
2930          return value;
2931        case -1335157162: // device
2932          this.device = castToReference(value); // Reference
2933          return value;
2934        case -1912545102: // referenceRange
2935          this.getReferenceRange().add((ObservationReferenceRangeComponent) value); // ObservationReferenceRangeComponent
2936          return value;
2937        case -458019372: // hasMember
2938          this.getHasMember().add(castToReference(value)); // Reference
2939          return value;
2940        case 1077922663: // derivedFrom
2941          this.getDerivedFrom().add(castToReference(value)); // Reference
2942          return value;
2943        case -1399907075: // component
2944          this.getComponent().add((ObservationComponentComponent) value); // ObservationComponentComponent
2945          return value;
2946        default: return super.setProperty(hash, name, value);
2947        }
2948
2949      }
2950
2951      @Override
2952      public Base setProperty(String name, Base value) throws FHIRException {
2953        if (name.equals("identifier")) {
2954          this.getIdentifier().add(castToIdentifier(value));
2955        } else if (name.equals("basedOn")) {
2956          this.getBasedOn().add(castToReference(value));
2957        } else if (name.equals("partOf")) {
2958          this.getPartOf().add(castToReference(value));
2959        } else if (name.equals("status")) {
2960          value = new ObservationStatusEnumFactory().fromType(castToCode(value));
2961          this.status = (Enumeration) value; // Enumeration<ObservationStatus>
2962        } else if (name.equals("category")) {
2963          this.getCategory().add(castToCodeableConcept(value));
2964        } else if (name.equals("code")) {
2965          this.code = castToCodeableConcept(value); // CodeableConcept
2966        } else if (name.equals("subject")) {
2967          this.subject = castToReference(value); // Reference
2968        } else if (name.equals("focus")) {
2969          this.focus = castToReference(value); // Reference
2970        } else if (name.equals("context")) {
2971          this.context = castToReference(value); // Reference
2972        } else if (name.equals("effective[x]")) {
2973          this.effective = castToType(value); // Type
2974        } else if (name.equals("issued")) {
2975          this.issued = castToInstant(value); // InstantType
2976        } else if (name.equals("performer")) {
2977          this.getPerformer().add(castToReference(value));
2978        } else if (name.equals("value[x]")) {
2979          this.value = castToType(value); // Type
2980        } else if (name.equals("dataAbsentReason")) {
2981          this.dataAbsentReason = castToCodeableConcept(value); // CodeableConcept
2982        } else if (name.equals("interpretation")) {
2983          this.interpretation = castToCodeableConcept(value); // CodeableConcept
2984        } else if (name.equals("comment")) {
2985          this.comment = castToString(value); // StringType
2986        } else if (name.equals("bodySite")) {
2987          this.bodySite = castToCodeableConcept(value); // CodeableConcept
2988        } else if (name.equals("method")) {
2989          this.method = castToCodeableConcept(value); // CodeableConcept
2990        } else if (name.equals("specimen")) {
2991          this.specimen = castToReference(value); // Reference
2992        } else if (name.equals("device")) {
2993          this.device = castToReference(value); // Reference
2994        } else if (name.equals("referenceRange")) {
2995          this.getReferenceRange().add((ObservationReferenceRangeComponent) value);
2996        } else if (name.equals("hasMember")) {
2997          this.getHasMember().add(castToReference(value));
2998        } else if (name.equals("derivedFrom")) {
2999          this.getDerivedFrom().add(castToReference(value));
3000        } else if (name.equals("component")) {
3001          this.getComponent().add((ObservationComponentComponent) value);
3002        } else
3003          return super.setProperty(name, value);
3004        return value;
3005      }
3006
3007      @Override
3008      public Base makeProperty(int hash, String name) throws FHIRException {
3009        switch (hash) {
3010        case -1618432855:  return addIdentifier(); 
3011        case -332612366:  return addBasedOn(); 
3012        case -995410646:  return addPartOf(); 
3013        case -892481550:  return getStatusElement();
3014        case 50511102:  return addCategory(); 
3015        case 3059181:  return getCode(); 
3016        case -1867885268:  return getSubject(); 
3017        case 97604824:  return getFocus(); 
3018        case 951530927:  return getContext(); 
3019        case 247104889:  return getEffective(); 
3020        case -1468651097:  return getEffective(); 
3021        case -1179159893:  return getIssuedElement();
3022        case 481140686:  return addPerformer(); 
3023        case -1410166417:  return getValue(); 
3024        case 111972721:  return getValue(); 
3025        case 1034315687:  return getDataAbsentReason(); 
3026        case -297950712:  return getInterpretation(); 
3027        case 950398559:  return getCommentElement();
3028        case 1702620169:  return getBodySite(); 
3029        case -1077554975:  return getMethod(); 
3030        case -2132868344:  return getSpecimen(); 
3031        case -1335157162:  return getDevice(); 
3032        case -1912545102:  return addReferenceRange(); 
3033        case -458019372:  return addHasMember(); 
3034        case 1077922663:  return addDerivedFrom(); 
3035        case -1399907075:  return addComponent(); 
3036        default: return super.makeProperty(hash, name);
3037        }
3038
3039      }
3040
3041      @Override
3042      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3043        switch (hash) {
3044        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3045        case -332612366: /*basedOn*/ return new String[] {"Reference"};
3046        case -995410646: /*partOf*/ return new String[] {"Reference"};
3047        case -892481550: /*status*/ return new String[] {"code"};
3048        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
3049        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
3050        case -1867885268: /*subject*/ return new String[] {"Reference"};
3051        case 97604824: /*focus*/ return new String[] {"Reference"};
3052        case 951530927: /*context*/ return new String[] {"Reference"};
3053        case -1468651097: /*effective*/ return new String[] {"dateTime", "Period", "Timing"};
3054        case -1179159893: /*issued*/ return new String[] {"instant"};
3055        case 481140686: /*performer*/ return new String[] {"Reference"};
3056        case 111972721: /*value*/ return new String[] {"Quantity", "CodeableConcept", "string", "boolean", "integer", "Range", "Ratio", "SampledData", "time", "dateTime", "Period"};
3057        case 1034315687: /*dataAbsentReason*/ return new String[] {"CodeableConcept"};
3058        case -297950712: /*interpretation*/ return new String[] {"CodeableConcept"};
3059        case 950398559: /*comment*/ return new String[] {"string"};
3060        case 1702620169: /*bodySite*/ return new String[] {"CodeableConcept"};
3061        case -1077554975: /*method*/ return new String[] {"CodeableConcept"};
3062        case -2132868344: /*specimen*/ return new String[] {"Reference"};
3063        case -1335157162: /*device*/ return new String[] {"Reference"};
3064        case -1912545102: /*referenceRange*/ return new String[] {};
3065        case -458019372: /*hasMember*/ return new String[] {"Reference"};
3066        case 1077922663: /*derivedFrom*/ return new String[] {"Reference"};
3067        case -1399907075: /*component*/ return new String[] {};
3068        default: return super.getTypesForProperty(hash, name);
3069        }
3070
3071      }
3072
3073      @Override
3074      public Base addChild(String name) throws FHIRException {
3075        if (name.equals("identifier")) {
3076          return addIdentifier();
3077        }
3078        else if (name.equals("basedOn")) {
3079          return addBasedOn();
3080        }
3081        else if (name.equals("partOf")) {
3082          return addPartOf();
3083        }
3084        else if (name.equals("status")) {
3085          throw new FHIRException("Cannot call addChild on a primitive type Observation.status");
3086        }
3087        else if (name.equals("category")) {
3088          return addCategory();
3089        }
3090        else if (name.equals("code")) {
3091          this.code = new CodeableConcept();
3092          return this.code;
3093        }
3094        else if (name.equals("subject")) {
3095          this.subject = new Reference();
3096          return this.subject;
3097        }
3098        else if (name.equals("focus")) {
3099          this.focus = new Reference();
3100          return this.focus;
3101        }
3102        else if (name.equals("context")) {
3103          this.context = new Reference();
3104          return this.context;
3105        }
3106        else if (name.equals("effectiveDateTime")) {
3107          this.effective = new DateTimeType();
3108          return this.effective;
3109        }
3110        else if (name.equals("effectivePeriod")) {
3111          this.effective = new Period();
3112          return this.effective;
3113        }
3114        else if (name.equals("effectiveTiming")) {
3115          this.effective = new Timing();
3116          return this.effective;
3117        }
3118        else if (name.equals("issued")) {
3119          throw new FHIRException("Cannot call addChild on a primitive type Observation.issued");
3120        }
3121        else if (name.equals("performer")) {
3122          return addPerformer();
3123        }
3124        else if (name.equals("valueQuantity")) {
3125          this.value = new Quantity();
3126          return this.value;
3127        }
3128        else if (name.equals("valueCodeableConcept")) {
3129          this.value = new CodeableConcept();
3130          return this.value;
3131        }
3132        else if (name.equals("valueString")) {
3133          this.value = new StringType();
3134          return this.value;
3135        }
3136        else if (name.equals("valueBoolean")) {
3137          this.value = new BooleanType();
3138          return this.value;
3139        }
3140        else if (name.equals("valueInteger")) {
3141          this.value = new IntegerType();
3142          return this.value;
3143        }
3144        else if (name.equals("valueRange")) {
3145          this.value = new Range();
3146          return this.value;
3147        }
3148        else if (name.equals("valueRatio")) {
3149          this.value = new Ratio();
3150          return this.value;
3151        }
3152        else if (name.equals("valueSampledData")) {
3153          this.value = new SampledData();
3154          return this.value;
3155        }
3156        else if (name.equals("valueTime")) {
3157          this.value = new TimeType();
3158          return this.value;
3159        }
3160        else if (name.equals("valueDateTime")) {
3161          this.value = new DateTimeType();
3162          return this.value;
3163        }
3164        else if (name.equals("valuePeriod")) {
3165          this.value = new Period();
3166          return this.value;
3167        }
3168        else if (name.equals("dataAbsentReason")) {
3169          this.dataAbsentReason = new CodeableConcept();
3170          return this.dataAbsentReason;
3171        }
3172        else if (name.equals("interpretation")) {
3173          this.interpretation = new CodeableConcept();
3174          return this.interpretation;
3175        }
3176        else if (name.equals("comment")) {
3177          throw new FHIRException("Cannot call addChild on a primitive type Observation.comment");
3178        }
3179        else if (name.equals("bodySite")) {
3180          this.bodySite = new CodeableConcept();
3181          return this.bodySite;
3182        }
3183        else if (name.equals("method")) {
3184          this.method = new CodeableConcept();
3185          return this.method;
3186        }
3187        else if (name.equals("specimen")) {
3188          this.specimen = new Reference();
3189          return this.specimen;
3190        }
3191        else if (name.equals("device")) {
3192          this.device = new Reference();
3193          return this.device;
3194        }
3195        else if (name.equals("referenceRange")) {
3196          return addReferenceRange();
3197        }
3198        else if (name.equals("hasMember")) {
3199          return addHasMember();
3200        }
3201        else if (name.equals("derivedFrom")) {
3202          return addDerivedFrom();
3203        }
3204        else if (name.equals("component")) {
3205          return addComponent();
3206        }
3207        else
3208          return super.addChild(name);
3209      }
3210
3211  public String fhirType() {
3212    return "Observation";
3213
3214  }
3215
3216      public Observation copy() {
3217        Observation dst = new Observation();
3218        copyValues(dst);
3219        if (identifier != null) {
3220          dst.identifier = new ArrayList<Identifier>();
3221          for (Identifier i : identifier)
3222            dst.identifier.add(i.copy());
3223        };
3224        if (basedOn != null) {
3225          dst.basedOn = new ArrayList<Reference>();
3226          for (Reference i : basedOn)
3227            dst.basedOn.add(i.copy());
3228        };
3229        if (partOf != null) {
3230          dst.partOf = new ArrayList<Reference>();
3231          for (Reference i : partOf)
3232            dst.partOf.add(i.copy());
3233        };
3234        dst.status = status == null ? null : status.copy();
3235        if (category != null) {
3236          dst.category = new ArrayList<CodeableConcept>();
3237          for (CodeableConcept i : category)
3238            dst.category.add(i.copy());
3239        };
3240        dst.code = code == null ? null : code.copy();
3241        dst.subject = subject == null ? null : subject.copy();
3242        dst.focus = focus == null ? null : focus.copy();
3243        dst.context = context == null ? null : context.copy();
3244        dst.effective = effective == null ? null : effective.copy();
3245        dst.issued = issued == null ? null : issued.copy();
3246        if (performer != null) {
3247          dst.performer = new ArrayList<Reference>();
3248          for (Reference i : performer)
3249            dst.performer.add(i.copy());
3250        };
3251        dst.value = value == null ? null : value.copy();
3252        dst.dataAbsentReason = dataAbsentReason == null ? null : dataAbsentReason.copy();
3253        dst.interpretation = interpretation == null ? null : interpretation.copy();
3254        dst.comment = comment == null ? null : comment.copy();
3255        dst.bodySite = bodySite == null ? null : bodySite.copy();
3256        dst.method = method == null ? null : method.copy();
3257        dst.specimen = specimen == null ? null : specimen.copy();
3258        dst.device = device == null ? null : device.copy();
3259        if (referenceRange != null) {
3260          dst.referenceRange = new ArrayList<ObservationReferenceRangeComponent>();
3261          for (ObservationReferenceRangeComponent i : referenceRange)
3262            dst.referenceRange.add(i.copy());
3263        };
3264        if (hasMember != null) {
3265          dst.hasMember = new ArrayList<Reference>();
3266          for (Reference i : hasMember)
3267            dst.hasMember.add(i.copy());
3268        };
3269        if (derivedFrom != null) {
3270          dst.derivedFrom = new ArrayList<Reference>();
3271          for (Reference i : derivedFrom)
3272            dst.derivedFrom.add(i.copy());
3273        };
3274        if (component != null) {
3275          dst.component = new ArrayList<ObservationComponentComponent>();
3276          for (ObservationComponentComponent i : component)
3277            dst.component.add(i.copy());
3278        };
3279        return dst;
3280      }
3281
3282      protected Observation typedCopy() {
3283        return copy();
3284      }
3285
3286      @Override
3287      public boolean equalsDeep(Base other_) {
3288        if (!super.equalsDeep(other_))
3289          return false;
3290        if (!(other_ instanceof Observation))
3291          return false;
3292        Observation o = (Observation) other_;
3293        return compareDeep(identifier, o.identifier, true) && compareDeep(basedOn, o.basedOn, true) && compareDeep(partOf, o.partOf, true)
3294           && compareDeep(status, o.status, true) && compareDeep(category, o.category, true) && compareDeep(code, o.code, true)
3295           && compareDeep(subject, o.subject, true) && compareDeep(focus, o.focus, true) && compareDeep(context, o.context, true)
3296           && compareDeep(effective, o.effective, true) && compareDeep(issued, o.issued, true) && compareDeep(performer, o.performer, true)
3297           && compareDeep(value, o.value, true) && compareDeep(dataAbsentReason, o.dataAbsentReason, true)
3298           && compareDeep(interpretation, o.interpretation, true) && compareDeep(comment, o.comment, true)
3299           && compareDeep(bodySite, o.bodySite, true) && compareDeep(method, o.method, true) && compareDeep(specimen, o.specimen, true)
3300           && compareDeep(device, o.device, true) && compareDeep(referenceRange, o.referenceRange, true) && compareDeep(hasMember, o.hasMember, true)
3301           && compareDeep(derivedFrom, o.derivedFrom, true) && compareDeep(component, o.component, true);
3302      }
3303
3304      @Override
3305      public boolean equalsShallow(Base other_) {
3306        if (!super.equalsShallow(other_))
3307          return false;
3308        if (!(other_ instanceof Observation))
3309          return false;
3310        Observation o = (Observation) other_;
3311        return compareValues(status, o.status, true) && compareValues(issued, o.issued, true) && compareValues(comment, o.comment, true)
3312          ;
3313      }
3314
3315      public boolean isEmpty() {
3316        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, basedOn, partOf
3317          , status, category, code, subject, focus, context, effective, issued, performer
3318          , value, dataAbsentReason, interpretation, comment, bodySite, method, specimen
3319          , device, referenceRange, hasMember, derivedFrom, component);
3320      }
3321
3322  @Override
3323  public ResourceType getResourceType() {
3324    return ResourceType.Observation;
3325   }
3326
3327 /**
3328   * Search parameter: <b>date</b>
3329   * <p>
3330   * Description: <b>Obtained date/time. If the obtained element is a period, a date that falls in the period</b><br>
3331   * Type: <b>date</b><br>
3332   * Path: <b>Observation.effective[x]</b><br>
3333   * </p>
3334   */
3335  @SearchParamDefinition(name="date", path="Observation.effective", description="Obtained date/time. If the obtained element is a period, a date that falls in the period", type="date" )
3336  public static final String SP_DATE = "date";
3337 /**
3338   * <b>Fluent Client</b> search parameter constant for <b>date</b>
3339   * <p>
3340   * Description: <b>Obtained date/time. If the obtained element is a period, a date that falls in the period</b><br>
3341   * Type: <b>date</b><br>
3342   * Path: <b>Observation.effective[x]</b><br>
3343   * </p>
3344   */
3345  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
3346
3347 /**
3348   * Search parameter: <b>combo-data-absent-reason</b>
3349   * <p>
3350   * Description: <b>The reason why the expected value in the element Observation.value[x] or Observation.component.value[x] is missing.</b><br>
3351   * Type: <b>token</b><br>
3352   * Path: <b>Observation.dataAbsentReason, Observation.component.dataAbsentReason</b><br>
3353   * </p>
3354   */
3355  @SearchParamDefinition(name="combo-data-absent-reason", path="Observation.dataAbsentReason | Observation.component.dataAbsentReason", description="The reason why the expected value in the element Observation.value[x] or Observation.component.value[x] is missing.", type="token" )
3356  public static final String SP_COMBO_DATA_ABSENT_REASON = "combo-data-absent-reason";
3357 /**
3358   * <b>Fluent Client</b> search parameter constant for <b>combo-data-absent-reason</b>
3359   * <p>
3360   * Description: <b>The reason why the expected value in the element Observation.value[x] or Observation.component.value[x] is missing.</b><br>
3361   * Type: <b>token</b><br>
3362   * Path: <b>Observation.dataAbsentReason, Observation.component.dataAbsentReason</b><br>
3363   * </p>
3364   */
3365  public static final ca.uhn.fhir.rest.gclient.TokenClientParam COMBO_DATA_ABSENT_REASON = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_COMBO_DATA_ABSENT_REASON);
3366
3367 /**
3368   * Search parameter: <b>code</b>
3369   * <p>
3370   * Description: <b>The code of the observation type</b><br>
3371   * Type: <b>token</b><br>
3372   * Path: <b>Observation.code</b><br>
3373   * </p>
3374   */
3375  @SearchParamDefinition(name="code", path="Observation.code", description="The code of the observation type", type="token" )
3376  public static final String SP_CODE = "code";
3377 /**
3378   * <b>Fluent Client</b> search parameter constant for <b>code</b>
3379   * <p>
3380   * Description: <b>The code of the observation type</b><br>
3381   * Type: <b>token</b><br>
3382   * Path: <b>Observation.code</b><br>
3383   * </p>
3384   */
3385  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
3386
3387 /**
3388   * Search parameter: <b>combo-code-value-quantity</b>
3389   * <p>
3390   * Description: <b>Code and quantity value parameter pair, including in components</b><br>
3391   * Type: <b>composite</b><br>
3392   * Path: <b></b><br>
3393   * </p>
3394   */
3395  @SearchParamDefinition(name="combo-code-value-quantity", path="Observation | Observation.component", description="Code and quantity value parameter pair, including in components", type="composite", compositeOf={"combo-code", "combo-value-quantity"} )
3396  public static final String SP_COMBO_CODE_VALUE_QUANTITY = "combo-code-value-quantity";
3397 /**
3398   * <b>Fluent Client</b> search parameter constant for <b>combo-code-value-quantity</b>
3399   * <p>
3400   * Description: <b>Code and quantity value parameter pair, including in components</b><br>
3401   * Type: <b>composite</b><br>
3402   * Path: <b></b><br>
3403   * </p>
3404   */
3405  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam> COMBO_CODE_VALUE_QUANTITY = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam>(SP_COMBO_CODE_VALUE_QUANTITY);
3406
3407 /**
3408   * Search parameter: <b>subject</b>
3409   * <p>
3410   * Description: <b>The subject that the observation is about</b><br>
3411   * Type: <b>reference</b><br>
3412   * Path: <b>Observation.subject</b><br>
3413   * </p>
3414   */
3415  @SearchParamDefinition(name="subject", path="Observation.subject", description="The subject that the observation is about", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Device.class, Group.class, Location.class, Patient.class } )
3416  public static final String SP_SUBJECT = "subject";
3417 /**
3418   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
3419   * <p>
3420   * Description: <b>The subject that the observation is about</b><br>
3421   * Type: <b>reference</b><br>
3422   * Path: <b>Observation.subject</b><br>
3423   * </p>
3424   */
3425  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
3426
3427/**
3428   * Constant for fluent queries to be used to add include statements. Specifies
3429   * the path value of "<b>Observation:subject</b>".
3430   */
3431  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Observation:subject").toLocked();
3432
3433 /**
3434   * Search parameter: <b>component-data-absent-reason</b>
3435   * <p>
3436   * Description: <b>The reason why the expected value in the element Observation.component.value[x] is missing.</b><br>
3437   * Type: <b>token</b><br>
3438   * Path: <b>Observation.component.dataAbsentReason</b><br>
3439   * </p>
3440   */
3441  @SearchParamDefinition(name="component-data-absent-reason", path="Observation.component.dataAbsentReason", description="The reason why the expected value in the element Observation.component.value[x] is missing.", type="token" )
3442  public static final String SP_COMPONENT_DATA_ABSENT_REASON = "component-data-absent-reason";
3443 /**
3444   * <b>Fluent Client</b> search parameter constant for <b>component-data-absent-reason</b>
3445   * <p>
3446   * Description: <b>The reason why the expected value in the element Observation.component.value[x] is missing.</b><br>
3447   * Type: <b>token</b><br>
3448   * Path: <b>Observation.component.dataAbsentReason</b><br>
3449   * </p>
3450   */
3451  public static final ca.uhn.fhir.rest.gclient.TokenClientParam COMPONENT_DATA_ABSENT_REASON = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_COMPONENT_DATA_ABSENT_REASON);
3452
3453 /**
3454   * Search parameter: <b>value-concept</b>
3455   * <p>
3456   * Description: <b>The value of the observation, if the value is a CodeableConcept</b><br>
3457   * Type: <b>token</b><br>
3458   * Path: <b>Observation.valueCodeableConcept</b><br>
3459   * </p>
3460   */
3461  @SearchParamDefinition(name="value-concept", path="Observation.value.as(CodeableConcept)", description="The value of the observation, if the value is a CodeableConcept", type="token" )
3462  public static final String SP_VALUE_CONCEPT = "value-concept";
3463 /**
3464   * <b>Fluent Client</b> search parameter constant for <b>value-concept</b>
3465   * <p>
3466   * Description: <b>The value of the observation, if the value is a CodeableConcept</b><br>
3467   * Type: <b>token</b><br>
3468   * Path: <b>Observation.valueCodeableConcept</b><br>
3469   * </p>
3470   */
3471  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VALUE_CONCEPT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VALUE_CONCEPT);
3472
3473 /**
3474   * Search parameter: <b>value-date</b>
3475   * <p>
3476   * Description: <b>The value of the observation, if the value is a date or period of time</b><br>
3477   * Type: <b>date</b><br>
3478   * Path: <b>Observation.valueDateTime, Observation.valuePeriod</b><br>
3479   * </p>
3480   */
3481  @SearchParamDefinition(name="value-date", path="Observation.value.as(dateTime) | Observation.value.as(Period)", description="The value of the observation, if the value is a date or period of time", type="date" )
3482  public static final String SP_VALUE_DATE = "value-date";
3483 /**
3484   * <b>Fluent Client</b> search parameter constant for <b>value-date</b>
3485   * <p>
3486   * Description: <b>The value of the observation, if the value is a date or period of time</b><br>
3487   * Type: <b>date</b><br>
3488   * Path: <b>Observation.valueDateTime, Observation.valuePeriod</b><br>
3489   * </p>
3490   */
3491  public static final ca.uhn.fhir.rest.gclient.DateClientParam VALUE_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_VALUE_DATE);
3492
3493 /**
3494   * Search parameter: <b>focus</b>
3495   * <p>
3496   * Description: <b>The focus of an observation when the focus is not the patient of record.</b><br>
3497   * Type: <b>reference</b><br>
3498   * Path: <b>Observation.focus</b><br>
3499   * </p>
3500   */
3501  @SearchParamDefinition(name="focus", path="Observation.focus", description="The focus of an observation when the focus is not the patient of record.", type="reference" )
3502  public static final String SP_FOCUS = "focus";
3503 /**
3504   * <b>Fluent Client</b> search parameter constant for <b>focus</b>
3505   * <p>
3506   * Description: <b>The focus of an observation when the focus is not the patient of record.</b><br>
3507   * Type: <b>reference</b><br>
3508   * Path: <b>Observation.focus</b><br>
3509   * </p>
3510   */
3511  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FOCUS = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FOCUS);
3512
3513/**
3514   * Constant for fluent queries to be used to add include statements. Specifies
3515   * the path value of "<b>Observation:focus</b>".
3516   */
3517  public static final ca.uhn.fhir.model.api.Include INCLUDE_FOCUS = new ca.uhn.fhir.model.api.Include("Observation:focus").toLocked();
3518
3519 /**
3520   * Search parameter: <b>derived-from</b>
3521   * <p>
3522   * Description: <b>Related measurements the observation is made from</b><br>
3523   * Type: <b>reference</b><br>
3524   * Path: <b>Observation.derivedFrom</b><br>
3525   * </p>
3526   */
3527  @SearchParamDefinition(name="derived-from", path="Observation.derivedFrom", description="Related measurements the observation is made from", type="reference", target={DocumentReference.class, ImagingStudy.class, Media.class, Observation.class, QuestionnaireResponse.class, Sequence.class } )
3528  public static final String SP_DERIVED_FROM = "derived-from";
3529 /**
3530   * <b>Fluent Client</b> search parameter constant for <b>derived-from</b>
3531   * <p>
3532   * Description: <b>Related measurements the observation is made from</b><br>
3533   * Type: <b>reference</b><br>
3534   * Path: <b>Observation.derivedFrom</b><br>
3535   * </p>
3536   */
3537  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DERIVED_FROM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DERIVED_FROM);
3538
3539/**
3540   * Constant for fluent queries to be used to add include statements. Specifies
3541   * the path value of "<b>Observation:derived-from</b>".
3542   */
3543  public static final ca.uhn.fhir.model.api.Include INCLUDE_DERIVED_FROM = new ca.uhn.fhir.model.api.Include("Observation:derived-from").toLocked();
3544
3545 /**
3546   * Search parameter: <b>part-of</b>
3547   * <p>
3548   * Description: <b>Part of referenced event</b><br>
3549   * Type: <b>reference</b><br>
3550   * Path: <b>Observation.partOf</b><br>
3551   * </p>
3552   */
3553  @SearchParamDefinition(name="part-of", path="Observation.partOf", description="Part of referenced event", type="reference", target={ImagingStudy.class, Immunization.class, MedicationAdministration.class, MedicationDispense.class, MedicationStatement.class, Procedure.class } )
3554  public static final String SP_PART_OF = "part-of";
3555 /**
3556   * <b>Fluent Client</b> search parameter constant for <b>part-of</b>
3557   * <p>
3558   * Description: <b>Part of referenced event</b><br>
3559   * Type: <b>reference</b><br>
3560   * Path: <b>Observation.partOf</b><br>
3561   * </p>
3562   */
3563  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PART_OF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PART_OF);
3564
3565/**
3566   * Constant for fluent queries to be used to add include statements. Specifies
3567   * the path value of "<b>Observation:part-of</b>".
3568   */
3569  public static final ca.uhn.fhir.model.api.Include INCLUDE_PART_OF = new ca.uhn.fhir.model.api.Include("Observation:part-of").toLocked();
3570
3571 /**
3572   * Search parameter: <b>has-member</b>
3573   * <p>
3574   * Description: <b>Related resource that belongs to the Observation group</b><br>
3575   * Type: <b>reference</b><br>
3576   * Path: <b>Observation.hasMember</b><br>
3577   * </p>
3578   */
3579  @SearchParamDefinition(name="has-member", path="Observation.hasMember", description="Related resource that belongs to the Observation group", type="reference", target={Observation.class, QuestionnaireResponse.class, Sequence.class } )
3580  public static final String SP_HAS_MEMBER = "has-member";
3581 /**
3582   * <b>Fluent Client</b> search parameter constant for <b>has-member</b>
3583   * <p>
3584   * Description: <b>Related resource that belongs to the Observation group</b><br>
3585   * Type: <b>reference</b><br>
3586   * Path: <b>Observation.hasMember</b><br>
3587   * </p>
3588   */
3589  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam HAS_MEMBER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_HAS_MEMBER);
3590
3591/**
3592   * Constant for fluent queries to be used to add include statements. Specifies
3593   * the path value of "<b>Observation:has-member</b>".
3594   */
3595  public static final ca.uhn.fhir.model.api.Include INCLUDE_HAS_MEMBER = new ca.uhn.fhir.model.api.Include("Observation:has-member").toLocked();
3596
3597 /**
3598   * Search parameter: <b>code-value-string</b>
3599   * <p>
3600   * Description: <b>Code and string value parameter pair</b><br>
3601   * Type: <b>composite</b><br>
3602   * Path: <b></b><br>
3603   * </p>
3604   */
3605  @SearchParamDefinition(name="code-value-string", path="Observation", description="Code and string value parameter pair", type="composite", compositeOf={"code", "value-string"} )
3606  public static final String SP_CODE_VALUE_STRING = "code-value-string";
3607 /**
3608   * <b>Fluent Client</b> search parameter constant for <b>code-value-string</b>
3609   * <p>
3610   * Description: <b>Code and string value parameter pair</b><br>
3611   * Type: <b>composite</b><br>
3612   * Path: <b></b><br>
3613   * </p>
3614   */
3615  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.StringClientParam> CODE_VALUE_STRING = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.StringClientParam>(SP_CODE_VALUE_STRING);
3616
3617 /**
3618   * Search parameter: <b>component-code-value-quantity</b>
3619   * <p>
3620   * Description: <b>Component code and component quantity value parameter pair</b><br>
3621   * Type: <b>composite</b><br>
3622   * Path: <b></b><br>
3623   * </p>
3624   */
3625  @SearchParamDefinition(name="component-code-value-quantity", path="Observation.component", description="Component code and component quantity value parameter pair", type="composite", compositeOf={"component-code", "component-value-quantity"} )
3626  public static final String SP_COMPONENT_CODE_VALUE_QUANTITY = "component-code-value-quantity";
3627 /**
3628   * <b>Fluent Client</b> search parameter constant for <b>component-code-value-quantity</b>
3629   * <p>
3630   * Description: <b>Component code and component quantity value parameter pair</b><br>
3631   * Type: <b>composite</b><br>
3632   * Path: <b></b><br>
3633   * </p>
3634   */
3635  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam> COMPONENT_CODE_VALUE_QUANTITY = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam>(SP_COMPONENT_CODE_VALUE_QUANTITY);
3636
3637 /**
3638   * Search parameter: <b>based-on</b>
3639   * <p>
3640   * Description: <b>Reference to the service request.</b><br>
3641   * Type: <b>reference</b><br>
3642   * Path: <b>Observation.basedOn</b><br>
3643   * </p>
3644   */
3645  @SearchParamDefinition(name="based-on", path="Observation.basedOn", description="Reference to the service request.", type="reference", target={CarePlan.class, DeviceRequest.class, ImmunizationRecommendation.class, MedicationRequest.class, NutritionOrder.class, ServiceRequest.class } )
3646  public static final String SP_BASED_ON = "based-on";
3647 /**
3648   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
3649   * <p>
3650   * Description: <b>Reference to the service request.</b><br>
3651   * Type: <b>reference</b><br>
3652   * Path: <b>Observation.basedOn</b><br>
3653   * </p>
3654   */
3655  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON);
3656
3657/**
3658   * Constant for fluent queries to be used to add include statements. Specifies
3659   * the path value of "<b>Observation:based-on</b>".
3660   */
3661  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("Observation:based-on").toLocked();
3662
3663 /**
3664   * Search parameter: <b>code-value-date</b>
3665   * <p>
3666   * Description: <b>Code and date/time value parameter pair</b><br>
3667   * Type: <b>composite</b><br>
3668   * Path: <b></b><br>
3669   * </p>
3670   */
3671  @SearchParamDefinition(name="code-value-date", path="Observation", description="Code and date/time value parameter pair", type="composite", compositeOf={"code", "value-date"} )
3672  public static final String SP_CODE_VALUE_DATE = "code-value-date";
3673 /**
3674   * <b>Fluent Client</b> search parameter constant for <b>code-value-date</b>
3675   * <p>
3676   * Description: <b>Code and date/time value parameter pair</b><br>
3677   * Type: <b>composite</b><br>
3678   * Path: <b></b><br>
3679   * </p>
3680   */
3681  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.DateClientParam> CODE_VALUE_DATE = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.DateClientParam>(SP_CODE_VALUE_DATE);
3682
3683 /**
3684   * Search parameter: <b>patient</b>
3685   * <p>
3686   * Description: <b>The subject that the observation is about (if patient)</b><br>
3687   * Type: <b>reference</b><br>
3688   * Path: <b>Observation.subject</b><br>
3689   * </p>
3690   */
3691  @SearchParamDefinition(name="patient", path="Observation.subject", description="The subject that the observation is about (if patient)", type="reference", target={Patient.class } )
3692  public static final String SP_PATIENT = "patient";
3693 /**
3694   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3695   * <p>
3696   * Description: <b>The subject that the observation is about (if patient)</b><br>
3697   * Type: <b>reference</b><br>
3698   * Path: <b>Observation.subject</b><br>
3699   * </p>
3700   */
3701  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3702
3703/**
3704   * Constant for fluent queries to be used to add include statements. Specifies
3705   * the path value of "<b>Observation:patient</b>".
3706   */
3707  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Observation:patient").toLocked();
3708
3709 /**
3710   * Search parameter: <b>specimen</b>
3711   * <p>
3712   * Description: <b>Specimen used for this observation</b><br>
3713   * Type: <b>reference</b><br>
3714   * Path: <b>Observation.specimen</b><br>
3715   * </p>
3716   */
3717  @SearchParamDefinition(name="specimen", path="Observation.specimen", description="Specimen used for this observation", type="reference", target={Specimen.class } )
3718  public static final String SP_SPECIMEN = "specimen";
3719 /**
3720   * <b>Fluent Client</b> search parameter constant for <b>specimen</b>
3721   * <p>
3722   * Description: <b>Specimen used for this observation</b><br>
3723   * Type: <b>reference</b><br>
3724   * Path: <b>Observation.specimen</b><br>
3725   * </p>
3726   */
3727  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SPECIMEN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SPECIMEN);
3728
3729/**
3730   * Constant for fluent queries to be used to add include statements. Specifies
3731   * the path value of "<b>Observation:specimen</b>".
3732   */
3733  public static final ca.uhn.fhir.model.api.Include INCLUDE_SPECIMEN = new ca.uhn.fhir.model.api.Include("Observation:specimen").toLocked();
3734
3735 /**
3736   * Search parameter: <b>component-code</b>
3737   * <p>
3738   * Description: <b>The component code of the observation type</b><br>
3739   * Type: <b>token</b><br>
3740   * Path: <b>Observation.component.code</b><br>
3741   * </p>
3742   */
3743  @SearchParamDefinition(name="component-code", path="Observation.component.code", description="The component code of the observation type", type="token" )
3744  public static final String SP_COMPONENT_CODE = "component-code";
3745 /**
3746   * <b>Fluent Client</b> search parameter constant for <b>component-code</b>
3747   * <p>
3748   * Description: <b>The component code of the observation type</b><br>
3749   * Type: <b>token</b><br>
3750   * Path: <b>Observation.component.code</b><br>
3751   * </p>
3752   */
3753  public static final ca.uhn.fhir.rest.gclient.TokenClientParam COMPONENT_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_COMPONENT_CODE);
3754
3755 /**
3756   * Search parameter: <b>code-value-quantity</b>
3757   * <p>
3758   * Description: <b>Code and quantity value parameter pair</b><br>
3759   * Type: <b>composite</b><br>
3760   * Path: <b></b><br>
3761   * </p>
3762   */
3763  @SearchParamDefinition(name="code-value-quantity", path="Observation", description="Code and quantity value parameter pair", type="composite", compositeOf={"code", "value-quantity"} )
3764  public static final String SP_CODE_VALUE_QUANTITY = "code-value-quantity";
3765 /**
3766   * <b>Fluent Client</b> search parameter constant for <b>code-value-quantity</b>
3767   * <p>
3768   * Description: <b>Code and quantity value parameter pair</b><br>
3769   * Type: <b>composite</b><br>
3770   * Path: <b></b><br>
3771   * </p>
3772   */
3773  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam> CODE_VALUE_QUANTITY = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam>(SP_CODE_VALUE_QUANTITY);
3774
3775 /**
3776   * Search parameter: <b>context</b>
3777   * <p>
3778   * Description: <b>Healthcare event  (Episode-of-care or Encounter) related to the observation</b><br>
3779   * Type: <b>reference</b><br>
3780   * Path: <b>Observation.context</b><br>
3781   * </p>
3782   */
3783  @SearchParamDefinition(name="context", path="Observation.context", description="Healthcare event  (Episode-of-care or Encounter) related to the observation", type="reference", target={Encounter.class, EpisodeOfCare.class } )
3784  public static final String SP_CONTEXT = "context";
3785 /**
3786   * <b>Fluent Client</b> search parameter constant for <b>context</b>
3787   * <p>
3788   * Description: <b>Healthcare event  (Episode-of-care or Encounter) related to the observation</b><br>
3789   * Type: <b>reference</b><br>
3790   * Path: <b>Observation.context</b><br>
3791   * </p>
3792   */
3793  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONTEXT);
3794
3795/**
3796   * Constant for fluent queries to be used to add include statements. Specifies
3797   * the path value of "<b>Observation:context</b>".
3798   */
3799  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONTEXT = new ca.uhn.fhir.model.api.Include("Observation:context").toLocked();
3800
3801 /**
3802   * Search parameter: <b>combo-code-value-concept</b>
3803   * <p>
3804   * Description: <b>Code and coded value parameter pair, including in components</b><br>
3805   * Type: <b>composite</b><br>
3806   * Path: <b></b><br>
3807   * </p>
3808   */
3809  @SearchParamDefinition(name="combo-code-value-concept", path="Observation | Observation.component", description="Code and coded value parameter pair, including in components", type="composite", compositeOf={"combo-code", "combo-value-concept"} )
3810  public static final String SP_COMBO_CODE_VALUE_CONCEPT = "combo-code-value-concept";
3811 /**
3812   * <b>Fluent Client</b> search parameter constant for <b>combo-code-value-concept</b>
3813   * <p>
3814   * Description: <b>Code and coded value parameter pair, including in components</b><br>
3815   * Type: <b>composite</b><br>
3816   * Path: <b></b><br>
3817   * </p>
3818   */
3819  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam> COMBO_CODE_VALUE_CONCEPT = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam>(SP_COMBO_CODE_VALUE_CONCEPT);
3820
3821 /**
3822   * Search parameter: <b>value-string</b>
3823   * <p>
3824   * Description: <b>The value of the observation, if the value is a string, and also searches in CodeableConcept.text</b><br>
3825   * Type: <b>string</b><br>
3826   * Path: <b>Observation.valueString</b><br>
3827   * </p>
3828   */
3829  @SearchParamDefinition(name="value-string", path="Observation.value.as(string)", description="The value of the observation, if the value is a string, and also searches in CodeableConcept.text", type="string" )
3830  public static final String SP_VALUE_STRING = "value-string";
3831 /**
3832   * <b>Fluent Client</b> search parameter constant for <b>value-string</b>
3833   * <p>
3834   * Description: <b>The value of the observation, if the value is a string, and also searches in CodeableConcept.text</b><br>
3835   * Type: <b>string</b><br>
3836   * Path: <b>Observation.valueString</b><br>
3837   * </p>
3838   */
3839  public static final ca.uhn.fhir.rest.gclient.StringClientParam VALUE_STRING = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VALUE_STRING);
3840
3841 /**
3842   * Search parameter: <b>identifier</b>
3843   * <p>
3844   * Description: <b>The unique id for a particular observation</b><br>
3845   * Type: <b>token</b><br>
3846   * Path: <b>Observation.identifier</b><br>
3847   * </p>
3848   */
3849  @SearchParamDefinition(name="identifier", path="Observation.identifier", description="The unique id for a particular observation", type="token" )
3850  public static final String SP_IDENTIFIER = "identifier";
3851 /**
3852   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3853   * <p>
3854   * Description: <b>The unique id for a particular observation</b><br>
3855   * Type: <b>token</b><br>
3856   * Path: <b>Observation.identifier</b><br>
3857   * </p>
3858   */
3859  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3860
3861 /**
3862   * Search parameter: <b>performer</b>
3863   * <p>
3864   * Description: <b>Who performed the observation</b><br>
3865   * Type: <b>reference</b><br>
3866   * Path: <b>Observation.performer</b><br>
3867   * </p>
3868   */
3869  @SearchParamDefinition(name="performer", path="Observation.performer", description="Who performed the observation", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={CareTeam.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
3870  public static final String SP_PERFORMER = "performer";
3871 /**
3872   * <b>Fluent Client</b> search parameter constant for <b>performer</b>
3873   * <p>
3874   * Description: <b>Who performed the observation</b><br>
3875   * Type: <b>reference</b><br>
3876   * Path: <b>Observation.performer</b><br>
3877   * </p>
3878   */
3879  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER);
3880
3881/**
3882   * Constant for fluent queries to be used to add include statements. Specifies
3883   * the path value of "<b>Observation:performer</b>".
3884   */
3885  public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("Observation:performer").toLocked();
3886
3887 /**
3888   * Search parameter: <b>combo-code</b>
3889   * <p>
3890   * Description: <b>The code of the observation type or component type</b><br>
3891   * Type: <b>token</b><br>
3892   * Path: <b>Observation.code, Observation.component.code</b><br>
3893   * </p>
3894   */
3895  @SearchParamDefinition(name="combo-code", path="Observation.code | Observation.component.code", description="The code of the observation type or component type", type="token" )
3896  public static final String SP_COMBO_CODE = "combo-code";
3897 /**
3898   * <b>Fluent Client</b> search parameter constant for <b>combo-code</b>
3899   * <p>
3900   * Description: <b>The code of the observation type or component type</b><br>
3901   * Type: <b>token</b><br>
3902   * Path: <b>Observation.code, Observation.component.code</b><br>
3903   * </p>
3904   */
3905  public static final ca.uhn.fhir.rest.gclient.TokenClientParam COMBO_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_COMBO_CODE);
3906
3907 /**
3908   * Search parameter: <b>method</b>
3909   * <p>
3910   * Description: <b>The method used for the observation</b><br>
3911   * Type: <b>token</b><br>
3912   * Path: <b>Observation.method</b><br>
3913   * </p>
3914   */
3915  @SearchParamDefinition(name="method", path="Observation.method", description="The method used for the observation", type="token" )
3916  public static final String SP_METHOD = "method";
3917 /**
3918   * <b>Fluent Client</b> search parameter constant for <b>method</b>
3919   * <p>
3920   * Description: <b>The method used for the observation</b><br>
3921   * Type: <b>token</b><br>
3922   * Path: <b>Observation.method</b><br>
3923   * </p>
3924   */
3925  public static final ca.uhn.fhir.rest.gclient.TokenClientParam METHOD = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_METHOD);
3926
3927 /**
3928   * Search parameter: <b>value-quantity</b>
3929   * <p>
3930   * Description: <b>The value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)</b><br>
3931   * Type: <b>quantity</b><br>
3932   * Path: <b>Observation.valueQuantity</b><br>
3933   * </p>
3934   */
3935  @SearchParamDefinition(name="value-quantity", path="Observation.value.as(Quantity)", description="The value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)", type="quantity" )
3936  public static final String SP_VALUE_QUANTITY = "value-quantity";
3937 /**
3938   * <b>Fluent Client</b> search parameter constant for <b>value-quantity</b>
3939   * <p>
3940   * Description: <b>The value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)</b><br>
3941   * Type: <b>quantity</b><br>
3942   * Path: <b>Observation.valueQuantity</b><br>
3943   * </p>
3944   */
3945  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam VALUE_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_VALUE_QUANTITY);
3946
3947 /**
3948   * Search parameter: <b>component-value-quantity</b>
3949   * <p>
3950   * Description: <b>The value of the component observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)</b><br>
3951   * Type: <b>quantity</b><br>
3952   * Path: <b>Observation.component.valueQuantity</b><br>
3953   * </p>
3954   */
3955  @SearchParamDefinition(name="component-value-quantity", path="Observation.component.value.as(Quantity)", description="The value of the component observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)", type="quantity" )
3956  public static final String SP_COMPONENT_VALUE_QUANTITY = "component-value-quantity";
3957 /**
3958   * <b>Fluent Client</b> search parameter constant for <b>component-value-quantity</b>
3959   * <p>
3960   * Description: <b>The value of the component observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)</b><br>
3961   * Type: <b>quantity</b><br>
3962   * Path: <b>Observation.component.valueQuantity</b><br>
3963   * </p>
3964   */
3965  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam COMPONENT_VALUE_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_COMPONENT_VALUE_QUANTITY);
3966
3967 /**
3968   * Search parameter: <b>data-absent-reason</b>
3969   * <p>
3970   * Description: <b>The reason why the expected value in the element Observation.value[x] is missing.</b><br>
3971   * Type: <b>token</b><br>
3972   * Path: <b>Observation.dataAbsentReason</b><br>
3973   * </p>
3974   */
3975  @SearchParamDefinition(name="data-absent-reason", path="Observation.dataAbsentReason", description="The reason why the expected value in the element Observation.value[x] is missing.", type="token" )
3976  public static final String SP_DATA_ABSENT_REASON = "data-absent-reason";
3977 /**
3978   * <b>Fluent Client</b> search parameter constant for <b>data-absent-reason</b>
3979   * <p>
3980   * Description: <b>The reason why the expected value in the element Observation.value[x] is missing.</b><br>
3981   * Type: <b>token</b><br>
3982   * Path: <b>Observation.dataAbsentReason</b><br>
3983   * </p>
3984   */
3985  public static final ca.uhn.fhir.rest.gclient.TokenClientParam DATA_ABSENT_REASON = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DATA_ABSENT_REASON);
3986
3987 /**
3988   * Search parameter: <b>combo-value-quantity</b>
3989   * <p>
3990   * Description: <b>The value or component value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)</b><br>
3991   * Type: <b>quantity</b><br>
3992   * Path: <b>Observation.valueQuantity, Observation.component.valueQuantity</b><br>
3993   * </p>
3994   */
3995  @SearchParamDefinition(name="combo-value-quantity", path="Observation.value.as(Quantity) | Observation.component.value.as(Quantity)", description="The value or component value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)", type="quantity" )
3996  public static final String SP_COMBO_VALUE_QUANTITY = "combo-value-quantity";
3997 /**
3998   * <b>Fluent Client</b> search parameter constant for <b>combo-value-quantity</b>
3999   * <p>
4000   * Description: <b>The value or component value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)</b><br>
4001   * Type: <b>quantity</b><br>
4002   * Path: <b>Observation.valueQuantity, Observation.component.valueQuantity</b><br>
4003   * </p>
4004   */
4005  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam COMBO_VALUE_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_COMBO_VALUE_QUANTITY);
4006
4007 /**
4008   * Search parameter: <b>encounter</b>
4009   * <p>
4010   * Description: <b>Encounter related to the observation</b><br>
4011   * Type: <b>reference</b><br>
4012   * Path: <b>Observation.context</b><br>
4013   * </p>
4014   */
4015  @SearchParamDefinition(name="encounter", path="Observation.context", description="Encounter related to the observation", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Encounter") }, target={Encounter.class } )
4016  public static final String SP_ENCOUNTER = "encounter";
4017 /**
4018   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
4019   * <p>
4020   * Description: <b>Encounter related to the observation</b><br>
4021   * Type: <b>reference</b><br>
4022   * Path: <b>Observation.context</b><br>
4023   * </p>
4024   */
4025  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
4026
4027/**
4028   * Constant for fluent queries to be used to add include statements. Specifies
4029   * the path value of "<b>Observation:encounter</b>".
4030   */
4031  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("Observation:encounter").toLocked();
4032
4033 /**
4034   * Search parameter: <b>code-value-concept</b>
4035   * <p>
4036   * Description: <b>Code and coded value parameter pair</b><br>
4037   * Type: <b>composite</b><br>
4038   * Path: <b></b><br>
4039   * </p>
4040   */
4041  @SearchParamDefinition(name="code-value-concept", path="Observation", description="Code and coded value parameter pair", type="composite", compositeOf={"code", "value-concept"} )
4042  public static final String SP_CODE_VALUE_CONCEPT = "code-value-concept";
4043 /**
4044   * <b>Fluent Client</b> search parameter constant for <b>code-value-concept</b>
4045   * <p>
4046   * Description: <b>Code and coded value parameter pair</b><br>
4047   * Type: <b>composite</b><br>
4048   * Path: <b></b><br>
4049   * </p>
4050   */
4051  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam> CODE_VALUE_CONCEPT = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam>(SP_CODE_VALUE_CONCEPT);
4052
4053 /**
4054   * Search parameter: <b>component-code-value-concept</b>
4055   * <p>
4056   * Description: <b>Component code and component coded value parameter pair</b><br>
4057   * Type: <b>composite</b><br>
4058   * Path: <b></b><br>
4059   * </p>
4060   */
4061  @SearchParamDefinition(name="component-code-value-concept", path="Observation.component", description="Component code and component coded value parameter pair", type="composite", compositeOf={"component-code", "component-value-concept"} )
4062  public static final String SP_COMPONENT_CODE_VALUE_CONCEPT = "component-code-value-concept";
4063 /**
4064   * <b>Fluent Client</b> search parameter constant for <b>component-code-value-concept</b>
4065   * <p>
4066   * Description: <b>Component code and component coded value parameter pair</b><br>
4067   * Type: <b>composite</b><br>
4068   * Path: <b></b><br>
4069   * </p>
4070   */
4071  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam> COMPONENT_CODE_VALUE_CONCEPT = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam>(SP_COMPONENT_CODE_VALUE_CONCEPT);
4072
4073 /**
4074   * Search parameter: <b>component-value-concept</b>
4075   * <p>
4076   * Description: <b>The value of the component observation, if the value is a CodeableConcept</b><br>
4077   * Type: <b>token</b><br>
4078   * Path: <b>Observation.component.valueCodeableConcept</b><br>
4079   * </p>
4080   */
4081  @SearchParamDefinition(name="component-value-concept", path="Observation.component.value.as(CodeableConcept)", description="The value of the component observation, if the value is a CodeableConcept", type="token" )
4082  public static final String SP_COMPONENT_VALUE_CONCEPT = "component-value-concept";
4083 /**
4084   * <b>Fluent Client</b> search parameter constant for <b>component-value-concept</b>
4085   * <p>
4086   * Description: <b>The value of the component observation, if the value is a CodeableConcept</b><br>
4087   * Type: <b>token</b><br>
4088   * Path: <b>Observation.component.valueCodeableConcept</b><br>
4089   * </p>
4090   */
4091  public static final ca.uhn.fhir.rest.gclient.TokenClientParam COMPONENT_VALUE_CONCEPT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_COMPONENT_VALUE_CONCEPT);
4092
4093 /**
4094   * Search parameter: <b>category</b>
4095   * <p>
4096   * Description: <b>The classification of the type of observation</b><br>
4097   * Type: <b>token</b><br>
4098   * Path: <b>Observation.category</b><br>
4099   * </p>
4100   */
4101  @SearchParamDefinition(name="category", path="Observation.category", description="The classification of the type of observation", type="token" )
4102  public static final String SP_CATEGORY = "category";
4103 /**
4104   * <b>Fluent Client</b> search parameter constant for <b>category</b>
4105   * <p>
4106   * Description: <b>The classification of the type of observation</b><br>
4107   * Type: <b>token</b><br>
4108   * Path: <b>Observation.category</b><br>
4109   * </p>
4110   */
4111  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
4112
4113 /**
4114   * Search parameter: <b>device</b>
4115   * <p>
4116   * Description: <b>The Device that generated the observation data.</b><br>
4117   * Type: <b>reference</b><br>
4118   * Path: <b>Observation.device</b><br>
4119   * </p>
4120   */
4121  @SearchParamDefinition(name="device", path="Observation.device", description="The Device that generated the observation data.", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device") }, target={Device.class, DeviceComponent.class, DeviceMetric.class } )
4122  public static final String SP_DEVICE = "device";
4123 /**
4124   * <b>Fluent Client</b> search parameter constant for <b>device</b>
4125   * <p>
4126   * Description: <b>The Device that generated the observation data.</b><br>
4127   * Type: <b>reference</b><br>
4128   * Path: <b>Observation.device</b><br>
4129   * </p>
4130   */
4131  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEVICE);
4132
4133/**
4134   * Constant for fluent queries to be used to add include statements. Specifies
4135   * the path value of "<b>Observation:device</b>".
4136   */
4137  public static final ca.uhn.fhir.model.api.Include INCLUDE_DEVICE = new ca.uhn.fhir.model.api.Include("Observation:device").toLocked();
4138
4139 /**
4140   * Search parameter: <b>combo-value-concept</b>
4141   * <p>
4142   * Description: <b>The value or component value of the observation, if the value is a CodeableConcept</b><br>
4143   * Type: <b>token</b><br>
4144   * Path: <b>Observation.valueCodeableConcept, Observation.component.valueCodeableConcept</b><br>
4145   * </p>
4146   */
4147  @SearchParamDefinition(name="combo-value-concept", path="Observation.value.as(CodeableConcept) | Observation.component.value.as(CodeableConcept)", description="The value or component value of the observation, if the value is a CodeableConcept", type="token" )
4148  public static final String SP_COMBO_VALUE_CONCEPT = "combo-value-concept";
4149 /**
4150   * <b>Fluent Client</b> search parameter constant for <b>combo-value-concept</b>
4151   * <p>
4152   * Description: <b>The value or component value of the observation, if the value is a CodeableConcept</b><br>
4153   * Type: <b>token</b><br>
4154   * Path: <b>Observation.valueCodeableConcept, Observation.component.valueCodeableConcept</b><br>
4155   * </p>
4156   */
4157  public static final ca.uhn.fhir.rest.gclient.TokenClientParam COMBO_VALUE_CONCEPT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_COMBO_VALUE_CONCEPT);
4158
4159 /**
4160   * Search parameter: <b>status</b>
4161   * <p>
4162   * Description: <b>The status of the observation</b><br>
4163   * Type: <b>token</b><br>
4164   * Path: <b>Observation.status</b><br>
4165   * </p>
4166   */
4167  @SearchParamDefinition(name="status", path="Observation.status", description="The status of the observation", type="token" )
4168  public static final String SP_STATUS = "status";
4169 /**
4170   * <b>Fluent Client</b> search parameter constant for <b>status</b>
4171   * <p>
4172   * Description: <b>The status of the observation</b><br>
4173   * Type: <b>token</b><br>
4174   * Path: <b>Observation.status</b><br>
4175   * </p>
4176   */
4177  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
4178
4179
4180}
4181