001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017package ca.uhn.fhir.model.dstu2.composite; 018 019import java.net.URI; 020import java.math.BigDecimal; 021import org.apache.commons.lang3.StringUtils; 022import java.util.*; 023import ca.uhn.fhir.model.api.*; 024import ca.uhn.fhir.model.primitive.*; 025import ca.uhn.fhir.model.api.annotation.*; 026import ca.uhn.fhir.model.base.composite.*; 027 028import ca.uhn.fhir.model.dstu2.valueset.AddressTypeEnum; 029import ca.uhn.fhir.model.dstu2.valueset.AddressUseEnum; 030import ca.uhn.fhir.model.dstu2.valueset.AggregationModeEnum; 031import ca.uhn.fhir.model.dstu2.valueset.BindingStrengthEnum; 032import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; 033import ca.uhn.fhir.model.dstu2.composite.CodingDt; 034import ca.uhn.fhir.model.dstu2.valueset.ConstraintSeverityEnum; 035import ca.uhn.fhir.model.dstu2.valueset.ContactPointSystemEnum; 036import ca.uhn.fhir.model.dstu2.valueset.ContactPointUseEnum; 037import ca.uhn.fhir.model.dstu2.resource.Device; 038import ca.uhn.fhir.model.dstu2.valueset.EventTimingEnum; 039import ca.uhn.fhir.model.dstu2.valueset.IdentifierTypeCodesEnum; 040import ca.uhn.fhir.model.dstu2.valueset.IdentifierUseEnum; 041import ca.uhn.fhir.model.dstu2.valueset.NameUseEnum; 042import ca.uhn.fhir.model.dstu2.resource.Organization; 043import ca.uhn.fhir.model.dstu2.resource.Patient; 044import ca.uhn.fhir.model.dstu2.composite.PeriodDt; 045import ca.uhn.fhir.model.dstu2.resource.Practitioner; 046import ca.uhn.fhir.model.dstu2.valueset.PropertyRepresentationEnum; 047import ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum; 048import ca.uhn.fhir.model.dstu2.composite.QuantityDt; 049import ca.uhn.fhir.model.dstu2.composite.RangeDt; 050import ca.uhn.fhir.model.dstu2.resource.RelatedPerson; 051import ca.uhn.fhir.model.dstu2.valueset.SignatureTypeCodesEnum; 052import ca.uhn.fhir.model.dstu2.valueset.SlicingRulesEnum; 053import ca.uhn.fhir.model.api.TemporalPrecisionEnum; 054import ca.uhn.fhir.model.dstu2.valueset.TimingAbbreviationEnum; 055import ca.uhn.fhir.model.dstu2.valueset.UnitsOfTimeEnum; 056import ca.uhn.fhir.model.dstu2.resource.ValueSet; 057import ca.uhn.fhir.model.dstu2.composite.BoundCodeableConceptDt; 058import ca.uhn.fhir.model.dstu2.composite.DurationDt; 059import ca.uhn.fhir.model.dstu2.composite.ResourceReferenceDt; 060import ca.uhn.fhir.model.dstu2.composite.SimpleQuantityDt; 061import ca.uhn.fhir.model.primitive.Base64BinaryDt; 062import ca.uhn.fhir.model.primitive.BooleanDt; 063import ca.uhn.fhir.model.primitive.BoundCodeDt; 064import ca.uhn.fhir.model.primitive.CodeDt; 065import ca.uhn.fhir.model.primitive.DateTimeDt; 066import ca.uhn.fhir.model.primitive.DecimalDt; 067import ca.uhn.fhir.model.primitive.IdDt; 068import ca.uhn.fhir.model.primitive.InstantDt; 069import ca.uhn.fhir.model.primitive.IntegerDt; 070import ca.uhn.fhir.model.primitive.MarkdownDt; 071import ca.uhn.fhir.model.primitive.PositiveIntDt; 072import ca.uhn.fhir.model.primitive.StringDt; 073import ca.uhn.fhir.model.primitive.UnsignedIntDt; 074import ca.uhn.fhir.model.primitive.UriDt; 075 076/** 077 * HAPI/FHIR <b>SampledDataDt</b> Datatype 078 * () 079 * 080 * <p> 081 * <b>Definition:</b> 082 * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data 083 * </p> 084 * 085 * <p> 086 * <b>Requirements:</b> 087 * There is a need for a concise way to handle the data produced by devices that sample a physical state at a high frequency 088 * </p> 089 */ 090@DatatypeDef(name="SampledData") 091public class SampledDataDt 092 extends BaseIdentifiableElement implements ICompositeDatatype{ 093 094 /** 095 * Constructor 096 */ 097 public SampledDataDt() { 098 // nothing 099 } 100 101 102 @Child(name="origin", type=SimpleQuantityDt.class, order=0, min=1, max=1, summary=true, modifier=false) 103 @Description( 104 shortDefinition="", 105 formalDefinition="The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series" 106 ) 107 private SimpleQuantityDt myOrigin; 108 109 @Child(name="period", type=DecimalDt.class, order=1, min=1, max=1, summary=true, modifier=false) 110 @Description( 111 shortDefinition="", 112 formalDefinition="The length of time between sampling times, measured in milliseconds" 113 ) 114 private DecimalDt myPeriod; 115 116 @Child(name="factor", type=DecimalDt.class, order=2, min=0, max=1, summary=true, modifier=false) 117 @Description( 118 shortDefinition="", 119 formalDefinition="A correction factor that is applied to the sampled data points before they are added to the origin" 120 ) 121 private DecimalDt myFactor; 122 123 @Child(name="lowerLimit", type=DecimalDt.class, order=3, min=0, max=1, summary=true, modifier=false) 124 @Description( 125 shortDefinition="", 126 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)" 127 ) 128 private DecimalDt myLowerLimit; 129 130 @Child(name="upperLimit", type=DecimalDt.class, order=4, min=0, max=1, summary=true, modifier=false) 131 @Description( 132 shortDefinition="", 133 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)" 134 ) 135 private DecimalDt myUpperLimit; 136 137 @Child(name="dimensions", type=PositiveIntDt.class, order=5, min=1, max=1, summary=true, modifier=false) 138 @Description( 139 shortDefinition="", 140 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" 141 ) 142 private PositiveIntDt myDimensions; 143 144 @Child(name="data", type=StringDt.class, order=6, min=1, max=1, summary=true, modifier=false) 145 @Description( 146 shortDefinition="", 147 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" 148 ) 149 private StringDt myData; 150 151 152 @Override 153 public boolean isEmpty() { 154 return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myOrigin, myPeriod, myFactor, myLowerLimit, myUpperLimit, myDimensions, myData); 155 } 156 157 @Override 158 public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) { 159 return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myOrigin, myPeriod, myFactor, myLowerLimit, myUpperLimit, myDimensions, myData); 160 } 161 162 /** 163 * Gets the value(s) for <b>origin</b> (). 164 * creating it if it does 165 * not exist. Will not return <code>null</code>. 166 * 167 * <p> 168 * <b>Definition:</b> 169 * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series 170 * </p> 171 */ 172 public SimpleQuantityDt getOrigin() { 173 if (myOrigin == null) { 174 myOrigin = new SimpleQuantityDt(); 175 } 176 return myOrigin; 177 } 178 179 /** 180 * Sets the value(s) for <b>origin</b> () 181 * 182 * <p> 183 * <b>Definition:</b> 184 * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series 185 * </p> 186 */ 187 public SampledDataDt setOrigin(SimpleQuantityDt theValue) { 188 myOrigin = theValue; 189 return this; 190 } 191 192 193 194 195 /** 196 * Gets the value(s) for <b>period</b> (). 197 * creating it if it does 198 * not exist. Will not return <code>null</code>. 199 * 200 * <p> 201 * <b>Definition:</b> 202 * The length of time between sampling times, measured in milliseconds 203 * </p> 204 */ 205 public DecimalDt getPeriodElement() { 206 if (myPeriod == null) { 207 myPeriod = new DecimalDt(); 208 } 209 return myPeriod; 210 } 211 212 213 /** 214 * Gets the value(s) for <b>period</b> (). 215 * creating it if it does 216 * not exist. This method may return <code>null</code>. 217 * 218 * <p> 219 * <b>Definition:</b> 220 * The length of time between sampling times, measured in milliseconds 221 * </p> 222 */ 223 public BigDecimal getPeriod() { 224 return getPeriodElement().getValue(); 225 } 226 227 /** 228 * Sets the value(s) for <b>period</b> () 229 * 230 * <p> 231 * <b>Definition:</b> 232 * The length of time between sampling times, measured in milliseconds 233 * </p> 234 */ 235 public SampledDataDt setPeriod(DecimalDt theValue) { 236 myPeriod = theValue; 237 return this; 238 } 239 240 241 242 /** 243 * Sets the value for <b>period</b> () 244 * 245 * <p> 246 * <b>Definition:</b> 247 * The length of time between sampling times, measured in milliseconds 248 * </p> 249 */ 250 public SampledDataDt setPeriod( long theValue) { 251 myPeriod = new DecimalDt(theValue); 252 return this; 253 } 254 255 /** 256 * Sets the value for <b>period</b> () 257 * 258 * <p> 259 * <b>Definition:</b> 260 * The length of time between sampling times, measured in milliseconds 261 * </p> 262 */ 263 public SampledDataDt setPeriod( double theValue) { 264 myPeriod = new DecimalDt(theValue); 265 return this; 266 } 267 268 /** 269 * Sets the value for <b>period</b> () 270 * 271 * <p> 272 * <b>Definition:</b> 273 * The length of time between sampling times, measured in milliseconds 274 * </p> 275 */ 276 public SampledDataDt setPeriod( java.math.BigDecimal theValue) { 277 myPeriod = new DecimalDt(theValue); 278 return this; 279 } 280 281 282 /** 283 * Gets the value(s) for <b>factor</b> (). 284 * creating it if it does 285 * not exist. Will not return <code>null</code>. 286 * 287 * <p> 288 * <b>Definition:</b> 289 * A correction factor that is applied to the sampled data points before they are added to the origin 290 * </p> 291 */ 292 public DecimalDt getFactorElement() { 293 if (myFactor == null) { 294 myFactor = new DecimalDt(); 295 } 296 return myFactor; 297 } 298 299 300 /** 301 * Gets the value(s) for <b>factor</b> (). 302 * creating it if it does 303 * not exist. This method may return <code>null</code>. 304 * 305 * <p> 306 * <b>Definition:</b> 307 * A correction factor that is applied to the sampled data points before they are added to the origin 308 * </p> 309 */ 310 public BigDecimal getFactor() { 311 return getFactorElement().getValue(); 312 } 313 314 /** 315 * Sets the value(s) for <b>factor</b> () 316 * 317 * <p> 318 * <b>Definition:</b> 319 * A correction factor that is applied to the sampled data points before they are added to the origin 320 * </p> 321 */ 322 public SampledDataDt setFactor(DecimalDt theValue) { 323 myFactor = theValue; 324 return this; 325 } 326 327 328 329 /** 330 * Sets the value for <b>factor</b> () 331 * 332 * <p> 333 * <b>Definition:</b> 334 * A correction factor that is applied to the sampled data points before they are added to the origin 335 * </p> 336 */ 337 public SampledDataDt setFactor( long theValue) { 338 myFactor = new DecimalDt(theValue); 339 return this; 340 } 341 342 /** 343 * Sets the value for <b>factor</b> () 344 * 345 * <p> 346 * <b>Definition:</b> 347 * A correction factor that is applied to the sampled data points before they are added to the origin 348 * </p> 349 */ 350 public SampledDataDt setFactor( double theValue) { 351 myFactor = new DecimalDt(theValue); 352 return this; 353 } 354 355 /** 356 * Sets the value for <b>factor</b> () 357 * 358 * <p> 359 * <b>Definition:</b> 360 * A correction factor that is applied to the sampled data points before they are added to the origin 361 * </p> 362 */ 363 public SampledDataDt setFactor( java.math.BigDecimal theValue) { 364 myFactor = new DecimalDt(theValue); 365 return this; 366 } 367 368 369 /** 370 * Gets the value(s) for <b>lowerLimit</b> (). 371 * creating it if it does 372 * not exist. Will not return <code>null</code>. 373 * 374 * <p> 375 * <b>Definition:</b> 376 * 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) 377 * </p> 378 */ 379 public DecimalDt getLowerLimitElement() { 380 if (myLowerLimit == null) { 381 myLowerLimit = new DecimalDt(); 382 } 383 return myLowerLimit; 384 } 385 386 387 /** 388 * Gets the value(s) for <b>lowerLimit</b> (). 389 * creating it if it does 390 * not exist. This method may return <code>null</code>. 391 * 392 * <p> 393 * <b>Definition:</b> 394 * 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) 395 * </p> 396 */ 397 public BigDecimal getLowerLimit() { 398 return getLowerLimitElement().getValue(); 399 } 400 401 /** 402 * Sets the value(s) for <b>lowerLimit</b> () 403 * 404 * <p> 405 * <b>Definition:</b> 406 * 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) 407 * </p> 408 */ 409 public SampledDataDt setLowerLimit(DecimalDt theValue) { 410 myLowerLimit = theValue; 411 return this; 412 } 413 414 415 416 /** 417 * Sets the value for <b>lowerLimit</b> () 418 * 419 * <p> 420 * <b>Definition:</b> 421 * 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) 422 * </p> 423 */ 424 public SampledDataDt setLowerLimit( long theValue) { 425 myLowerLimit = new DecimalDt(theValue); 426 return this; 427 } 428 429 /** 430 * Sets the value for <b>lowerLimit</b> () 431 * 432 * <p> 433 * <b>Definition:</b> 434 * 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) 435 * </p> 436 */ 437 public SampledDataDt setLowerLimit( double theValue) { 438 myLowerLimit = new DecimalDt(theValue); 439 return this; 440 } 441 442 /** 443 * Sets the value for <b>lowerLimit</b> () 444 * 445 * <p> 446 * <b>Definition:</b> 447 * 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) 448 * </p> 449 */ 450 public SampledDataDt setLowerLimit( java.math.BigDecimal theValue) { 451 myLowerLimit = new DecimalDt(theValue); 452 return this; 453 } 454 455 456 /** 457 * Gets the value(s) for <b>upperLimit</b> (). 458 * creating it if it does 459 * not exist. Will not return <code>null</code>. 460 * 461 * <p> 462 * <b>Definition:</b> 463 * 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) 464 * </p> 465 */ 466 public DecimalDt getUpperLimitElement() { 467 if (myUpperLimit == null) { 468 myUpperLimit = new DecimalDt(); 469 } 470 return myUpperLimit; 471 } 472 473 474 /** 475 * Gets the value(s) for <b>upperLimit</b> (). 476 * creating it if it does 477 * not exist. This method may return <code>null</code>. 478 * 479 * <p> 480 * <b>Definition:</b> 481 * 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) 482 * </p> 483 */ 484 public BigDecimal getUpperLimit() { 485 return getUpperLimitElement().getValue(); 486 } 487 488 /** 489 * Sets the value(s) for <b>upperLimit</b> () 490 * 491 * <p> 492 * <b>Definition:</b> 493 * 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) 494 * </p> 495 */ 496 public SampledDataDt setUpperLimit(DecimalDt theValue) { 497 myUpperLimit = theValue; 498 return this; 499 } 500 501 502 503 /** 504 * Sets the value for <b>upperLimit</b> () 505 * 506 * <p> 507 * <b>Definition:</b> 508 * 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) 509 * </p> 510 */ 511 public SampledDataDt setUpperLimit( long theValue) { 512 myUpperLimit = new DecimalDt(theValue); 513 return this; 514 } 515 516 /** 517 * Sets the value for <b>upperLimit</b> () 518 * 519 * <p> 520 * <b>Definition:</b> 521 * 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) 522 * </p> 523 */ 524 public SampledDataDt setUpperLimit( double theValue) { 525 myUpperLimit = new DecimalDt(theValue); 526 return this; 527 } 528 529 /** 530 * Sets the value for <b>upperLimit</b> () 531 * 532 * <p> 533 * <b>Definition:</b> 534 * 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) 535 * </p> 536 */ 537 public SampledDataDt setUpperLimit( java.math.BigDecimal theValue) { 538 myUpperLimit = new DecimalDt(theValue); 539 return this; 540 } 541 542 543 /** 544 * Gets the value(s) for <b>dimensions</b> (). 545 * creating it if it does 546 * not exist. Will not return <code>null</code>. 547 * 548 * <p> 549 * <b>Definition:</b> 550 * 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 551 * </p> 552 */ 553 public PositiveIntDt getDimensionsElement() { 554 if (myDimensions == null) { 555 myDimensions = new PositiveIntDt(); 556 } 557 return myDimensions; 558 } 559 560 561 /** 562 * Gets the value(s) for <b>dimensions</b> (). 563 * creating it if it does 564 * not exist. This method may return <code>null</code>. 565 * 566 * <p> 567 * <b>Definition:</b> 568 * 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 569 * </p> 570 */ 571 public Integer getDimensions() { 572 return getDimensionsElement().getValue(); 573 } 574 575 /** 576 * Sets the value(s) for <b>dimensions</b> () 577 * 578 * <p> 579 * <b>Definition:</b> 580 * 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 581 * </p> 582 */ 583 public SampledDataDt setDimensions(PositiveIntDt theValue) { 584 myDimensions = theValue; 585 return this; 586 } 587 588 589 590 /** 591 * Sets the value for <b>dimensions</b> () 592 * 593 * <p> 594 * <b>Definition:</b> 595 * 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 596 * </p> 597 */ 598 public SampledDataDt setDimensions( int theInteger) { 599 myDimensions = new PositiveIntDt(theInteger); 600 return this; 601 } 602 603 604 /** 605 * Gets the value(s) for <b>data</b> (). 606 * creating it if it does 607 * not exist. Will not return <code>null</code>. 608 * 609 * <p> 610 * <b>Definition:</b> 611 * 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 612 * </p> 613 */ 614 public StringDt getDataElement() { 615 if (myData == null) { 616 myData = new StringDt(); 617 } 618 return myData; 619 } 620 621 622 /** 623 * Gets the value(s) for <b>data</b> (). 624 * creating it if it does 625 * not exist. This method may return <code>null</code>. 626 * 627 * <p> 628 * <b>Definition:</b> 629 * 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 630 * </p> 631 */ 632 public String getData() { 633 return getDataElement().getValue(); 634 } 635 636 /** 637 * Sets the value(s) for <b>data</b> () 638 * 639 * <p> 640 * <b>Definition:</b> 641 * 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 642 * </p> 643 */ 644 public SampledDataDt setData(StringDt theValue) { 645 myData = theValue; 646 return this; 647 } 648 649 650 651 /** 652 * Sets the value for <b>data</b> () 653 * 654 * <p> 655 * <b>Definition:</b> 656 * 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 657 * </p> 658 */ 659 public SampledDataDt setData( String theString) { 660 myData = new StringDt(theString); 661 return this; 662 } 663 664 665 666 667}