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