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