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