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