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