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