001package org.hl7.fhir.r4.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 Thu, Sep 13, 2018 09:04-0400 for FHIR v3.5.0
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 = {Quantity.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 Quantity 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=0, 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 = -1984181262L;
101
102  /**
103   * Constructor
104   */
105    public SampledData() {
106      super();
107    }
108
109  /**
110   * Constructor
111   */
112    public SampledData(Quantity origin, DecimalType period, PositiveIntType dimensions) {
113      super();
114      this.origin = origin;
115      this.period = period;
116      this.dimensions = dimensions;
117    }
118
119    /**
120     * @return {@link #origin} (The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.)
121     */
122    public Quantity getOrigin() { 
123      if (this.origin == null)
124        if (Configuration.errorOnAutoCreate())
125          throw new Error("Attempt to auto-create SampledData.origin");
126        else if (Configuration.doAutoCreate())
127          this.origin = new Quantity(); // cc
128      return this.origin;
129    }
130
131    public boolean hasOrigin() { 
132      return this.origin != null && !this.origin.isEmpty();
133    }
134
135    /**
136     * @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.)
137     */
138    public SampledData setOrigin(Quantity value) { 
139      this.origin = value;
140      return this;
141    }
142
143    /**
144     * @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
145     */
146    public DecimalType getPeriodElement() { 
147      if (this.period == null)
148        if (Configuration.errorOnAutoCreate())
149          throw new Error("Attempt to auto-create SampledData.period");
150        else if (Configuration.doAutoCreate())
151          this.period = new DecimalType(); // bb
152      return this.period;
153    }
154
155    public boolean hasPeriodElement() { 
156      return this.period != null && !this.period.isEmpty();
157    }
158
159    public boolean hasPeriod() { 
160      return this.period != null && !this.period.isEmpty();
161    }
162
163    /**
164     * @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
165     */
166    public SampledData setPeriodElement(DecimalType value) { 
167      this.period = value;
168      return this;
169    }
170
171    /**
172     * @return The length of time between sampling times, measured in milliseconds.
173     */
174    public BigDecimal getPeriod() { 
175      return this.period == null ? null : this.period.getValue();
176    }
177
178    /**
179     * @param value The length of time between sampling times, measured in milliseconds.
180     */
181    public SampledData setPeriod(BigDecimal value) { 
182        if (this.period == null)
183          this.period = new DecimalType();
184        this.period.setValue(value);
185      return this;
186    }
187
188    /**
189     * @param value The length of time between sampling times, measured in milliseconds.
190     */
191    public SampledData setPeriod(long value) { 
192          this.period = new DecimalType();
193        this.period.setValue(value);
194      return this;
195    }
196
197    /**
198     * @param value The length of time between sampling times, measured in milliseconds.
199     */
200    public SampledData setPeriod(double value) { 
201          this.period = new DecimalType();
202        this.period.setValue(value);
203      return this;
204    }
205
206    /**
207     * @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
208     */
209    public DecimalType getFactorElement() { 
210      if (this.factor == null)
211        if (Configuration.errorOnAutoCreate())
212          throw new Error("Attempt to auto-create SampledData.factor");
213        else if (Configuration.doAutoCreate())
214          this.factor = new DecimalType(); // bb
215      return this.factor;
216    }
217
218    public boolean hasFactorElement() { 
219      return this.factor != null && !this.factor.isEmpty();
220    }
221
222    public boolean hasFactor() { 
223      return this.factor != null && !this.factor.isEmpty();
224    }
225
226    /**
227     * @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
228     */
229    public SampledData setFactorElement(DecimalType value) { 
230      this.factor = value;
231      return this;
232    }
233
234    /**
235     * @return A correction factor that is applied to the sampled data points before they are added to the origin.
236     */
237    public BigDecimal getFactor() { 
238      return this.factor == null ? null : this.factor.getValue();
239    }
240
241    /**
242     * @param value A correction factor that is applied to the sampled data points before they are added to the origin.
243     */
244    public SampledData setFactor(BigDecimal value) { 
245      if (value == null)
246        this.factor = null;
247      else {
248        if (this.factor == null)
249          this.factor = new DecimalType();
250        this.factor.setValue(value);
251      }
252      return this;
253    }
254
255    /**
256     * @param value A correction factor that is applied to the sampled data points before they are added to the origin.
257     */
258    public SampledData setFactor(long value) { 
259          this.factor = new DecimalType();
260        this.factor.setValue(value);
261      return this;
262    }
263
264    /**
265     * @param value A correction factor that is applied to the sampled data points before they are added to the origin.
266     */
267    public SampledData setFactor(double value) { 
268          this.factor = new DecimalType();
269        this.factor.setValue(value);
270      return this;
271    }
272
273    /**
274     * @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
275     */
276    public DecimalType getLowerLimitElement() { 
277      if (this.lowerLimit == null)
278        if (Configuration.errorOnAutoCreate())
279          throw new Error("Attempt to auto-create SampledData.lowerLimit");
280        else if (Configuration.doAutoCreate())
281          this.lowerLimit = new DecimalType(); // bb
282      return this.lowerLimit;
283    }
284
285    public boolean hasLowerLimitElement() { 
286      return this.lowerLimit != null && !this.lowerLimit.isEmpty();
287    }
288
289    public boolean hasLowerLimit() { 
290      return this.lowerLimit != null && !this.lowerLimit.isEmpty();
291    }
292
293    /**
294     * @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
295     */
296    public SampledData setLowerLimitElement(DecimalType value) { 
297      this.lowerLimit = value;
298      return this;
299    }
300
301    /**
302     * @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).
303     */
304    public BigDecimal getLowerLimit() { 
305      return this.lowerLimit == null ? null : this.lowerLimit.getValue();
306    }
307
308    /**
309     * @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).
310     */
311    public SampledData setLowerLimit(BigDecimal value) { 
312      if (value == null)
313        this.lowerLimit = null;
314      else {
315        if (this.lowerLimit == null)
316          this.lowerLimit = new DecimalType();
317        this.lowerLimit.setValue(value);
318      }
319      return this;
320    }
321
322    /**
323     * @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).
324     */
325    public SampledData setLowerLimit(long value) { 
326          this.lowerLimit = new DecimalType();
327        this.lowerLimit.setValue(value);
328      return this;
329    }
330
331    /**
332     * @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).
333     */
334    public SampledData setLowerLimit(double value) { 
335          this.lowerLimit = new DecimalType();
336        this.lowerLimit.setValue(value);
337      return this;
338    }
339
340    /**
341     * @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
342     */
343    public DecimalType getUpperLimitElement() { 
344      if (this.upperLimit == null)
345        if (Configuration.errorOnAutoCreate())
346          throw new Error("Attempt to auto-create SampledData.upperLimit");
347        else if (Configuration.doAutoCreate())
348          this.upperLimit = new DecimalType(); // bb
349      return this.upperLimit;
350    }
351
352    public boolean hasUpperLimitElement() { 
353      return this.upperLimit != null && !this.upperLimit.isEmpty();
354    }
355
356    public boolean hasUpperLimit() { 
357      return this.upperLimit != null && !this.upperLimit.isEmpty();
358    }
359
360    /**
361     * @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
362     */
363    public SampledData setUpperLimitElement(DecimalType value) { 
364      this.upperLimit = value;
365      return this;
366    }
367
368    /**
369     * @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).
370     */
371    public BigDecimal getUpperLimit() { 
372      return this.upperLimit == null ? null : this.upperLimit.getValue();
373    }
374
375    /**
376     * @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).
377     */
378    public SampledData setUpperLimit(BigDecimal value) { 
379      if (value == null)
380        this.upperLimit = null;
381      else {
382        if (this.upperLimit == null)
383          this.upperLimit = new DecimalType();
384        this.upperLimit.setValue(value);
385      }
386      return this;
387    }
388
389    /**
390     * @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).
391     */
392    public SampledData setUpperLimit(long value) { 
393          this.upperLimit = new DecimalType();
394        this.upperLimit.setValue(value);
395      return this;
396    }
397
398    /**
399     * @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).
400     */
401    public SampledData setUpperLimit(double value) { 
402          this.upperLimit = new DecimalType();
403        this.upperLimit.setValue(value);
404      return this;
405    }
406
407    /**
408     * @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
409     */
410    public PositiveIntType getDimensionsElement() { 
411      if (this.dimensions == null)
412        if (Configuration.errorOnAutoCreate())
413          throw new Error("Attempt to auto-create SampledData.dimensions");
414        else if (Configuration.doAutoCreate())
415          this.dimensions = new PositiveIntType(); // bb
416      return this.dimensions;
417    }
418
419    public boolean hasDimensionsElement() { 
420      return this.dimensions != null && !this.dimensions.isEmpty();
421    }
422
423    public boolean hasDimensions() { 
424      return this.dimensions != null && !this.dimensions.isEmpty();
425    }
426
427    /**
428     * @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
429     */
430    public SampledData setDimensionsElement(PositiveIntType value) { 
431      this.dimensions = value;
432      return this;
433    }
434
435    /**
436     * @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.
437     */
438    public int getDimensions() { 
439      return this.dimensions == null || this.dimensions.isEmpty() ? 0 : this.dimensions.getValue();
440    }
441
442    /**
443     * @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.
444     */
445    public SampledData setDimensions(int value) { 
446        if (this.dimensions == null)
447          this.dimensions = new PositiveIntType();
448        this.dimensions.setValue(value);
449      return this;
450    }
451
452    /**
453     * @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
454     */
455    public StringType getDataElement() { 
456      if (this.data == null)
457        if (Configuration.errorOnAutoCreate())
458          throw new Error("Attempt to auto-create SampledData.data");
459        else if (Configuration.doAutoCreate())
460          this.data = new StringType(); // bb
461      return this.data;
462    }
463
464    public boolean hasDataElement() { 
465      return this.data != null && !this.data.isEmpty();
466    }
467
468    public boolean hasData() { 
469      return this.data != null && !this.data.isEmpty();
470    }
471
472    /**
473     * @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
474     */
475    public SampledData setDataElement(StringType value) { 
476      this.data = value;
477      return this;
478    }
479
480    /**
481     * @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.
482     */
483    public String getData() { 
484      return this.data == null ? null : this.data.getValue();
485    }
486
487    /**
488     * @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.
489     */
490    public SampledData setData(String value) { 
491      if (Utilities.noString(value))
492        this.data = null;
493      else {
494        if (this.data == null)
495          this.data = new StringType();
496        this.data.setValue(value);
497      }
498      return this;
499    }
500
501      protected void listChildren(List<Property> children) {
502        super.listChildren(children);
503        children.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, 1, origin));
504        children.add(new Property("period", "decimal", "The length of time between sampling times, measured in milliseconds.", 0, 1, period));
505        children.add(new Property("factor", "decimal", "A correction factor that is applied to the sampled data points before they are added to the origin.", 0, 1, factor));
506        children.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, 1, lowerLimit));
507        children.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, 1, upperLimit));
508        children.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, 1, dimensions));
509        children.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, 1, data));
510      }
511
512      @Override
513      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
514        switch (_hash) {
515        case -1008619738: /*origin*/  return 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, 1, origin);
516        case -991726143: /*period*/  return new Property("period", "decimal", "The length of time between sampling times, measured in milliseconds.", 0, 1, period);
517        case -1282148017: /*factor*/  return new Property("factor", "decimal", "A correction factor that is applied to the sampled data points before they are added to the origin.", 0, 1, factor);
518        case 1209133370: /*lowerLimit*/  return 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, 1, lowerLimit);
519        case -1681713095: /*upperLimit*/  return 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, 1, upperLimit);
520        case 414334925: /*dimensions*/  return 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, 1, dimensions);
521        case 3076010: /*data*/  return 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, 1, data);
522        default: return super.getNamedProperty(_hash, _name, _checkValid);
523        }
524
525      }
526
527      @Override
528      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
529        switch (hash) {
530        case -1008619738: /*origin*/ return this.origin == null ? new Base[0] : new Base[] {this.origin}; // Quantity
531        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // DecimalType
532        case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType
533        case 1209133370: /*lowerLimit*/ return this.lowerLimit == null ? new Base[0] : new Base[] {this.lowerLimit}; // DecimalType
534        case -1681713095: /*upperLimit*/ return this.upperLimit == null ? new Base[0] : new Base[] {this.upperLimit}; // DecimalType
535        case 414334925: /*dimensions*/ return this.dimensions == null ? new Base[0] : new Base[] {this.dimensions}; // PositiveIntType
536        case 3076010: /*data*/ return this.data == null ? new Base[0] : new Base[] {this.data}; // StringType
537        default: return super.getProperty(hash, name, checkValid);
538        }
539
540      }
541
542      @Override
543      public Base setProperty(int hash, String name, Base value) throws FHIRException {
544        switch (hash) {
545        case -1008619738: // origin
546          this.origin = castToQuantity(value); // Quantity
547          return value;
548        case -991726143: // period
549          this.period = castToDecimal(value); // DecimalType
550          return value;
551        case -1282148017: // factor
552          this.factor = castToDecimal(value); // DecimalType
553          return value;
554        case 1209133370: // lowerLimit
555          this.lowerLimit = castToDecimal(value); // DecimalType
556          return value;
557        case -1681713095: // upperLimit
558          this.upperLimit = castToDecimal(value); // DecimalType
559          return value;
560        case 414334925: // dimensions
561          this.dimensions = castToPositiveInt(value); // PositiveIntType
562          return value;
563        case 3076010: // data
564          this.data = castToString(value); // StringType
565          return value;
566        default: return super.setProperty(hash, name, value);
567        }
568
569      }
570
571      @Override
572      public Base setProperty(String name, Base value) throws FHIRException {
573        if (name.equals("origin")) {
574          this.origin = castToQuantity(value); // Quantity
575        } else if (name.equals("period")) {
576          this.period = castToDecimal(value); // DecimalType
577        } else if (name.equals("factor")) {
578          this.factor = castToDecimal(value); // DecimalType
579        } else if (name.equals("lowerLimit")) {
580          this.lowerLimit = castToDecimal(value); // DecimalType
581        } else if (name.equals("upperLimit")) {
582          this.upperLimit = castToDecimal(value); // DecimalType
583        } else if (name.equals("dimensions")) {
584          this.dimensions = castToPositiveInt(value); // PositiveIntType
585        } else if (name.equals("data")) {
586          this.data = castToString(value); // StringType
587        } else
588          return super.setProperty(name, value);
589        return value;
590      }
591
592      @Override
593      public Base makeProperty(int hash, String name) throws FHIRException {
594        switch (hash) {
595        case -1008619738:  return getOrigin(); 
596        case -991726143:  return getPeriodElement();
597        case -1282148017:  return getFactorElement();
598        case 1209133370:  return getLowerLimitElement();
599        case -1681713095:  return getUpperLimitElement();
600        case 414334925:  return getDimensionsElement();
601        case 3076010:  return getDataElement();
602        default: return super.makeProperty(hash, name);
603        }
604
605      }
606
607      @Override
608      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
609        switch (hash) {
610        case -1008619738: /*origin*/ return new String[] {"SimpleQuantity"};
611        case -991726143: /*period*/ return new String[] {"decimal"};
612        case -1282148017: /*factor*/ return new String[] {"decimal"};
613        case 1209133370: /*lowerLimit*/ return new String[] {"decimal"};
614        case -1681713095: /*upperLimit*/ return new String[] {"decimal"};
615        case 414334925: /*dimensions*/ return new String[] {"positiveInt"};
616        case 3076010: /*data*/ return new String[] {"string"};
617        default: return super.getTypesForProperty(hash, name);
618        }
619
620      }
621
622      @Override
623      public Base addChild(String name) throws FHIRException {
624        if (name.equals("origin")) {
625          this.origin = new Quantity();
626          return this.origin;
627        }
628        else if (name.equals("period")) {
629          throw new FHIRException("Cannot call addChild on a primitive type SampledData.period");
630        }
631        else if (name.equals("factor")) {
632          throw new FHIRException("Cannot call addChild on a primitive type SampledData.factor");
633        }
634        else if (name.equals("lowerLimit")) {
635          throw new FHIRException("Cannot call addChild on a primitive type SampledData.lowerLimit");
636        }
637        else if (name.equals("upperLimit")) {
638          throw new FHIRException("Cannot call addChild on a primitive type SampledData.upperLimit");
639        }
640        else if (name.equals("dimensions")) {
641          throw new FHIRException("Cannot call addChild on a primitive type SampledData.dimensions");
642        }
643        else if (name.equals("data")) {
644          throw new FHIRException("Cannot call addChild on a primitive type SampledData.data");
645        }
646        else
647          return super.addChild(name);
648      }
649
650  public String fhirType() {
651    return "SampledData";
652
653  }
654
655      public SampledData copy() {
656        SampledData dst = new SampledData();
657        copyValues(dst);
658        dst.origin = origin == null ? null : origin.copy();
659        dst.period = period == null ? null : period.copy();
660        dst.factor = factor == null ? null : factor.copy();
661        dst.lowerLimit = lowerLimit == null ? null : lowerLimit.copy();
662        dst.upperLimit = upperLimit == null ? null : upperLimit.copy();
663        dst.dimensions = dimensions == null ? null : dimensions.copy();
664        dst.data = data == null ? null : data.copy();
665        return dst;
666      }
667
668      protected SampledData typedCopy() {
669        return copy();
670      }
671
672      @Override
673      public boolean equalsDeep(Base other_) {
674        if (!super.equalsDeep(other_))
675          return false;
676        if (!(other_ instanceof SampledData))
677          return false;
678        SampledData o = (SampledData) other_;
679        return compareDeep(origin, o.origin, true) && compareDeep(period, o.period, true) && compareDeep(factor, o.factor, true)
680           && compareDeep(lowerLimit, o.lowerLimit, true) && compareDeep(upperLimit, o.upperLimit, true) && compareDeep(dimensions, o.dimensions, true)
681           && compareDeep(data, o.data, true);
682      }
683
684      @Override
685      public boolean equalsShallow(Base other_) {
686        if (!super.equalsShallow(other_))
687          return false;
688        if (!(other_ instanceof SampledData))
689          return false;
690        SampledData o = (SampledData) other_;
691        return compareValues(period, o.period, true) && compareValues(factor, o.factor, true) && compareValues(lowerLimit, o.lowerLimit, true)
692           && compareValues(upperLimit, o.upperLimit, true) && compareValues(dimensions, o.dimensions, true) && compareValues(data, o.data, true)
693          ;
694      }
695
696      public boolean isEmpty() {
697        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(origin, period, factor, lowerLimit
698          , upperLimit, dimensions, data);
699      }
700
701
702}
703