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