001package org.hl7.fhir.dstu3.model; 002 003/* 004 Copyright (c) 2011+, HL7, Inc. 005 All rights reserved. 006 007 Redistribution and use in source and binary forms, with or without modification, 008 are permitted provided that the following conditions are met: 009 010 * Redistributions of source code must retain the above copyright notice, this 011 list of conditions and the following disclaimer. 012 * Redistributions in binary form must reproduce the above copyright notice, 013 this list of conditions and the following disclaimer in the documentation 014 and/or other materials provided with the distribution. 015 * Neither the name of HL7 nor the names of its contributors may be used to 016 endorse or promote products derived from this software without specific 017 prior written permission. 018 019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 020 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 021 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 022 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 023 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 024 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 025 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 026 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 027 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 028 POSSIBILITY OF SUCH DAMAGE. 029 030*/ 031 032// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.1 033 034import java.util.*; 035 036import java.math.*; 037import org.hl7.fhir.utilities.Utilities; 038import ca.uhn.fhir.model.api.annotation.Child; 039import ca.uhn.fhir.model.api.annotation.ChildOrder; 040import ca.uhn.fhir.model.api.annotation.Description; 041import ca.uhn.fhir.model.api.annotation.DatatypeDef; 042import ca.uhn.fhir.model.api.annotation.Block; 043import org.hl7.fhir.instance.model.api.*; 044import org.hl7.fhir.exceptions.FHIRException; 045import org.hl7.fhir.exceptions.FHIRFormatError; 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> children) { 500 super.listChildren(children); 501 children.add(new Property("origin", "SimpleQuantity", "The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.", 0, 1, origin)); 502 children.add(new Property("period", "decimal", "The length of time between sampling times, measured in milliseconds.", 0, 1, period)); 503 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)); 504 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)); 505 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)); 506 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)); 507 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)); 508 } 509 510 @Override 511 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 512 switch (_hash) { 513 case -1008619738: /*origin*/ return new Property("origin", "SimpleQuantity", "The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.", 0, 1, origin); 514 case -991726143: /*period*/ return new Property("period", "decimal", "The length of time between sampling times, measured in milliseconds.", 0, 1, period); 515 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); 516 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); 517 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); 518 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); 519 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); 520 default: return super.getNamedProperty(_hash, _name, _checkValid); 521 } 522 523 } 524 525 @Override 526 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 527 switch (hash) { 528 case -1008619738: /*origin*/ return this.origin == null ? new Base[0] : new Base[] {this.origin}; // SimpleQuantity 529 case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // DecimalType 530 case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType 531 case 1209133370: /*lowerLimit*/ return this.lowerLimit == null ? new Base[0] : new Base[] {this.lowerLimit}; // DecimalType 532 case -1681713095: /*upperLimit*/ return this.upperLimit == null ? new Base[0] : new Base[] {this.upperLimit}; // DecimalType 533 case 414334925: /*dimensions*/ return this.dimensions == null ? new Base[0] : new Base[] {this.dimensions}; // PositiveIntType 534 case 3076010: /*data*/ return this.data == null ? new Base[0] : new Base[] {this.data}; // StringType 535 default: return super.getProperty(hash, name, checkValid); 536 } 537 538 } 539 540 @Override 541 public Base setProperty(int hash, String name, Base value) throws FHIRException { 542 switch (hash) { 543 case -1008619738: // origin 544 this.origin = castToSimpleQuantity(value); // SimpleQuantity 545 return value; 546 case -991726143: // period 547 this.period = castToDecimal(value); // DecimalType 548 return value; 549 case -1282148017: // factor 550 this.factor = castToDecimal(value); // DecimalType 551 return value; 552 case 1209133370: // lowerLimit 553 this.lowerLimit = castToDecimal(value); // DecimalType 554 return value; 555 case -1681713095: // upperLimit 556 this.upperLimit = castToDecimal(value); // DecimalType 557 return value; 558 case 414334925: // dimensions 559 this.dimensions = castToPositiveInt(value); // PositiveIntType 560 return value; 561 case 3076010: // data 562 this.data = castToString(value); // StringType 563 return value; 564 default: return super.setProperty(hash, name, value); 565 } 566 567 } 568 569 @Override 570 public Base setProperty(String name, Base value) throws FHIRException { 571 if (name.equals("origin")) { 572 this.origin = castToSimpleQuantity(value); // SimpleQuantity 573 } else if (name.equals("period")) { 574 this.period = castToDecimal(value); // DecimalType 575 } else if (name.equals("factor")) { 576 this.factor = castToDecimal(value); // DecimalType 577 } else if (name.equals("lowerLimit")) { 578 this.lowerLimit = castToDecimal(value); // DecimalType 579 } else if (name.equals("upperLimit")) { 580 this.upperLimit = castToDecimal(value); // DecimalType 581 } else if (name.equals("dimensions")) { 582 this.dimensions = castToPositiveInt(value); // PositiveIntType 583 } else if (name.equals("data")) { 584 this.data = castToString(value); // StringType 585 } else 586 return super.setProperty(name, value); 587 return value; 588 } 589 590 @Override 591 public Base makeProperty(int hash, String name) throws FHIRException { 592 switch (hash) { 593 case -1008619738: return getOrigin(); 594 case -991726143: return getPeriodElement(); 595 case -1282148017: return getFactorElement(); 596 case 1209133370: return getLowerLimitElement(); 597 case -1681713095: return getUpperLimitElement(); 598 case 414334925: return getDimensionsElement(); 599 case 3076010: return getDataElement(); 600 default: return super.makeProperty(hash, name); 601 } 602 603 } 604 605 @Override 606 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 607 switch (hash) { 608 case -1008619738: /*origin*/ return new String[] {"SimpleQuantity"}; 609 case -991726143: /*period*/ return new String[] {"decimal"}; 610 case -1282148017: /*factor*/ return new String[] {"decimal"}; 611 case 1209133370: /*lowerLimit*/ return new String[] {"decimal"}; 612 case -1681713095: /*upperLimit*/ return new String[] {"decimal"}; 613 case 414334925: /*dimensions*/ return new String[] {"positiveInt"}; 614 case 3076010: /*data*/ return new String[] {"string"}; 615 default: return super.getTypesForProperty(hash, name); 616 } 617 618 } 619 620 @Override 621 public Base addChild(String name) throws FHIRException { 622 if (name.equals("origin")) { 623 this.origin = new SimpleQuantity(); 624 return this.origin; 625 } 626 else if (name.equals("period")) { 627 throw new FHIRException("Cannot call addChild on a primitive type SampledData.period"); 628 } 629 else if (name.equals("factor")) { 630 throw new FHIRException("Cannot call addChild on a primitive type SampledData.factor"); 631 } 632 else if (name.equals("lowerLimit")) { 633 throw new FHIRException("Cannot call addChild on a primitive type SampledData.lowerLimit"); 634 } 635 else if (name.equals("upperLimit")) { 636 throw new FHIRException("Cannot call addChild on a primitive type SampledData.upperLimit"); 637 } 638 else if (name.equals("dimensions")) { 639 throw new FHIRException("Cannot call addChild on a primitive type SampledData.dimensions"); 640 } 641 else if (name.equals("data")) { 642 throw new FHIRException("Cannot call addChild on a primitive type SampledData.data"); 643 } 644 else 645 return super.addChild(name); 646 } 647 648 public String fhirType() { 649 return "SampledData"; 650 651 } 652 653 public SampledData copy() { 654 SampledData dst = new SampledData(); 655 copyValues(dst); 656 dst.origin = origin == null ? null : origin.copy(); 657 dst.period = period == null ? null : period.copy(); 658 dst.factor = factor == null ? null : factor.copy(); 659 dst.lowerLimit = lowerLimit == null ? null : lowerLimit.copy(); 660 dst.upperLimit = upperLimit == null ? null : upperLimit.copy(); 661 dst.dimensions = dimensions == null ? null : dimensions.copy(); 662 dst.data = data == null ? null : data.copy(); 663 return dst; 664 } 665 666 protected SampledData typedCopy() { 667 return copy(); 668 } 669 670 @Override 671 public boolean equalsDeep(Base other_) { 672 if (!super.equalsDeep(other_)) 673 return false; 674 if (!(other_ instanceof SampledData)) 675 return false; 676 SampledData o = (SampledData) other_; 677 return compareDeep(origin, o.origin, true) && compareDeep(period, o.period, true) && compareDeep(factor, o.factor, true) 678 && compareDeep(lowerLimit, o.lowerLimit, true) && compareDeep(upperLimit, o.upperLimit, true) && compareDeep(dimensions, o.dimensions, true) 679 && compareDeep(data, o.data, true); 680 } 681 682 @Override 683 public boolean equalsShallow(Base other_) { 684 if (!super.equalsShallow(other_)) 685 return false; 686 if (!(other_ instanceof SampledData)) 687 return false; 688 SampledData o = (SampledData) other_; 689 return compareValues(period, o.period, true) && compareValues(factor, o.factor, true) && compareValues(lowerLimit, o.lowerLimit, true) 690 && compareValues(upperLimit, o.upperLimit, true) && compareValues(dimensions, o.dimensions, true) && compareValues(data, o.data, true) 691 ; 692 } 693 694 public boolean isEmpty() { 695 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(origin, period, factor, lowerLimit 696 , upperLimit, dimensions, data); 697 } 698 699 700} 701