001package org.hl7.fhir.dstu3.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Mon, Apr 17, 2017 17:38-0400 for FHIR v3.0.1
033
034import java.util.*;
035
036import java.math.*;
037import org.hl7.fhir.utilities.Utilities;
038import ca.uhn.fhir.model.api.annotation.Child;
039import ca.uhn.fhir.model.api.annotation.ChildOrder;
040import ca.uhn.fhir.model.api.annotation.Description;
041import ca.uhn.fhir.model.api.annotation.DatatypeDef;
042import ca.uhn.fhir.model.api.annotation.Block;
043import org.hl7.fhir.instance.model.api.*;
044import org.hl7.fhir.exceptions.FHIRException;
045/**
046 * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.
047 */
048@DatatypeDef(name="SampledData")
049public class SampledData extends Type implements ICompositeType {
050
051    /**
052     * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.
053     */
054    @Child(name = "origin", type = {SimpleQuantity.class}, order=0, min=1, max=1, modifier=false, summary=true)
055    @Description(shortDefinition="Zero value and units", formalDefinition="The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series." )
056    protected SimpleQuantity origin;
057
058    /**
059     * The length of time between sampling times, measured in milliseconds.
060     */
061    @Child(name = "period", type = {DecimalType.class}, order=1, min=1, max=1, modifier=false, summary=true)
062    @Description(shortDefinition="Number of milliseconds between samples", formalDefinition="The length of time between sampling times, measured in milliseconds." )
063    protected DecimalType period;
064
065    /**
066     * A correction factor that is applied to the sampled data points before they are added to the origin.
067     */
068    @Child(name = "factor", type = {DecimalType.class}, order=2, min=0, max=1, modifier=false, summary=true)
069    @Description(shortDefinition="Multiply data by this before adding to origin", formalDefinition="A correction factor that is applied to the sampled data points before they are added to the origin." )
070    protected DecimalType factor;
071
072    /**
073     * The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).
074     */
075    @Child(name = "lowerLimit", type = {DecimalType.class}, order=3, min=0, max=1, modifier=false, summary=true)
076    @Description(shortDefinition="Lower limit of detection", formalDefinition="The lower limit of detection of the measured points. This is needed if any of the data points have the value \"L\" (lower than detection limit)." )
077    protected DecimalType lowerLimit;
078
079    /**
080     * The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).
081     */
082    @Child(name = "upperLimit", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true)
083    @Description(shortDefinition="Upper limit of detection", formalDefinition="The upper limit of detection of the measured points. This is needed if any of the data points have the value \"U\" (higher than detection limit)." )
084    protected DecimalType upperLimit;
085
086    /**
087     * The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.
088     */
089    @Child(name = "dimensions", type = {PositiveIntType.class}, order=5, min=1, max=1, modifier=false, summary=true)
090    @Description(shortDefinition="Number of sample points at each time point", formalDefinition="The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once." )
091    protected PositiveIntType dimensions;
092
093    /**
094     * A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.
095     */
096    @Child(name = "data", type = {StringType.class}, order=6, min=1, max=1, modifier=false, summary=false)
097    @Description(shortDefinition="Decimal values with spaces, or \"E\" | \"U\" | \"L\"", formalDefinition="A series of data points which are decimal values separated by a single space (character u20). The special values \"E\" (error), \"L\" (below detection limit) and \"U\" (above detection limit) can also be used in place of a decimal value." )
098    protected StringType data;
099
100    private static final long serialVersionUID = -1763278368L;
101
102  /**
103   * Constructor
104   */
105    public SampledData() {
106      super();
107    }
108
109  /**
110   * Constructor
111   */
112    public SampledData(SimpleQuantity origin, DecimalType period, PositiveIntType dimensions, StringType data) {
113      super();
114      this.origin = origin;
115      this.period = period;
116      this.dimensions = dimensions;
117      this.data = data;
118    }
119
120    /**
121     * @return {@link #origin} (The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.)
122     */
123    public SimpleQuantity getOrigin() { 
124      if (this.origin == null)
125        if (Configuration.errorOnAutoCreate())
126          throw new Error("Attempt to auto-create SampledData.origin");
127        else if (Configuration.doAutoCreate())
128          this.origin = new SimpleQuantity(); // cc
129      return this.origin;
130    }
131
132    public boolean hasOrigin() { 
133      return this.origin != null && !this.origin.isEmpty();
134    }
135
136    /**
137     * @param value {@link #origin} (The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.)
138     */
139    public SampledData setOrigin(SimpleQuantity value) { 
140      this.origin = value;
141      return this;
142    }
143
144    /**
145     * @return {@link #period} (The length of time between sampling times, measured in milliseconds.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value
146     */
147    public DecimalType getPeriodElement() { 
148      if (this.period == null)
149        if (Configuration.errorOnAutoCreate())
150          throw new Error("Attempt to auto-create SampledData.period");
151        else if (Configuration.doAutoCreate())
152          this.period = new DecimalType(); // bb
153      return this.period;
154    }
155
156    public boolean hasPeriodElement() { 
157      return this.period != null && !this.period.isEmpty();
158    }
159
160    public boolean hasPeriod() { 
161      return this.period != null && !this.period.isEmpty();
162    }
163
164    /**
165     * @param value {@link #period} (The length of time between sampling times, measured in milliseconds.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value
166     */
167    public SampledData setPeriodElement(DecimalType value) { 
168      this.period = value;
169      return this;
170    }
171
172    /**
173     * @return The length of time between sampling times, measured in milliseconds.
174     */
175    public BigDecimal getPeriod() { 
176      return this.period == null ? null : this.period.getValue();
177    }
178
179    /**
180     * @param value The length of time between sampling times, measured in milliseconds.
181     */
182    public SampledData setPeriod(BigDecimal value) { 
183        if (this.period == null)
184          this.period = new DecimalType();
185        this.period.setValue(value);
186      return this;
187    }
188
189    /**
190     * @param value The length of time between sampling times, measured in milliseconds.
191     */
192    public SampledData setPeriod(long value) { 
193          this.period = new DecimalType();
194        this.period.setValue(value);
195      return this;
196    }
197
198    /**
199     * @param value The length of time between sampling times, measured in milliseconds.
200     */
201    public SampledData setPeriod(double value) { 
202          this.period = new DecimalType();
203        this.period.setValue(value);
204      return this;
205    }
206
207    /**
208     * @return {@link #factor} (A correction factor that is applied to the sampled data points before they are added to the origin.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value
209     */
210    public DecimalType getFactorElement() { 
211      if (this.factor == null)
212        if (Configuration.errorOnAutoCreate())
213          throw new Error("Attempt to auto-create SampledData.factor");
214        else if (Configuration.doAutoCreate())
215          this.factor = new DecimalType(); // bb
216      return this.factor;
217    }
218
219    public boolean hasFactorElement() { 
220      return this.factor != null && !this.factor.isEmpty();
221    }
222
223    public boolean hasFactor() { 
224      return this.factor != null && !this.factor.isEmpty();
225    }
226
227    /**
228     * @param value {@link #factor} (A correction factor that is applied to the sampled data points before they are added to the origin.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value
229     */
230    public SampledData setFactorElement(DecimalType value) { 
231      this.factor = value;
232      return this;
233    }
234
235    /**
236     * @return A correction factor that is applied to the sampled data points before they are added to the origin.
237     */
238    public BigDecimal getFactor() { 
239      return this.factor == null ? null : this.factor.getValue();
240    }
241
242    /**
243     * @param value A correction factor that is applied to the sampled data points before they are added to the origin.
244     */
245    public SampledData setFactor(BigDecimal value) { 
246      if (value == null)
247        this.factor = null;
248      else {
249        if (this.factor == null)
250          this.factor = new DecimalType();
251        this.factor.setValue(value);
252      }
253      return this;
254    }
255
256    /**
257     * @param value A correction factor that is applied to the sampled data points before they are added to the origin.
258     */
259    public SampledData setFactor(long value) { 
260          this.factor = new DecimalType();
261        this.factor.setValue(value);
262      return this;
263    }
264
265    /**
266     * @param value A correction factor that is applied to the sampled data points before they are added to the origin.
267     */
268    public SampledData setFactor(double value) { 
269          this.factor = new DecimalType();
270        this.factor.setValue(value);
271      return this;
272    }
273
274    /**
275     * @return {@link #lowerLimit} (The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).). This is the underlying object with id, value and extensions. The accessor "getLowerLimit" gives direct access to the value
276     */
277    public DecimalType getLowerLimitElement() { 
278      if (this.lowerLimit == null)
279        if (Configuration.errorOnAutoCreate())
280          throw new Error("Attempt to auto-create SampledData.lowerLimit");
281        else if (Configuration.doAutoCreate())
282          this.lowerLimit = new DecimalType(); // bb
283      return this.lowerLimit;
284    }
285
286    public boolean hasLowerLimitElement() { 
287      return this.lowerLimit != null && !this.lowerLimit.isEmpty();
288    }
289
290    public boolean hasLowerLimit() { 
291      return this.lowerLimit != null && !this.lowerLimit.isEmpty();
292    }
293
294    /**
295     * @param value {@link #lowerLimit} (The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).). This is the underlying object with id, value and extensions. The accessor "getLowerLimit" gives direct access to the value
296     */
297    public SampledData setLowerLimitElement(DecimalType value) { 
298      this.lowerLimit = value;
299      return this;
300    }
301
302    /**
303     * @return The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).
304     */
305    public BigDecimal getLowerLimit() { 
306      return this.lowerLimit == null ? null : this.lowerLimit.getValue();
307    }
308
309    /**
310     * @param value The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).
311     */
312    public SampledData setLowerLimit(BigDecimal value) { 
313      if (value == null)
314        this.lowerLimit = null;
315      else {
316        if (this.lowerLimit == null)
317          this.lowerLimit = new DecimalType();
318        this.lowerLimit.setValue(value);
319      }
320      return this;
321    }
322
323    /**
324     * @param value The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).
325     */
326    public SampledData setLowerLimit(long value) { 
327          this.lowerLimit = new DecimalType();
328        this.lowerLimit.setValue(value);
329      return this;
330    }
331
332    /**
333     * @param value The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).
334     */
335    public SampledData setLowerLimit(double value) { 
336          this.lowerLimit = new DecimalType();
337        this.lowerLimit.setValue(value);
338      return this;
339    }
340
341    /**
342     * @return {@link #upperLimit} (The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).). This is the underlying object with id, value and extensions. The accessor "getUpperLimit" gives direct access to the value
343     */
344    public DecimalType getUpperLimitElement() { 
345      if (this.upperLimit == null)
346        if (Configuration.errorOnAutoCreate())
347          throw new Error("Attempt to auto-create SampledData.upperLimit");
348        else if (Configuration.doAutoCreate())
349          this.upperLimit = new DecimalType(); // bb
350      return this.upperLimit;
351    }
352
353    public boolean hasUpperLimitElement() { 
354      return this.upperLimit != null && !this.upperLimit.isEmpty();
355    }
356
357    public boolean hasUpperLimit() { 
358      return this.upperLimit != null && !this.upperLimit.isEmpty();
359    }
360
361    /**
362     * @param value {@link #upperLimit} (The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).). This is the underlying object with id, value and extensions. The accessor "getUpperLimit" gives direct access to the value
363     */
364    public SampledData setUpperLimitElement(DecimalType value) { 
365      this.upperLimit = value;
366      return this;
367    }
368
369    /**
370     * @return The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).
371     */
372    public BigDecimal getUpperLimit() { 
373      return this.upperLimit == null ? null : this.upperLimit.getValue();
374    }
375
376    /**
377     * @param value The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).
378     */
379    public SampledData setUpperLimit(BigDecimal value) { 
380      if (value == null)
381        this.upperLimit = null;
382      else {
383        if (this.upperLimit == null)
384          this.upperLimit = new DecimalType();
385        this.upperLimit.setValue(value);
386      }
387      return this;
388    }
389
390    /**
391     * @param value The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).
392     */
393    public SampledData setUpperLimit(long value) { 
394          this.upperLimit = new DecimalType();
395        this.upperLimit.setValue(value);
396      return this;
397    }
398
399    /**
400     * @param value The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).
401     */
402    public SampledData setUpperLimit(double value) { 
403          this.upperLimit = new DecimalType();
404        this.upperLimit.setValue(value);
405      return this;
406    }
407
408    /**
409     * @return {@link #dimensions} (The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.). This is the underlying object with id, value and extensions. The accessor "getDimensions" gives direct access to the value
410     */
411    public PositiveIntType getDimensionsElement() { 
412      if (this.dimensions == null)
413        if (Configuration.errorOnAutoCreate())
414          throw new Error("Attempt to auto-create SampledData.dimensions");
415        else if (Configuration.doAutoCreate())
416          this.dimensions = new PositiveIntType(); // bb
417      return this.dimensions;
418    }
419
420    public boolean hasDimensionsElement() { 
421      return this.dimensions != null && !this.dimensions.isEmpty();
422    }
423
424    public boolean hasDimensions() { 
425      return this.dimensions != null && !this.dimensions.isEmpty();
426    }
427
428    /**
429     * @param value {@link #dimensions} (The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.). This is the underlying object with id, value and extensions. The accessor "getDimensions" gives direct access to the value
430     */
431    public SampledData setDimensionsElement(PositiveIntType value) { 
432      this.dimensions = value;
433      return this;
434    }
435
436    /**
437     * @return The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.
438     */
439    public int getDimensions() { 
440      return this.dimensions == null || this.dimensions.isEmpty() ? 0 : this.dimensions.getValue();
441    }
442
443    /**
444     * @param value The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.
445     */
446    public SampledData setDimensions(int value) { 
447        if (this.dimensions == null)
448          this.dimensions = new PositiveIntType();
449        this.dimensions.setValue(value);
450      return this;
451    }
452
453    /**
454     * @return {@link #data} (A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value
455     */
456    public StringType getDataElement() { 
457      if (this.data == null)
458        if (Configuration.errorOnAutoCreate())
459          throw new Error("Attempt to auto-create SampledData.data");
460        else if (Configuration.doAutoCreate())
461          this.data = new StringType(); // bb
462      return this.data;
463    }
464
465    public boolean hasDataElement() { 
466      return this.data != null && !this.data.isEmpty();
467    }
468
469    public boolean hasData() { 
470      return this.data != null && !this.data.isEmpty();
471    }
472
473    /**
474     * @param value {@link #data} (A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value
475     */
476    public SampledData setDataElement(StringType value) { 
477      this.data = value;
478      return this;
479    }
480
481    /**
482     * @return A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.
483     */
484    public String getData() { 
485      return this.data == null ? null : this.data.getValue();
486    }
487
488    /**
489     * @param value A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.
490     */
491    public SampledData setData(String value) { 
492        if (this.data == null)
493          this.data = new StringType();
494        this.data.setValue(value);
495      return this;
496    }
497
498      protected void listChildren(List<Property> childrenList) {
499        super.listChildren(childrenList);
500        childrenList.add(new Property("origin", "SimpleQuantity", "The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.", 0, java.lang.Integer.MAX_VALUE, origin));
501        childrenList.add(new Property("period", "decimal", "The length of time between sampling times, measured in milliseconds.", 0, java.lang.Integer.MAX_VALUE, period));
502        childrenList.add(new Property("factor", "decimal", "A correction factor that is applied to the sampled data points before they are added to the origin.", 0, java.lang.Integer.MAX_VALUE, factor));
503        childrenList.add(new Property("lowerLimit", "decimal", "The lower limit of detection of the measured points. This is needed if any of the data points have the value \"L\" (lower than detection limit).", 0, java.lang.Integer.MAX_VALUE, lowerLimit));
504        childrenList.add(new Property("upperLimit", "decimal", "The upper limit of detection of the measured points. This is needed if any of the data points have the value \"U\" (higher than detection limit).", 0, java.lang.Integer.MAX_VALUE, upperLimit));
505        childrenList.add(new Property("dimensions", "positiveInt", "The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.", 0, java.lang.Integer.MAX_VALUE, dimensions));
506        childrenList.add(new Property("data", "string", "A series of data points which are decimal values separated by a single space (character u20). The special values \"E\" (error), \"L\" (below detection limit) and \"U\" (above detection limit) can also be used in place of a decimal value.", 0, java.lang.Integer.MAX_VALUE, data));
507      }
508
509      @Override
510      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
511        switch (hash) {
512        case -1008619738: /*origin*/ return this.origin == null ? new Base[0] : new Base[] {this.origin}; // SimpleQuantity
513        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // DecimalType
514        case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType
515        case 1209133370: /*lowerLimit*/ return this.lowerLimit == null ? new Base[0] : new Base[] {this.lowerLimit}; // DecimalType
516        case -1681713095: /*upperLimit*/ return this.upperLimit == null ? new Base[0] : new Base[] {this.upperLimit}; // DecimalType
517        case 414334925: /*dimensions*/ return this.dimensions == null ? new Base[0] : new Base[] {this.dimensions}; // PositiveIntType
518        case 3076010: /*data*/ return this.data == null ? new Base[0] : new Base[] {this.data}; // StringType
519        default: return super.getProperty(hash, name, checkValid);
520        }
521
522      }
523
524      @Override
525      public Base setProperty(int hash, String name, Base value) throws FHIRException {
526        switch (hash) {
527        case -1008619738: // origin
528          this.origin = castToSimpleQuantity(value); // SimpleQuantity
529          return value;
530        case -991726143: // period
531          this.period = castToDecimal(value); // DecimalType
532          return value;
533        case -1282148017: // factor
534          this.factor = castToDecimal(value); // DecimalType
535          return value;
536        case 1209133370: // lowerLimit
537          this.lowerLimit = castToDecimal(value); // DecimalType
538          return value;
539        case -1681713095: // upperLimit
540          this.upperLimit = castToDecimal(value); // DecimalType
541          return value;
542        case 414334925: // dimensions
543          this.dimensions = castToPositiveInt(value); // PositiveIntType
544          return value;
545        case 3076010: // data
546          this.data = castToString(value); // StringType
547          return value;
548        default: return super.setProperty(hash, name, value);
549        }
550
551      }
552
553      @Override
554      public Base setProperty(String name, Base value) throws FHIRException {
555        if (name.equals("origin")) {
556          this.origin = castToSimpleQuantity(value); // SimpleQuantity
557        } else if (name.equals("period")) {
558          this.period = castToDecimal(value); // DecimalType
559        } else if (name.equals("factor")) {
560          this.factor = castToDecimal(value); // DecimalType
561        } else if (name.equals("lowerLimit")) {
562          this.lowerLimit = castToDecimal(value); // DecimalType
563        } else if (name.equals("upperLimit")) {
564          this.upperLimit = castToDecimal(value); // DecimalType
565        } else if (name.equals("dimensions")) {
566          this.dimensions = castToPositiveInt(value); // PositiveIntType
567        } else if (name.equals("data")) {
568          this.data = castToString(value); // StringType
569        } else
570          return super.setProperty(name, value);
571        return value;
572      }
573
574      @Override
575      public Base makeProperty(int hash, String name) throws FHIRException {
576        switch (hash) {
577        case -1008619738:  return getOrigin(); 
578        case -991726143:  return getPeriodElement();
579        case -1282148017:  return getFactorElement();
580        case 1209133370:  return getLowerLimitElement();
581        case -1681713095:  return getUpperLimitElement();
582        case 414334925:  return getDimensionsElement();
583        case 3076010:  return getDataElement();
584        default: return super.makeProperty(hash, name);
585        }
586
587      }
588
589      @Override
590      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
591        switch (hash) {
592        case -1008619738: /*origin*/ return new String[] {"SimpleQuantity"};
593        case -991726143: /*period*/ return new String[] {"decimal"};
594        case -1282148017: /*factor*/ return new String[] {"decimal"};
595        case 1209133370: /*lowerLimit*/ return new String[] {"decimal"};
596        case -1681713095: /*upperLimit*/ return new String[] {"decimal"};
597        case 414334925: /*dimensions*/ return new String[] {"positiveInt"};
598        case 3076010: /*data*/ return new String[] {"string"};
599        default: return super.getTypesForProperty(hash, name);
600        }
601
602      }
603
604      @Override
605      public Base addChild(String name) throws FHIRException {
606        if (name.equals("origin")) {
607          this.origin = new SimpleQuantity();
608          return this.origin;
609        }
610        else if (name.equals("period")) {
611          throw new FHIRException("Cannot call addChild on a primitive type SampledData.period");
612        }
613        else if (name.equals("factor")) {
614          throw new FHIRException("Cannot call addChild on a primitive type SampledData.factor");
615        }
616        else if (name.equals("lowerLimit")) {
617          throw new FHIRException("Cannot call addChild on a primitive type SampledData.lowerLimit");
618        }
619        else if (name.equals("upperLimit")) {
620          throw new FHIRException("Cannot call addChild on a primitive type SampledData.upperLimit");
621        }
622        else if (name.equals("dimensions")) {
623          throw new FHIRException("Cannot call addChild on a primitive type SampledData.dimensions");
624        }
625        else if (name.equals("data")) {
626          throw new FHIRException("Cannot call addChild on a primitive type SampledData.data");
627        }
628        else
629          return super.addChild(name);
630      }
631
632  public String fhirType() {
633    return "SampledData";
634
635  }
636
637      public SampledData copy() {
638        SampledData dst = new SampledData();
639        copyValues(dst);
640        dst.origin = origin == null ? null : origin.copy();
641        dst.period = period == null ? null : period.copy();
642        dst.factor = factor == null ? null : factor.copy();
643        dst.lowerLimit = lowerLimit == null ? null : lowerLimit.copy();
644        dst.upperLimit = upperLimit == null ? null : upperLimit.copy();
645        dst.dimensions = dimensions == null ? null : dimensions.copy();
646        dst.data = data == null ? null : data.copy();
647        return dst;
648      }
649
650      protected SampledData typedCopy() {
651        return copy();
652      }
653
654      @Override
655      public boolean equalsDeep(Base other) {
656        if (!super.equalsDeep(other))
657          return false;
658        if (!(other instanceof SampledData))
659          return false;
660        SampledData o = (SampledData) other;
661        return compareDeep(origin, o.origin, true) && compareDeep(period, o.period, true) && compareDeep(factor, o.factor, true)
662           && compareDeep(lowerLimit, o.lowerLimit, true) && compareDeep(upperLimit, o.upperLimit, true) && compareDeep(dimensions, o.dimensions, true)
663           && compareDeep(data, o.data, true);
664      }
665
666      @Override
667      public boolean equalsShallow(Base other) {
668        if (!super.equalsShallow(other))
669          return false;
670        if (!(other instanceof SampledData))
671          return false;
672        SampledData o = (SampledData) other;
673        return compareValues(period, o.period, true) && compareValues(factor, o.factor, true) && compareValues(lowerLimit, o.lowerLimit, true)
674           && compareValues(upperLimit, o.upperLimit, true) && compareValues(dimensions, o.dimensions, true) && compareValues(data, o.data, true)
675          ;
676      }
677
678      public boolean isEmpty() {
679        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(origin, period, factor, lowerLimit
680          , upperLimit, dimensions, data);
681      }
682
683
684}
685