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