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