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