001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Fri, Jul 15, 2022 11:20+1000 for FHIR v5.0.0-snapshot2
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import java.math.*;
038import org.hl7.fhir.utilities.Utilities;
039import org.hl7.fhir.r5.model.Enumerations.*;
040import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
041import org.hl7.fhir.exceptions.FHIRException;
042import org.hl7.fhir.instance.model.api.ICompositeType;
043import ca.uhn.fhir.model.api.annotation.ResourceDef;
044import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
045import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
046import ca.uhn.fhir.model.api.annotation.Child;
047import ca.uhn.fhir.model.api.annotation.ChildOrder;
048import ca.uhn.fhir.model.api.annotation.Description;
049import ca.uhn.fhir.model.api.annotation.Block;
050
051/**
052 * Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service.
053 */
054@ResourceDef(name="ObservationDefinition", profile="http://hl7.org/fhir/StructureDefinition/ObservationDefinition")
055public class ObservationDefinition extends DomainResource {
056
057    public enum ObservationDataType {
058        /**
059         * A measured amount.
060         */
061        QUANTITY, 
062        /**
063         * A coded concept from a reference terminology and/or text.
064         */
065        CODEABLECONCEPT, 
066        /**
067         * A sequence of Unicode characters.
068         */
069        STRING, 
070        /**
071         * true or false.
072         */
073        BOOLEAN, 
074        /**
075         * A signed integer.
076         */
077        INTEGER, 
078        /**
079         * A set of values bounded by low and high.
080         */
081        RANGE, 
082        /**
083         * A ratio of two Quantity values - a numerator and a denominator.
084         */
085        RATIO, 
086        /**
087         * A series of measurements taken by a device.
088         */
089        SAMPLEDDATA, 
090        /**
091         * A time during the day, in the format hh:mm:ss.
092         */
093        TIME, 
094        /**
095         * A date, date-time or partial date (e.g. just year or year + month) as used in human communication.
096         */
097        DATETIME, 
098        /**
099         * A time range defined by start and end date/time.
100         */
101        PERIOD, 
102        /**
103         * added to help the parsers with the generic types
104         */
105        NULL;
106        public static ObservationDataType fromCode(String codeString) throws FHIRException {
107            if (codeString == null || "".equals(codeString))
108                return null;
109        if ("Quantity".equals(codeString))
110          return QUANTITY;
111        if ("CodeableConcept".equals(codeString))
112          return CODEABLECONCEPT;
113        if ("string".equals(codeString))
114          return STRING;
115        if ("boolean".equals(codeString))
116          return BOOLEAN;
117        if ("integer".equals(codeString))
118          return INTEGER;
119        if ("Range".equals(codeString))
120          return RANGE;
121        if ("Ratio".equals(codeString))
122          return RATIO;
123        if ("SampledData".equals(codeString))
124          return SAMPLEDDATA;
125        if ("time".equals(codeString))
126          return TIME;
127        if ("dateTime".equals(codeString))
128          return DATETIME;
129        if ("Period".equals(codeString))
130          return PERIOD;
131        if (Configuration.isAcceptInvalidEnums())
132          return null;
133        else
134          throw new FHIRException("Unknown ObservationDataType code '"+codeString+"'");
135        }
136        public String toCode() {
137          switch (this) {
138            case QUANTITY: return "Quantity";
139            case CODEABLECONCEPT: return "CodeableConcept";
140            case STRING: return "string";
141            case BOOLEAN: return "boolean";
142            case INTEGER: return "integer";
143            case RANGE: return "Range";
144            case RATIO: return "Ratio";
145            case SAMPLEDDATA: return "SampledData";
146            case TIME: return "time";
147            case DATETIME: return "dateTime";
148            case PERIOD: return "Period";
149            case NULL: return null;
150            default: return "?";
151          }
152        }
153        public String getSystem() {
154          switch (this) {
155            case QUANTITY: return "http://hl7.org/fhir/permitted-data-type";
156            case CODEABLECONCEPT: return "http://hl7.org/fhir/permitted-data-type";
157            case STRING: return "http://hl7.org/fhir/permitted-data-type";
158            case BOOLEAN: return "http://hl7.org/fhir/permitted-data-type";
159            case INTEGER: return "http://hl7.org/fhir/permitted-data-type";
160            case RANGE: return "http://hl7.org/fhir/permitted-data-type";
161            case RATIO: return "http://hl7.org/fhir/permitted-data-type";
162            case SAMPLEDDATA: return "http://hl7.org/fhir/permitted-data-type";
163            case TIME: return "http://hl7.org/fhir/permitted-data-type";
164            case DATETIME: return "http://hl7.org/fhir/permitted-data-type";
165            case PERIOD: return "http://hl7.org/fhir/permitted-data-type";
166            case NULL: return null;
167            default: return "?";
168          }
169        }
170        public String getDefinition() {
171          switch (this) {
172            case QUANTITY: return "A measured amount.";
173            case CODEABLECONCEPT: return "A coded concept from a reference terminology and/or text.";
174            case STRING: return "A sequence of Unicode characters.";
175            case BOOLEAN: return "true or false.";
176            case INTEGER: return "A signed integer.";
177            case RANGE: return "A set of values bounded by low and high.";
178            case RATIO: return "A ratio of two Quantity values - a numerator and a denominator.";
179            case SAMPLEDDATA: return "A series of measurements taken by a device.";
180            case TIME: return "A time during the day, in the format hh:mm:ss.";
181            case DATETIME: return "A date, date-time or partial date (e.g. just year or year + month) as used in human communication.";
182            case PERIOD: return "A time range defined by start and end date/time.";
183            case NULL: return null;
184            default: return "?";
185          }
186        }
187        public String getDisplay() {
188          switch (this) {
189            case QUANTITY: return "Quantity";
190            case CODEABLECONCEPT: return "CodeableConcept";
191            case STRING: return "string";
192            case BOOLEAN: return "boolean";
193            case INTEGER: return "integer";
194            case RANGE: return "Range";
195            case RATIO: return "Ratio";
196            case SAMPLEDDATA: return "SampledData";
197            case TIME: return "time";
198            case DATETIME: return "dateTime";
199            case PERIOD: return "Period";
200            case NULL: return null;
201            default: return "?";
202          }
203        }
204    }
205
206  public static class ObservationDataTypeEnumFactory implements EnumFactory<ObservationDataType> {
207    public ObservationDataType fromCode(String codeString) throws IllegalArgumentException {
208      if (codeString == null || "".equals(codeString))
209            if (codeString == null || "".equals(codeString))
210                return null;
211        if ("Quantity".equals(codeString))
212          return ObservationDataType.QUANTITY;
213        if ("CodeableConcept".equals(codeString))
214          return ObservationDataType.CODEABLECONCEPT;
215        if ("string".equals(codeString))
216          return ObservationDataType.STRING;
217        if ("boolean".equals(codeString))
218          return ObservationDataType.BOOLEAN;
219        if ("integer".equals(codeString))
220          return ObservationDataType.INTEGER;
221        if ("Range".equals(codeString))
222          return ObservationDataType.RANGE;
223        if ("Ratio".equals(codeString))
224          return ObservationDataType.RATIO;
225        if ("SampledData".equals(codeString))
226          return ObservationDataType.SAMPLEDDATA;
227        if ("time".equals(codeString))
228          return ObservationDataType.TIME;
229        if ("dateTime".equals(codeString))
230          return ObservationDataType.DATETIME;
231        if ("Period".equals(codeString))
232          return ObservationDataType.PERIOD;
233        throw new IllegalArgumentException("Unknown ObservationDataType code '"+codeString+"'");
234        }
235        public Enumeration<ObservationDataType> fromType(Base code) throws FHIRException {
236          if (code == null)
237            return null;
238          if (code.isEmpty())
239            return new Enumeration<ObservationDataType>(this);
240          String codeString = ((PrimitiveType) code).asStringValue();
241          if (codeString == null || "".equals(codeString))
242            return null;
243        if ("Quantity".equals(codeString))
244          return new Enumeration<ObservationDataType>(this, ObservationDataType.QUANTITY);
245        if ("CodeableConcept".equals(codeString))
246          return new Enumeration<ObservationDataType>(this, ObservationDataType.CODEABLECONCEPT);
247        if ("string".equals(codeString))
248          return new Enumeration<ObservationDataType>(this, ObservationDataType.STRING);
249        if ("boolean".equals(codeString))
250          return new Enumeration<ObservationDataType>(this, ObservationDataType.BOOLEAN);
251        if ("integer".equals(codeString))
252          return new Enumeration<ObservationDataType>(this, ObservationDataType.INTEGER);
253        if ("Range".equals(codeString))
254          return new Enumeration<ObservationDataType>(this, ObservationDataType.RANGE);
255        if ("Ratio".equals(codeString))
256          return new Enumeration<ObservationDataType>(this, ObservationDataType.RATIO);
257        if ("SampledData".equals(codeString))
258          return new Enumeration<ObservationDataType>(this, ObservationDataType.SAMPLEDDATA);
259        if ("time".equals(codeString))
260          return new Enumeration<ObservationDataType>(this, ObservationDataType.TIME);
261        if ("dateTime".equals(codeString))
262          return new Enumeration<ObservationDataType>(this, ObservationDataType.DATETIME);
263        if ("Period".equals(codeString))
264          return new Enumeration<ObservationDataType>(this, ObservationDataType.PERIOD);
265        throw new FHIRException("Unknown ObservationDataType code '"+codeString+"'");
266        }
267    public String toCode(ObservationDataType code) {
268      if (code == ObservationDataType.QUANTITY)
269        return "Quantity";
270      if (code == ObservationDataType.CODEABLECONCEPT)
271        return "CodeableConcept";
272      if (code == ObservationDataType.STRING)
273        return "string";
274      if (code == ObservationDataType.BOOLEAN)
275        return "boolean";
276      if (code == ObservationDataType.INTEGER)
277        return "integer";
278      if (code == ObservationDataType.RANGE)
279        return "Range";
280      if (code == ObservationDataType.RATIO)
281        return "Ratio";
282      if (code == ObservationDataType.SAMPLEDDATA)
283        return "SampledData";
284      if (code == ObservationDataType.TIME)
285        return "time";
286      if (code == ObservationDataType.DATETIME)
287        return "dateTime";
288      if (code == ObservationDataType.PERIOD)
289        return "Period";
290      return "?";
291      }
292    public String toSystem(ObservationDataType code) {
293      return code.getSystem();
294      }
295    }
296
297    public enum ObservationRangeCategory {
298        /**
299         * Reference (Normal) Range for Ordinal and Continuous Observations.
300         */
301        REFERENCE, 
302        /**
303         * Critical Range for Ordinal and Continuous Observations. Results outside this range are critical.
304         */
305        CRITICAL, 
306        /**
307         * Absolute Range for Ordinal and Continuous Observations. Results outside this range are not possible.
308         */
309        ABSOLUTE, 
310        /**
311         * added to help the parsers with the generic types
312         */
313        NULL;
314        public static ObservationRangeCategory fromCode(String codeString) throws FHIRException {
315            if (codeString == null || "".equals(codeString))
316                return null;
317        if ("reference".equals(codeString))
318          return REFERENCE;
319        if ("critical".equals(codeString))
320          return CRITICAL;
321        if ("absolute".equals(codeString))
322          return ABSOLUTE;
323        if (Configuration.isAcceptInvalidEnums())
324          return null;
325        else
326          throw new FHIRException("Unknown ObservationRangeCategory code '"+codeString+"'");
327        }
328        public String toCode() {
329          switch (this) {
330            case REFERENCE: return "reference";
331            case CRITICAL: return "critical";
332            case ABSOLUTE: return "absolute";
333            case NULL: return null;
334            default: return "?";
335          }
336        }
337        public String getSystem() {
338          switch (this) {
339            case REFERENCE: return "http://hl7.org/fhir/observation-range-category";
340            case CRITICAL: return "http://hl7.org/fhir/observation-range-category";
341            case ABSOLUTE: return "http://hl7.org/fhir/observation-range-category";
342            case NULL: return null;
343            default: return "?";
344          }
345        }
346        public String getDefinition() {
347          switch (this) {
348            case REFERENCE: return "Reference (Normal) Range for Ordinal and Continuous Observations.";
349            case CRITICAL: return "Critical Range for Ordinal and Continuous Observations. Results outside this range are critical.";
350            case ABSOLUTE: return "Absolute Range for Ordinal and Continuous Observations. Results outside this range are not possible.";
351            case NULL: return null;
352            default: return "?";
353          }
354        }
355        public String getDisplay() {
356          switch (this) {
357            case REFERENCE: return "reference range";
358            case CRITICAL: return "critical range";
359            case ABSOLUTE: return "absolute range";
360            case NULL: return null;
361            default: return "?";
362          }
363        }
364    }
365
366  public static class ObservationRangeCategoryEnumFactory implements EnumFactory<ObservationRangeCategory> {
367    public ObservationRangeCategory fromCode(String codeString) throws IllegalArgumentException {
368      if (codeString == null || "".equals(codeString))
369            if (codeString == null || "".equals(codeString))
370                return null;
371        if ("reference".equals(codeString))
372          return ObservationRangeCategory.REFERENCE;
373        if ("critical".equals(codeString))
374          return ObservationRangeCategory.CRITICAL;
375        if ("absolute".equals(codeString))
376          return ObservationRangeCategory.ABSOLUTE;
377        throw new IllegalArgumentException("Unknown ObservationRangeCategory code '"+codeString+"'");
378        }
379        public Enumeration<ObservationRangeCategory> fromType(Base code) throws FHIRException {
380          if (code == null)
381            return null;
382          if (code.isEmpty())
383            return new Enumeration<ObservationRangeCategory>(this);
384          String codeString = ((PrimitiveType) code).asStringValue();
385          if (codeString == null || "".equals(codeString))
386            return null;
387        if ("reference".equals(codeString))
388          return new Enumeration<ObservationRangeCategory>(this, ObservationRangeCategory.REFERENCE);
389        if ("critical".equals(codeString))
390          return new Enumeration<ObservationRangeCategory>(this, ObservationRangeCategory.CRITICAL);
391        if ("absolute".equals(codeString))
392          return new Enumeration<ObservationRangeCategory>(this, ObservationRangeCategory.ABSOLUTE);
393        throw new FHIRException("Unknown ObservationRangeCategory code '"+codeString+"'");
394        }
395    public String toCode(ObservationRangeCategory code) {
396      if (code == ObservationRangeCategory.REFERENCE)
397        return "reference";
398      if (code == ObservationRangeCategory.CRITICAL)
399        return "critical";
400      if (code == ObservationRangeCategory.ABSOLUTE)
401        return "absolute";
402      return "?";
403      }
404    public String toSystem(ObservationRangeCategory code) {
405      return code.getSystem();
406      }
407    }
408
409    @Block()
410    public static class ObservationDefinitionQuantitativeDetailsComponent extends BackboneElement implements IBaseBackboneElement {
411        /**
412         * Primary unit used to report quantitative results of observations conforming to this ObservationDefinition.
413         */
414        @Child(name = "unit", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
415        @Description(shortDefinition="Primary unit for quantitative results", formalDefinition="Primary unit used to report quantitative results of observations conforming to this ObservationDefinition." )
416        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ucum-units")
417        protected CodeableConcept unit;
418
419        /**
420         * Secondary unit used to report quantitative results of observations conforming to this ObservationDefinition.
421         */
422        @Child(name = "customaryUnit", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
423        @Description(shortDefinition="Customary (secondary) unit for quantitative results", formalDefinition="Secondary unit used to report quantitative results of observations conforming to this ObservationDefinition." )
424        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ucum-units")
425        protected CodeableConcept customaryUnit;
426
427        /**
428         * Factor for converting value expressed with primary unit to value expressed with secondary unit.
429         */
430        @Child(name = "conversionFactor", type = {DecimalType.class}, order=3, min=0, max=1, modifier=false, summary=false)
431        @Description(shortDefinition="Primary to secondary unit conversion factor", formalDefinition="Factor for converting value expressed with primary unit to value expressed with secondary unit." )
432        protected DecimalType conversionFactor;
433
434        /**
435         * Number of digits after decimal separator when the results of such observations are of type Quantity.
436         */
437        @Child(name = "decimalPrecision", type = {IntegerType.class}, order=4, min=0, max=1, modifier=false, summary=false)
438        @Description(shortDefinition="Decimal precision of observation quantitative results", formalDefinition="Number of digits after decimal separator when the results of such observations are of type Quantity." )
439        protected IntegerType decimalPrecision;
440
441        private static final long serialVersionUID = -1745187850L;
442
443    /**
444     * Constructor
445     */
446      public ObservationDefinitionQuantitativeDetailsComponent() {
447        super();
448      }
449
450        /**
451         * @return {@link #unit} (Primary unit used to report quantitative results of observations conforming to this ObservationDefinition.)
452         */
453        public CodeableConcept getUnit() { 
454          if (this.unit == null)
455            if (Configuration.errorOnAutoCreate())
456              throw new Error("Attempt to auto-create ObservationDefinitionQuantitativeDetailsComponent.unit");
457            else if (Configuration.doAutoCreate())
458              this.unit = new CodeableConcept(); // cc
459          return this.unit;
460        }
461
462        public boolean hasUnit() { 
463          return this.unit != null && !this.unit.isEmpty();
464        }
465
466        /**
467         * @param value {@link #unit} (Primary unit used to report quantitative results of observations conforming to this ObservationDefinition.)
468         */
469        public ObservationDefinitionQuantitativeDetailsComponent setUnit(CodeableConcept value) { 
470          this.unit = value;
471          return this;
472        }
473
474        /**
475         * @return {@link #customaryUnit} (Secondary unit used to report quantitative results of observations conforming to this ObservationDefinition.)
476         */
477        public CodeableConcept getCustomaryUnit() { 
478          if (this.customaryUnit == null)
479            if (Configuration.errorOnAutoCreate())
480              throw new Error("Attempt to auto-create ObservationDefinitionQuantitativeDetailsComponent.customaryUnit");
481            else if (Configuration.doAutoCreate())
482              this.customaryUnit = new CodeableConcept(); // cc
483          return this.customaryUnit;
484        }
485
486        public boolean hasCustomaryUnit() { 
487          return this.customaryUnit != null && !this.customaryUnit.isEmpty();
488        }
489
490        /**
491         * @param value {@link #customaryUnit} (Secondary unit used to report quantitative results of observations conforming to this ObservationDefinition.)
492         */
493        public ObservationDefinitionQuantitativeDetailsComponent setCustomaryUnit(CodeableConcept value) { 
494          this.customaryUnit = value;
495          return this;
496        }
497
498        /**
499         * @return {@link #conversionFactor} (Factor for converting value expressed with primary unit to value expressed with secondary unit.). This is the underlying object with id, value and extensions. The accessor "getConversionFactor" gives direct access to the value
500         */
501        public DecimalType getConversionFactorElement() { 
502          if (this.conversionFactor == null)
503            if (Configuration.errorOnAutoCreate())
504              throw new Error("Attempt to auto-create ObservationDefinitionQuantitativeDetailsComponent.conversionFactor");
505            else if (Configuration.doAutoCreate())
506              this.conversionFactor = new DecimalType(); // bb
507          return this.conversionFactor;
508        }
509
510        public boolean hasConversionFactorElement() { 
511          return this.conversionFactor != null && !this.conversionFactor.isEmpty();
512        }
513
514        public boolean hasConversionFactor() { 
515          return this.conversionFactor != null && !this.conversionFactor.isEmpty();
516        }
517
518        /**
519         * @param value {@link #conversionFactor} (Factor for converting value expressed with primary unit to value expressed with secondary unit.). This is the underlying object with id, value and extensions. The accessor "getConversionFactor" gives direct access to the value
520         */
521        public ObservationDefinitionQuantitativeDetailsComponent setConversionFactorElement(DecimalType value) { 
522          this.conversionFactor = value;
523          return this;
524        }
525
526        /**
527         * @return Factor for converting value expressed with primary unit to value expressed with secondary unit.
528         */
529        public BigDecimal getConversionFactor() { 
530          return this.conversionFactor == null ? null : this.conversionFactor.getValue();
531        }
532
533        /**
534         * @param value Factor for converting value expressed with primary unit to value expressed with secondary unit.
535         */
536        public ObservationDefinitionQuantitativeDetailsComponent setConversionFactor(BigDecimal value) { 
537          if (value == null)
538            this.conversionFactor = null;
539          else {
540            if (this.conversionFactor == null)
541              this.conversionFactor = new DecimalType();
542            this.conversionFactor.setValue(value);
543          }
544          return this;
545        }
546
547        /**
548         * @param value Factor for converting value expressed with primary unit to value expressed with secondary unit.
549         */
550        public ObservationDefinitionQuantitativeDetailsComponent setConversionFactor(long value) { 
551              this.conversionFactor = new DecimalType();
552            this.conversionFactor.setValue(value);
553          return this;
554        }
555
556        /**
557         * @param value Factor for converting value expressed with primary unit to value expressed with secondary unit.
558         */
559        public ObservationDefinitionQuantitativeDetailsComponent setConversionFactor(double value) { 
560              this.conversionFactor = new DecimalType();
561            this.conversionFactor.setValue(value);
562          return this;
563        }
564
565        /**
566         * @return {@link #decimalPrecision} (Number of digits after decimal separator when the results of such observations are of type Quantity.). This is the underlying object with id, value and extensions. The accessor "getDecimalPrecision" gives direct access to the value
567         */
568        public IntegerType getDecimalPrecisionElement() { 
569          if (this.decimalPrecision == null)
570            if (Configuration.errorOnAutoCreate())
571              throw new Error("Attempt to auto-create ObservationDefinitionQuantitativeDetailsComponent.decimalPrecision");
572            else if (Configuration.doAutoCreate())
573              this.decimalPrecision = new IntegerType(); // bb
574          return this.decimalPrecision;
575        }
576
577        public boolean hasDecimalPrecisionElement() { 
578          return this.decimalPrecision != null && !this.decimalPrecision.isEmpty();
579        }
580
581        public boolean hasDecimalPrecision() { 
582          return this.decimalPrecision != null && !this.decimalPrecision.isEmpty();
583        }
584
585        /**
586         * @param value {@link #decimalPrecision} (Number of digits after decimal separator when the results of such observations are of type Quantity.). This is the underlying object with id, value and extensions. The accessor "getDecimalPrecision" gives direct access to the value
587         */
588        public ObservationDefinitionQuantitativeDetailsComponent setDecimalPrecisionElement(IntegerType value) { 
589          this.decimalPrecision = value;
590          return this;
591        }
592
593        /**
594         * @return Number of digits after decimal separator when the results of such observations are of type Quantity.
595         */
596        public int getDecimalPrecision() { 
597          return this.decimalPrecision == null || this.decimalPrecision.isEmpty() ? 0 : this.decimalPrecision.getValue();
598        }
599
600        /**
601         * @param value Number of digits after decimal separator when the results of such observations are of type Quantity.
602         */
603        public ObservationDefinitionQuantitativeDetailsComponent setDecimalPrecision(int value) { 
604            if (this.decimalPrecision == null)
605              this.decimalPrecision = new IntegerType();
606            this.decimalPrecision.setValue(value);
607          return this;
608        }
609
610        protected void listChildren(List<Property> children) {
611          super.listChildren(children);
612          children.add(new Property("unit", "CodeableConcept", "Primary unit used to report quantitative results of observations conforming to this ObservationDefinition.", 0, 1, unit));
613          children.add(new Property("customaryUnit", "CodeableConcept", "Secondary unit used to report quantitative results of observations conforming to this ObservationDefinition.", 0, 1, customaryUnit));
614          children.add(new Property("conversionFactor", "decimal", "Factor for converting value expressed with primary unit to value expressed with secondary unit.", 0, 1, conversionFactor));
615          children.add(new Property("decimalPrecision", "integer", "Number of digits after decimal separator when the results of such observations are of type Quantity.", 0, 1, decimalPrecision));
616        }
617
618        @Override
619        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
620          switch (_hash) {
621          case 3594628: /*unit*/  return new Property("unit", "CodeableConcept", "Primary unit used to report quantitative results of observations conforming to this ObservationDefinition.", 0, 1, unit);
622          case -1375586437: /*customaryUnit*/  return new Property("customaryUnit", "CodeableConcept", "Secondary unit used to report quantitative results of observations conforming to this ObservationDefinition.", 0, 1, customaryUnit);
623          case 1438876165: /*conversionFactor*/  return new Property("conversionFactor", "decimal", "Factor for converting value expressed with primary unit to value expressed with secondary unit.", 0, 1, conversionFactor);
624          case -1564447699: /*decimalPrecision*/  return new Property("decimalPrecision", "integer", "Number of digits after decimal separator when the results of such observations are of type Quantity.", 0, 1, decimalPrecision);
625          default: return super.getNamedProperty(_hash, _name, _checkValid);
626          }
627
628        }
629
630      @Override
631      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
632        switch (hash) {
633        case 3594628: /*unit*/ return this.unit == null ? new Base[0] : new Base[] {this.unit}; // CodeableConcept
634        case -1375586437: /*customaryUnit*/ return this.customaryUnit == null ? new Base[0] : new Base[] {this.customaryUnit}; // CodeableConcept
635        case 1438876165: /*conversionFactor*/ return this.conversionFactor == null ? new Base[0] : new Base[] {this.conversionFactor}; // DecimalType
636        case -1564447699: /*decimalPrecision*/ return this.decimalPrecision == null ? new Base[0] : new Base[] {this.decimalPrecision}; // IntegerType
637        default: return super.getProperty(hash, name, checkValid);
638        }
639
640      }
641
642      @Override
643      public Base setProperty(int hash, String name, Base value) throws FHIRException {
644        switch (hash) {
645        case 3594628: // unit
646          this.unit = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
647          return value;
648        case -1375586437: // customaryUnit
649          this.customaryUnit = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
650          return value;
651        case 1438876165: // conversionFactor
652          this.conversionFactor = TypeConvertor.castToDecimal(value); // DecimalType
653          return value;
654        case -1564447699: // decimalPrecision
655          this.decimalPrecision = TypeConvertor.castToInteger(value); // IntegerType
656          return value;
657        default: return super.setProperty(hash, name, value);
658        }
659
660      }
661
662      @Override
663      public Base setProperty(String name, Base value) throws FHIRException {
664        if (name.equals("unit")) {
665          this.unit = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
666        } else if (name.equals("customaryUnit")) {
667          this.customaryUnit = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
668        } else if (name.equals("conversionFactor")) {
669          this.conversionFactor = TypeConvertor.castToDecimal(value); // DecimalType
670        } else if (name.equals("decimalPrecision")) {
671          this.decimalPrecision = TypeConvertor.castToInteger(value); // IntegerType
672        } else
673          return super.setProperty(name, value);
674        return value;
675      }
676
677      @Override
678      public Base makeProperty(int hash, String name) throws FHIRException {
679        switch (hash) {
680        case 3594628:  return getUnit();
681        case -1375586437:  return getCustomaryUnit();
682        case 1438876165:  return getConversionFactorElement();
683        case -1564447699:  return getDecimalPrecisionElement();
684        default: return super.makeProperty(hash, name);
685        }
686
687      }
688
689      @Override
690      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
691        switch (hash) {
692        case 3594628: /*unit*/ return new String[] {"CodeableConcept"};
693        case -1375586437: /*customaryUnit*/ return new String[] {"CodeableConcept"};
694        case 1438876165: /*conversionFactor*/ return new String[] {"decimal"};
695        case -1564447699: /*decimalPrecision*/ return new String[] {"integer"};
696        default: return super.getTypesForProperty(hash, name);
697        }
698
699      }
700
701      @Override
702      public Base addChild(String name) throws FHIRException {
703        if (name.equals("unit")) {
704          this.unit = new CodeableConcept();
705          return this.unit;
706        }
707        else if (name.equals("customaryUnit")) {
708          this.customaryUnit = new CodeableConcept();
709          return this.customaryUnit;
710        }
711        else if (name.equals("conversionFactor")) {
712          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.quantitativeDetails.conversionFactor");
713        }
714        else if (name.equals("decimalPrecision")) {
715          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.quantitativeDetails.decimalPrecision");
716        }
717        else
718          return super.addChild(name);
719      }
720
721      public ObservationDefinitionQuantitativeDetailsComponent copy() {
722        ObservationDefinitionQuantitativeDetailsComponent dst = new ObservationDefinitionQuantitativeDetailsComponent();
723        copyValues(dst);
724        return dst;
725      }
726
727      public void copyValues(ObservationDefinitionQuantitativeDetailsComponent dst) {
728        super.copyValues(dst);
729        dst.unit = unit == null ? null : unit.copy();
730        dst.customaryUnit = customaryUnit == null ? null : customaryUnit.copy();
731        dst.conversionFactor = conversionFactor == null ? null : conversionFactor.copy();
732        dst.decimalPrecision = decimalPrecision == null ? null : decimalPrecision.copy();
733      }
734
735      @Override
736      public boolean equalsDeep(Base other_) {
737        if (!super.equalsDeep(other_))
738          return false;
739        if (!(other_ instanceof ObservationDefinitionQuantitativeDetailsComponent))
740          return false;
741        ObservationDefinitionQuantitativeDetailsComponent o = (ObservationDefinitionQuantitativeDetailsComponent) other_;
742        return compareDeep(unit, o.unit, true) && compareDeep(customaryUnit, o.customaryUnit, true) && compareDeep(conversionFactor, o.conversionFactor, true)
743           && compareDeep(decimalPrecision, o.decimalPrecision, true);
744      }
745
746      @Override
747      public boolean equalsShallow(Base other_) {
748        if (!super.equalsShallow(other_))
749          return false;
750        if (!(other_ instanceof ObservationDefinitionQuantitativeDetailsComponent))
751          return false;
752        ObservationDefinitionQuantitativeDetailsComponent o = (ObservationDefinitionQuantitativeDetailsComponent) other_;
753        return compareValues(conversionFactor, o.conversionFactor, true) && compareValues(decimalPrecision, o.decimalPrecision, true)
754          ;
755      }
756
757      public boolean isEmpty() {
758        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(unit, customaryUnit, conversionFactor
759          , decimalPrecision);
760      }
761
762  public String fhirType() {
763    return "ObservationDefinition.quantitativeDetails";
764
765  }
766
767  }
768
769    @Block()
770    public static class ObservationDefinitionQualifiedValueComponent extends BackboneElement implements IBaseBackboneElement {
771        /**
772         * A concept defining the context for this set of qualified values.
773         */
774        @Child(name = "context", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
775        @Description(shortDefinition="Context qualifier for the set of qualified values", formalDefinition="A concept defining the context for this set of qualified values." )
776        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/referencerange-meaning")
777        protected CodeableConcept context;
778
779        /**
780         * The target population this  set of qualified values applies to.
781         */
782        @Child(name = "appliesTo", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
783        @Description(shortDefinition="Targetted population for the set of qualified values", formalDefinition="The target population this  set of qualified values applies to." )
784        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/referencerange-appliesto")
785        protected List<CodeableConcept> appliesTo;
786
787        /**
788         * The gender this  set of qualified values applies to.
789         */
790        @Child(name = "gender", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false)
791        @Description(shortDefinition="male | female | other | unknown", formalDefinition="The gender this  set of qualified values applies to." )
792        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/administrative-gender")
793        protected Enumeration<AdministrativeGender> gender;
794
795        /**
796         * The age range this  set of qualified values applies to.
797         */
798        @Child(name = "age", type = {Range.class}, order=4, min=0, max=1, modifier=false, summary=false)
799        @Description(shortDefinition="Applicable age range for the set of qualified values", formalDefinition="The age range this  set of qualified values applies to." )
800        protected Range age;
801
802        /**
803         * The gestational age this  set of qualified values applies to.
804         */
805        @Child(name = "gestationalAge", type = {Range.class}, order=5, min=0, max=1, modifier=false, summary=false)
806        @Description(shortDefinition="Applicable gestational age range for the set of qualified values", formalDefinition="The gestational age this  set of qualified values applies to." )
807        protected Range gestationalAge;
808
809        /**
810         * Text based condition for which the the set of qualified values is valid.
811         */
812        @Child(name = "condition", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
813        @Description(shortDefinition="Condition associated with the set of qualified values", formalDefinition="Text based condition for which the the set of qualified values is valid." )
814        protected StringType condition;
815
816        /**
817         * The category of range of values for continuous or ordinal observations that match the criteria of this set of qualified values.
818         */
819        @Child(name = "rangeCategory", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=false)
820        @Description(shortDefinition="reference | critical | absolute", formalDefinition="The category of range of values for continuous or ordinal observations that match the criteria of this set of qualified values." )
821        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/observation-range-category")
822        protected Enumeration<ObservationRangeCategory> rangeCategory;
823
824        /**
825         * The range of values defined for continuous or ordinal observations that match the criteria of this set of qualified values.
826         */
827        @Child(name = "range", type = {Range.class}, order=8, min=0, max=1, modifier=false, summary=false)
828        @Description(shortDefinition="The range for continuous or ordinal observations", formalDefinition="The range of values defined for continuous or ordinal observations that match the criteria of this set of qualified values." )
829        protected Range range;
830
831        /**
832         * The set of valid coded results for qualitative observations  that match the criteria of this set of qualified values.
833         */
834        @Child(name = "validCodedValueSet", type = {CanonicalType.class}, order=9, min=0, max=1, modifier=false, summary=false)
835        @Description(shortDefinition="Value set of valid coded values as part of this set of qualified values", formalDefinition="The set of valid coded results for qualitative observations  that match the criteria of this set of qualified values." )
836        protected CanonicalType validCodedValueSet;
837
838        /**
839         * The set of normal coded results for qualitative observations  that match the criteria of this set of qualified values.
840         */
841        @Child(name = "normalCodedValueSet", type = {CanonicalType.class}, order=10, min=0, max=1, modifier=false, summary=false)
842        @Description(shortDefinition="Value set of normal coded values as part of this set of qualified values", formalDefinition="The set of normal coded results for qualitative observations  that match the criteria of this set of qualified values." )
843        protected CanonicalType normalCodedValueSet;
844
845        /**
846         * The set of abnormal coded results for qualitative observations  that match the criteria of this set of qualified values.
847         */
848        @Child(name = "abnormalCodedValueSet", type = {CanonicalType.class}, order=11, min=0, max=1, modifier=false, summary=false)
849        @Description(shortDefinition="Value set of abnormal coded values as part of this set of qualified values", formalDefinition="The set of abnormal coded results for qualitative observations  that match the criteria of this set of qualified values." )
850        protected CanonicalType abnormalCodedValueSet;
851
852        /**
853         * The set of critical coded results for qualitative observations  that match the criteria of this set of qualified values.
854         */
855        @Child(name = "criticalCodedValueSet", type = {CanonicalType.class}, order=12, min=0, max=1, modifier=false, summary=false)
856        @Description(shortDefinition="Value set of critical coded values as part of this set of qualified values", formalDefinition="The set of critical coded results for qualitative observations  that match the criteria of this set of qualified values." )
857        protected CanonicalType criticalCodedValueSet;
858
859        private static final long serialVersionUID = -538666361L;
860
861    /**
862     * Constructor
863     */
864      public ObservationDefinitionQualifiedValueComponent() {
865        super();
866      }
867
868        /**
869         * @return {@link #context} (A concept defining the context for this set of qualified values.)
870         */
871        public CodeableConcept getContext() { 
872          if (this.context == null)
873            if (Configuration.errorOnAutoCreate())
874              throw new Error("Attempt to auto-create ObservationDefinitionQualifiedValueComponent.context");
875            else if (Configuration.doAutoCreate())
876              this.context = new CodeableConcept(); // cc
877          return this.context;
878        }
879
880        public boolean hasContext() { 
881          return this.context != null && !this.context.isEmpty();
882        }
883
884        /**
885         * @param value {@link #context} (A concept defining the context for this set of qualified values.)
886         */
887        public ObservationDefinitionQualifiedValueComponent setContext(CodeableConcept value) { 
888          this.context = value;
889          return this;
890        }
891
892        /**
893         * @return {@link #appliesTo} (The target population this  set of qualified values applies to.)
894         */
895        public List<CodeableConcept> getAppliesTo() { 
896          if (this.appliesTo == null)
897            this.appliesTo = new ArrayList<CodeableConcept>();
898          return this.appliesTo;
899        }
900
901        /**
902         * @return Returns a reference to <code>this</code> for easy method chaining
903         */
904        public ObservationDefinitionQualifiedValueComponent setAppliesTo(List<CodeableConcept> theAppliesTo) { 
905          this.appliesTo = theAppliesTo;
906          return this;
907        }
908
909        public boolean hasAppliesTo() { 
910          if (this.appliesTo == null)
911            return false;
912          for (CodeableConcept item : this.appliesTo)
913            if (!item.isEmpty())
914              return true;
915          return false;
916        }
917
918        public CodeableConcept addAppliesTo() { //3
919          CodeableConcept t = new CodeableConcept();
920          if (this.appliesTo == null)
921            this.appliesTo = new ArrayList<CodeableConcept>();
922          this.appliesTo.add(t);
923          return t;
924        }
925
926        public ObservationDefinitionQualifiedValueComponent addAppliesTo(CodeableConcept t) { //3
927          if (t == null)
928            return this;
929          if (this.appliesTo == null)
930            this.appliesTo = new ArrayList<CodeableConcept>();
931          this.appliesTo.add(t);
932          return this;
933        }
934
935        /**
936         * @return The first repetition of repeating field {@link #appliesTo}, creating it if it does not already exist {3}
937         */
938        public CodeableConcept getAppliesToFirstRep() { 
939          if (getAppliesTo().isEmpty()) {
940            addAppliesTo();
941          }
942          return getAppliesTo().get(0);
943        }
944
945        /**
946         * @return {@link #gender} (The gender this  set of qualified values applies to.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value
947         */
948        public Enumeration<AdministrativeGender> getGenderElement() { 
949          if (this.gender == null)
950            if (Configuration.errorOnAutoCreate())
951              throw new Error("Attempt to auto-create ObservationDefinitionQualifiedValueComponent.gender");
952            else if (Configuration.doAutoCreate())
953              this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory()); // bb
954          return this.gender;
955        }
956
957        public boolean hasGenderElement() { 
958          return this.gender != null && !this.gender.isEmpty();
959        }
960
961        public boolean hasGender() { 
962          return this.gender != null && !this.gender.isEmpty();
963        }
964
965        /**
966         * @param value {@link #gender} (The gender this  set of qualified values applies to.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value
967         */
968        public ObservationDefinitionQualifiedValueComponent setGenderElement(Enumeration<AdministrativeGender> value) { 
969          this.gender = value;
970          return this;
971        }
972
973        /**
974         * @return The gender this  set of qualified values applies to.
975         */
976        public AdministrativeGender getGender() { 
977          return this.gender == null ? null : this.gender.getValue();
978        }
979
980        /**
981         * @param value The gender this  set of qualified values applies to.
982         */
983        public ObservationDefinitionQualifiedValueComponent setGender(AdministrativeGender value) { 
984          if (value == null)
985            this.gender = null;
986          else {
987            if (this.gender == null)
988              this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory());
989            this.gender.setValue(value);
990          }
991          return this;
992        }
993
994        /**
995         * @return {@link #age} (The age range this  set of qualified values applies to.)
996         */
997        public Range getAge() { 
998          if (this.age == null)
999            if (Configuration.errorOnAutoCreate())
1000              throw new Error("Attempt to auto-create ObservationDefinitionQualifiedValueComponent.age");
1001            else if (Configuration.doAutoCreate())
1002              this.age = new Range(); // cc
1003          return this.age;
1004        }
1005
1006        public boolean hasAge() { 
1007          return this.age != null && !this.age.isEmpty();
1008        }
1009
1010        /**
1011         * @param value {@link #age} (The age range this  set of qualified values applies to.)
1012         */
1013        public ObservationDefinitionQualifiedValueComponent setAge(Range value) { 
1014          this.age = value;
1015          return this;
1016        }
1017
1018        /**
1019         * @return {@link #gestationalAge} (The gestational age this  set of qualified values applies to.)
1020         */
1021        public Range getGestationalAge() { 
1022          if (this.gestationalAge == null)
1023            if (Configuration.errorOnAutoCreate())
1024              throw new Error("Attempt to auto-create ObservationDefinitionQualifiedValueComponent.gestationalAge");
1025            else if (Configuration.doAutoCreate())
1026              this.gestationalAge = new Range(); // cc
1027          return this.gestationalAge;
1028        }
1029
1030        public boolean hasGestationalAge() { 
1031          return this.gestationalAge != null && !this.gestationalAge.isEmpty();
1032        }
1033
1034        /**
1035         * @param value {@link #gestationalAge} (The gestational age this  set of qualified values applies to.)
1036         */
1037        public ObservationDefinitionQualifiedValueComponent setGestationalAge(Range value) { 
1038          this.gestationalAge = value;
1039          return this;
1040        }
1041
1042        /**
1043         * @return {@link #condition} (Text based condition for which the the set of qualified values is valid.). This is the underlying object with id, value and extensions. The accessor "getCondition" gives direct access to the value
1044         */
1045        public StringType getConditionElement() { 
1046          if (this.condition == null)
1047            if (Configuration.errorOnAutoCreate())
1048              throw new Error("Attempt to auto-create ObservationDefinitionQualifiedValueComponent.condition");
1049            else if (Configuration.doAutoCreate())
1050              this.condition = new StringType(); // bb
1051          return this.condition;
1052        }
1053
1054        public boolean hasConditionElement() { 
1055          return this.condition != null && !this.condition.isEmpty();
1056        }
1057
1058        public boolean hasCondition() { 
1059          return this.condition != null && !this.condition.isEmpty();
1060        }
1061
1062        /**
1063         * @param value {@link #condition} (Text based condition for which the the set of qualified values is valid.). This is the underlying object with id, value and extensions. The accessor "getCondition" gives direct access to the value
1064         */
1065        public ObservationDefinitionQualifiedValueComponent setConditionElement(StringType value) { 
1066          this.condition = value;
1067          return this;
1068        }
1069
1070        /**
1071         * @return Text based condition for which the the set of qualified values is valid.
1072         */
1073        public String getCondition() { 
1074          return this.condition == null ? null : this.condition.getValue();
1075        }
1076
1077        /**
1078         * @param value Text based condition for which the the set of qualified values is valid.
1079         */
1080        public ObservationDefinitionQualifiedValueComponent setCondition(String value) { 
1081          if (Utilities.noString(value))
1082            this.condition = null;
1083          else {
1084            if (this.condition == null)
1085              this.condition = new StringType();
1086            this.condition.setValue(value);
1087          }
1088          return this;
1089        }
1090
1091        /**
1092         * @return {@link #rangeCategory} (The category of range of values for continuous or ordinal observations that match the criteria of this set of qualified values.). This is the underlying object with id, value and extensions. The accessor "getRangeCategory" gives direct access to the value
1093         */
1094        public Enumeration<ObservationRangeCategory> getRangeCategoryElement() { 
1095          if (this.rangeCategory == null)
1096            if (Configuration.errorOnAutoCreate())
1097              throw new Error("Attempt to auto-create ObservationDefinitionQualifiedValueComponent.rangeCategory");
1098            else if (Configuration.doAutoCreate())
1099              this.rangeCategory = new Enumeration<ObservationRangeCategory>(new ObservationRangeCategoryEnumFactory()); // bb
1100          return this.rangeCategory;
1101        }
1102
1103        public boolean hasRangeCategoryElement() { 
1104          return this.rangeCategory != null && !this.rangeCategory.isEmpty();
1105        }
1106
1107        public boolean hasRangeCategory() { 
1108          return this.rangeCategory != null && !this.rangeCategory.isEmpty();
1109        }
1110
1111        /**
1112         * @param value {@link #rangeCategory} (The category of range of values for continuous or ordinal observations that match the criteria of this set of qualified values.). This is the underlying object with id, value and extensions. The accessor "getRangeCategory" gives direct access to the value
1113         */
1114        public ObservationDefinitionQualifiedValueComponent setRangeCategoryElement(Enumeration<ObservationRangeCategory> value) { 
1115          this.rangeCategory = value;
1116          return this;
1117        }
1118
1119        /**
1120         * @return The category of range of values for continuous or ordinal observations that match the criteria of this set of qualified values.
1121         */
1122        public ObservationRangeCategory getRangeCategory() { 
1123          return this.rangeCategory == null ? null : this.rangeCategory.getValue();
1124        }
1125
1126        /**
1127         * @param value The category of range of values for continuous or ordinal observations that match the criteria of this set of qualified values.
1128         */
1129        public ObservationDefinitionQualifiedValueComponent setRangeCategory(ObservationRangeCategory value) { 
1130          if (value == null)
1131            this.rangeCategory = null;
1132          else {
1133            if (this.rangeCategory == null)
1134              this.rangeCategory = new Enumeration<ObservationRangeCategory>(new ObservationRangeCategoryEnumFactory());
1135            this.rangeCategory.setValue(value);
1136          }
1137          return this;
1138        }
1139
1140        /**
1141         * @return {@link #range} (The range of values defined for continuous or ordinal observations that match the criteria of this set of qualified values.)
1142         */
1143        public Range getRange() { 
1144          if (this.range == null)
1145            if (Configuration.errorOnAutoCreate())
1146              throw new Error("Attempt to auto-create ObservationDefinitionQualifiedValueComponent.range");
1147            else if (Configuration.doAutoCreate())
1148              this.range = new Range(); // cc
1149          return this.range;
1150        }
1151
1152        public boolean hasRange() { 
1153          return this.range != null && !this.range.isEmpty();
1154        }
1155
1156        /**
1157         * @param value {@link #range} (The range of values defined for continuous or ordinal observations that match the criteria of this set of qualified values.)
1158         */
1159        public ObservationDefinitionQualifiedValueComponent setRange(Range value) { 
1160          this.range = value;
1161          return this;
1162        }
1163
1164        /**
1165         * @return {@link #validCodedValueSet} (The set of valid coded results for qualitative observations  that match the criteria of this set of qualified values.). This is the underlying object with id, value and extensions. The accessor "getValidCodedValueSet" gives direct access to the value
1166         */
1167        public CanonicalType getValidCodedValueSetElement() { 
1168          if (this.validCodedValueSet == null)
1169            if (Configuration.errorOnAutoCreate())
1170              throw new Error("Attempt to auto-create ObservationDefinitionQualifiedValueComponent.validCodedValueSet");
1171            else if (Configuration.doAutoCreate())
1172              this.validCodedValueSet = new CanonicalType(); // bb
1173          return this.validCodedValueSet;
1174        }
1175
1176        public boolean hasValidCodedValueSetElement() { 
1177          return this.validCodedValueSet != null && !this.validCodedValueSet.isEmpty();
1178        }
1179
1180        public boolean hasValidCodedValueSet() { 
1181          return this.validCodedValueSet != null && !this.validCodedValueSet.isEmpty();
1182        }
1183
1184        /**
1185         * @param value {@link #validCodedValueSet} (The set of valid coded results for qualitative observations  that match the criteria of this set of qualified values.). This is the underlying object with id, value and extensions. The accessor "getValidCodedValueSet" gives direct access to the value
1186         */
1187        public ObservationDefinitionQualifiedValueComponent setValidCodedValueSetElement(CanonicalType value) { 
1188          this.validCodedValueSet = value;
1189          return this;
1190        }
1191
1192        /**
1193         * @return The set of valid coded results for qualitative observations  that match the criteria of this set of qualified values.
1194         */
1195        public String getValidCodedValueSet() { 
1196          return this.validCodedValueSet == null ? null : this.validCodedValueSet.getValue();
1197        }
1198
1199        /**
1200         * @param value The set of valid coded results for qualitative observations  that match the criteria of this set of qualified values.
1201         */
1202        public ObservationDefinitionQualifiedValueComponent setValidCodedValueSet(String value) { 
1203          if (Utilities.noString(value))
1204            this.validCodedValueSet = null;
1205          else {
1206            if (this.validCodedValueSet == null)
1207              this.validCodedValueSet = new CanonicalType();
1208            this.validCodedValueSet.setValue(value);
1209          }
1210          return this;
1211        }
1212
1213        /**
1214         * @return {@link #normalCodedValueSet} (The set of normal coded results for qualitative observations  that match the criteria of this set of qualified values.). This is the underlying object with id, value and extensions. The accessor "getNormalCodedValueSet" gives direct access to the value
1215         */
1216        public CanonicalType getNormalCodedValueSetElement() { 
1217          if (this.normalCodedValueSet == null)
1218            if (Configuration.errorOnAutoCreate())
1219              throw new Error("Attempt to auto-create ObservationDefinitionQualifiedValueComponent.normalCodedValueSet");
1220            else if (Configuration.doAutoCreate())
1221              this.normalCodedValueSet = new CanonicalType(); // bb
1222          return this.normalCodedValueSet;
1223        }
1224
1225        public boolean hasNormalCodedValueSetElement() { 
1226          return this.normalCodedValueSet != null && !this.normalCodedValueSet.isEmpty();
1227        }
1228
1229        public boolean hasNormalCodedValueSet() { 
1230          return this.normalCodedValueSet != null && !this.normalCodedValueSet.isEmpty();
1231        }
1232
1233        /**
1234         * @param value {@link #normalCodedValueSet} (The set of normal coded results for qualitative observations  that match the criteria of this set of qualified values.). This is the underlying object with id, value and extensions. The accessor "getNormalCodedValueSet" gives direct access to the value
1235         */
1236        public ObservationDefinitionQualifiedValueComponent setNormalCodedValueSetElement(CanonicalType value) { 
1237          this.normalCodedValueSet = value;
1238          return this;
1239        }
1240
1241        /**
1242         * @return The set of normal coded results for qualitative observations  that match the criteria of this set of qualified values.
1243         */
1244        public String getNormalCodedValueSet() { 
1245          return this.normalCodedValueSet == null ? null : this.normalCodedValueSet.getValue();
1246        }
1247
1248        /**
1249         * @param value The set of normal coded results for qualitative observations  that match the criteria of this set of qualified values.
1250         */
1251        public ObservationDefinitionQualifiedValueComponent setNormalCodedValueSet(String value) { 
1252          if (Utilities.noString(value))
1253            this.normalCodedValueSet = null;
1254          else {
1255            if (this.normalCodedValueSet == null)
1256              this.normalCodedValueSet = new CanonicalType();
1257            this.normalCodedValueSet.setValue(value);
1258          }
1259          return this;
1260        }
1261
1262        /**
1263         * @return {@link #abnormalCodedValueSet} (The set of abnormal coded results for qualitative observations  that match the criteria of this set of qualified values.). This is the underlying object with id, value and extensions. The accessor "getAbnormalCodedValueSet" gives direct access to the value
1264         */
1265        public CanonicalType getAbnormalCodedValueSetElement() { 
1266          if (this.abnormalCodedValueSet == null)
1267            if (Configuration.errorOnAutoCreate())
1268              throw new Error("Attempt to auto-create ObservationDefinitionQualifiedValueComponent.abnormalCodedValueSet");
1269            else if (Configuration.doAutoCreate())
1270              this.abnormalCodedValueSet = new CanonicalType(); // bb
1271          return this.abnormalCodedValueSet;
1272        }
1273
1274        public boolean hasAbnormalCodedValueSetElement() { 
1275          return this.abnormalCodedValueSet != null && !this.abnormalCodedValueSet.isEmpty();
1276        }
1277
1278        public boolean hasAbnormalCodedValueSet() { 
1279          return this.abnormalCodedValueSet != null && !this.abnormalCodedValueSet.isEmpty();
1280        }
1281
1282        /**
1283         * @param value {@link #abnormalCodedValueSet} (The set of abnormal coded results for qualitative observations  that match the criteria of this set of qualified values.). This is the underlying object with id, value and extensions. The accessor "getAbnormalCodedValueSet" gives direct access to the value
1284         */
1285        public ObservationDefinitionQualifiedValueComponent setAbnormalCodedValueSetElement(CanonicalType value) { 
1286          this.abnormalCodedValueSet = value;
1287          return this;
1288        }
1289
1290        /**
1291         * @return The set of abnormal coded results for qualitative observations  that match the criteria of this set of qualified values.
1292         */
1293        public String getAbnormalCodedValueSet() { 
1294          return this.abnormalCodedValueSet == null ? null : this.abnormalCodedValueSet.getValue();
1295        }
1296
1297        /**
1298         * @param value The set of abnormal coded results for qualitative observations  that match the criteria of this set of qualified values.
1299         */
1300        public ObservationDefinitionQualifiedValueComponent setAbnormalCodedValueSet(String value) { 
1301          if (Utilities.noString(value))
1302            this.abnormalCodedValueSet = null;
1303          else {
1304            if (this.abnormalCodedValueSet == null)
1305              this.abnormalCodedValueSet = new CanonicalType();
1306            this.abnormalCodedValueSet.setValue(value);
1307          }
1308          return this;
1309        }
1310
1311        /**
1312         * @return {@link #criticalCodedValueSet} (The set of critical coded results for qualitative observations  that match the criteria of this set of qualified values.). This is the underlying object with id, value and extensions. The accessor "getCriticalCodedValueSet" gives direct access to the value
1313         */
1314        public CanonicalType getCriticalCodedValueSetElement() { 
1315          if (this.criticalCodedValueSet == null)
1316            if (Configuration.errorOnAutoCreate())
1317              throw new Error("Attempt to auto-create ObservationDefinitionQualifiedValueComponent.criticalCodedValueSet");
1318            else if (Configuration.doAutoCreate())
1319              this.criticalCodedValueSet = new CanonicalType(); // bb
1320          return this.criticalCodedValueSet;
1321        }
1322
1323        public boolean hasCriticalCodedValueSetElement() { 
1324          return this.criticalCodedValueSet != null && !this.criticalCodedValueSet.isEmpty();
1325        }
1326
1327        public boolean hasCriticalCodedValueSet() { 
1328          return this.criticalCodedValueSet != null && !this.criticalCodedValueSet.isEmpty();
1329        }
1330
1331        /**
1332         * @param value {@link #criticalCodedValueSet} (The set of critical coded results for qualitative observations  that match the criteria of this set of qualified values.). This is the underlying object with id, value and extensions. The accessor "getCriticalCodedValueSet" gives direct access to the value
1333         */
1334        public ObservationDefinitionQualifiedValueComponent setCriticalCodedValueSetElement(CanonicalType value) { 
1335          this.criticalCodedValueSet = value;
1336          return this;
1337        }
1338
1339        /**
1340         * @return The set of critical coded results for qualitative observations  that match the criteria of this set of qualified values.
1341         */
1342        public String getCriticalCodedValueSet() { 
1343          return this.criticalCodedValueSet == null ? null : this.criticalCodedValueSet.getValue();
1344        }
1345
1346        /**
1347         * @param value The set of critical coded results for qualitative observations  that match the criteria of this set of qualified values.
1348         */
1349        public ObservationDefinitionQualifiedValueComponent setCriticalCodedValueSet(String value) { 
1350          if (Utilities.noString(value))
1351            this.criticalCodedValueSet = null;
1352          else {
1353            if (this.criticalCodedValueSet == null)
1354              this.criticalCodedValueSet = new CanonicalType();
1355            this.criticalCodedValueSet.setValue(value);
1356          }
1357          return this;
1358        }
1359
1360        protected void listChildren(List<Property> children) {
1361          super.listChildren(children);
1362          children.add(new Property("context", "CodeableConcept", "A concept defining the context for this set of qualified values.", 0, 1, context));
1363          children.add(new Property("appliesTo", "CodeableConcept", "The target population this  set of qualified values applies to.", 0, java.lang.Integer.MAX_VALUE, appliesTo));
1364          children.add(new Property("gender", "code", "The gender this  set of qualified values applies to.", 0, 1, gender));
1365          children.add(new Property("age", "Range", "The age range this  set of qualified values applies to.", 0, 1, age));
1366          children.add(new Property("gestationalAge", "Range", "The gestational age this  set of qualified values applies to.", 0, 1, gestationalAge));
1367          children.add(new Property("condition", "string", "Text based condition for which the the set of qualified values is valid.", 0, 1, condition));
1368          children.add(new Property("rangeCategory", "code", "The category of range of values for continuous or ordinal observations that match the criteria of this set of qualified values.", 0, 1, rangeCategory));
1369          children.add(new Property("range", "Range", "The range of values defined for continuous or ordinal observations that match the criteria of this set of qualified values.", 0, 1, range));
1370          children.add(new Property("validCodedValueSet", "canonical(ValueSet)", "The set of valid coded results for qualitative observations  that match the criteria of this set of qualified values.", 0, 1, validCodedValueSet));
1371          children.add(new Property("normalCodedValueSet", "canonical(ValueSet)", "The set of normal coded results for qualitative observations  that match the criteria of this set of qualified values.", 0, 1, normalCodedValueSet));
1372          children.add(new Property("abnormalCodedValueSet", "canonical(ValueSet)", "The set of abnormal coded results for qualitative observations  that match the criteria of this set of qualified values.", 0, 1, abnormalCodedValueSet));
1373          children.add(new Property("criticalCodedValueSet", "canonical(ValueSet)", "The set of critical coded results for qualitative observations  that match the criteria of this set of qualified values.", 0, 1, criticalCodedValueSet));
1374        }
1375
1376        @Override
1377        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1378          switch (_hash) {
1379          case 951530927: /*context*/  return new Property("context", "CodeableConcept", "A concept defining the context for this set of qualified values.", 0, 1, context);
1380          case -2089924569: /*appliesTo*/  return new Property("appliesTo", "CodeableConcept", "The target population this  set of qualified values applies to.", 0, java.lang.Integer.MAX_VALUE, appliesTo);
1381          case -1249512767: /*gender*/  return new Property("gender", "code", "The gender this  set of qualified values applies to.", 0, 1, gender);
1382          case 96511: /*age*/  return new Property("age", "Range", "The age range this  set of qualified values applies to.", 0, 1, age);
1383          case -241217538: /*gestationalAge*/  return new Property("gestationalAge", "Range", "The gestational age this  set of qualified values applies to.", 0, 1, gestationalAge);
1384          case -861311717: /*condition*/  return new Property("condition", "string", "Text based condition for which the the set of qualified values is valid.", 0, 1, condition);
1385          case -363410085: /*rangeCategory*/  return new Property("rangeCategory", "code", "The category of range of values for continuous or ordinal observations that match the criteria of this set of qualified values.", 0, 1, rangeCategory);
1386          case 108280125: /*range*/  return new Property("range", "Range", "The range of values defined for continuous or ordinal observations that match the criteria of this set of qualified values.", 0, 1, range);
1387          case 1374640076: /*validCodedValueSet*/  return new Property("validCodedValueSet", "canonical(ValueSet)", "The set of valid coded results for qualitative observations  that match the criteria of this set of qualified values.", 0, 1, validCodedValueSet);
1388          case -837500735: /*normalCodedValueSet*/  return new Property("normalCodedValueSet", "canonical(ValueSet)", "The set of normal coded results for qualitative observations  that match the criteria of this set of qualified values.", 0, 1, normalCodedValueSet);
1389          case 1073600256: /*abnormalCodedValueSet*/  return new Property("abnormalCodedValueSet", "canonical(ValueSet)", "The set of abnormal coded results for qualitative observations  that match the criteria of this set of qualified values.", 0, 1, abnormalCodedValueSet);
1390          case 2568457: /*criticalCodedValueSet*/  return new Property("criticalCodedValueSet", "canonical(ValueSet)", "The set of critical coded results for qualitative observations  that match the criteria of this set of qualified values.", 0, 1, criticalCodedValueSet);
1391          default: return super.getNamedProperty(_hash, _name, _checkValid);
1392          }
1393
1394        }
1395
1396      @Override
1397      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1398        switch (hash) {
1399        case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // CodeableConcept
1400        case -2089924569: /*appliesTo*/ return this.appliesTo == null ? new Base[0] : this.appliesTo.toArray(new Base[this.appliesTo.size()]); // CodeableConcept
1401        case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // Enumeration<AdministrativeGender>
1402        case 96511: /*age*/ return this.age == null ? new Base[0] : new Base[] {this.age}; // Range
1403        case -241217538: /*gestationalAge*/ return this.gestationalAge == null ? new Base[0] : new Base[] {this.gestationalAge}; // Range
1404        case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // StringType
1405        case -363410085: /*rangeCategory*/ return this.rangeCategory == null ? new Base[0] : new Base[] {this.rangeCategory}; // Enumeration<ObservationRangeCategory>
1406        case 108280125: /*range*/ return this.range == null ? new Base[0] : new Base[] {this.range}; // Range
1407        case 1374640076: /*validCodedValueSet*/ return this.validCodedValueSet == null ? new Base[0] : new Base[] {this.validCodedValueSet}; // CanonicalType
1408        case -837500735: /*normalCodedValueSet*/ return this.normalCodedValueSet == null ? new Base[0] : new Base[] {this.normalCodedValueSet}; // CanonicalType
1409        case 1073600256: /*abnormalCodedValueSet*/ return this.abnormalCodedValueSet == null ? new Base[0] : new Base[] {this.abnormalCodedValueSet}; // CanonicalType
1410        case 2568457: /*criticalCodedValueSet*/ return this.criticalCodedValueSet == null ? new Base[0] : new Base[] {this.criticalCodedValueSet}; // CanonicalType
1411        default: return super.getProperty(hash, name, checkValid);
1412        }
1413
1414      }
1415
1416      @Override
1417      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1418        switch (hash) {
1419        case 951530927: // context
1420          this.context = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1421          return value;
1422        case -2089924569: // appliesTo
1423          this.getAppliesTo().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1424          return value;
1425        case -1249512767: // gender
1426          value = new AdministrativeGenderEnumFactory().fromType(TypeConvertor.castToCode(value));
1427          this.gender = (Enumeration) value; // Enumeration<AdministrativeGender>
1428          return value;
1429        case 96511: // age
1430          this.age = TypeConvertor.castToRange(value); // Range
1431          return value;
1432        case -241217538: // gestationalAge
1433          this.gestationalAge = TypeConvertor.castToRange(value); // Range
1434          return value;
1435        case -861311717: // condition
1436          this.condition = TypeConvertor.castToString(value); // StringType
1437          return value;
1438        case -363410085: // rangeCategory
1439          value = new ObservationRangeCategoryEnumFactory().fromType(TypeConvertor.castToCode(value));
1440          this.rangeCategory = (Enumeration) value; // Enumeration<ObservationRangeCategory>
1441          return value;
1442        case 108280125: // range
1443          this.range = TypeConvertor.castToRange(value); // Range
1444          return value;
1445        case 1374640076: // validCodedValueSet
1446          this.validCodedValueSet = TypeConvertor.castToCanonical(value); // CanonicalType
1447          return value;
1448        case -837500735: // normalCodedValueSet
1449          this.normalCodedValueSet = TypeConvertor.castToCanonical(value); // CanonicalType
1450          return value;
1451        case 1073600256: // abnormalCodedValueSet
1452          this.abnormalCodedValueSet = TypeConvertor.castToCanonical(value); // CanonicalType
1453          return value;
1454        case 2568457: // criticalCodedValueSet
1455          this.criticalCodedValueSet = TypeConvertor.castToCanonical(value); // CanonicalType
1456          return value;
1457        default: return super.setProperty(hash, name, value);
1458        }
1459
1460      }
1461
1462      @Override
1463      public Base setProperty(String name, Base value) throws FHIRException {
1464        if (name.equals("context")) {
1465          this.context = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1466        } else if (name.equals("appliesTo")) {
1467          this.getAppliesTo().add(TypeConvertor.castToCodeableConcept(value));
1468        } else if (name.equals("gender")) {
1469          value = new AdministrativeGenderEnumFactory().fromType(TypeConvertor.castToCode(value));
1470          this.gender = (Enumeration) value; // Enumeration<AdministrativeGender>
1471        } else if (name.equals("age")) {
1472          this.age = TypeConvertor.castToRange(value); // Range
1473        } else if (name.equals("gestationalAge")) {
1474          this.gestationalAge = TypeConvertor.castToRange(value); // Range
1475        } else if (name.equals("condition")) {
1476          this.condition = TypeConvertor.castToString(value); // StringType
1477        } else if (name.equals("rangeCategory")) {
1478          value = new ObservationRangeCategoryEnumFactory().fromType(TypeConvertor.castToCode(value));
1479          this.rangeCategory = (Enumeration) value; // Enumeration<ObservationRangeCategory>
1480        } else if (name.equals("range")) {
1481          this.range = TypeConvertor.castToRange(value); // Range
1482        } else if (name.equals("validCodedValueSet")) {
1483          this.validCodedValueSet = TypeConvertor.castToCanonical(value); // CanonicalType
1484        } else if (name.equals("normalCodedValueSet")) {
1485          this.normalCodedValueSet = TypeConvertor.castToCanonical(value); // CanonicalType
1486        } else if (name.equals("abnormalCodedValueSet")) {
1487          this.abnormalCodedValueSet = TypeConvertor.castToCanonical(value); // CanonicalType
1488        } else if (name.equals("criticalCodedValueSet")) {
1489          this.criticalCodedValueSet = TypeConvertor.castToCanonical(value); // CanonicalType
1490        } else
1491          return super.setProperty(name, value);
1492        return value;
1493      }
1494
1495      @Override
1496      public Base makeProperty(int hash, String name) throws FHIRException {
1497        switch (hash) {
1498        case 951530927:  return getContext();
1499        case -2089924569:  return addAppliesTo(); 
1500        case -1249512767:  return getGenderElement();
1501        case 96511:  return getAge();
1502        case -241217538:  return getGestationalAge();
1503        case -861311717:  return getConditionElement();
1504        case -363410085:  return getRangeCategoryElement();
1505        case 108280125:  return getRange();
1506        case 1374640076:  return getValidCodedValueSetElement();
1507        case -837500735:  return getNormalCodedValueSetElement();
1508        case 1073600256:  return getAbnormalCodedValueSetElement();
1509        case 2568457:  return getCriticalCodedValueSetElement();
1510        default: return super.makeProperty(hash, name);
1511        }
1512
1513      }
1514
1515      @Override
1516      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1517        switch (hash) {
1518        case 951530927: /*context*/ return new String[] {"CodeableConcept"};
1519        case -2089924569: /*appliesTo*/ return new String[] {"CodeableConcept"};
1520        case -1249512767: /*gender*/ return new String[] {"code"};
1521        case 96511: /*age*/ return new String[] {"Range"};
1522        case -241217538: /*gestationalAge*/ return new String[] {"Range"};
1523        case -861311717: /*condition*/ return new String[] {"string"};
1524        case -363410085: /*rangeCategory*/ return new String[] {"code"};
1525        case 108280125: /*range*/ return new String[] {"Range"};
1526        case 1374640076: /*validCodedValueSet*/ return new String[] {"canonical"};
1527        case -837500735: /*normalCodedValueSet*/ return new String[] {"canonical"};
1528        case 1073600256: /*abnormalCodedValueSet*/ return new String[] {"canonical"};
1529        case 2568457: /*criticalCodedValueSet*/ return new String[] {"canonical"};
1530        default: return super.getTypesForProperty(hash, name);
1531        }
1532
1533      }
1534
1535      @Override
1536      public Base addChild(String name) throws FHIRException {
1537        if (name.equals("context")) {
1538          this.context = new CodeableConcept();
1539          return this.context;
1540        }
1541        else if (name.equals("appliesTo")) {
1542          return addAppliesTo();
1543        }
1544        else if (name.equals("gender")) {
1545          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.qualifiedValue.gender");
1546        }
1547        else if (name.equals("age")) {
1548          this.age = new Range();
1549          return this.age;
1550        }
1551        else if (name.equals("gestationalAge")) {
1552          this.gestationalAge = new Range();
1553          return this.gestationalAge;
1554        }
1555        else if (name.equals("condition")) {
1556          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.qualifiedValue.condition");
1557        }
1558        else if (name.equals("rangeCategory")) {
1559          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.qualifiedValue.rangeCategory");
1560        }
1561        else if (name.equals("range")) {
1562          this.range = new Range();
1563          return this.range;
1564        }
1565        else if (name.equals("validCodedValueSet")) {
1566          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.qualifiedValue.validCodedValueSet");
1567        }
1568        else if (name.equals("normalCodedValueSet")) {
1569          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.qualifiedValue.normalCodedValueSet");
1570        }
1571        else if (name.equals("abnormalCodedValueSet")) {
1572          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.qualifiedValue.abnormalCodedValueSet");
1573        }
1574        else if (name.equals("criticalCodedValueSet")) {
1575          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.qualifiedValue.criticalCodedValueSet");
1576        }
1577        else
1578          return super.addChild(name);
1579      }
1580
1581      public ObservationDefinitionQualifiedValueComponent copy() {
1582        ObservationDefinitionQualifiedValueComponent dst = new ObservationDefinitionQualifiedValueComponent();
1583        copyValues(dst);
1584        return dst;
1585      }
1586
1587      public void copyValues(ObservationDefinitionQualifiedValueComponent dst) {
1588        super.copyValues(dst);
1589        dst.context = context == null ? null : context.copy();
1590        if (appliesTo != null) {
1591          dst.appliesTo = new ArrayList<CodeableConcept>();
1592          for (CodeableConcept i : appliesTo)
1593            dst.appliesTo.add(i.copy());
1594        };
1595        dst.gender = gender == null ? null : gender.copy();
1596        dst.age = age == null ? null : age.copy();
1597        dst.gestationalAge = gestationalAge == null ? null : gestationalAge.copy();
1598        dst.condition = condition == null ? null : condition.copy();
1599        dst.rangeCategory = rangeCategory == null ? null : rangeCategory.copy();
1600        dst.range = range == null ? null : range.copy();
1601        dst.validCodedValueSet = validCodedValueSet == null ? null : validCodedValueSet.copy();
1602        dst.normalCodedValueSet = normalCodedValueSet == null ? null : normalCodedValueSet.copy();
1603        dst.abnormalCodedValueSet = abnormalCodedValueSet == null ? null : abnormalCodedValueSet.copy();
1604        dst.criticalCodedValueSet = criticalCodedValueSet == null ? null : criticalCodedValueSet.copy();
1605      }
1606
1607      @Override
1608      public boolean equalsDeep(Base other_) {
1609        if (!super.equalsDeep(other_))
1610          return false;
1611        if (!(other_ instanceof ObservationDefinitionQualifiedValueComponent))
1612          return false;
1613        ObservationDefinitionQualifiedValueComponent o = (ObservationDefinitionQualifiedValueComponent) other_;
1614        return compareDeep(context, o.context, true) && compareDeep(appliesTo, o.appliesTo, true) && compareDeep(gender, o.gender, true)
1615           && compareDeep(age, o.age, true) && compareDeep(gestationalAge, o.gestationalAge, true) && compareDeep(condition, o.condition, true)
1616           && compareDeep(rangeCategory, o.rangeCategory, true) && compareDeep(range, o.range, true) && compareDeep(validCodedValueSet, o.validCodedValueSet, true)
1617           && compareDeep(normalCodedValueSet, o.normalCodedValueSet, true) && compareDeep(abnormalCodedValueSet, o.abnormalCodedValueSet, true)
1618           && compareDeep(criticalCodedValueSet, o.criticalCodedValueSet, true);
1619      }
1620
1621      @Override
1622      public boolean equalsShallow(Base other_) {
1623        if (!super.equalsShallow(other_))
1624          return false;
1625        if (!(other_ instanceof ObservationDefinitionQualifiedValueComponent))
1626          return false;
1627        ObservationDefinitionQualifiedValueComponent o = (ObservationDefinitionQualifiedValueComponent) other_;
1628        return compareValues(gender, o.gender, true) && compareValues(condition, o.condition, true) && compareValues(rangeCategory, o.rangeCategory, true)
1629           && compareValues(validCodedValueSet, o.validCodedValueSet, true) && compareValues(normalCodedValueSet, o.normalCodedValueSet, true)
1630           && compareValues(abnormalCodedValueSet, o.abnormalCodedValueSet, true) && compareValues(criticalCodedValueSet, o.criticalCodedValueSet, true)
1631          ;
1632      }
1633
1634      public boolean isEmpty() {
1635        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(context, appliesTo, gender
1636          , age, gestationalAge, condition, rangeCategory, range, validCodedValueSet, normalCodedValueSet
1637          , abnormalCodedValueSet, criticalCodedValueSet);
1638      }
1639
1640  public String fhirType() {
1641    return "ObservationDefinition.qualifiedValue";
1642
1643  }
1644
1645  }
1646
1647    @Block()
1648    public static class ObservationDefinitionComponentComponent extends BackboneElement implements IBaseBackboneElement {
1649        /**
1650         * Describes what will be observed.
1651         */
1652        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
1653        @Description(shortDefinition="Type of observation", formalDefinition="Describes what will be observed." )
1654        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/observation-codes")
1655        protected CodeableConcept code;
1656
1657        /**
1658         * The data types allowed for the value element of the instance of this component observations.
1659         */
1660        @Child(name = "permittedDataType", type = {CodeType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1661        @Description(shortDefinition="Quantity | CodeableConcept | string | boolean | integer | Range | Ratio | SampledData | time | dateTime | Period", formalDefinition="The data types allowed for the value element of the instance of this component observations." )
1662        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/permitted-data-type")
1663        protected List<Enumeration<ObservationDataType>> permittedDataType;
1664
1665        /**
1666         * Characteristics for quantitative results of this observation.
1667         */
1668        @Child(name = "quantitativeDetails", type = {ObservationDefinitionQuantitativeDetailsComponent.class}, order=3, min=0, max=1, modifier=false, summary=false)
1669        @Description(shortDefinition="Characteristics of quantitative results", formalDefinition="Characteristics for quantitative results of this observation." )
1670        protected ObservationDefinitionQuantitativeDetailsComponent quantitativeDetails;
1671
1672        /**
1673         * A set of qualified values associated with a context and a set of conditions -  provides a range for quantitative and ordinal observations and a collection of value sets for qualitative observations.
1674         */
1675        @Child(name = "qualifiedValue", type = {ObservationDefinitionQualifiedValueComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1676        @Description(shortDefinition="Set of qualified values for observation results", formalDefinition="A set of qualified values associated with a context and a set of conditions -  provides a range for quantitative and ordinal observations and a collection of value sets for qualitative observations." )
1677        protected List<ObservationDefinitionQualifiedValueComponent> qualifiedValue;
1678
1679        private static final long serialVersionUID = -369470835L;
1680
1681    /**
1682     * Constructor
1683     */
1684      public ObservationDefinitionComponentComponent() {
1685        super();
1686      }
1687
1688    /**
1689     * Constructor
1690     */
1691      public ObservationDefinitionComponentComponent(CodeableConcept code) {
1692        super();
1693        this.setCode(code);
1694      }
1695
1696        /**
1697         * @return {@link #code} (Describes what will be observed.)
1698         */
1699        public CodeableConcept getCode() { 
1700          if (this.code == null)
1701            if (Configuration.errorOnAutoCreate())
1702              throw new Error("Attempt to auto-create ObservationDefinitionComponentComponent.code");
1703            else if (Configuration.doAutoCreate())
1704              this.code = new CodeableConcept(); // cc
1705          return this.code;
1706        }
1707
1708        public boolean hasCode() { 
1709          return this.code != null && !this.code.isEmpty();
1710        }
1711
1712        /**
1713         * @param value {@link #code} (Describes what will be observed.)
1714         */
1715        public ObservationDefinitionComponentComponent setCode(CodeableConcept value) { 
1716          this.code = value;
1717          return this;
1718        }
1719
1720        /**
1721         * @return {@link #permittedDataType} (The data types allowed for the value element of the instance of this component observations.)
1722         */
1723        public List<Enumeration<ObservationDataType>> getPermittedDataType() { 
1724          if (this.permittedDataType == null)
1725            this.permittedDataType = new ArrayList<Enumeration<ObservationDataType>>();
1726          return this.permittedDataType;
1727        }
1728
1729        /**
1730         * @return Returns a reference to <code>this</code> for easy method chaining
1731         */
1732        public ObservationDefinitionComponentComponent setPermittedDataType(List<Enumeration<ObservationDataType>> thePermittedDataType) { 
1733          this.permittedDataType = thePermittedDataType;
1734          return this;
1735        }
1736
1737        public boolean hasPermittedDataType() { 
1738          if (this.permittedDataType == null)
1739            return false;
1740          for (Enumeration<ObservationDataType> item : this.permittedDataType)
1741            if (!item.isEmpty())
1742              return true;
1743          return false;
1744        }
1745
1746        /**
1747         * @return {@link #permittedDataType} (The data types allowed for the value element of the instance of this component observations.)
1748         */
1749        public Enumeration<ObservationDataType> addPermittedDataTypeElement() {//2 
1750          Enumeration<ObservationDataType> t = new Enumeration<ObservationDataType>(new ObservationDataTypeEnumFactory());
1751          if (this.permittedDataType == null)
1752            this.permittedDataType = new ArrayList<Enumeration<ObservationDataType>>();
1753          this.permittedDataType.add(t);
1754          return t;
1755        }
1756
1757        /**
1758         * @param value {@link #permittedDataType} (The data types allowed for the value element of the instance of this component observations.)
1759         */
1760        public ObservationDefinitionComponentComponent addPermittedDataType(ObservationDataType value) { //1
1761          Enumeration<ObservationDataType> t = new Enumeration<ObservationDataType>(new ObservationDataTypeEnumFactory());
1762          t.setValue(value);
1763          if (this.permittedDataType == null)
1764            this.permittedDataType = new ArrayList<Enumeration<ObservationDataType>>();
1765          this.permittedDataType.add(t);
1766          return this;
1767        }
1768
1769        /**
1770         * @param value {@link #permittedDataType} (The data types allowed for the value element of the instance of this component observations.)
1771         */
1772        public boolean hasPermittedDataType(ObservationDataType value) { 
1773          if (this.permittedDataType == null)
1774            return false;
1775          for (Enumeration<ObservationDataType> v : this.permittedDataType)
1776            if (v.getValue().equals(value)) // code
1777              return true;
1778          return false;
1779        }
1780
1781        /**
1782         * @return {@link #quantitativeDetails} (Characteristics for quantitative results of this observation.)
1783         */
1784        public ObservationDefinitionQuantitativeDetailsComponent getQuantitativeDetails() { 
1785          if (this.quantitativeDetails == null)
1786            if (Configuration.errorOnAutoCreate())
1787              throw new Error("Attempt to auto-create ObservationDefinitionComponentComponent.quantitativeDetails");
1788            else if (Configuration.doAutoCreate())
1789              this.quantitativeDetails = new ObservationDefinitionQuantitativeDetailsComponent(); // cc
1790          return this.quantitativeDetails;
1791        }
1792
1793        public boolean hasQuantitativeDetails() { 
1794          return this.quantitativeDetails != null && !this.quantitativeDetails.isEmpty();
1795        }
1796
1797        /**
1798         * @param value {@link #quantitativeDetails} (Characteristics for quantitative results of this observation.)
1799         */
1800        public ObservationDefinitionComponentComponent setQuantitativeDetails(ObservationDefinitionQuantitativeDetailsComponent value) { 
1801          this.quantitativeDetails = value;
1802          return this;
1803        }
1804
1805        /**
1806         * @return {@link #qualifiedValue} (A set of qualified values associated with a context and a set of conditions -  provides a range for quantitative and ordinal observations and a collection of value sets for qualitative observations.)
1807         */
1808        public List<ObservationDefinitionQualifiedValueComponent> getQualifiedValue() { 
1809          if (this.qualifiedValue == null)
1810            this.qualifiedValue = new ArrayList<ObservationDefinitionQualifiedValueComponent>();
1811          return this.qualifiedValue;
1812        }
1813
1814        /**
1815         * @return Returns a reference to <code>this</code> for easy method chaining
1816         */
1817        public ObservationDefinitionComponentComponent setQualifiedValue(List<ObservationDefinitionQualifiedValueComponent> theQualifiedValue) { 
1818          this.qualifiedValue = theQualifiedValue;
1819          return this;
1820        }
1821
1822        public boolean hasQualifiedValue() { 
1823          if (this.qualifiedValue == null)
1824            return false;
1825          for (ObservationDefinitionQualifiedValueComponent item : this.qualifiedValue)
1826            if (!item.isEmpty())
1827              return true;
1828          return false;
1829        }
1830
1831        public ObservationDefinitionQualifiedValueComponent addQualifiedValue() { //3
1832          ObservationDefinitionQualifiedValueComponent t = new ObservationDefinitionQualifiedValueComponent();
1833          if (this.qualifiedValue == null)
1834            this.qualifiedValue = new ArrayList<ObservationDefinitionQualifiedValueComponent>();
1835          this.qualifiedValue.add(t);
1836          return t;
1837        }
1838
1839        public ObservationDefinitionComponentComponent addQualifiedValue(ObservationDefinitionQualifiedValueComponent t) { //3
1840          if (t == null)
1841            return this;
1842          if (this.qualifiedValue == null)
1843            this.qualifiedValue = new ArrayList<ObservationDefinitionQualifiedValueComponent>();
1844          this.qualifiedValue.add(t);
1845          return this;
1846        }
1847
1848        /**
1849         * @return The first repetition of repeating field {@link #qualifiedValue}, creating it if it does not already exist {3}
1850         */
1851        public ObservationDefinitionQualifiedValueComponent getQualifiedValueFirstRep() { 
1852          if (getQualifiedValue().isEmpty()) {
1853            addQualifiedValue();
1854          }
1855          return getQualifiedValue().get(0);
1856        }
1857
1858        protected void listChildren(List<Property> children) {
1859          super.listChildren(children);
1860          children.add(new Property("code", "CodeableConcept", "Describes what will be observed.", 0, 1, code));
1861          children.add(new Property("permittedDataType", "code", "The data types allowed for the value element of the instance of this component observations.", 0, java.lang.Integer.MAX_VALUE, permittedDataType));
1862          children.add(new Property("quantitativeDetails", "@ObservationDefinition.quantitativeDetails", "Characteristics for quantitative results of this observation.", 0, 1, quantitativeDetails));
1863          children.add(new Property("qualifiedValue", "@ObservationDefinition.qualifiedValue", "A set of qualified values associated with a context and a set of conditions -  provides a range for quantitative and ordinal observations and a collection of value sets for qualitative observations.", 0, java.lang.Integer.MAX_VALUE, qualifiedValue));
1864        }
1865
1866        @Override
1867        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1868          switch (_hash) {
1869          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "Describes what will be observed.", 0, 1, code);
1870          case -99492804: /*permittedDataType*/  return new Property("permittedDataType", "code", "The data types allowed for the value element of the instance of this component observations.", 0, java.lang.Integer.MAX_VALUE, permittedDataType);
1871          case 842150763: /*quantitativeDetails*/  return new Property("quantitativeDetails", "@ObservationDefinition.quantitativeDetails", "Characteristics for quantitative results of this observation.", 0, 1, quantitativeDetails);
1872          case -558517707: /*qualifiedValue*/  return new Property("qualifiedValue", "@ObservationDefinition.qualifiedValue", "A set of qualified values associated with a context and a set of conditions -  provides a range for quantitative and ordinal observations and a collection of value sets for qualitative observations.", 0, java.lang.Integer.MAX_VALUE, qualifiedValue);
1873          default: return super.getNamedProperty(_hash, _name, _checkValid);
1874          }
1875
1876        }
1877
1878      @Override
1879      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1880        switch (hash) {
1881        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
1882        case -99492804: /*permittedDataType*/ return this.permittedDataType == null ? new Base[0] : this.permittedDataType.toArray(new Base[this.permittedDataType.size()]); // Enumeration<ObservationDataType>
1883        case 842150763: /*quantitativeDetails*/ return this.quantitativeDetails == null ? new Base[0] : new Base[] {this.quantitativeDetails}; // ObservationDefinitionQuantitativeDetailsComponent
1884        case -558517707: /*qualifiedValue*/ return this.qualifiedValue == null ? new Base[0] : this.qualifiedValue.toArray(new Base[this.qualifiedValue.size()]); // ObservationDefinitionQualifiedValueComponent
1885        default: return super.getProperty(hash, name, checkValid);
1886        }
1887
1888      }
1889
1890      @Override
1891      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1892        switch (hash) {
1893        case 3059181: // code
1894          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1895          return value;
1896        case -99492804: // permittedDataType
1897          value = new ObservationDataTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1898          this.getPermittedDataType().add((Enumeration) value); // Enumeration<ObservationDataType>
1899          return value;
1900        case 842150763: // quantitativeDetails
1901          this.quantitativeDetails = (ObservationDefinitionQuantitativeDetailsComponent) value; // ObservationDefinitionQuantitativeDetailsComponent
1902          return value;
1903        case -558517707: // qualifiedValue
1904          this.getQualifiedValue().add((ObservationDefinitionQualifiedValueComponent) value); // ObservationDefinitionQualifiedValueComponent
1905          return value;
1906        default: return super.setProperty(hash, name, value);
1907        }
1908
1909      }
1910
1911      @Override
1912      public Base setProperty(String name, Base value) throws FHIRException {
1913        if (name.equals("code")) {
1914          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1915        } else if (name.equals("permittedDataType")) {
1916          value = new ObservationDataTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1917          this.getPermittedDataType().add((Enumeration) value);
1918        } else if (name.equals("quantitativeDetails")) {
1919          this.quantitativeDetails = (ObservationDefinitionQuantitativeDetailsComponent) value; // ObservationDefinitionQuantitativeDetailsComponent
1920        } else if (name.equals("qualifiedValue")) {
1921          this.getQualifiedValue().add((ObservationDefinitionQualifiedValueComponent) value);
1922        } else
1923          return super.setProperty(name, value);
1924        return value;
1925      }
1926
1927      @Override
1928      public Base makeProperty(int hash, String name) throws FHIRException {
1929        switch (hash) {
1930        case 3059181:  return getCode();
1931        case -99492804:  return addPermittedDataTypeElement();
1932        case 842150763:  return getQuantitativeDetails();
1933        case -558517707:  return addQualifiedValue(); 
1934        default: return super.makeProperty(hash, name);
1935        }
1936
1937      }
1938
1939      @Override
1940      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1941        switch (hash) {
1942        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1943        case -99492804: /*permittedDataType*/ return new String[] {"code"};
1944        case 842150763: /*quantitativeDetails*/ return new String[] {"@ObservationDefinition.quantitativeDetails"};
1945        case -558517707: /*qualifiedValue*/ return new String[] {"@ObservationDefinition.qualifiedValue"};
1946        default: return super.getTypesForProperty(hash, name);
1947        }
1948
1949      }
1950
1951      @Override
1952      public Base addChild(String name) throws FHIRException {
1953        if (name.equals("code")) {
1954          this.code = new CodeableConcept();
1955          return this.code;
1956        }
1957        else if (name.equals("permittedDataType")) {
1958          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.component.permittedDataType");
1959        }
1960        else if (name.equals("quantitativeDetails")) {
1961          this.quantitativeDetails = new ObservationDefinitionQuantitativeDetailsComponent();
1962          return this.quantitativeDetails;
1963        }
1964        else if (name.equals("qualifiedValue")) {
1965          return addQualifiedValue();
1966        }
1967        else
1968          return super.addChild(name);
1969      }
1970
1971      public ObservationDefinitionComponentComponent copy() {
1972        ObservationDefinitionComponentComponent dst = new ObservationDefinitionComponentComponent();
1973        copyValues(dst);
1974        return dst;
1975      }
1976
1977      public void copyValues(ObservationDefinitionComponentComponent dst) {
1978        super.copyValues(dst);
1979        dst.code = code == null ? null : code.copy();
1980        if (permittedDataType != null) {
1981          dst.permittedDataType = new ArrayList<Enumeration<ObservationDataType>>();
1982          for (Enumeration<ObservationDataType> i : permittedDataType)
1983            dst.permittedDataType.add(i.copy());
1984        };
1985        dst.quantitativeDetails = quantitativeDetails == null ? null : quantitativeDetails.copy();
1986        if (qualifiedValue != null) {
1987          dst.qualifiedValue = new ArrayList<ObservationDefinitionQualifiedValueComponent>();
1988          for (ObservationDefinitionQualifiedValueComponent i : qualifiedValue)
1989            dst.qualifiedValue.add(i.copy());
1990        };
1991      }
1992
1993      @Override
1994      public boolean equalsDeep(Base other_) {
1995        if (!super.equalsDeep(other_))
1996          return false;
1997        if (!(other_ instanceof ObservationDefinitionComponentComponent))
1998          return false;
1999        ObservationDefinitionComponentComponent o = (ObservationDefinitionComponentComponent) other_;
2000        return compareDeep(code, o.code, true) && compareDeep(permittedDataType, o.permittedDataType, true)
2001           && compareDeep(quantitativeDetails, o.quantitativeDetails, true) && compareDeep(qualifiedValue, o.qualifiedValue, true)
2002          ;
2003      }
2004
2005      @Override
2006      public boolean equalsShallow(Base other_) {
2007        if (!super.equalsShallow(other_))
2008          return false;
2009        if (!(other_ instanceof ObservationDefinitionComponentComponent))
2010          return false;
2011        ObservationDefinitionComponentComponent o = (ObservationDefinitionComponentComponent) other_;
2012        return compareValues(permittedDataType, o.permittedDataType, true);
2013      }
2014
2015      public boolean isEmpty() {
2016        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, permittedDataType, quantitativeDetails
2017          , qualifiedValue);
2018      }
2019
2020  public String fhirType() {
2021    return "ObservationDefinition.component";
2022
2023  }
2024
2025  }
2026
2027    /**
2028     * An absolute URL that is used to identify this ObservationDefinition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this ObservationDefinition is (or will be) published. The URL SHOULD include the major version of the ObservationDefinition. For more information see Technical and Business Versions.
2029     */
2030    @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true)
2031    @Description(shortDefinition="Logical canonical URL to reference this ObservationDefinition (globally unique)", formalDefinition="An absolute URL that is used to identify this ObservationDefinition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this ObservationDefinition is (or will be) published. The URL SHOULD include the major version of the ObservationDefinition. For more information see Technical and Business Versions." )
2032    protected UriType url;
2033
2034    /**
2035     * Business identifiers assigned to this ObservationDefinition. by the performer and/or other systems. These identifiers remain constant as the resource is updated and propagates from server to server.
2036     */
2037    @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true)
2038    @Description(shortDefinition="Business identifier of the ObservationDefinition", formalDefinition="Business identifiers assigned to this ObservationDefinition. by the performer and/or other systems. These identifiers remain constant as the resource is updated and propagates from server to server." )
2039    protected Identifier identifier;
2040
2041    /**
2042     * The identifier that is used to identify this version of the ObservationDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the ObservationDefinition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions are orderable.
2043     */
2044    @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
2045    @Description(shortDefinition="Business version of the ObservationDefinition", formalDefinition="The identifier that is used to identify this version of the ObservationDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the ObservationDefinition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions are orderable." )
2046    protected StringType version;
2047
2048    /**
2049     * A natural language name identifying the ObservationDefinition. This name should be usable as an identifier for the module by machine processing applications such as code generation.
2050     */
2051    @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
2052    @Description(shortDefinition="Name for this ObservationDefinition (computer friendly)", formalDefinition="A natural language name identifying the ObservationDefinition. This name should be usable as an identifier for the module by machine processing applications such as code generation." )
2053    protected StringType name;
2054
2055    /**
2056     * A short, descriptive, user-friendly title for the ObservationDefinition.
2057     */
2058    @Child(name = "title", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
2059    @Description(shortDefinition="Name for this ObservationDefinition (human friendly)", formalDefinition="A short, descriptive, user-friendly title for the ObservationDefinition." )
2060    protected StringType title;
2061
2062    /**
2063     * The current state of the ObservationDefinition.
2064     */
2065    @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1, modifier=true, summary=true)
2066    @Description(shortDefinition="draft | active | retired | unknown", formalDefinition="The current state of the ObservationDefinition." )
2067    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status")
2068    protected Enumeration<PublicationStatus> status;
2069
2070    /**
2071     * A flag to indicate that this ObservationDefinition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
2072     */
2073    @Child(name = "experimental", type = {BooleanType.class}, order=6, min=0, max=1, modifier=true, summary=true)
2074    @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="A flag to indicate that this ObservationDefinition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." )
2075    protected BooleanType experimental;
2076
2077    /**
2078     * The date (and optionally time) when the ObservationDefinition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ObservationDefinition changes.
2079     */
2080    @Child(name = "date", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true)
2081    @Description(shortDefinition="Date last changed", formalDefinition="The date (and optionally time) when the ObservationDefinition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ObservationDefinition changes." )
2082    protected DateTimeType date;
2083
2084    /**
2085     * Helps establish the "authority/credibility" of the ObservationDefinition. May also allow for contact.
2086     */
2087    @Child(name = "publisher", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=8, min=0, max=1, modifier=false, summary=true)
2088    @Description(shortDefinition="The name of the individual or organization that published the ObservationDefinition", formalDefinition="Helps establish the \"authority/credibility\" of the ObservationDefinition. May also allow for contact." )
2089    protected Reference publisher;
2090
2091    /**
2092     * Contact details to assist a user in finding and communicating with the publisher.
2093     */
2094    @Child(name = "contact", type = {ContactDetail.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2095    @Description(shortDefinition="Contact details for the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." )
2096    protected List<ContactDetail> contact;
2097
2098    /**
2099     * A free text natural language description of the ObservationDefinition from the consumer's perspective.
2100     */
2101    @Child(name = "description", type = {MarkdownType.class}, order=10, min=0, max=1, modifier=false, summary=false)
2102    @Description(shortDefinition="Natural language description of the ObservationDefinition", formalDefinition="A free text natural language description of the ObservationDefinition from the consumer's perspective." )
2103    protected MarkdownType description;
2104
2105    /**
2106     * The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate ObservationDefinition instances.
2107     */
2108    @Child(name = "useContext", type = {UsageContext.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2109    @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate ObservationDefinition instances." )
2110    protected List<UsageContext> useContext;
2111
2112    /**
2113     * A jurisdiction in which the ObservationDefinition is intended to be used.
2114     */
2115    @Child(name = "jurisdiction", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2116    @Description(shortDefinition="Intended jurisdiction for this ObservationDefinition (if applicable)", formalDefinition="A jurisdiction in which the ObservationDefinition is intended to be used." )
2117    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/jurisdiction")
2118    protected List<CodeableConcept> jurisdiction;
2119
2120    /**
2121     * Explains why this ObservationDefinition is needed and why it has been designed as it has.
2122     */
2123    @Child(name = "purpose", type = {MarkdownType.class}, order=13, min=0, max=1, modifier=false, summary=false)
2124    @Description(shortDefinition="Why this ObservationDefinition is defined", formalDefinition="Explains why this ObservationDefinition is needed and why it has been designed as it has." )
2125    protected MarkdownType purpose;
2126
2127    /**
2128     * Copyright statement relating to the ObservationDefinition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the ObservationDefinition.
2129     */
2130    @Child(name = "copyright", type = {MarkdownType.class}, order=14, min=0, max=1, modifier=false, summary=false)
2131    @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="Copyright statement relating to the ObservationDefinition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the ObservationDefinition." )
2132    protected MarkdownType copyright;
2133
2134    /**
2135     * The date on which the asset content was approved by the publisher. Approval happens once when the content is officially approved for usage.
2136     */
2137    @Child(name = "approvalDate", type = {DateType.class}, order=15, min=0, max=1, modifier=false, summary=false)
2138    @Description(shortDefinition="When ObservationDefinition was approved by publisher", formalDefinition="The date on which the asset content was approved by the publisher. Approval happens once when the content is officially approved for usage." )
2139    protected DateType approvalDate;
2140
2141    /**
2142     * The date on which the asset content was last reviewed. Review happens periodically after that, but doesn't change the original approval date.
2143     */
2144    @Child(name = "lastReviewDate", type = {DateType.class}, order=16, min=0, max=1, modifier=false, summary=false)
2145    @Description(shortDefinition="Date on which the asset content was last reviewed", formalDefinition="The date on which the asset content was last reviewed. Review happens periodically after that, but doesn't change the original approval date." )
2146    protected DateType lastReviewDate;
2147
2148    /**
2149     * The period during which the ObservationDefinition content was or is planned to be effective.
2150     */
2151    @Child(name = "effectivePeriod", type = {Period.class}, order=17, min=0, max=1, modifier=false, summary=true)
2152    @Description(shortDefinition="The effective date range for the ObservationDefinition", formalDefinition="The period during which the ObservationDefinition content was or is planned to be effective." )
2153    protected Period effectivePeriod;
2154
2155    /**
2156     * The canonical URL pointing to another FHIR-defined ObservationDefinition that is adhered to in whole or in part by this definition.
2157     */
2158    @Child(name = "derivedFromCanonical", type = {CanonicalType.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2159    @Description(shortDefinition="Based on FHIR definition of another observation", formalDefinition="The canonical URL pointing to another FHIR-defined ObservationDefinition that is adhered to in whole or in part by this definition." )
2160    protected List<CanonicalType> derivedFromCanonical;
2161
2162    /**
2163     * The URL pointing to an externally-defined observation definition, guideline or other definition that is adhered to in whole or in part by this definition.
2164     */
2165    @Child(name = "derivedFromUri", type = {UriType.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2166    @Description(shortDefinition="Based on external definition", formalDefinition="The URL pointing to an externally-defined observation definition, guideline or other definition that is adhered to in whole or in part by this definition." )
2167    protected List<UriType> derivedFromUri;
2168
2169    /**
2170     * A code that describes the intended kind of subject of Observation instances conforming to this ObservationDefinition.
2171     */
2172    @Child(name = "subject", type = {CodeableConcept.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2173    @Description(shortDefinition="Type of subject for the defined observation", formalDefinition="A code that describes the intended kind of subject of Observation instances conforming to this ObservationDefinition." )
2174    protected List<CodeableConcept> subject;
2175
2176    /**
2177     * The type of individual/organization/device that is expected to act upon instances of this definition.
2178     */
2179    @Child(name = "performerType", type = {CodeableConcept.class}, order=21, min=0, max=1, modifier=false, summary=true)
2180    @Description(shortDefinition="Desired kind of performer for such kind of observation", formalDefinition="The type of individual/organization/device that is expected to act upon instances of this definition." )
2181    protected CodeableConcept performerType;
2182
2183    /**
2184     * A code that classifies the general type of observation.
2185     */
2186    @Child(name = "category", type = {CodeableConcept.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2187    @Description(shortDefinition="General type of observation", formalDefinition="A code that classifies the general type of observation." )
2188    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/observation-category")
2189    protected List<CodeableConcept> category;
2190
2191    /**
2192     * Describes what will be observed. Sometimes this is called the observation "name".
2193     */
2194    @Child(name = "code", type = {CodeableConcept.class}, order=23, min=1, max=1, modifier=false, summary=true)
2195    @Description(shortDefinition="Type of observation", formalDefinition="Describes what will be observed. Sometimes this is called the observation \"name\"." )
2196    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/observation-codes")
2197    protected CodeableConcept code;
2198
2199    /**
2200     * The data types allowed for the value element of the instance observations conforming to this ObservationDefinition.
2201     */
2202    @Child(name = "permittedDataType", type = {CodeType.class}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2203    @Description(shortDefinition="Quantity | CodeableConcept | string | boolean | integer | Range | Ratio | SampledData | time | dateTime | Period", formalDefinition="The data types allowed for the value element of the instance observations conforming to this ObservationDefinition." )
2204    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/permitted-data-type")
2205    protected List<Enumeration<ObservationDataType>> permittedDataType;
2206
2207    /**
2208     * Multiple results allowed for observations conforming to this ObservationDefinition.
2209     */
2210    @Child(name = "multipleResultsAllowed", type = {BooleanType.class}, order=25, min=0, max=1, modifier=false, summary=false)
2211    @Description(shortDefinition="Multiple results allowed for conforming observations", formalDefinition="Multiple results allowed for observations conforming to this ObservationDefinition." )
2212    protected BooleanType multipleResultsAllowed;
2213
2214    /**
2215     * The site on the subject's body where the  observation is to be made.
2216     */
2217    @Child(name = "bodySite", type = {CodeableConcept.class}, order=26, min=0, max=1, modifier=false, summary=false)
2218    @Description(shortDefinition="Body part to be observed", formalDefinition="The site on the subject's body where the  observation is to be made." )
2219    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/body-site")
2220    protected CodeableConcept bodySite;
2221
2222    /**
2223     * The method or technique used to perform the observation.
2224     */
2225    @Child(name = "method", type = {CodeableConcept.class}, order=27, min=0, max=1, modifier=false, summary=false)
2226    @Description(shortDefinition="Method used to produce the observation", formalDefinition="The method or technique used to perform the observation." )
2227    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/observation-methods")
2228    protected CodeableConcept method;
2229
2230    /**
2231     * The kind of specimen that this type of observation is produced on.
2232     */
2233    @Child(name = "specimen", type = {SpecimenDefinition.class}, order=28, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2234    @Description(shortDefinition="Kind of specimen used by this type of observation", formalDefinition="The kind of specimen that this type of observation is produced on." )
2235    protected List<Reference> specimen;
2236
2237    /**
2238     * The measurement model of device or actual device used to produce observations of this type.
2239     */
2240    @Child(name = "device", type = {DeviceDefinition.class, Device.class}, order=29, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2241    @Description(shortDefinition="Measurement device or model of device", formalDefinition="The measurement model of device or actual device used to produce observations of this type." )
2242    protected List<Reference> device;
2243
2244    /**
2245     * The preferred name to be used when reporting the results of observations conforming to this ObservationDefinition.
2246     */
2247    @Child(name = "preferredReportName", type = {StringType.class}, order=30, min=0, max=1, modifier=false, summary=false)
2248    @Description(shortDefinition="The preferred name to be used when reporting the observation results", formalDefinition="The preferred name to be used when reporting the results of observations conforming to this ObservationDefinition." )
2249    protected StringType preferredReportName;
2250
2251    /**
2252     * Characteristics for quantitative results of observations conforming to this ObservationDefinition.
2253     */
2254    @Child(name = "quantitativeDetails", type = {}, order=31, min=0, max=1, modifier=false, summary=false)
2255    @Description(shortDefinition="Characteristics of quantitative results", formalDefinition="Characteristics for quantitative results of observations conforming to this ObservationDefinition." )
2256    protected ObservationDefinitionQuantitativeDetailsComponent quantitativeDetails;
2257
2258    /**
2259     * A set of qualified values associated with a context and a set of conditions -  provides a range for quantitative and ordinal observations and a collection of value sets for qualitative observations.
2260     */
2261    @Child(name = "qualifiedValue", type = {}, order=32, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2262    @Description(shortDefinition="Set of qualified values for observation results", formalDefinition="A set of qualified values associated with a context and a set of conditions -  provides a range for quantitative and ordinal observations and a collection of value sets for qualitative observations." )
2263    protected List<ObservationDefinitionQualifiedValueComponent> qualifiedValue;
2264
2265    /**
2266     * This ObservationDefinition defines 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.
2267     */
2268    @Child(name = "hasMember", type = {ObservationDefinition.class, Questionnaire.class}, order=33, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2269    @Description(shortDefinition="Definitions of related resources belonging to this kind of observation group", formalDefinition="This ObservationDefinition defines 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." )
2270    protected List<Reference> hasMember;
2271
2272    /**
2273     * Some observations have multiple component observations, expressed as separate code value pairs.
2274     */
2275    @Child(name = "component", type = {}, order=34, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2276    @Description(shortDefinition="Component results", formalDefinition="Some observations have multiple component observations, expressed as separate code value pairs." )
2277    protected List<ObservationDefinitionComponentComponent> component;
2278
2279    private static final long serialVersionUID = 1085308569L;
2280
2281  /**
2282   * Constructor
2283   */
2284    public ObservationDefinition() {
2285      super();
2286    }
2287
2288  /**
2289   * Constructor
2290   */
2291    public ObservationDefinition(PublicationStatus status, CodeableConcept code) {
2292      super();
2293      this.setStatus(status);
2294      this.setCode(code);
2295    }
2296
2297    /**
2298     * @return {@link #url} (An absolute URL that is used to identify this ObservationDefinition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this ObservationDefinition is (or will be) published. The URL SHOULD include the major version of the ObservationDefinition. For more information see Technical and Business Versions.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
2299     */
2300    public UriType getUrlElement() { 
2301      if (this.url == null)
2302        if (Configuration.errorOnAutoCreate())
2303          throw new Error("Attempt to auto-create ObservationDefinition.url");
2304        else if (Configuration.doAutoCreate())
2305          this.url = new UriType(); // bb
2306      return this.url;
2307    }
2308
2309    public boolean hasUrlElement() { 
2310      return this.url != null && !this.url.isEmpty();
2311    }
2312
2313    public boolean hasUrl() { 
2314      return this.url != null && !this.url.isEmpty();
2315    }
2316
2317    /**
2318     * @param value {@link #url} (An absolute URL that is used to identify this ObservationDefinition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this ObservationDefinition is (or will be) published. The URL SHOULD include the major version of the ObservationDefinition. For more information see Technical and Business Versions.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
2319     */
2320    public ObservationDefinition setUrlElement(UriType value) { 
2321      this.url = value;
2322      return this;
2323    }
2324
2325    /**
2326     * @return An absolute URL that is used to identify this ObservationDefinition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this ObservationDefinition is (or will be) published. The URL SHOULD include the major version of the ObservationDefinition. For more information see Technical and Business Versions.
2327     */
2328    public String getUrl() { 
2329      return this.url == null ? null : this.url.getValue();
2330    }
2331
2332    /**
2333     * @param value An absolute URL that is used to identify this ObservationDefinition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this ObservationDefinition is (or will be) published. The URL SHOULD include the major version of the ObservationDefinition. For more information see Technical and Business Versions.
2334     */
2335    public ObservationDefinition setUrl(String value) { 
2336      if (Utilities.noString(value))
2337        this.url = null;
2338      else {
2339        if (this.url == null)
2340          this.url = new UriType();
2341        this.url.setValue(value);
2342      }
2343      return this;
2344    }
2345
2346    /**
2347     * @return {@link #identifier} (Business identifiers assigned to this ObservationDefinition. by the performer and/or other systems. These identifiers remain constant as the resource is updated and propagates from server to server.)
2348     */
2349    public Identifier getIdentifier() { 
2350      if (this.identifier == null)
2351        if (Configuration.errorOnAutoCreate())
2352          throw new Error("Attempt to auto-create ObservationDefinition.identifier");
2353        else if (Configuration.doAutoCreate())
2354          this.identifier = new Identifier(); // cc
2355      return this.identifier;
2356    }
2357
2358    public boolean hasIdentifier() { 
2359      return this.identifier != null && !this.identifier.isEmpty();
2360    }
2361
2362    /**
2363     * @param value {@link #identifier} (Business identifiers assigned to this ObservationDefinition. by the performer and/or other systems. These identifiers remain constant as the resource is updated and propagates from server to server.)
2364     */
2365    public ObservationDefinition setIdentifier(Identifier value) { 
2366      this.identifier = value;
2367      return this;
2368    }
2369
2370    /**
2371     * @return {@link #version} (The identifier that is used to identify this version of the ObservationDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the ObservationDefinition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions are orderable.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
2372     */
2373    public StringType getVersionElement() { 
2374      if (this.version == null)
2375        if (Configuration.errorOnAutoCreate())
2376          throw new Error("Attempt to auto-create ObservationDefinition.version");
2377        else if (Configuration.doAutoCreate())
2378          this.version = new StringType(); // bb
2379      return this.version;
2380    }
2381
2382    public boolean hasVersionElement() { 
2383      return this.version != null && !this.version.isEmpty();
2384    }
2385
2386    public boolean hasVersion() { 
2387      return this.version != null && !this.version.isEmpty();
2388    }
2389
2390    /**
2391     * @param value {@link #version} (The identifier that is used to identify this version of the ObservationDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the ObservationDefinition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions are orderable.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
2392     */
2393    public ObservationDefinition setVersionElement(StringType value) { 
2394      this.version = value;
2395      return this;
2396    }
2397
2398    /**
2399     * @return The identifier that is used to identify this version of the ObservationDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the ObservationDefinition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions are orderable.
2400     */
2401    public String getVersion() { 
2402      return this.version == null ? null : this.version.getValue();
2403    }
2404
2405    /**
2406     * @param value The identifier that is used to identify this version of the ObservationDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the ObservationDefinition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions are orderable.
2407     */
2408    public ObservationDefinition setVersion(String value) { 
2409      if (Utilities.noString(value))
2410        this.version = null;
2411      else {
2412        if (this.version == null)
2413          this.version = new StringType();
2414        this.version.setValue(value);
2415      }
2416      return this;
2417    }
2418
2419    /**
2420     * @return {@link #name} (A natural language name identifying the ObservationDefinition. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2421     */
2422    public StringType getNameElement() { 
2423      if (this.name == null)
2424        if (Configuration.errorOnAutoCreate())
2425          throw new Error("Attempt to auto-create ObservationDefinition.name");
2426        else if (Configuration.doAutoCreate())
2427          this.name = new StringType(); // bb
2428      return this.name;
2429    }
2430
2431    public boolean hasNameElement() { 
2432      return this.name != null && !this.name.isEmpty();
2433    }
2434
2435    public boolean hasName() { 
2436      return this.name != null && !this.name.isEmpty();
2437    }
2438
2439    /**
2440     * @param value {@link #name} (A natural language name identifying the ObservationDefinition. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2441     */
2442    public ObservationDefinition setNameElement(StringType value) { 
2443      this.name = value;
2444      return this;
2445    }
2446
2447    /**
2448     * @return A natural language name identifying the ObservationDefinition. This name should be usable as an identifier for the module by machine processing applications such as code generation.
2449     */
2450    public String getName() { 
2451      return this.name == null ? null : this.name.getValue();
2452    }
2453
2454    /**
2455     * @param value A natural language name identifying the ObservationDefinition. This name should be usable as an identifier for the module by machine processing applications such as code generation.
2456     */
2457    public ObservationDefinition setName(String value) { 
2458      if (Utilities.noString(value))
2459        this.name = null;
2460      else {
2461        if (this.name == null)
2462          this.name = new StringType();
2463        this.name.setValue(value);
2464      }
2465      return this;
2466    }
2467
2468    /**
2469     * @return {@link #title} (A short, descriptive, user-friendly title for the ObservationDefinition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
2470     */
2471    public StringType getTitleElement() { 
2472      if (this.title == null)
2473        if (Configuration.errorOnAutoCreate())
2474          throw new Error("Attempt to auto-create ObservationDefinition.title");
2475        else if (Configuration.doAutoCreate())
2476          this.title = new StringType(); // bb
2477      return this.title;
2478    }
2479
2480    public boolean hasTitleElement() { 
2481      return this.title != null && !this.title.isEmpty();
2482    }
2483
2484    public boolean hasTitle() { 
2485      return this.title != null && !this.title.isEmpty();
2486    }
2487
2488    /**
2489     * @param value {@link #title} (A short, descriptive, user-friendly title for the ObservationDefinition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
2490     */
2491    public ObservationDefinition setTitleElement(StringType value) { 
2492      this.title = value;
2493      return this;
2494    }
2495
2496    /**
2497     * @return A short, descriptive, user-friendly title for the ObservationDefinition.
2498     */
2499    public String getTitle() { 
2500      return this.title == null ? null : this.title.getValue();
2501    }
2502
2503    /**
2504     * @param value A short, descriptive, user-friendly title for the ObservationDefinition.
2505     */
2506    public ObservationDefinition setTitle(String value) { 
2507      if (Utilities.noString(value))
2508        this.title = null;
2509      else {
2510        if (this.title == null)
2511          this.title = new StringType();
2512        this.title.setValue(value);
2513      }
2514      return this;
2515    }
2516
2517    /**
2518     * @return {@link #status} (The current state of the ObservationDefinition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2519     */
2520    public Enumeration<PublicationStatus> getStatusElement() { 
2521      if (this.status == null)
2522        if (Configuration.errorOnAutoCreate())
2523          throw new Error("Attempt to auto-create ObservationDefinition.status");
2524        else if (Configuration.doAutoCreate())
2525          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
2526      return this.status;
2527    }
2528
2529    public boolean hasStatusElement() { 
2530      return this.status != null && !this.status.isEmpty();
2531    }
2532
2533    public boolean hasStatus() { 
2534      return this.status != null && !this.status.isEmpty();
2535    }
2536
2537    /**
2538     * @param value {@link #status} (The current state of the ObservationDefinition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2539     */
2540    public ObservationDefinition setStatusElement(Enumeration<PublicationStatus> value) { 
2541      this.status = value;
2542      return this;
2543    }
2544
2545    /**
2546     * @return The current state of the ObservationDefinition.
2547     */
2548    public PublicationStatus getStatus() { 
2549      return this.status == null ? null : this.status.getValue();
2550    }
2551
2552    /**
2553     * @param value The current state of the ObservationDefinition.
2554     */
2555    public ObservationDefinition setStatus(PublicationStatus value) { 
2556        if (this.status == null)
2557          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
2558        this.status.setValue(value);
2559      return this;
2560    }
2561
2562    /**
2563     * @return {@link #experimental} (A flag to indicate that this ObservationDefinition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
2564     */
2565    public BooleanType getExperimentalElement() { 
2566      if (this.experimental == null)
2567        if (Configuration.errorOnAutoCreate())
2568          throw new Error("Attempt to auto-create ObservationDefinition.experimental");
2569        else if (Configuration.doAutoCreate())
2570          this.experimental = new BooleanType(); // bb
2571      return this.experimental;
2572    }
2573
2574    public boolean hasExperimentalElement() { 
2575      return this.experimental != null && !this.experimental.isEmpty();
2576    }
2577
2578    public boolean hasExperimental() { 
2579      return this.experimental != null && !this.experimental.isEmpty();
2580    }
2581
2582    /**
2583     * @param value {@link #experimental} (A flag to indicate that this ObservationDefinition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
2584     */
2585    public ObservationDefinition setExperimentalElement(BooleanType value) { 
2586      this.experimental = value;
2587      return this;
2588    }
2589
2590    /**
2591     * @return A flag to indicate that this ObservationDefinition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
2592     */
2593    public boolean getExperimental() { 
2594      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
2595    }
2596
2597    /**
2598     * @param value A flag to indicate that this ObservationDefinition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
2599     */
2600    public ObservationDefinition setExperimental(boolean value) { 
2601        if (this.experimental == null)
2602          this.experimental = new BooleanType();
2603        this.experimental.setValue(value);
2604      return this;
2605    }
2606
2607    /**
2608     * @return {@link #date} (The date (and optionally time) when the ObservationDefinition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ObservationDefinition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
2609     */
2610    public DateTimeType getDateElement() { 
2611      if (this.date == null)
2612        if (Configuration.errorOnAutoCreate())
2613          throw new Error("Attempt to auto-create ObservationDefinition.date");
2614        else if (Configuration.doAutoCreate())
2615          this.date = new DateTimeType(); // bb
2616      return this.date;
2617    }
2618
2619    public boolean hasDateElement() { 
2620      return this.date != null && !this.date.isEmpty();
2621    }
2622
2623    public boolean hasDate() { 
2624      return this.date != null && !this.date.isEmpty();
2625    }
2626
2627    /**
2628     * @param value {@link #date} (The date (and optionally time) when the ObservationDefinition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ObservationDefinition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
2629     */
2630    public ObservationDefinition setDateElement(DateTimeType value) { 
2631      this.date = value;
2632      return this;
2633    }
2634
2635    /**
2636     * @return The date (and optionally time) when the ObservationDefinition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ObservationDefinition changes.
2637     */
2638    public Date getDate() { 
2639      return this.date == null ? null : this.date.getValue();
2640    }
2641
2642    /**
2643     * @param value The date (and optionally time) when the ObservationDefinition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ObservationDefinition changes.
2644     */
2645    public ObservationDefinition setDate(Date value) { 
2646      if (value == null)
2647        this.date = null;
2648      else {
2649        if (this.date == null)
2650          this.date = new DateTimeType();
2651        this.date.setValue(value);
2652      }
2653      return this;
2654    }
2655
2656    /**
2657     * @return {@link #publisher} (Helps establish the "authority/credibility" of the ObservationDefinition. May also allow for contact.)
2658     */
2659    public Reference getPublisher() { 
2660      if (this.publisher == null)
2661        if (Configuration.errorOnAutoCreate())
2662          throw new Error("Attempt to auto-create ObservationDefinition.publisher");
2663        else if (Configuration.doAutoCreate())
2664          this.publisher = new Reference(); // cc
2665      return this.publisher;
2666    }
2667
2668    public boolean hasPublisher() { 
2669      return this.publisher != null && !this.publisher.isEmpty();
2670    }
2671
2672    /**
2673     * @param value {@link #publisher} (Helps establish the "authority/credibility" of the ObservationDefinition. May also allow for contact.)
2674     */
2675    public ObservationDefinition setPublisher(Reference value) { 
2676      this.publisher = value;
2677      return this;
2678    }
2679
2680    /**
2681     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
2682     */
2683    public List<ContactDetail> getContact() { 
2684      if (this.contact == null)
2685        this.contact = new ArrayList<ContactDetail>();
2686      return this.contact;
2687    }
2688
2689    /**
2690     * @return Returns a reference to <code>this</code> for easy method chaining
2691     */
2692    public ObservationDefinition setContact(List<ContactDetail> theContact) { 
2693      this.contact = theContact;
2694      return this;
2695    }
2696
2697    public boolean hasContact() { 
2698      if (this.contact == null)
2699        return false;
2700      for (ContactDetail item : this.contact)
2701        if (!item.isEmpty())
2702          return true;
2703      return false;
2704    }
2705
2706    public ContactDetail addContact() { //3
2707      ContactDetail t = new ContactDetail();
2708      if (this.contact == null)
2709        this.contact = new ArrayList<ContactDetail>();
2710      this.contact.add(t);
2711      return t;
2712    }
2713
2714    public ObservationDefinition addContact(ContactDetail t) { //3
2715      if (t == null)
2716        return this;
2717      if (this.contact == null)
2718        this.contact = new ArrayList<ContactDetail>();
2719      this.contact.add(t);
2720      return this;
2721    }
2722
2723    /**
2724     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist {3}
2725     */
2726    public ContactDetail getContactFirstRep() { 
2727      if (getContact().isEmpty()) {
2728        addContact();
2729      }
2730      return getContact().get(0);
2731    }
2732
2733    /**
2734     * @return {@link #description} (A free text natural language description of the ObservationDefinition from the consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2735     */
2736    public MarkdownType getDescriptionElement() { 
2737      if (this.description == null)
2738        if (Configuration.errorOnAutoCreate())
2739          throw new Error("Attempt to auto-create ObservationDefinition.description");
2740        else if (Configuration.doAutoCreate())
2741          this.description = new MarkdownType(); // bb
2742      return this.description;
2743    }
2744
2745    public boolean hasDescriptionElement() { 
2746      return this.description != null && !this.description.isEmpty();
2747    }
2748
2749    public boolean hasDescription() { 
2750      return this.description != null && !this.description.isEmpty();
2751    }
2752
2753    /**
2754     * @param value {@link #description} (A free text natural language description of the ObservationDefinition from the consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2755     */
2756    public ObservationDefinition setDescriptionElement(MarkdownType value) { 
2757      this.description = value;
2758      return this;
2759    }
2760
2761    /**
2762     * @return A free text natural language description of the ObservationDefinition from the consumer's perspective.
2763     */
2764    public String getDescription() { 
2765      return this.description == null ? null : this.description.getValue();
2766    }
2767
2768    /**
2769     * @param value A free text natural language description of the ObservationDefinition from the consumer's perspective.
2770     */
2771    public ObservationDefinition setDescription(String value) { 
2772      if (value == null)
2773        this.description = null;
2774      else {
2775        if (this.description == null)
2776          this.description = new MarkdownType();
2777        this.description.setValue(value);
2778      }
2779      return this;
2780    }
2781
2782    /**
2783     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate ObservationDefinition instances.)
2784     */
2785    public List<UsageContext> getUseContext() { 
2786      if (this.useContext == null)
2787        this.useContext = new ArrayList<UsageContext>();
2788      return this.useContext;
2789    }
2790
2791    /**
2792     * @return Returns a reference to <code>this</code> for easy method chaining
2793     */
2794    public ObservationDefinition setUseContext(List<UsageContext> theUseContext) { 
2795      this.useContext = theUseContext;
2796      return this;
2797    }
2798
2799    public boolean hasUseContext() { 
2800      if (this.useContext == null)
2801        return false;
2802      for (UsageContext item : this.useContext)
2803        if (!item.isEmpty())
2804          return true;
2805      return false;
2806    }
2807
2808    public UsageContext addUseContext() { //3
2809      UsageContext t = new UsageContext();
2810      if (this.useContext == null)
2811        this.useContext = new ArrayList<UsageContext>();
2812      this.useContext.add(t);
2813      return t;
2814    }
2815
2816    public ObservationDefinition addUseContext(UsageContext t) { //3
2817      if (t == null)
2818        return this;
2819      if (this.useContext == null)
2820        this.useContext = new ArrayList<UsageContext>();
2821      this.useContext.add(t);
2822      return this;
2823    }
2824
2825    /**
2826     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist {3}
2827     */
2828    public UsageContext getUseContextFirstRep() { 
2829      if (getUseContext().isEmpty()) {
2830        addUseContext();
2831      }
2832      return getUseContext().get(0);
2833    }
2834
2835    /**
2836     * @return {@link #jurisdiction} (A jurisdiction in which the ObservationDefinition is intended to be used.)
2837     */
2838    public List<CodeableConcept> getJurisdiction() { 
2839      if (this.jurisdiction == null)
2840        this.jurisdiction = new ArrayList<CodeableConcept>();
2841      return this.jurisdiction;
2842    }
2843
2844    /**
2845     * @return Returns a reference to <code>this</code> for easy method chaining
2846     */
2847    public ObservationDefinition setJurisdiction(List<CodeableConcept> theJurisdiction) { 
2848      this.jurisdiction = theJurisdiction;
2849      return this;
2850    }
2851
2852    public boolean hasJurisdiction() { 
2853      if (this.jurisdiction == null)
2854        return false;
2855      for (CodeableConcept item : this.jurisdiction)
2856        if (!item.isEmpty())
2857          return true;
2858      return false;
2859    }
2860
2861    public CodeableConcept addJurisdiction() { //3
2862      CodeableConcept t = new CodeableConcept();
2863      if (this.jurisdiction == null)
2864        this.jurisdiction = new ArrayList<CodeableConcept>();
2865      this.jurisdiction.add(t);
2866      return t;
2867    }
2868
2869    public ObservationDefinition addJurisdiction(CodeableConcept t) { //3
2870      if (t == null)
2871        return this;
2872      if (this.jurisdiction == null)
2873        this.jurisdiction = new ArrayList<CodeableConcept>();
2874      this.jurisdiction.add(t);
2875      return this;
2876    }
2877
2878    /**
2879     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist {3}
2880     */
2881    public CodeableConcept getJurisdictionFirstRep() { 
2882      if (getJurisdiction().isEmpty()) {
2883        addJurisdiction();
2884      }
2885      return getJurisdiction().get(0);
2886    }
2887
2888    /**
2889     * @return {@link #purpose} (Explains why this ObservationDefinition is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
2890     */
2891    public MarkdownType getPurposeElement() { 
2892      if (this.purpose == null)
2893        if (Configuration.errorOnAutoCreate())
2894          throw new Error("Attempt to auto-create ObservationDefinition.purpose");
2895        else if (Configuration.doAutoCreate())
2896          this.purpose = new MarkdownType(); // bb
2897      return this.purpose;
2898    }
2899
2900    public boolean hasPurposeElement() { 
2901      return this.purpose != null && !this.purpose.isEmpty();
2902    }
2903
2904    public boolean hasPurpose() { 
2905      return this.purpose != null && !this.purpose.isEmpty();
2906    }
2907
2908    /**
2909     * @param value {@link #purpose} (Explains why this ObservationDefinition is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
2910     */
2911    public ObservationDefinition setPurposeElement(MarkdownType value) { 
2912      this.purpose = value;
2913      return this;
2914    }
2915
2916    /**
2917     * @return Explains why this ObservationDefinition is needed and why it has been designed as it has.
2918     */
2919    public String getPurpose() { 
2920      return this.purpose == null ? null : this.purpose.getValue();
2921    }
2922
2923    /**
2924     * @param value Explains why this ObservationDefinition is needed and why it has been designed as it has.
2925     */
2926    public ObservationDefinition setPurpose(String value) { 
2927      if (value == null)
2928        this.purpose = null;
2929      else {
2930        if (this.purpose == null)
2931          this.purpose = new MarkdownType();
2932        this.purpose.setValue(value);
2933      }
2934      return this;
2935    }
2936
2937    /**
2938     * @return {@link #copyright} (Copyright statement relating to the ObservationDefinition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the ObservationDefinition.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
2939     */
2940    public MarkdownType getCopyrightElement() { 
2941      if (this.copyright == null)
2942        if (Configuration.errorOnAutoCreate())
2943          throw new Error("Attempt to auto-create ObservationDefinition.copyright");
2944        else if (Configuration.doAutoCreate())
2945          this.copyright = new MarkdownType(); // bb
2946      return this.copyright;
2947    }
2948
2949    public boolean hasCopyrightElement() { 
2950      return this.copyright != null && !this.copyright.isEmpty();
2951    }
2952
2953    public boolean hasCopyright() { 
2954      return this.copyright != null && !this.copyright.isEmpty();
2955    }
2956
2957    /**
2958     * @param value {@link #copyright} (Copyright statement relating to the ObservationDefinition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the ObservationDefinition.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
2959     */
2960    public ObservationDefinition setCopyrightElement(MarkdownType value) { 
2961      this.copyright = value;
2962      return this;
2963    }
2964
2965    /**
2966     * @return Copyright statement relating to the ObservationDefinition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the ObservationDefinition.
2967     */
2968    public String getCopyright() { 
2969      return this.copyright == null ? null : this.copyright.getValue();
2970    }
2971
2972    /**
2973     * @param value Copyright statement relating to the ObservationDefinition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the ObservationDefinition.
2974     */
2975    public ObservationDefinition setCopyright(String value) { 
2976      if (value == null)
2977        this.copyright = null;
2978      else {
2979        if (this.copyright == null)
2980          this.copyright = new MarkdownType();
2981        this.copyright.setValue(value);
2982      }
2983      return this;
2984    }
2985
2986    /**
2987     * @return {@link #approvalDate} (The date on which the asset content was approved by the publisher. Approval happens once when the content is officially approved for usage.). This is the underlying object with id, value and extensions. The accessor "getApprovalDate" gives direct access to the value
2988     */
2989    public DateType getApprovalDateElement() { 
2990      if (this.approvalDate == null)
2991        if (Configuration.errorOnAutoCreate())
2992          throw new Error("Attempt to auto-create ObservationDefinition.approvalDate");
2993        else if (Configuration.doAutoCreate())
2994          this.approvalDate = new DateType(); // bb
2995      return this.approvalDate;
2996    }
2997
2998    public boolean hasApprovalDateElement() { 
2999      return this.approvalDate != null && !this.approvalDate.isEmpty();
3000    }
3001
3002    public boolean hasApprovalDate() { 
3003      return this.approvalDate != null && !this.approvalDate.isEmpty();
3004    }
3005
3006    /**
3007     * @param value {@link #approvalDate} (The date on which the asset content was approved by the publisher. Approval happens once when the content is officially approved for usage.). This is the underlying object with id, value and extensions. The accessor "getApprovalDate" gives direct access to the value
3008     */
3009    public ObservationDefinition setApprovalDateElement(DateType value) { 
3010      this.approvalDate = value;
3011      return this;
3012    }
3013
3014    /**
3015     * @return The date on which the asset content was approved by the publisher. Approval happens once when the content is officially approved for usage.
3016     */
3017    public Date getApprovalDate() { 
3018      return this.approvalDate == null ? null : this.approvalDate.getValue();
3019    }
3020
3021    /**
3022     * @param value The date on which the asset content was approved by the publisher. Approval happens once when the content is officially approved for usage.
3023     */
3024    public ObservationDefinition setApprovalDate(Date value) { 
3025      if (value == null)
3026        this.approvalDate = null;
3027      else {
3028        if (this.approvalDate == null)
3029          this.approvalDate = new DateType();
3030        this.approvalDate.setValue(value);
3031      }
3032      return this;
3033    }
3034
3035    /**
3036     * @return {@link #lastReviewDate} (The date on which the asset content was last reviewed. Review happens periodically after that, but doesn't change the original approval date.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value
3037     */
3038    public DateType getLastReviewDateElement() { 
3039      if (this.lastReviewDate == null)
3040        if (Configuration.errorOnAutoCreate())
3041          throw new Error("Attempt to auto-create ObservationDefinition.lastReviewDate");
3042        else if (Configuration.doAutoCreate())
3043          this.lastReviewDate = new DateType(); // bb
3044      return this.lastReviewDate;
3045    }
3046
3047    public boolean hasLastReviewDateElement() { 
3048      return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
3049    }
3050
3051    public boolean hasLastReviewDate() { 
3052      return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
3053    }
3054
3055    /**
3056     * @param value {@link #lastReviewDate} (The date on which the asset content was last reviewed. Review happens periodically after that, but doesn't change the original approval date.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value
3057     */
3058    public ObservationDefinition setLastReviewDateElement(DateType value) { 
3059      this.lastReviewDate = value;
3060      return this;
3061    }
3062
3063    /**
3064     * @return The date on which the asset content was last reviewed. Review happens periodically after that, but doesn't change the original approval date.
3065     */
3066    public Date getLastReviewDate() { 
3067      return this.lastReviewDate == null ? null : this.lastReviewDate.getValue();
3068    }
3069
3070    /**
3071     * @param value The date on which the asset content was last reviewed. Review happens periodically after that, but doesn't change the original approval date.
3072     */
3073    public ObservationDefinition setLastReviewDate(Date value) { 
3074      if (value == null)
3075        this.lastReviewDate = null;
3076      else {
3077        if (this.lastReviewDate == null)
3078          this.lastReviewDate = new DateType();
3079        this.lastReviewDate.setValue(value);
3080      }
3081      return this;
3082    }
3083
3084    /**
3085     * @return {@link #effectivePeriod} (The period during which the ObservationDefinition content was or is planned to be effective.)
3086     */
3087    public Period getEffectivePeriod() { 
3088      if (this.effectivePeriod == null)
3089        if (Configuration.errorOnAutoCreate())
3090          throw new Error("Attempt to auto-create ObservationDefinition.effectivePeriod");
3091        else if (Configuration.doAutoCreate())
3092          this.effectivePeriod = new Period(); // cc
3093      return this.effectivePeriod;
3094    }
3095
3096    public boolean hasEffectivePeriod() { 
3097      return this.effectivePeriod != null && !this.effectivePeriod.isEmpty();
3098    }
3099
3100    /**
3101     * @param value {@link #effectivePeriod} (The period during which the ObservationDefinition content was or is planned to be effective.)
3102     */
3103    public ObservationDefinition setEffectivePeriod(Period value) { 
3104      this.effectivePeriod = value;
3105      return this;
3106    }
3107
3108    /**
3109     * @return {@link #derivedFromCanonical} (The canonical URL pointing to another FHIR-defined ObservationDefinition that is adhered to in whole or in part by this definition.)
3110     */
3111    public List<CanonicalType> getDerivedFromCanonical() { 
3112      if (this.derivedFromCanonical == null)
3113        this.derivedFromCanonical = new ArrayList<CanonicalType>();
3114      return this.derivedFromCanonical;
3115    }
3116
3117    /**
3118     * @return Returns a reference to <code>this</code> for easy method chaining
3119     */
3120    public ObservationDefinition setDerivedFromCanonical(List<CanonicalType> theDerivedFromCanonical) { 
3121      this.derivedFromCanonical = theDerivedFromCanonical;
3122      return this;
3123    }
3124
3125    public boolean hasDerivedFromCanonical() { 
3126      if (this.derivedFromCanonical == null)
3127        return false;
3128      for (CanonicalType item : this.derivedFromCanonical)
3129        if (!item.isEmpty())
3130          return true;
3131      return false;
3132    }
3133
3134    /**
3135     * @return {@link #derivedFromCanonical} (The canonical URL pointing to another FHIR-defined ObservationDefinition that is adhered to in whole or in part by this definition.)
3136     */
3137    public CanonicalType addDerivedFromCanonicalElement() {//2 
3138      CanonicalType t = new CanonicalType();
3139      if (this.derivedFromCanonical == null)
3140        this.derivedFromCanonical = new ArrayList<CanonicalType>();
3141      this.derivedFromCanonical.add(t);
3142      return t;
3143    }
3144
3145    /**
3146     * @param value {@link #derivedFromCanonical} (The canonical URL pointing to another FHIR-defined ObservationDefinition that is adhered to in whole or in part by this definition.)
3147     */
3148    public ObservationDefinition addDerivedFromCanonical(String value) { //1
3149      CanonicalType t = new CanonicalType();
3150      t.setValue(value);
3151      if (this.derivedFromCanonical == null)
3152        this.derivedFromCanonical = new ArrayList<CanonicalType>();
3153      this.derivedFromCanonical.add(t);
3154      return this;
3155    }
3156
3157    /**
3158     * @param value {@link #derivedFromCanonical} (The canonical URL pointing to another FHIR-defined ObservationDefinition that is adhered to in whole or in part by this definition.)
3159     */
3160    public boolean hasDerivedFromCanonical(String value) { 
3161      if (this.derivedFromCanonical == null)
3162        return false;
3163      for (CanonicalType v : this.derivedFromCanonical)
3164        if (v.getValue().equals(value)) // canonical
3165          return true;
3166      return false;
3167    }
3168
3169    /**
3170     * @return {@link #derivedFromUri} (The URL pointing to an externally-defined observation definition, guideline or other definition that is adhered to in whole or in part by this definition.)
3171     */
3172    public List<UriType> getDerivedFromUri() { 
3173      if (this.derivedFromUri == null)
3174        this.derivedFromUri = new ArrayList<UriType>();
3175      return this.derivedFromUri;
3176    }
3177
3178    /**
3179     * @return Returns a reference to <code>this</code> for easy method chaining
3180     */
3181    public ObservationDefinition setDerivedFromUri(List<UriType> theDerivedFromUri) { 
3182      this.derivedFromUri = theDerivedFromUri;
3183      return this;
3184    }
3185
3186    public boolean hasDerivedFromUri() { 
3187      if (this.derivedFromUri == null)
3188        return false;
3189      for (UriType item : this.derivedFromUri)
3190        if (!item.isEmpty())
3191          return true;
3192      return false;
3193    }
3194
3195    /**
3196     * @return {@link #derivedFromUri} (The URL pointing to an externally-defined observation definition, guideline or other definition that is adhered to in whole or in part by this definition.)
3197     */
3198    public UriType addDerivedFromUriElement() {//2 
3199      UriType t = new UriType();
3200      if (this.derivedFromUri == null)
3201        this.derivedFromUri = new ArrayList<UriType>();
3202      this.derivedFromUri.add(t);
3203      return t;
3204    }
3205
3206    /**
3207     * @param value {@link #derivedFromUri} (The URL pointing to an externally-defined observation definition, guideline or other definition that is adhered to in whole or in part by this definition.)
3208     */
3209    public ObservationDefinition addDerivedFromUri(String value) { //1
3210      UriType t = new UriType();
3211      t.setValue(value);
3212      if (this.derivedFromUri == null)
3213        this.derivedFromUri = new ArrayList<UriType>();
3214      this.derivedFromUri.add(t);
3215      return this;
3216    }
3217
3218    /**
3219     * @param value {@link #derivedFromUri} (The URL pointing to an externally-defined observation definition, guideline or other definition that is adhered to in whole or in part by this definition.)
3220     */
3221    public boolean hasDerivedFromUri(String value) { 
3222      if (this.derivedFromUri == null)
3223        return false;
3224      for (UriType v : this.derivedFromUri)
3225        if (v.getValue().equals(value)) // uri
3226          return true;
3227      return false;
3228    }
3229
3230    /**
3231     * @return {@link #subject} (A code that describes the intended kind of subject of Observation instances conforming to this ObservationDefinition.)
3232     */
3233    public List<CodeableConcept> getSubject() { 
3234      if (this.subject == null)
3235        this.subject = new ArrayList<CodeableConcept>();
3236      return this.subject;
3237    }
3238
3239    /**
3240     * @return Returns a reference to <code>this</code> for easy method chaining
3241     */
3242    public ObservationDefinition setSubject(List<CodeableConcept> theSubject) { 
3243      this.subject = theSubject;
3244      return this;
3245    }
3246
3247    public boolean hasSubject() { 
3248      if (this.subject == null)
3249        return false;
3250      for (CodeableConcept item : this.subject)
3251        if (!item.isEmpty())
3252          return true;
3253      return false;
3254    }
3255
3256    public CodeableConcept addSubject() { //3
3257      CodeableConcept t = new CodeableConcept();
3258      if (this.subject == null)
3259        this.subject = new ArrayList<CodeableConcept>();
3260      this.subject.add(t);
3261      return t;
3262    }
3263
3264    public ObservationDefinition addSubject(CodeableConcept t) { //3
3265      if (t == null)
3266        return this;
3267      if (this.subject == null)
3268        this.subject = new ArrayList<CodeableConcept>();
3269      this.subject.add(t);
3270      return this;
3271    }
3272
3273    /**
3274     * @return The first repetition of repeating field {@link #subject}, creating it if it does not already exist {3}
3275     */
3276    public CodeableConcept getSubjectFirstRep() { 
3277      if (getSubject().isEmpty()) {
3278        addSubject();
3279      }
3280      return getSubject().get(0);
3281    }
3282
3283    /**
3284     * @return {@link #performerType} (The type of individual/organization/device that is expected to act upon instances of this definition.)
3285     */
3286    public CodeableConcept getPerformerType() { 
3287      if (this.performerType == null)
3288        if (Configuration.errorOnAutoCreate())
3289          throw new Error("Attempt to auto-create ObservationDefinition.performerType");
3290        else if (Configuration.doAutoCreate())
3291          this.performerType = new CodeableConcept(); // cc
3292      return this.performerType;
3293    }
3294
3295    public boolean hasPerformerType() { 
3296      return this.performerType != null && !this.performerType.isEmpty();
3297    }
3298
3299    /**
3300     * @param value {@link #performerType} (The type of individual/organization/device that is expected to act upon instances of this definition.)
3301     */
3302    public ObservationDefinition setPerformerType(CodeableConcept value) { 
3303      this.performerType = value;
3304      return this;
3305    }
3306
3307    /**
3308     * @return {@link #category} (A code that classifies the general type of observation.)
3309     */
3310    public List<CodeableConcept> getCategory() { 
3311      if (this.category == null)
3312        this.category = new ArrayList<CodeableConcept>();
3313      return this.category;
3314    }
3315
3316    /**
3317     * @return Returns a reference to <code>this</code> for easy method chaining
3318     */
3319    public ObservationDefinition setCategory(List<CodeableConcept> theCategory) { 
3320      this.category = theCategory;
3321      return this;
3322    }
3323
3324    public boolean hasCategory() { 
3325      if (this.category == null)
3326        return false;
3327      for (CodeableConcept item : this.category)
3328        if (!item.isEmpty())
3329          return true;
3330      return false;
3331    }
3332
3333    public CodeableConcept addCategory() { //3
3334      CodeableConcept t = new CodeableConcept();
3335      if (this.category == null)
3336        this.category = new ArrayList<CodeableConcept>();
3337      this.category.add(t);
3338      return t;
3339    }
3340
3341    public ObservationDefinition addCategory(CodeableConcept t) { //3
3342      if (t == null)
3343        return this;
3344      if (this.category == null)
3345        this.category = new ArrayList<CodeableConcept>();
3346      this.category.add(t);
3347      return this;
3348    }
3349
3350    /**
3351     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist {3}
3352     */
3353    public CodeableConcept getCategoryFirstRep() { 
3354      if (getCategory().isEmpty()) {
3355        addCategory();
3356      }
3357      return getCategory().get(0);
3358    }
3359
3360    /**
3361     * @return {@link #code} (Describes what will be observed. Sometimes this is called the observation "name".)
3362     */
3363    public CodeableConcept getCode() { 
3364      if (this.code == null)
3365        if (Configuration.errorOnAutoCreate())
3366          throw new Error("Attempt to auto-create ObservationDefinition.code");
3367        else if (Configuration.doAutoCreate())
3368          this.code = new CodeableConcept(); // cc
3369      return this.code;
3370    }
3371
3372    public boolean hasCode() { 
3373      return this.code != null && !this.code.isEmpty();
3374    }
3375
3376    /**
3377     * @param value {@link #code} (Describes what will be observed. Sometimes this is called the observation "name".)
3378     */
3379    public ObservationDefinition setCode(CodeableConcept value) { 
3380      this.code = value;
3381      return this;
3382    }
3383
3384    /**
3385     * @return {@link #permittedDataType} (The data types allowed for the value element of the instance observations conforming to this ObservationDefinition.)
3386     */
3387    public List<Enumeration<ObservationDataType>> getPermittedDataType() { 
3388      if (this.permittedDataType == null)
3389        this.permittedDataType = new ArrayList<Enumeration<ObservationDataType>>();
3390      return this.permittedDataType;
3391    }
3392
3393    /**
3394     * @return Returns a reference to <code>this</code> for easy method chaining
3395     */
3396    public ObservationDefinition setPermittedDataType(List<Enumeration<ObservationDataType>> thePermittedDataType) { 
3397      this.permittedDataType = thePermittedDataType;
3398      return this;
3399    }
3400
3401    public boolean hasPermittedDataType() { 
3402      if (this.permittedDataType == null)
3403        return false;
3404      for (Enumeration<ObservationDataType> item : this.permittedDataType)
3405        if (!item.isEmpty())
3406          return true;
3407      return false;
3408    }
3409
3410    /**
3411     * @return {@link #permittedDataType} (The data types allowed for the value element of the instance observations conforming to this ObservationDefinition.)
3412     */
3413    public Enumeration<ObservationDataType> addPermittedDataTypeElement() {//2 
3414      Enumeration<ObservationDataType> t = new Enumeration<ObservationDataType>(new ObservationDataTypeEnumFactory());
3415      if (this.permittedDataType == null)
3416        this.permittedDataType = new ArrayList<Enumeration<ObservationDataType>>();
3417      this.permittedDataType.add(t);
3418      return t;
3419    }
3420
3421    /**
3422     * @param value {@link #permittedDataType} (The data types allowed for the value element of the instance observations conforming to this ObservationDefinition.)
3423     */
3424    public ObservationDefinition addPermittedDataType(ObservationDataType value) { //1
3425      Enumeration<ObservationDataType> t = new Enumeration<ObservationDataType>(new ObservationDataTypeEnumFactory());
3426      t.setValue(value);
3427      if (this.permittedDataType == null)
3428        this.permittedDataType = new ArrayList<Enumeration<ObservationDataType>>();
3429      this.permittedDataType.add(t);
3430      return this;
3431    }
3432
3433    /**
3434     * @param value {@link #permittedDataType} (The data types allowed for the value element of the instance observations conforming to this ObservationDefinition.)
3435     */
3436    public boolean hasPermittedDataType(ObservationDataType value) { 
3437      if (this.permittedDataType == null)
3438        return false;
3439      for (Enumeration<ObservationDataType> v : this.permittedDataType)
3440        if (v.getValue().equals(value)) // code
3441          return true;
3442      return false;
3443    }
3444
3445    /**
3446     * @return {@link #multipleResultsAllowed} (Multiple results allowed for observations conforming to this ObservationDefinition.). This is the underlying object with id, value and extensions. The accessor "getMultipleResultsAllowed" gives direct access to the value
3447     */
3448    public BooleanType getMultipleResultsAllowedElement() { 
3449      if (this.multipleResultsAllowed == null)
3450        if (Configuration.errorOnAutoCreate())
3451          throw new Error("Attempt to auto-create ObservationDefinition.multipleResultsAllowed");
3452        else if (Configuration.doAutoCreate())
3453          this.multipleResultsAllowed = new BooleanType(); // bb
3454      return this.multipleResultsAllowed;
3455    }
3456
3457    public boolean hasMultipleResultsAllowedElement() { 
3458      return this.multipleResultsAllowed != null && !this.multipleResultsAllowed.isEmpty();
3459    }
3460
3461    public boolean hasMultipleResultsAllowed() { 
3462      return this.multipleResultsAllowed != null && !this.multipleResultsAllowed.isEmpty();
3463    }
3464
3465    /**
3466     * @param value {@link #multipleResultsAllowed} (Multiple results allowed for observations conforming to this ObservationDefinition.). This is the underlying object with id, value and extensions. The accessor "getMultipleResultsAllowed" gives direct access to the value
3467     */
3468    public ObservationDefinition setMultipleResultsAllowedElement(BooleanType value) { 
3469      this.multipleResultsAllowed = value;
3470      return this;
3471    }
3472
3473    /**
3474     * @return Multiple results allowed for observations conforming to this ObservationDefinition.
3475     */
3476    public boolean getMultipleResultsAllowed() { 
3477      return this.multipleResultsAllowed == null || this.multipleResultsAllowed.isEmpty() ? false : this.multipleResultsAllowed.getValue();
3478    }
3479
3480    /**
3481     * @param value Multiple results allowed for observations conforming to this ObservationDefinition.
3482     */
3483    public ObservationDefinition setMultipleResultsAllowed(boolean value) { 
3484        if (this.multipleResultsAllowed == null)
3485          this.multipleResultsAllowed = new BooleanType();
3486        this.multipleResultsAllowed.setValue(value);
3487      return this;
3488    }
3489
3490    /**
3491     * @return {@link #bodySite} (The site on the subject's body where the  observation is to be made.)
3492     */
3493    public CodeableConcept getBodySite() { 
3494      if (this.bodySite == null)
3495        if (Configuration.errorOnAutoCreate())
3496          throw new Error("Attempt to auto-create ObservationDefinition.bodySite");
3497        else if (Configuration.doAutoCreate())
3498          this.bodySite = new CodeableConcept(); // cc
3499      return this.bodySite;
3500    }
3501
3502    public boolean hasBodySite() { 
3503      return this.bodySite != null && !this.bodySite.isEmpty();
3504    }
3505
3506    /**
3507     * @param value {@link #bodySite} (The site on the subject's body where the  observation is to be made.)
3508     */
3509    public ObservationDefinition setBodySite(CodeableConcept value) { 
3510      this.bodySite = value;
3511      return this;
3512    }
3513
3514    /**
3515     * @return {@link #method} (The method or technique used to perform the observation.)
3516     */
3517    public CodeableConcept getMethod() { 
3518      if (this.method == null)
3519        if (Configuration.errorOnAutoCreate())
3520          throw new Error("Attempt to auto-create ObservationDefinition.method");
3521        else if (Configuration.doAutoCreate())
3522          this.method = new CodeableConcept(); // cc
3523      return this.method;
3524    }
3525
3526    public boolean hasMethod() { 
3527      return this.method != null && !this.method.isEmpty();
3528    }
3529
3530    /**
3531     * @param value {@link #method} (The method or technique used to perform the observation.)
3532     */
3533    public ObservationDefinition setMethod(CodeableConcept value) { 
3534      this.method = value;
3535      return this;
3536    }
3537
3538    /**
3539     * @return {@link #specimen} (The kind of specimen that this type of observation is produced on.)
3540     */
3541    public List<Reference> getSpecimen() { 
3542      if (this.specimen == null)
3543        this.specimen = new ArrayList<Reference>();
3544      return this.specimen;
3545    }
3546
3547    /**
3548     * @return Returns a reference to <code>this</code> for easy method chaining
3549     */
3550    public ObservationDefinition setSpecimen(List<Reference> theSpecimen) { 
3551      this.specimen = theSpecimen;
3552      return this;
3553    }
3554
3555    public boolean hasSpecimen() { 
3556      if (this.specimen == null)
3557        return false;
3558      for (Reference item : this.specimen)
3559        if (!item.isEmpty())
3560          return true;
3561      return false;
3562    }
3563
3564    public Reference addSpecimen() { //3
3565      Reference t = new Reference();
3566      if (this.specimen == null)
3567        this.specimen = new ArrayList<Reference>();
3568      this.specimen.add(t);
3569      return t;
3570    }
3571
3572    public ObservationDefinition addSpecimen(Reference t) { //3
3573      if (t == null)
3574        return this;
3575      if (this.specimen == null)
3576        this.specimen = new ArrayList<Reference>();
3577      this.specimen.add(t);
3578      return this;
3579    }
3580
3581    /**
3582     * @return The first repetition of repeating field {@link #specimen}, creating it if it does not already exist {3}
3583     */
3584    public Reference getSpecimenFirstRep() { 
3585      if (getSpecimen().isEmpty()) {
3586        addSpecimen();
3587      }
3588      return getSpecimen().get(0);
3589    }
3590
3591    /**
3592     * @return {@link #device} (The measurement model of device or actual device used to produce observations of this type.)
3593     */
3594    public List<Reference> getDevice() { 
3595      if (this.device == null)
3596        this.device = new ArrayList<Reference>();
3597      return this.device;
3598    }
3599
3600    /**
3601     * @return Returns a reference to <code>this</code> for easy method chaining
3602     */
3603    public ObservationDefinition setDevice(List<Reference> theDevice) { 
3604      this.device = theDevice;
3605      return this;
3606    }
3607
3608    public boolean hasDevice() { 
3609      if (this.device == null)
3610        return false;
3611      for (Reference item : this.device)
3612        if (!item.isEmpty())
3613          return true;
3614      return false;
3615    }
3616
3617    public Reference addDevice() { //3
3618      Reference t = new Reference();
3619      if (this.device == null)
3620        this.device = new ArrayList<Reference>();
3621      this.device.add(t);
3622      return t;
3623    }
3624
3625    public ObservationDefinition addDevice(Reference t) { //3
3626      if (t == null)
3627        return this;
3628      if (this.device == null)
3629        this.device = new ArrayList<Reference>();
3630      this.device.add(t);
3631      return this;
3632    }
3633
3634    /**
3635     * @return The first repetition of repeating field {@link #device}, creating it if it does not already exist {3}
3636     */
3637    public Reference getDeviceFirstRep() { 
3638      if (getDevice().isEmpty()) {
3639        addDevice();
3640      }
3641      return getDevice().get(0);
3642    }
3643
3644    /**
3645     * @return {@link #preferredReportName} (The preferred name to be used when reporting the results of observations conforming to this ObservationDefinition.). This is the underlying object with id, value and extensions. The accessor "getPreferredReportName" gives direct access to the value
3646     */
3647    public StringType getPreferredReportNameElement() { 
3648      if (this.preferredReportName == null)
3649        if (Configuration.errorOnAutoCreate())
3650          throw new Error("Attempt to auto-create ObservationDefinition.preferredReportName");
3651        else if (Configuration.doAutoCreate())
3652          this.preferredReportName = new StringType(); // bb
3653      return this.preferredReportName;
3654    }
3655
3656    public boolean hasPreferredReportNameElement() { 
3657      return this.preferredReportName != null && !this.preferredReportName.isEmpty();
3658    }
3659
3660    public boolean hasPreferredReportName() { 
3661      return this.preferredReportName != null && !this.preferredReportName.isEmpty();
3662    }
3663
3664    /**
3665     * @param value {@link #preferredReportName} (The preferred name to be used when reporting the results of observations conforming to this ObservationDefinition.). This is the underlying object with id, value and extensions. The accessor "getPreferredReportName" gives direct access to the value
3666     */
3667    public ObservationDefinition setPreferredReportNameElement(StringType value) { 
3668      this.preferredReportName = value;
3669      return this;
3670    }
3671
3672    /**
3673     * @return The preferred name to be used when reporting the results of observations conforming to this ObservationDefinition.
3674     */
3675    public String getPreferredReportName() { 
3676      return this.preferredReportName == null ? null : this.preferredReportName.getValue();
3677    }
3678
3679    /**
3680     * @param value The preferred name to be used when reporting the results of observations conforming to this ObservationDefinition.
3681     */
3682    public ObservationDefinition setPreferredReportName(String value) { 
3683      if (Utilities.noString(value))
3684        this.preferredReportName = null;
3685      else {
3686        if (this.preferredReportName == null)
3687          this.preferredReportName = new StringType();
3688        this.preferredReportName.setValue(value);
3689      }
3690      return this;
3691    }
3692
3693    /**
3694     * @return {@link #quantitativeDetails} (Characteristics for quantitative results of observations conforming to this ObservationDefinition.)
3695     */
3696    public ObservationDefinitionQuantitativeDetailsComponent getQuantitativeDetails() { 
3697      if (this.quantitativeDetails == null)
3698        if (Configuration.errorOnAutoCreate())
3699          throw new Error("Attempt to auto-create ObservationDefinition.quantitativeDetails");
3700        else if (Configuration.doAutoCreate())
3701          this.quantitativeDetails = new ObservationDefinitionQuantitativeDetailsComponent(); // cc
3702      return this.quantitativeDetails;
3703    }
3704
3705    public boolean hasQuantitativeDetails() { 
3706      return this.quantitativeDetails != null && !this.quantitativeDetails.isEmpty();
3707    }
3708
3709    /**
3710     * @param value {@link #quantitativeDetails} (Characteristics for quantitative results of observations conforming to this ObservationDefinition.)
3711     */
3712    public ObservationDefinition setQuantitativeDetails(ObservationDefinitionQuantitativeDetailsComponent value) { 
3713      this.quantitativeDetails = value;
3714      return this;
3715    }
3716
3717    /**
3718     * @return {@link #qualifiedValue} (A set of qualified values associated with a context and a set of conditions -  provides a range for quantitative and ordinal observations and a collection of value sets for qualitative observations.)
3719     */
3720    public List<ObservationDefinitionQualifiedValueComponent> getQualifiedValue() { 
3721      if (this.qualifiedValue == null)
3722        this.qualifiedValue = new ArrayList<ObservationDefinitionQualifiedValueComponent>();
3723      return this.qualifiedValue;
3724    }
3725
3726    /**
3727     * @return Returns a reference to <code>this</code> for easy method chaining
3728     */
3729    public ObservationDefinition setQualifiedValue(List<ObservationDefinitionQualifiedValueComponent> theQualifiedValue) { 
3730      this.qualifiedValue = theQualifiedValue;
3731      return this;
3732    }
3733
3734    public boolean hasQualifiedValue() { 
3735      if (this.qualifiedValue == null)
3736        return false;
3737      for (ObservationDefinitionQualifiedValueComponent item : this.qualifiedValue)
3738        if (!item.isEmpty())
3739          return true;
3740      return false;
3741    }
3742
3743    public ObservationDefinitionQualifiedValueComponent addQualifiedValue() { //3
3744      ObservationDefinitionQualifiedValueComponent t = new ObservationDefinitionQualifiedValueComponent();
3745      if (this.qualifiedValue == null)
3746        this.qualifiedValue = new ArrayList<ObservationDefinitionQualifiedValueComponent>();
3747      this.qualifiedValue.add(t);
3748      return t;
3749    }
3750
3751    public ObservationDefinition addQualifiedValue(ObservationDefinitionQualifiedValueComponent t) { //3
3752      if (t == null)
3753        return this;
3754      if (this.qualifiedValue == null)
3755        this.qualifiedValue = new ArrayList<ObservationDefinitionQualifiedValueComponent>();
3756      this.qualifiedValue.add(t);
3757      return this;
3758    }
3759
3760    /**
3761     * @return The first repetition of repeating field {@link #qualifiedValue}, creating it if it does not already exist {3}
3762     */
3763    public ObservationDefinitionQualifiedValueComponent getQualifiedValueFirstRep() { 
3764      if (getQualifiedValue().isEmpty()) {
3765        addQualifiedValue();
3766      }
3767      return getQualifiedValue().get(0);
3768    }
3769
3770    /**
3771     * @return {@link #hasMember} (This ObservationDefinition defines 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.)
3772     */
3773    public List<Reference> getHasMember() { 
3774      if (this.hasMember == null)
3775        this.hasMember = new ArrayList<Reference>();
3776      return this.hasMember;
3777    }
3778
3779    /**
3780     * @return Returns a reference to <code>this</code> for easy method chaining
3781     */
3782    public ObservationDefinition setHasMember(List<Reference> theHasMember) { 
3783      this.hasMember = theHasMember;
3784      return this;
3785    }
3786
3787    public boolean hasHasMember() { 
3788      if (this.hasMember == null)
3789        return false;
3790      for (Reference item : this.hasMember)
3791        if (!item.isEmpty())
3792          return true;
3793      return false;
3794    }
3795
3796    public Reference addHasMember() { //3
3797      Reference t = new Reference();
3798      if (this.hasMember == null)
3799        this.hasMember = new ArrayList<Reference>();
3800      this.hasMember.add(t);
3801      return t;
3802    }
3803
3804    public ObservationDefinition addHasMember(Reference t) { //3
3805      if (t == null)
3806        return this;
3807      if (this.hasMember == null)
3808        this.hasMember = new ArrayList<Reference>();
3809      this.hasMember.add(t);
3810      return this;
3811    }
3812
3813    /**
3814     * @return The first repetition of repeating field {@link #hasMember}, creating it if it does not already exist {3}
3815     */
3816    public Reference getHasMemberFirstRep() { 
3817      if (getHasMember().isEmpty()) {
3818        addHasMember();
3819      }
3820      return getHasMember().get(0);
3821    }
3822
3823    /**
3824     * @return {@link #component} (Some observations have multiple component observations, expressed as separate code value pairs.)
3825     */
3826    public List<ObservationDefinitionComponentComponent> getComponent() { 
3827      if (this.component == null)
3828        this.component = new ArrayList<ObservationDefinitionComponentComponent>();
3829      return this.component;
3830    }
3831
3832    /**
3833     * @return Returns a reference to <code>this</code> for easy method chaining
3834     */
3835    public ObservationDefinition setComponent(List<ObservationDefinitionComponentComponent> theComponent) { 
3836      this.component = theComponent;
3837      return this;
3838    }
3839
3840    public boolean hasComponent() { 
3841      if (this.component == null)
3842        return false;
3843      for (ObservationDefinitionComponentComponent item : this.component)
3844        if (!item.isEmpty())
3845          return true;
3846      return false;
3847    }
3848
3849    public ObservationDefinitionComponentComponent addComponent() { //3
3850      ObservationDefinitionComponentComponent t = new ObservationDefinitionComponentComponent();
3851      if (this.component == null)
3852        this.component = new ArrayList<ObservationDefinitionComponentComponent>();
3853      this.component.add(t);
3854      return t;
3855    }
3856
3857    public ObservationDefinition addComponent(ObservationDefinitionComponentComponent t) { //3
3858      if (t == null)
3859        return this;
3860      if (this.component == null)
3861        this.component = new ArrayList<ObservationDefinitionComponentComponent>();
3862      this.component.add(t);
3863      return this;
3864    }
3865
3866    /**
3867     * @return The first repetition of repeating field {@link #component}, creating it if it does not already exist {3}
3868     */
3869    public ObservationDefinitionComponentComponent getComponentFirstRep() { 
3870      if (getComponent().isEmpty()) {
3871        addComponent();
3872      }
3873      return getComponent().get(0);
3874    }
3875
3876      protected void listChildren(List<Property> children) {
3877        super.listChildren(children);
3878        children.add(new Property("url", "uri", "An absolute URL that is used to identify this ObservationDefinition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this ObservationDefinition is (or will be) published. The URL SHOULD include the major version of the ObservationDefinition. For more information see Technical and Business Versions.", 0, 1, url));
3879        children.add(new Property("identifier", "Identifier", "Business identifiers assigned to this ObservationDefinition. by the performer and/or other systems. These identifiers remain constant as the resource is updated and propagates from server to server.", 0, 1, identifier));
3880        children.add(new Property("version", "string", "The identifier that is used to identify this version of the ObservationDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the ObservationDefinition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions are orderable.", 0, 1, version));
3881        children.add(new Property("name", "string", "A natural language name identifying the ObservationDefinition. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name));
3882        children.add(new Property("title", "string", "A short, descriptive, user-friendly title for the ObservationDefinition.", 0, 1, title));
3883        children.add(new Property("status", "code", "The current state of the ObservationDefinition.", 0, 1, status));
3884        children.add(new Property("experimental", "boolean", "A flag to indicate that this ObservationDefinition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, 1, experimental));
3885        children.add(new Property("date", "dateTime", "The date (and optionally time) when the ObservationDefinition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ObservationDefinition changes.", 0, 1, date));
3886        children.add(new Property("publisher", "Reference(Practitioner|PractitionerRole|Organization)", "Helps establish the \"authority/credibility\" of the ObservationDefinition. May also allow for contact.", 0, 1, publisher));
3887        children.add(new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
3888        children.add(new Property("description", "markdown", "A free text natural language description of the ObservationDefinition from the consumer's perspective.", 0, 1, description));
3889        children.add(new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate ObservationDefinition instances.", 0, java.lang.Integer.MAX_VALUE, useContext));
3890        children.add(new Property("jurisdiction", "CodeableConcept", "A jurisdiction in which the ObservationDefinition is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction));
3891        children.add(new Property("purpose", "markdown", "Explains why this ObservationDefinition is needed and why it has been designed as it has.", 0, 1, purpose));
3892        children.add(new Property("copyright", "markdown", "Copyright statement relating to the ObservationDefinition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the ObservationDefinition.", 0, 1, copyright));
3893        children.add(new Property("approvalDate", "date", "The date on which the asset content was approved by the publisher. Approval happens once when the content is officially approved for usage.", 0, 1, approvalDate));
3894        children.add(new Property("lastReviewDate", "date", "The date on which the asset content was last reviewed. Review happens periodically after that, but doesn't change the original approval date.", 0, 1, lastReviewDate));
3895        children.add(new Property("effectivePeriod", "Period", "The period during which the ObservationDefinition content was or is planned to be effective.", 0, 1, effectivePeriod));
3896        children.add(new Property("derivedFromCanonical", "canonical(ObservationDefinition)", "The canonical URL pointing to another FHIR-defined ObservationDefinition that is adhered to in whole or in part by this definition.", 0, java.lang.Integer.MAX_VALUE, derivedFromCanonical));
3897        children.add(new Property("derivedFromUri", "uri", "The URL pointing to an externally-defined observation definition, guideline or other definition that is adhered to in whole or in part by this definition.", 0, java.lang.Integer.MAX_VALUE, derivedFromUri));
3898        children.add(new Property("subject", "CodeableConcept", "A code that describes the intended kind of subject of Observation instances conforming to this ObservationDefinition.", 0, java.lang.Integer.MAX_VALUE, subject));
3899        children.add(new Property("performerType", "CodeableConcept", "The type of individual/organization/device that is expected to act upon instances of this definition.", 0, 1, performerType));
3900        children.add(new Property("category", "CodeableConcept", "A code that classifies the general type of observation.", 0, java.lang.Integer.MAX_VALUE, category));
3901        children.add(new Property("code", "CodeableConcept", "Describes what will be observed. Sometimes this is called the observation \"name\".", 0, 1, code));
3902        children.add(new Property("permittedDataType", "code", "The data types allowed for the value element of the instance observations conforming to this ObservationDefinition.", 0, java.lang.Integer.MAX_VALUE, permittedDataType));
3903        children.add(new Property("multipleResultsAllowed", "boolean", "Multiple results allowed for observations conforming to this ObservationDefinition.", 0, 1, multipleResultsAllowed));
3904        children.add(new Property("bodySite", "CodeableConcept", "The site on the subject's body where the  observation is to be made.", 0, 1, bodySite));
3905        children.add(new Property("method", "CodeableConcept", "The method or technique used to perform the observation.", 0, 1, method));
3906        children.add(new Property("specimen", "Reference(SpecimenDefinition)", "The kind of specimen that this type of observation is produced on.", 0, java.lang.Integer.MAX_VALUE, specimen));
3907        children.add(new Property("device", "Reference(DeviceDefinition|Device)", "The measurement model of device or actual device used to produce observations of this type.", 0, java.lang.Integer.MAX_VALUE, device));
3908        children.add(new Property("preferredReportName", "string", "The preferred name to be used when reporting the results of observations conforming to this ObservationDefinition.", 0, 1, preferredReportName));
3909        children.add(new Property("quantitativeDetails", "", "Characteristics for quantitative results of observations conforming to this ObservationDefinition.", 0, 1, quantitativeDetails));
3910        children.add(new Property("qualifiedValue", "", "A set of qualified values associated with a context and a set of conditions -  provides a range for quantitative and ordinal observations and a collection of value sets for qualitative observations.", 0, java.lang.Integer.MAX_VALUE, qualifiedValue));
3911        children.add(new Property("hasMember", "Reference(ObservationDefinition|Questionnaire)", "This ObservationDefinition defines 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));
3912        children.add(new Property("component", "", "Some observations have multiple component observations, expressed as separate code value pairs.", 0, java.lang.Integer.MAX_VALUE, component));
3913      }
3914
3915      @Override
3916      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3917        switch (_hash) {
3918        case 116079: /*url*/  return new Property("url", "uri", "An absolute URL that is used to identify this ObservationDefinition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this ObservationDefinition is (or will be) published. The URL SHOULD include the major version of the ObservationDefinition. For more information see Technical and Business Versions.", 0, 1, url);
3919        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Business identifiers assigned to this ObservationDefinition. by the performer and/or other systems. These identifiers remain constant as the resource is updated and propagates from server to server.", 0, 1, identifier);
3920        case 351608024: /*version*/  return new Property("version", "string", "The identifier that is used to identify this version of the ObservationDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the ObservationDefinition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions are orderable.", 0, 1, version);
3921        case 3373707: /*name*/  return new Property("name", "string", "A natural language name identifying the ObservationDefinition. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name);
3922        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive, user-friendly title for the ObservationDefinition.", 0, 1, title);
3923        case -892481550: /*status*/  return new Property("status", "code", "The current state of the ObservationDefinition.", 0, 1, status);
3924        case -404562712: /*experimental*/  return new Property("experimental", "boolean", "A flag to indicate that this ObservationDefinition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, 1, experimental);
3925        case 3076014: /*date*/  return new Property("date", "dateTime", "The date (and optionally time) when the ObservationDefinition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the ObservationDefinition changes.", 0, 1, date);
3926        case 1447404028: /*publisher*/  return new Property("publisher", "Reference(Practitioner|PractitionerRole|Organization)", "Helps establish the \"authority/credibility\" of the ObservationDefinition. May also allow for contact.", 0, 1, publisher);
3927        case 951526432: /*contact*/  return new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact);
3928        case -1724546052: /*description*/  return new Property("description", "markdown", "A free text natural language description of the ObservationDefinition from the consumer's perspective.", 0, 1, description);
3929        case -669707736: /*useContext*/  return new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate ObservationDefinition instances.", 0, java.lang.Integer.MAX_VALUE, useContext);
3930        case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "A jurisdiction in which the ObservationDefinition is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction);
3931        case -220463842: /*purpose*/  return new Property("purpose", "markdown", "Explains why this ObservationDefinition is needed and why it has been designed as it has.", 0, 1, purpose);
3932        case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "Copyright statement relating to the ObservationDefinition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the ObservationDefinition.", 0, 1, copyright);
3933        case 223539345: /*approvalDate*/  return new Property("approvalDate", "date", "The date on which the asset content was approved by the publisher. Approval happens once when the content is officially approved for usage.", 0, 1, approvalDate);
3934        case -1687512484: /*lastReviewDate*/  return new Property("lastReviewDate", "date", "The date on which the asset content was last reviewed. Review happens periodically after that, but doesn't change the original approval date.", 0, 1, lastReviewDate);
3935        case -403934648: /*effectivePeriod*/  return new Property("effectivePeriod", "Period", "The period during which the ObservationDefinition content was or is planned to be effective.", 0, 1, effectivePeriod);
3936        case -978133683: /*derivedFromCanonical*/  return new Property("derivedFromCanonical", "canonical(ObservationDefinition)", "The canonical URL pointing to another FHIR-defined ObservationDefinition that is adhered to in whole or in part by this definition.", 0, java.lang.Integer.MAX_VALUE, derivedFromCanonical);
3937        case -1076333435: /*derivedFromUri*/  return new Property("derivedFromUri", "uri", "The URL pointing to an externally-defined observation definition, guideline or other definition that is adhered to in whole or in part by this definition.", 0, java.lang.Integer.MAX_VALUE, derivedFromUri);
3938        case -1867885268: /*subject*/  return new Property("subject", "CodeableConcept", "A code that describes the intended kind of subject of Observation instances conforming to this ObservationDefinition.", 0, java.lang.Integer.MAX_VALUE, subject);
3939        case -901444568: /*performerType*/  return new Property("performerType", "CodeableConcept", "The type of individual/organization/device that is expected to act upon instances of this definition.", 0, 1, performerType);
3940        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "A code that classifies the general type of observation.", 0, java.lang.Integer.MAX_VALUE, category);
3941        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "Describes what will be observed. Sometimes this is called the observation \"name\".", 0, 1, code);
3942        case -99492804: /*permittedDataType*/  return new Property("permittedDataType", "code", "The data types allowed for the value element of the instance observations conforming to this ObservationDefinition.", 0, java.lang.Integer.MAX_VALUE, permittedDataType);
3943        case -2102414590: /*multipleResultsAllowed*/  return new Property("multipleResultsAllowed", "boolean", "Multiple results allowed for observations conforming to this ObservationDefinition.", 0, 1, multipleResultsAllowed);
3944        case 1702620169: /*bodySite*/  return new Property("bodySite", "CodeableConcept", "The site on the subject's body where the  observation is to be made.", 0, 1, bodySite);
3945        case -1077554975: /*method*/  return new Property("method", "CodeableConcept", "The method or technique used to perform the observation.", 0, 1, method);
3946        case -2132868344: /*specimen*/  return new Property("specimen", "Reference(SpecimenDefinition)", "The kind of specimen that this type of observation is produced on.", 0, java.lang.Integer.MAX_VALUE, specimen);
3947        case -1335157162: /*device*/  return new Property("device", "Reference(DeviceDefinition|Device)", "The measurement model of device or actual device used to produce observations of this type.", 0, java.lang.Integer.MAX_VALUE, device);
3948        case -1851030208: /*preferredReportName*/  return new Property("preferredReportName", "string", "The preferred name to be used when reporting the results of observations conforming to this ObservationDefinition.", 0, 1, preferredReportName);
3949        case 842150763: /*quantitativeDetails*/  return new Property("quantitativeDetails", "", "Characteristics for quantitative results of observations conforming to this ObservationDefinition.", 0, 1, quantitativeDetails);
3950        case -558517707: /*qualifiedValue*/  return new Property("qualifiedValue", "", "A set of qualified values associated with a context and a set of conditions -  provides a range for quantitative and ordinal observations and a collection of value sets for qualitative observations.", 0, java.lang.Integer.MAX_VALUE, qualifiedValue);
3951        case -458019372: /*hasMember*/  return new Property("hasMember", "Reference(ObservationDefinition|Questionnaire)", "This ObservationDefinition defines 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);
3952        case -1399907075: /*component*/  return new Property("component", "", "Some observations have multiple component observations, expressed as separate code value pairs.", 0, java.lang.Integer.MAX_VALUE, component);
3953        default: return super.getNamedProperty(_hash, _name, _checkValid);
3954        }
3955
3956      }
3957
3958      @Override
3959      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3960        switch (hash) {
3961        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
3962        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
3963        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
3964        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
3965        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
3966        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
3967        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
3968        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
3969        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // Reference
3970        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
3971        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
3972        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
3973        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
3974        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // MarkdownType
3975        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
3976        case 223539345: /*approvalDate*/ return this.approvalDate == null ? new Base[0] : new Base[] {this.approvalDate}; // DateType
3977        case -1687512484: /*lastReviewDate*/ return this.lastReviewDate == null ? new Base[0] : new Base[] {this.lastReviewDate}; // DateType
3978        case -403934648: /*effectivePeriod*/ return this.effectivePeriod == null ? new Base[0] : new Base[] {this.effectivePeriod}; // Period
3979        case -978133683: /*derivedFromCanonical*/ return this.derivedFromCanonical == null ? new Base[0] : this.derivedFromCanonical.toArray(new Base[this.derivedFromCanonical.size()]); // CanonicalType
3980        case -1076333435: /*derivedFromUri*/ return this.derivedFromUri == null ? new Base[0] : this.derivedFromUri.toArray(new Base[this.derivedFromUri.size()]); // UriType
3981        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : this.subject.toArray(new Base[this.subject.size()]); // CodeableConcept
3982        case -901444568: /*performerType*/ return this.performerType == null ? new Base[0] : new Base[] {this.performerType}; // CodeableConcept
3983        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
3984        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
3985        case -99492804: /*permittedDataType*/ return this.permittedDataType == null ? new Base[0] : this.permittedDataType.toArray(new Base[this.permittedDataType.size()]); // Enumeration<ObservationDataType>
3986        case -2102414590: /*multipleResultsAllowed*/ return this.multipleResultsAllowed == null ? new Base[0] : new Base[] {this.multipleResultsAllowed}; // BooleanType
3987        case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // CodeableConcept
3988        case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept
3989        case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : this.specimen.toArray(new Base[this.specimen.size()]); // Reference
3990        case -1335157162: /*device*/ return this.device == null ? new Base[0] : this.device.toArray(new Base[this.device.size()]); // Reference
3991        case -1851030208: /*preferredReportName*/ return this.preferredReportName == null ? new Base[0] : new Base[] {this.preferredReportName}; // StringType
3992        case 842150763: /*quantitativeDetails*/ return this.quantitativeDetails == null ? new Base[0] : new Base[] {this.quantitativeDetails}; // ObservationDefinitionQuantitativeDetailsComponent
3993        case -558517707: /*qualifiedValue*/ return this.qualifiedValue == null ? new Base[0] : this.qualifiedValue.toArray(new Base[this.qualifiedValue.size()]); // ObservationDefinitionQualifiedValueComponent
3994        case -458019372: /*hasMember*/ return this.hasMember == null ? new Base[0] : this.hasMember.toArray(new Base[this.hasMember.size()]); // Reference
3995        case -1399907075: /*component*/ return this.component == null ? new Base[0] : this.component.toArray(new Base[this.component.size()]); // ObservationDefinitionComponentComponent
3996        default: return super.getProperty(hash, name, checkValid);
3997        }
3998
3999      }
4000
4001      @Override
4002      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4003        switch (hash) {
4004        case 116079: // url
4005          this.url = TypeConvertor.castToUri(value); // UriType
4006          return value;
4007        case -1618432855: // identifier
4008          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
4009          return value;
4010        case 351608024: // version
4011          this.version = TypeConvertor.castToString(value); // StringType
4012          return value;
4013        case 3373707: // name
4014          this.name = TypeConvertor.castToString(value); // StringType
4015          return value;
4016        case 110371416: // title
4017          this.title = TypeConvertor.castToString(value); // StringType
4018          return value;
4019        case -892481550: // status
4020          value = new PublicationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
4021          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
4022          return value;
4023        case -404562712: // experimental
4024          this.experimental = TypeConvertor.castToBoolean(value); // BooleanType
4025          return value;
4026        case 3076014: // date
4027          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
4028          return value;
4029        case 1447404028: // publisher
4030          this.publisher = TypeConvertor.castToReference(value); // Reference
4031          return value;
4032        case 951526432: // contact
4033          this.getContact().add(TypeConvertor.castToContactDetail(value)); // ContactDetail
4034          return value;
4035        case -1724546052: // description
4036          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
4037          return value;
4038        case -669707736: // useContext
4039          this.getUseContext().add(TypeConvertor.castToUsageContext(value)); // UsageContext
4040          return value;
4041        case -507075711: // jurisdiction
4042          this.getJurisdiction().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
4043          return value;
4044        case -220463842: // purpose
4045          this.purpose = TypeConvertor.castToMarkdown(value); // MarkdownType
4046          return value;
4047        case 1522889671: // copyright
4048          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
4049          return value;
4050        case 223539345: // approvalDate
4051          this.approvalDate = TypeConvertor.castToDate(value); // DateType
4052          return value;
4053        case -1687512484: // lastReviewDate
4054          this.lastReviewDate = TypeConvertor.castToDate(value); // DateType
4055          return value;
4056        case -403934648: // effectivePeriod
4057          this.effectivePeriod = TypeConvertor.castToPeriod(value); // Period
4058          return value;
4059        case -978133683: // derivedFromCanonical
4060          this.getDerivedFromCanonical().add(TypeConvertor.castToCanonical(value)); // CanonicalType
4061          return value;
4062        case -1076333435: // derivedFromUri
4063          this.getDerivedFromUri().add(TypeConvertor.castToUri(value)); // UriType
4064          return value;
4065        case -1867885268: // subject
4066          this.getSubject().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
4067          return value;
4068        case -901444568: // performerType
4069          this.performerType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4070          return value;
4071        case 50511102: // category
4072          this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
4073          return value;
4074        case 3059181: // code
4075          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4076          return value;
4077        case -99492804: // permittedDataType
4078          value = new ObservationDataTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
4079          this.getPermittedDataType().add((Enumeration) value); // Enumeration<ObservationDataType>
4080          return value;
4081        case -2102414590: // multipleResultsAllowed
4082          this.multipleResultsAllowed = TypeConvertor.castToBoolean(value); // BooleanType
4083          return value;
4084        case 1702620169: // bodySite
4085          this.bodySite = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4086          return value;
4087        case -1077554975: // method
4088          this.method = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4089          return value;
4090        case -2132868344: // specimen
4091          this.getSpecimen().add(TypeConvertor.castToReference(value)); // Reference
4092          return value;
4093        case -1335157162: // device
4094          this.getDevice().add(TypeConvertor.castToReference(value)); // Reference
4095          return value;
4096        case -1851030208: // preferredReportName
4097          this.preferredReportName = TypeConvertor.castToString(value); // StringType
4098          return value;
4099        case 842150763: // quantitativeDetails
4100          this.quantitativeDetails = (ObservationDefinitionQuantitativeDetailsComponent) value; // ObservationDefinitionQuantitativeDetailsComponent
4101          return value;
4102        case -558517707: // qualifiedValue
4103          this.getQualifiedValue().add((ObservationDefinitionQualifiedValueComponent) value); // ObservationDefinitionQualifiedValueComponent
4104          return value;
4105        case -458019372: // hasMember
4106          this.getHasMember().add(TypeConvertor.castToReference(value)); // Reference
4107          return value;
4108        case -1399907075: // component
4109          this.getComponent().add((ObservationDefinitionComponentComponent) value); // ObservationDefinitionComponentComponent
4110          return value;
4111        default: return super.setProperty(hash, name, value);
4112        }
4113
4114      }
4115
4116      @Override
4117      public Base setProperty(String name, Base value) throws FHIRException {
4118        if (name.equals("url")) {
4119          this.url = TypeConvertor.castToUri(value); // UriType
4120        } else if (name.equals("identifier")) {
4121          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
4122        } else if (name.equals("version")) {
4123          this.version = TypeConvertor.castToString(value); // StringType
4124        } else if (name.equals("name")) {
4125          this.name = TypeConvertor.castToString(value); // StringType
4126        } else if (name.equals("title")) {
4127          this.title = TypeConvertor.castToString(value); // StringType
4128        } else if (name.equals("status")) {
4129          value = new PublicationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
4130          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
4131        } else if (name.equals("experimental")) {
4132          this.experimental = TypeConvertor.castToBoolean(value); // BooleanType
4133        } else if (name.equals("date")) {
4134          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
4135        } else if (name.equals("publisher")) {
4136          this.publisher = TypeConvertor.castToReference(value); // Reference
4137        } else if (name.equals("contact")) {
4138          this.getContact().add(TypeConvertor.castToContactDetail(value));
4139        } else if (name.equals("description")) {
4140          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
4141        } else if (name.equals("useContext")) {
4142          this.getUseContext().add(TypeConvertor.castToUsageContext(value));
4143        } else if (name.equals("jurisdiction")) {
4144          this.getJurisdiction().add(TypeConvertor.castToCodeableConcept(value));
4145        } else if (name.equals("purpose")) {
4146          this.purpose = TypeConvertor.castToMarkdown(value); // MarkdownType
4147        } else if (name.equals("copyright")) {
4148          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
4149        } else if (name.equals("approvalDate")) {
4150          this.approvalDate = TypeConvertor.castToDate(value); // DateType
4151        } else if (name.equals("lastReviewDate")) {
4152          this.lastReviewDate = TypeConvertor.castToDate(value); // DateType
4153        } else if (name.equals("effectivePeriod")) {
4154          this.effectivePeriod = TypeConvertor.castToPeriod(value); // Period
4155        } else if (name.equals("derivedFromCanonical")) {
4156          this.getDerivedFromCanonical().add(TypeConvertor.castToCanonical(value));
4157        } else if (name.equals("derivedFromUri")) {
4158          this.getDerivedFromUri().add(TypeConvertor.castToUri(value));
4159        } else if (name.equals("subject")) {
4160          this.getSubject().add(TypeConvertor.castToCodeableConcept(value));
4161        } else if (name.equals("performerType")) {
4162          this.performerType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4163        } else if (name.equals("category")) {
4164          this.getCategory().add(TypeConvertor.castToCodeableConcept(value));
4165        } else if (name.equals("code")) {
4166          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4167        } else if (name.equals("permittedDataType")) {
4168          value = new ObservationDataTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
4169          this.getPermittedDataType().add((Enumeration) value);
4170        } else if (name.equals("multipleResultsAllowed")) {
4171          this.multipleResultsAllowed = TypeConvertor.castToBoolean(value); // BooleanType
4172        } else if (name.equals("bodySite")) {
4173          this.bodySite = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4174        } else if (name.equals("method")) {
4175          this.method = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4176        } else if (name.equals("specimen")) {
4177          this.getSpecimen().add(TypeConvertor.castToReference(value));
4178        } else if (name.equals("device")) {
4179          this.getDevice().add(TypeConvertor.castToReference(value));
4180        } else if (name.equals("preferredReportName")) {
4181          this.preferredReportName = TypeConvertor.castToString(value); // StringType
4182        } else if (name.equals("quantitativeDetails")) {
4183          this.quantitativeDetails = (ObservationDefinitionQuantitativeDetailsComponent) value; // ObservationDefinitionQuantitativeDetailsComponent
4184        } else if (name.equals("qualifiedValue")) {
4185          this.getQualifiedValue().add((ObservationDefinitionQualifiedValueComponent) value);
4186        } else if (name.equals("hasMember")) {
4187          this.getHasMember().add(TypeConvertor.castToReference(value));
4188        } else if (name.equals("component")) {
4189          this.getComponent().add((ObservationDefinitionComponentComponent) value);
4190        } else
4191          return super.setProperty(name, value);
4192        return value;
4193      }
4194
4195      @Override
4196      public Base makeProperty(int hash, String name) throws FHIRException {
4197        switch (hash) {
4198        case 116079:  return getUrlElement();
4199        case -1618432855:  return getIdentifier();
4200        case 351608024:  return getVersionElement();
4201        case 3373707:  return getNameElement();
4202        case 110371416:  return getTitleElement();
4203        case -892481550:  return getStatusElement();
4204        case -404562712:  return getExperimentalElement();
4205        case 3076014:  return getDateElement();
4206        case 1447404028:  return getPublisher();
4207        case 951526432:  return addContact(); 
4208        case -1724546052:  return getDescriptionElement();
4209        case -669707736:  return addUseContext(); 
4210        case -507075711:  return addJurisdiction(); 
4211        case -220463842:  return getPurposeElement();
4212        case 1522889671:  return getCopyrightElement();
4213        case 223539345:  return getApprovalDateElement();
4214        case -1687512484:  return getLastReviewDateElement();
4215        case -403934648:  return getEffectivePeriod();
4216        case -978133683:  return addDerivedFromCanonicalElement();
4217        case -1076333435:  return addDerivedFromUriElement();
4218        case -1867885268:  return addSubject(); 
4219        case -901444568:  return getPerformerType();
4220        case 50511102:  return addCategory(); 
4221        case 3059181:  return getCode();
4222        case -99492804:  return addPermittedDataTypeElement();
4223        case -2102414590:  return getMultipleResultsAllowedElement();
4224        case 1702620169:  return getBodySite();
4225        case -1077554975:  return getMethod();
4226        case -2132868344:  return addSpecimen(); 
4227        case -1335157162:  return addDevice(); 
4228        case -1851030208:  return getPreferredReportNameElement();
4229        case 842150763:  return getQuantitativeDetails();
4230        case -558517707:  return addQualifiedValue(); 
4231        case -458019372:  return addHasMember(); 
4232        case -1399907075:  return addComponent(); 
4233        default: return super.makeProperty(hash, name);
4234        }
4235
4236      }
4237
4238      @Override
4239      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4240        switch (hash) {
4241        case 116079: /*url*/ return new String[] {"uri"};
4242        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
4243        case 351608024: /*version*/ return new String[] {"string"};
4244        case 3373707: /*name*/ return new String[] {"string"};
4245        case 110371416: /*title*/ return new String[] {"string"};
4246        case -892481550: /*status*/ return new String[] {"code"};
4247        case -404562712: /*experimental*/ return new String[] {"boolean"};
4248        case 3076014: /*date*/ return new String[] {"dateTime"};
4249        case 1447404028: /*publisher*/ return new String[] {"Reference"};
4250        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
4251        case -1724546052: /*description*/ return new String[] {"markdown"};
4252        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
4253        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
4254        case -220463842: /*purpose*/ return new String[] {"markdown"};
4255        case 1522889671: /*copyright*/ return new String[] {"markdown"};
4256        case 223539345: /*approvalDate*/ return new String[] {"date"};
4257        case -1687512484: /*lastReviewDate*/ return new String[] {"date"};
4258        case -403934648: /*effectivePeriod*/ return new String[] {"Period"};
4259        case -978133683: /*derivedFromCanonical*/ return new String[] {"canonical"};
4260        case -1076333435: /*derivedFromUri*/ return new String[] {"uri"};
4261        case -1867885268: /*subject*/ return new String[] {"CodeableConcept"};
4262        case -901444568: /*performerType*/ return new String[] {"CodeableConcept"};
4263        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
4264        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
4265        case -99492804: /*permittedDataType*/ return new String[] {"code"};
4266        case -2102414590: /*multipleResultsAllowed*/ return new String[] {"boolean"};
4267        case 1702620169: /*bodySite*/ return new String[] {"CodeableConcept"};
4268        case -1077554975: /*method*/ return new String[] {"CodeableConcept"};
4269        case -2132868344: /*specimen*/ return new String[] {"Reference"};
4270        case -1335157162: /*device*/ return new String[] {"Reference"};
4271        case -1851030208: /*preferredReportName*/ return new String[] {"string"};
4272        case 842150763: /*quantitativeDetails*/ return new String[] {};
4273        case -558517707: /*qualifiedValue*/ return new String[] {};
4274        case -458019372: /*hasMember*/ return new String[] {"Reference"};
4275        case -1399907075: /*component*/ return new String[] {};
4276        default: return super.getTypesForProperty(hash, name);
4277        }
4278
4279      }
4280
4281      @Override
4282      public Base addChild(String name) throws FHIRException {
4283        if (name.equals("url")) {
4284          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.url");
4285        }
4286        else if (name.equals("identifier")) {
4287          this.identifier = new Identifier();
4288          return this.identifier;
4289        }
4290        else if (name.equals("version")) {
4291          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.version");
4292        }
4293        else if (name.equals("name")) {
4294          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.name");
4295        }
4296        else if (name.equals("title")) {
4297          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.title");
4298        }
4299        else if (name.equals("status")) {
4300          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.status");
4301        }
4302        else if (name.equals("experimental")) {
4303          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.experimental");
4304        }
4305        else if (name.equals("date")) {
4306          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.date");
4307        }
4308        else if (name.equals("publisher")) {
4309          this.publisher = new Reference();
4310          return this.publisher;
4311        }
4312        else if (name.equals("contact")) {
4313          return addContact();
4314        }
4315        else if (name.equals("description")) {
4316          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.description");
4317        }
4318        else if (name.equals("useContext")) {
4319          return addUseContext();
4320        }
4321        else if (name.equals("jurisdiction")) {
4322          return addJurisdiction();
4323        }
4324        else if (name.equals("purpose")) {
4325          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.purpose");
4326        }
4327        else if (name.equals("copyright")) {
4328          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.copyright");
4329        }
4330        else if (name.equals("approvalDate")) {
4331          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.approvalDate");
4332        }
4333        else if (name.equals("lastReviewDate")) {
4334          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.lastReviewDate");
4335        }
4336        else if (name.equals("effectivePeriod")) {
4337          this.effectivePeriod = new Period();
4338          return this.effectivePeriod;
4339        }
4340        else if (name.equals("derivedFromCanonical")) {
4341          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.derivedFromCanonical");
4342        }
4343        else if (name.equals("derivedFromUri")) {
4344          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.derivedFromUri");
4345        }
4346        else if (name.equals("subject")) {
4347          return addSubject();
4348        }
4349        else if (name.equals("performerType")) {
4350          this.performerType = new CodeableConcept();
4351          return this.performerType;
4352        }
4353        else if (name.equals("category")) {
4354          return addCategory();
4355        }
4356        else if (name.equals("code")) {
4357          this.code = new CodeableConcept();
4358          return this.code;
4359        }
4360        else if (name.equals("permittedDataType")) {
4361          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.permittedDataType");
4362        }
4363        else if (name.equals("multipleResultsAllowed")) {
4364          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.multipleResultsAllowed");
4365        }
4366        else if (name.equals("bodySite")) {
4367          this.bodySite = new CodeableConcept();
4368          return this.bodySite;
4369        }
4370        else if (name.equals("method")) {
4371          this.method = new CodeableConcept();
4372          return this.method;
4373        }
4374        else if (name.equals("specimen")) {
4375          return addSpecimen();
4376        }
4377        else if (name.equals("device")) {
4378          return addDevice();
4379        }
4380        else if (name.equals("preferredReportName")) {
4381          throw new FHIRException("Cannot call addChild on a primitive type ObservationDefinition.preferredReportName");
4382        }
4383        else if (name.equals("quantitativeDetails")) {
4384          this.quantitativeDetails = new ObservationDefinitionQuantitativeDetailsComponent();
4385          return this.quantitativeDetails;
4386        }
4387        else if (name.equals("qualifiedValue")) {
4388          return addQualifiedValue();
4389        }
4390        else if (name.equals("hasMember")) {
4391          return addHasMember();
4392        }
4393        else if (name.equals("component")) {
4394          return addComponent();
4395        }
4396        else
4397          return super.addChild(name);
4398      }
4399
4400  public String fhirType() {
4401    return "ObservationDefinition";
4402
4403  }
4404
4405      public ObservationDefinition copy() {
4406        ObservationDefinition dst = new ObservationDefinition();
4407        copyValues(dst);
4408        return dst;
4409      }
4410
4411      public void copyValues(ObservationDefinition dst) {
4412        super.copyValues(dst);
4413        dst.url = url == null ? null : url.copy();
4414        dst.identifier = identifier == null ? null : identifier.copy();
4415        dst.version = version == null ? null : version.copy();
4416        dst.name = name == null ? null : name.copy();
4417        dst.title = title == null ? null : title.copy();
4418        dst.status = status == null ? null : status.copy();
4419        dst.experimental = experimental == null ? null : experimental.copy();
4420        dst.date = date == null ? null : date.copy();
4421        dst.publisher = publisher == null ? null : publisher.copy();
4422        if (contact != null) {
4423          dst.contact = new ArrayList<ContactDetail>();
4424          for (ContactDetail i : contact)
4425            dst.contact.add(i.copy());
4426        };
4427        dst.description = description == null ? null : description.copy();
4428        if (useContext != null) {
4429          dst.useContext = new ArrayList<UsageContext>();
4430          for (UsageContext i : useContext)
4431            dst.useContext.add(i.copy());
4432        };
4433        if (jurisdiction != null) {
4434          dst.jurisdiction = new ArrayList<CodeableConcept>();
4435          for (CodeableConcept i : jurisdiction)
4436            dst.jurisdiction.add(i.copy());
4437        };
4438        dst.purpose = purpose == null ? null : purpose.copy();
4439        dst.copyright = copyright == null ? null : copyright.copy();
4440        dst.approvalDate = approvalDate == null ? null : approvalDate.copy();
4441        dst.lastReviewDate = lastReviewDate == null ? null : lastReviewDate.copy();
4442        dst.effectivePeriod = effectivePeriod == null ? null : effectivePeriod.copy();
4443        if (derivedFromCanonical != null) {
4444          dst.derivedFromCanonical = new ArrayList<CanonicalType>();
4445          for (CanonicalType i : derivedFromCanonical)
4446            dst.derivedFromCanonical.add(i.copy());
4447        };
4448        if (derivedFromUri != null) {
4449          dst.derivedFromUri = new ArrayList<UriType>();
4450          for (UriType i : derivedFromUri)
4451            dst.derivedFromUri.add(i.copy());
4452        };
4453        if (subject != null) {
4454          dst.subject = new ArrayList<CodeableConcept>();
4455          for (CodeableConcept i : subject)
4456            dst.subject.add(i.copy());
4457        };
4458        dst.performerType = performerType == null ? null : performerType.copy();
4459        if (category != null) {
4460          dst.category = new ArrayList<CodeableConcept>();
4461          for (CodeableConcept i : category)
4462            dst.category.add(i.copy());
4463        };
4464        dst.code = code == null ? null : code.copy();
4465        if (permittedDataType != null) {
4466          dst.permittedDataType = new ArrayList<Enumeration<ObservationDataType>>();
4467          for (Enumeration<ObservationDataType> i : permittedDataType)
4468            dst.permittedDataType.add(i.copy());
4469        };
4470        dst.multipleResultsAllowed = multipleResultsAllowed == null ? null : multipleResultsAllowed.copy();
4471        dst.bodySite = bodySite == null ? null : bodySite.copy();
4472        dst.method = method == null ? null : method.copy();
4473        if (specimen != null) {
4474          dst.specimen = new ArrayList<Reference>();
4475          for (Reference i : specimen)
4476            dst.specimen.add(i.copy());
4477        };
4478        if (device != null) {
4479          dst.device = new ArrayList<Reference>();
4480          for (Reference i : device)
4481            dst.device.add(i.copy());
4482        };
4483        dst.preferredReportName = preferredReportName == null ? null : preferredReportName.copy();
4484        dst.quantitativeDetails = quantitativeDetails == null ? null : quantitativeDetails.copy();
4485        if (qualifiedValue != null) {
4486          dst.qualifiedValue = new ArrayList<ObservationDefinitionQualifiedValueComponent>();
4487          for (ObservationDefinitionQualifiedValueComponent i : qualifiedValue)
4488            dst.qualifiedValue.add(i.copy());
4489        };
4490        if (hasMember != null) {
4491          dst.hasMember = new ArrayList<Reference>();
4492          for (Reference i : hasMember)
4493            dst.hasMember.add(i.copy());
4494        };
4495        if (component != null) {
4496          dst.component = new ArrayList<ObservationDefinitionComponentComponent>();
4497          for (ObservationDefinitionComponentComponent i : component)
4498            dst.component.add(i.copy());
4499        };
4500      }
4501
4502      protected ObservationDefinition typedCopy() {
4503        return copy();
4504      }
4505
4506      @Override
4507      public boolean equalsDeep(Base other_) {
4508        if (!super.equalsDeep(other_))
4509          return false;
4510        if (!(other_ instanceof ObservationDefinition))
4511          return false;
4512        ObservationDefinition o = (ObservationDefinition) other_;
4513        return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true)
4514           && compareDeep(name, o.name, true) && compareDeep(title, o.title, true) && compareDeep(status, o.status, true)
4515           && compareDeep(experimental, o.experimental, true) && compareDeep(date, o.date, true) && compareDeep(publisher, o.publisher, true)
4516           && compareDeep(contact, o.contact, true) && compareDeep(description, o.description, true) && compareDeep(useContext, o.useContext, true)
4517           && compareDeep(jurisdiction, o.jurisdiction, true) && compareDeep(purpose, o.purpose, true) && compareDeep(copyright, o.copyright, true)
4518           && compareDeep(approvalDate, o.approvalDate, true) && compareDeep(lastReviewDate, o.lastReviewDate, true)
4519           && compareDeep(effectivePeriod, o.effectivePeriod, true) && compareDeep(derivedFromCanonical, o.derivedFromCanonical, true)
4520           && compareDeep(derivedFromUri, o.derivedFromUri, true) && compareDeep(subject, o.subject, true)
4521           && compareDeep(performerType, o.performerType, true) && compareDeep(category, o.category, true)
4522           && compareDeep(code, o.code, true) && compareDeep(permittedDataType, o.permittedDataType, true)
4523           && compareDeep(multipleResultsAllowed, o.multipleResultsAllowed, true) && compareDeep(bodySite, o.bodySite, true)
4524           && compareDeep(method, o.method, true) && compareDeep(specimen, o.specimen, true) && compareDeep(device, o.device, true)
4525           && compareDeep(preferredReportName, o.preferredReportName, true) && compareDeep(quantitativeDetails, o.quantitativeDetails, true)
4526           && compareDeep(qualifiedValue, o.qualifiedValue, true) && compareDeep(hasMember, o.hasMember, true)
4527           && compareDeep(component, o.component, true);
4528      }
4529
4530      @Override
4531      public boolean equalsShallow(Base other_) {
4532        if (!super.equalsShallow(other_))
4533          return false;
4534        if (!(other_ instanceof ObservationDefinition))
4535          return false;
4536        ObservationDefinition o = (ObservationDefinition) other_;
4537        return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true)
4538           && compareValues(title, o.title, true) && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true)
4539           && compareValues(date, o.date, true) && compareValues(description, o.description, true) && compareValues(purpose, o.purpose, true)
4540           && compareValues(copyright, o.copyright, true) && compareValues(approvalDate, o.approvalDate, true)
4541           && compareValues(lastReviewDate, o.lastReviewDate, true) && compareValues(derivedFromCanonical, o.derivedFromCanonical, true)
4542           && compareValues(derivedFromUri, o.derivedFromUri, true) && compareValues(permittedDataType, o.permittedDataType, true)
4543           && compareValues(multipleResultsAllowed, o.multipleResultsAllowed, true) && compareValues(preferredReportName, o.preferredReportName, true)
4544          ;
4545      }
4546
4547      public boolean isEmpty() {
4548        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(url, identifier, version
4549          , name, title, status, experimental, date, publisher, contact, description, useContext
4550          , jurisdiction, purpose, copyright, approvalDate, lastReviewDate, effectivePeriod
4551          , derivedFromCanonical, derivedFromUri, subject, performerType, category, code, permittedDataType
4552          , multipleResultsAllowed, bodySite, method, specimen, device, preferredReportName
4553          , quantitativeDetails, qualifiedValue, hasMember, component);
4554      }
4555
4556  @Override
4557  public ResourceType getResourceType() {
4558    return ResourceType.ObservationDefinition;
4559   }
4560
4561 /**
4562   * Search parameter: <b>category</b>
4563   * <p>
4564   * Description: <b>Category (class) of observation</b><br>
4565   * Type: <b>token</b><br>
4566   * Path: <b>ObservationDefinition.category</b><br>
4567   * </p>
4568   */
4569  @SearchParamDefinition(name="category", path="ObservationDefinition.category", description="Category (class) of observation", type="token" )
4570  public static final String SP_CATEGORY = "category";
4571 /**
4572   * <b>Fluent Client</b> search parameter constant for <b>category</b>
4573   * <p>
4574   * Description: <b>Category (class) of observation</b><br>
4575   * Type: <b>token</b><br>
4576   * Path: <b>ObservationDefinition.category</b><br>
4577   * </p>
4578   */
4579  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
4580
4581 /**
4582   * Search parameter: <b>code</b>
4583   * <p>
4584   * Description: <b>Observation code</b><br>
4585   * Type: <b>token</b><br>
4586   * Path: <b>ObservationDefinition.code</b><br>
4587   * </p>
4588   */
4589  @SearchParamDefinition(name="code", path="ObservationDefinition.code", description="Observation code", type="token" )
4590  public static final String SP_CODE = "code";
4591 /**
4592   * <b>Fluent Client</b> search parameter constant for <b>code</b>
4593   * <p>
4594   * Description: <b>Observation code</b><br>
4595   * Type: <b>token</b><br>
4596   * Path: <b>ObservationDefinition.code</b><br>
4597   * </p>
4598   */
4599  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
4600
4601 /**
4602   * Search parameter: <b>experimental</b>
4603   * <p>
4604   * Description: <b>Not for genuine usage (true)</b><br>
4605   * Type: <b>token</b><br>
4606   * Path: <b>ObservationDefinition.experimental</b><br>
4607   * </p>
4608   */
4609  @SearchParamDefinition(name="experimental", path="ObservationDefinition.experimental", description="Not for genuine usage (true)", type="token" )
4610  public static final String SP_EXPERIMENTAL = "experimental";
4611 /**
4612   * <b>Fluent Client</b> search parameter constant for <b>experimental</b>
4613   * <p>
4614   * Description: <b>Not for genuine usage (true)</b><br>
4615   * Type: <b>token</b><br>
4616   * Path: <b>ObservationDefinition.experimental</b><br>
4617   * </p>
4618   */
4619  public static final ca.uhn.fhir.rest.gclient.TokenClientParam EXPERIMENTAL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EXPERIMENTAL);
4620
4621 /**
4622   * Search parameter: <b>identifier</b>
4623   * <p>
4624   * Description: <b>The unique identifier associated with the specimen definition</b><br>
4625   * Type: <b>token</b><br>
4626   * Path: <b>ObservationDefinition.identifier</b><br>
4627   * </p>
4628   */
4629  @SearchParamDefinition(name="identifier", path="ObservationDefinition.identifier", description="The unique identifier associated with the specimen definition", type="token" )
4630  public static final String SP_IDENTIFIER = "identifier";
4631 /**
4632   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
4633   * <p>
4634   * Description: <b>The unique identifier associated with the specimen definition</b><br>
4635   * Type: <b>token</b><br>
4636   * Path: <b>ObservationDefinition.identifier</b><br>
4637   * </p>
4638   */
4639  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
4640
4641 /**
4642   * Search parameter: <b>method</b>
4643   * <p>
4644   * Description: <b>Method of observation</b><br>
4645   * Type: <b>token</b><br>
4646   * Path: <b>ObservationDefinition.method</b><br>
4647   * </p>
4648   */
4649  @SearchParamDefinition(name="method", path="ObservationDefinition.method", description="Method of observation", type="token" )
4650  public static final String SP_METHOD = "method";
4651 /**
4652   * <b>Fluent Client</b> search parameter constant for <b>method</b>
4653   * <p>
4654   * Description: <b>Method of observation</b><br>
4655   * Type: <b>token</b><br>
4656   * Path: <b>ObservationDefinition.method</b><br>
4657   * </p>
4658   */
4659  public static final ca.uhn.fhir.rest.gclient.TokenClientParam METHOD = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_METHOD);
4660
4661 /**
4662   * Search parameter: <b>status</b>
4663   * <p>
4664   * Description: <b>Publication status of the ObservationDefinition: draft, active, retired, unknown</b><br>
4665   * Type: <b>token</b><br>
4666   * Path: <b>ObservationDefinition.status</b><br>
4667   * </p>
4668   */
4669  @SearchParamDefinition(name="status", path="ObservationDefinition.status", description="Publication status of the ObservationDefinition: draft, active, retired, unknown", type="token" )
4670  public static final String SP_STATUS = "status";
4671 /**
4672   * <b>Fluent Client</b> search parameter constant for <b>status</b>
4673   * <p>
4674   * Description: <b>Publication status of the ObservationDefinition: draft, active, retired, unknown</b><br>
4675   * Type: <b>token</b><br>
4676   * Path: <b>ObservationDefinition.status</b><br>
4677   * </p>
4678   */
4679  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
4680
4681 /**
4682   * Search parameter: <b>title</b>
4683   * <p>
4684   * Description: <b>Human-friendly name of the ObservationDefinition</b><br>
4685   * Type: <b>string</b><br>
4686   * Path: <b>ObservationDefinition.title</b><br>
4687   * </p>
4688   */
4689  @SearchParamDefinition(name="title", path="ObservationDefinition.title", description="Human-friendly name of the ObservationDefinition", type="string" )
4690  public static final String SP_TITLE = "title";
4691 /**
4692   * <b>Fluent Client</b> search parameter constant for <b>title</b>
4693   * <p>
4694   * Description: <b>Human-friendly name of the ObservationDefinition</b><br>
4695   * Type: <b>string</b><br>
4696   * Path: <b>ObservationDefinition.title</b><br>
4697   * </p>
4698   */
4699  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
4700
4701 /**
4702   * Search parameter: <b>url</b>
4703   * <p>
4704   * Description: <b>The uri that identifies the observation definition</b><br>
4705   * Type: <b>uri</b><br>
4706   * Path: <b>ObservationDefinition.url</b><br>
4707   * </p>
4708   */
4709  @SearchParamDefinition(name="url", path="ObservationDefinition.url", description="The uri that identifies the observation definition", type="uri" )
4710  public static final String SP_URL = "url";
4711 /**
4712   * <b>Fluent Client</b> search parameter constant for <b>url</b>
4713   * <p>
4714   * Description: <b>The uri that identifies the observation definition</b><br>
4715   * Type: <b>uri</b><br>
4716   * Path: <b>ObservationDefinition.url</b><br>
4717   * </p>
4718   */
4719  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
4720
4721
4722}
4723