001package org.hl7.fhir.r4.model; 002 003import java.math.BigDecimal; 004 005/* 006 Copyright (c) 2011+, HL7, Inc. 007 All rights reserved. 008 009 Redistribution and use in source and binary forms, with or without modification, 010 are permitted provided that the following conditions are met: 011 012 * Redistributions of source code must retain the above copyright notice, this 013 list of conditions and the following disclaimer. 014 * Redistributions in binary form must reproduce the above copyright notice, 015 this list of conditions and the following disclaimer in the documentation 016 and/or other materials provided with the distribution. 017 * Neither the name of HL7 nor the names of its contributors may be used to 018 endorse or promote products derived from this software without specific 019 prior written permission. 020 021 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 022 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 023 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 024 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 025 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 026 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 027 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 028 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 029 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 030 POSSIBILITY OF SUCH DAMAGE. 031 032*/ 033 034// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1 035import java.util.ArrayList; 036import java.util.List; 037 038import org.hl7.fhir.exceptions.FHIRException; 039import org.hl7.fhir.instance.model.api.IBaseBackboneElement; 040import org.hl7.fhir.r4.model.Enumerations.AdministrativeGender; 041import org.hl7.fhir.r4.model.Enumerations.AdministrativeGenderEnumFactory; 042import org.hl7.fhir.utilities.Utilities; 043 044import ca.uhn.fhir.model.api.annotation.Block; 045import ca.uhn.fhir.model.api.annotation.Child; 046import ca.uhn.fhir.model.api.annotation.Description; 047import ca.uhn.fhir.model.api.annotation.ResourceDef; 048 049/** 050 * Set of definitional characteristics for a kind of observation or measurement 051 * produced or consumed by an orderable health care service. 052 */ 053@ResourceDef(name = "ObservationDefinition", profile = "http://hl7.org/fhir/StructureDefinition/ObservationDefinition") 054public class ObservationDefinition extends DomainResource { 055 056 public enum ObservationDataType { 057 /** 058 * A measured amount. 059 */ 060 QUANTITY, 061 /** 062 * A coded concept from a reference terminology and/or text. 063 */ 064 CODEABLECONCEPT, 065 /** 066 * A sequence of Unicode characters. 067 */ 068 STRING, 069 /** 070 * true or false. 071 */ 072 BOOLEAN, 073 /** 074 * A signed integer. 075 */ 076 INTEGER, 077 /** 078 * A set of values bounded by low and high. 079 */ 080 RANGE, 081 /** 082 * A ratio of two Quantity values - a numerator and a denominator. 083 */ 084 RATIO, 085 /** 086 * A series of measurements taken by a device. 087 */ 088 SAMPLEDDATA, 089 /** 090 * A time during the day, in the format hh:mm:ss. 091 */ 092 TIME, 093 /** 094 * A date, date-time or partial date (e.g. just year or year + month) as used in 095 * human communication. 096 */ 097 DATETIME, 098 /** 099 * A time range defined by start and end date/time. 100 */ 101 PERIOD, 102 /** 103 * added to help the parsers with the generic types 104 */ 105 NULL; 106 107 public static ObservationDataType fromCode(String codeString) throws FHIRException { 108 if (codeString == null || "".equals(codeString)) 109 return null; 110 if ("Quantity".equals(codeString)) 111 return QUANTITY; 112 if ("CodeableConcept".equals(codeString)) 113 return CODEABLECONCEPT; 114 if ("string".equals(codeString)) 115 return STRING; 116 if ("boolean".equals(codeString)) 117 return BOOLEAN; 118 if ("integer".equals(codeString)) 119 return INTEGER; 120 if ("Range".equals(codeString)) 121 return RANGE; 122 if ("Ratio".equals(codeString)) 123 return RATIO; 124 if ("SampledData".equals(codeString)) 125 return SAMPLEDDATA; 126 if ("time".equals(codeString)) 127 return TIME; 128 if ("dateTime".equals(codeString)) 129 return DATETIME; 130 if ("Period".equals(codeString)) 131 return PERIOD; 132 if (Configuration.isAcceptInvalidEnums()) 133 return null; 134 else 135 throw new FHIRException("Unknown ObservationDataType code '" + codeString + "'"); 136 } 137 138 public String toCode() { 139 switch (this) { 140 case QUANTITY: 141 return "Quantity"; 142 case CODEABLECONCEPT: 143 return "CodeableConcept"; 144 case STRING: 145 return "string"; 146 case BOOLEAN: 147 return "boolean"; 148 case INTEGER: 149 return "integer"; 150 case RANGE: 151 return "Range"; 152 case RATIO: 153 return "Ratio"; 154 case SAMPLEDDATA: 155 return "SampledData"; 156 case TIME: 157 return "time"; 158 case DATETIME: 159 return "dateTime"; 160 case PERIOD: 161 return "Period"; 162 case NULL: 163 return null; 164 default: 165 return "?"; 166 } 167 } 168 169 public String getSystem() { 170 switch (this) { 171 case QUANTITY: 172 return "http://hl7.org/fhir/permitted-data-type"; 173 case CODEABLECONCEPT: 174 return "http://hl7.org/fhir/permitted-data-type"; 175 case STRING: 176 return "http://hl7.org/fhir/permitted-data-type"; 177 case BOOLEAN: 178 return "http://hl7.org/fhir/permitted-data-type"; 179 case INTEGER: 180 return "http://hl7.org/fhir/permitted-data-type"; 181 case RANGE: 182 return "http://hl7.org/fhir/permitted-data-type"; 183 case RATIO: 184 return "http://hl7.org/fhir/permitted-data-type"; 185 case SAMPLEDDATA: 186 return "http://hl7.org/fhir/permitted-data-type"; 187 case TIME: 188 return "http://hl7.org/fhir/permitted-data-type"; 189 case DATETIME: 190 return "http://hl7.org/fhir/permitted-data-type"; 191 case PERIOD: 192 return "http://hl7.org/fhir/permitted-data-type"; 193 case NULL: 194 return null; 195 default: 196 return "?"; 197 } 198 } 199 200 public String getDefinition() { 201 switch (this) { 202 case QUANTITY: 203 return "A measured amount."; 204 case CODEABLECONCEPT: 205 return "A coded concept from a reference terminology and/or text."; 206 case STRING: 207 return "A sequence of Unicode characters."; 208 case BOOLEAN: 209 return "true or false."; 210 case INTEGER: 211 return "A signed integer."; 212 case RANGE: 213 return "A set of values bounded by low and high."; 214 case RATIO: 215 return "A ratio of two Quantity values - a numerator and a denominator."; 216 case SAMPLEDDATA: 217 return "A series of measurements taken by a device."; 218 case TIME: 219 return "A time during the day, in the format hh:mm:ss."; 220 case DATETIME: 221 return "A date, date-time or partial date (e.g. just year or year + month) as used in human communication."; 222 case PERIOD: 223 return "A time range defined by start and end date/time."; 224 case NULL: 225 return null; 226 default: 227 return "?"; 228 } 229 } 230 231 public String getDisplay() { 232 switch (this) { 233 case QUANTITY: 234 return "Quantity"; 235 case CODEABLECONCEPT: 236 return "CodeableConcept"; 237 case STRING: 238 return "string"; 239 case BOOLEAN: 240 return "boolean"; 241 case INTEGER: 242 return "integer"; 243 case RANGE: 244 return "Range"; 245 case RATIO: 246 return "Ratio"; 247 case SAMPLEDDATA: 248 return "SampledData"; 249 case TIME: 250 return "time"; 251 case DATETIME: 252 return "dateTime"; 253 case PERIOD: 254 return "Period"; 255 case NULL: 256 return null; 257 default: 258 return "?"; 259 } 260 } 261 } 262 263 public static class ObservationDataTypeEnumFactory implements EnumFactory<ObservationDataType> { 264 public ObservationDataType fromCode(String codeString) throws IllegalArgumentException { 265 if (codeString == null || "".equals(codeString)) 266 if (codeString == null || "".equals(codeString)) 267 return null; 268 if ("Quantity".equals(codeString)) 269 return ObservationDataType.QUANTITY; 270 if ("CodeableConcept".equals(codeString)) 271 return ObservationDataType.CODEABLECONCEPT; 272 if ("string".equals(codeString)) 273 return ObservationDataType.STRING; 274 if ("boolean".equals(codeString)) 275 return ObservationDataType.BOOLEAN; 276 if ("integer".equals(codeString)) 277 return ObservationDataType.INTEGER; 278 if ("Range".equals(codeString)) 279 return ObservationDataType.RANGE; 280 if ("Ratio".equals(codeString)) 281 return ObservationDataType.RATIO; 282 if ("SampledData".equals(codeString)) 283 return ObservationDataType.SAMPLEDDATA; 284 if ("time".equals(codeString)) 285 return ObservationDataType.TIME; 286 if ("dateTime".equals(codeString)) 287 return ObservationDataType.DATETIME; 288 if ("Period".equals(codeString)) 289 return ObservationDataType.PERIOD; 290 throw new IllegalArgumentException("Unknown ObservationDataType code '" + codeString + "'"); 291 } 292 293 public Enumeration<ObservationDataType> fromType(PrimitiveType<?> code) throws FHIRException { 294 if (code == null) 295 return null; 296 if (code.isEmpty()) 297 return new Enumeration<ObservationDataType>(this, ObservationDataType.NULL, code); 298 String codeString = code.asStringValue(); 299 if (codeString == null || "".equals(codeString)) 300 return new Enumeration<ObservationDataType>(this, ObservationDataType.NULL, code); 301 if ("Quantity".equals(codeString)) 302 return new Enumeration<ObservationDataType>(this, ObservationDataType.QUANTITY, code); 303 if ("CodeableConcept".equals(codeString)) 304 return new Enumeration<ObservationDataType>(this, ObservationDataType.CODEABLECONCEPT, code); 305 if ("string".equals(codeString)) 306 return new Enumeration<ObservationDataType>(this, ObservationDataType.STRING, code); 307 if ("boolean".equals(codeString)) 308 return new Enumeration<ObservationDataType>(this, ObservationDataType.BOOLEAN, code); 309 if ("integer".equals(codeString)) 310 return new Enumeration<ObservationDataType>(this, ObservationDataType.INTEGER, code); 311 if ("Range".equals(codeString)) 312 return new Enumeration<ObservationDataType>(this, ObservationDataType.RANGE, code); 313 if ("Ratio".equals(codeString)) 314 return new Enumeration<ObservationDataType>(this, ObservationDataType.RATIO, code); 315 if ("SampledData".equals(codeString)) 316 return new Enumeration<ObservationDataType>(this, ObservationDataType.SAMPLEDDATA, code); 317 if ("time".equals(codeString)) 318 return new Enumeration<ObservationDataType>(this, ObservationDataType.TIME, code); 319 if ("dateTime".equals(codeString)) 320 return new Enumeration<ObservationDataType>(this, ObservationDataType.DATETIME, code); 321 if ("Period".equals(codeString)) 322 return new Enumeration<ObservationDataType>(this, ObservationDataType.PERIOD, code); 323 throw new FHIRException("Unknown ObservationDataType code '" + codeString + "'"); 324 } 325 326 public String toCode(ObservationDataType code) { 327 if (code == ObservationDataType.QUANTITY) 328 return "Quantity"; 329 if (code == ObservationDataType.CODEABLECONCEPT) 330 return "CodeableConcept"; 331 if (code == ObservationDataType.STRING) 332 return "string"; 333 if (code == ObservationDataType.BOOLEAN) 334 return "boolean"; 335 if (code == ObservationDataType.INTEGER) 336 return "integer"; 337 if (code == ObservationDataType.RANGE) 338 return "Range"; 339 if (code == ObservationDataType.RATIO) 340 return "Ratio"; 341 if (code == ObservationDataType.SAMPLEDDATA) 342 return "SampledData"; 343 if (code == ObservationDataType.TIME) 344 return "time"; 345 if (code == ObservationDataType.DATETIME) 346 return "dateTime"; 347 if (code == ObservationDataType.PERIOD) 348 return "Period"; 349 return "?"; 350 } 351 352 public String toSystem(ObservationDataType code) { 353 return code.getSystem(); 354 } 355 } 356 357 public enum ObservationRangeCategory { 358 /** 359 * Reference (Normal) Range for Ordinal and Continuous Observations. 360 */ 361 REFERENCE, 362 /** 363 * Critical Range for Ordinal and Continuous Observations. 364 */ 365 CRITICAL, 366 /** 367 * Absolute Range for Ordinal and Continuous Observations. Results outside this 368 * range are not possible. 369 */ 370 ABSOLUTE, 371 /** 372 * added to help the parsers with the generic types 373 */ 374 NULL; 375 376 public static ObservationRangeCategory fromCode(String codeString) throws FHIRException { 377 if (codeString == null || "".equals(codeString)) 378 return null; 379 if ("reference".equals(codeString)) 380 return REFERENCE; 381 if ("critical".equals(codeString)) 382 return CRITICAL; 383 if ("absolute".equals(codeString)) 384 return ABSOLUTE; 385 if (Configuration.isAcceptInvalidEnums()) 386 return null; 387 else 388 throw new FHIRException("Unknown ObservationRangeCategory code '" + codeString + "'"); 389 } 390 391 public String toCode() { 392 switch (this) { 393 case REFERENCE: 394 return "reference"; 395 case CRITICAL: 396 return "critical"; 397 case ABSOLUTE: 398 return "absolute"; 399 case NULL: 400 return null; 401 default: 402 return "?"; 403 } 404 } 405 406 public String getSystem() { 407 switch (this) { 408 case REFERENCE: 409 return "http://hl7.org/fhir/observation-range-category"; 410 case CRITICAL: 411 return "http://hl7.org/fhir/observation-range-category"; 412 case ABSOLUTE: 413 return "http://hl7.org/fhir/observation-range-category"; 414 case NULL: 415 return null; 416 default: 417 return "?"; 418 } 419 } 420 421 public String getDefinition() { 422 switch (this) { 423 case REFERENCE: 424 return "Reference (Normal) Range for Ordinal and Continuous Observations."; 425 case CRITICAL: 426 return "Critical Range for Ordinal and Continuous Observations."; 427 case ABSOLUTE: 428 return "Absolute Range for Ordinal and Continuous Observations. Results outside this range are not possible."; 429 case NULL: 430 return null; 431 default: 432 return "?"; 433 } 434 } 435 436 public String getDisplay() { 437 switch (this) { 438 case REFERENCE: 439 return "reference range"; 440 case CRITICAL: 441 return "critical range"; 442 case ABSOLUTE: 443 return "absolute range"; 444 case NULL: 445 return null; 446 default: 447 return "?"; 448 } 449 } 450 } 451 452 public static class ObservationRangeCategoryEnumFactory implements EnumFactory<ObservationRangeCategory> { 453 public ObservationRangeCategory fromCode(String codeString) throws IllegalArgumentException { 454 if (codeString == null || "".equals(codeString)) 455 if (codeString == null || "".equals(codeString)) 456 return null; 457 if ("reference".equals(codeString)) 458 return ObservationRangeCategory.REFERENCE; 459 if ("critical".equals(codeString)) 460 return ObservationRangeCategory.CRITICAL; 461 if ("absolute".equals(codeString)) 462 return ObservationRangeCategory.ABSOLUTE; 463 throw new IllegalArgumentException("Unknown ObservationRangeCategory code '" + codeString + "'"); 464 } 465 466 public Enumeration<ObservationRangeCategory> fromType(PrimitiveType<?> code) throws FHIRException { 467 if (code == null) 468 return null; 469 if (code.isEmpty()) 470 return new Enumeration<ObservationRangeCategory>(this, ObservationRangeCategory.NULL, code); 471 String codeString = code.asStringValue(); 472 if (codeString == null || "".equals(codeString)) 473 return new Enumeration<ObservationRangeCategory>(this, ObservationRangeCategory.NULL, code); 474 if ("reference".equals(codeString)) 475 return new Enumeration<ObservationRangeCategory>(this, ObservationRangeCategory.REFERENCE, code); 476 if ("critical".equals(codeString)) 477 return new Enumeration<ObservationRangeCategory>(this, ObservationRangeCategory.CRITICAL, code); 478 if ("absolute".equals(codeString)) 479 return new Enumeration<ObservationRangeCategory>(this, ObservationRangeCategory.ABSOLUTE, code); 480 throw new FHIRException("Unknown ObservationRangeCategory code '" + codeString + "'"); 481 } 482 483 public String toCode(ObservationRangeCategory code) { 484 if (code == ObservationRangeCategory.REFERENCE) 485 return "reference"; 486 if (code == ObservationRangeCategory.CRITICAL) 487 return "critical"; 488 if (code == ObservationRangeCategory.ABSOLUTE) 489 return "absolute"; 490 return "?"; 491 } 492 493 public String toSystem(ObservationRangeCategory code) { 494 return code.getSystem(); 495 } 496 } 497 498 @Block() 499 public static class ObservationDefinitionQuantitativeDetailsComponent extends BackboneElement 500 implements IBaseBackboneElement { 501 /** 502 * Customary unit used to report quantitative results of observations conforming 503 * to this ObservationDefinition. 504 */ 505 @Child(name = "customaryUnit", type = { 506 CodeableConcept.class }, order = 1, min = 0, max = 1, modifier = false, summary = false) 507 @Description(shortDefinition = "Customary unit for quantitative results", formalDefinition = "Customary unit used to report quantitative results of observations conforming to this ObservationDefinition.") 508 @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/ucum-units") 509 protected CodeableConcept customaryUnit; 510 511 /** 512 * SI unit used to report quantitative results of observations conforming to 513 * this ObservationDefinition. 514 */ 515 @Child(name = "unit", type = { 516 CodeableConcept.class }, order = 2, min = 0, max = 1, modifier = false, summary = false) 517 @Description(shortDefinition = "SI unit for quantitative results", formalDefinition = "SI unit used to report quantitative results of observations conforming to this ObservationDefinition.") 518 @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/ucum-units") 519 protected CodeableConcept unit; 520 521 /** 522 * Factor for converting value expressed with SI unit to value expressed with 523 * customary unit. 524 */ 525 @Child(name = "conversionFactor", type = { 526 DecimalType.class }, order = 3, min = 0, max = 1, modifier = false, summary = false) 527 @Description(shortDefinition = "SI to Customary unit conversion factor", formalDefinition = "Factor for converting value expressed with SI unit to value expressed with customary unit.") 528 protected DecimalType conversionFactor; 529 530 /** 531 * Number of digits after decimal separator when the results of such 532 * observations are of type Quantity. 533 */ 534 @Child(name = "decimalPrecision", type = { 535 IntegerType.class }, order = 4, min = 0, max = 1, modifier = false, summary = false) 536 @Description(shortDefinition = "Decimal precision of observation quantitative results", formalDefinition = "Number of digits after decimal separator when the results of such observations are of type Quantity.") 537 protected IntegerType decimalPrecision; 538 539 private static final long serialVersionUID = 1790019610L; 540 541 /** 542 * Constructor 543 */ 544 public ObservationDefinitionQuantitativeDetailsComponent() { 545 super(); 546 } 547 548 /** 549 * @return {@link #customaryUnit} (Customary unit used to report quantitative 550 * results of observations conforming to this ObservationDefinition.) 551 */ 552 public CodeableConcept getCustomaryUnit() { 553 if (this.customaryUnit == null) 554 if (Configuration.errorOnAutoCreate()) 555 throw new Error("Attempt to auto-create ObservationDefinitionQuantitativeDetailsComponent.customaryUnit"); 556 else if (Configuration.doAutoCreate()) 557 this.customaryUnit = new CodeableConcept(); // cc 558 return this.customaryUnit; 559 } 560 561 public boolean hasCustomaryUnit() { 562 return this.customaryUnit != null && !this.customaryUnit.isEmpty(); 563 } 564 565 /** 566 * @param value {@link #customaryUnit} (Customary unit used to report 567 * quantitative results of observations conforming to this 568 * ObservationDefinition.) 569 */ 570 public ObservationDefinitionQuantitativeDetailsComponent setCustomaryUnit(CodeableConcept value) { 571 this.customaryUnit = value; 572 return this; 573 } 574 575 /** 576 * @return {@link #unit} (SI unit used to report quantitative results of 577 * observations conforming to this ObservationDefinition.) 578 */ 579 public CodeableConcept getUnit() { 580 if (this.unit == null) 581 if (Configuration.errorOnAutoCreate()) 582 throw new Error("Attempt to auto-create ObservationDefinitionQuantitativeDetailsComponent.unit"); 583 else if (Configuration.doAutoCreate()) 584 this.unit = new CodeableConcept(); // cc 585 return this.unit; 586 } 587 588 public boolean hasUnit() { 589 return this.unit != null && !this.unit.isEmpty(); 590 } 591 592 /** 593 * @param value {@link #unit} (SI unit used to report quantitative results of 594 * observations conforming to this ObservationDefinition.) 595 */ 596 public ObservationDefinitionQuantitativeDetailsComponent setUnit(CodeableConcept value) { 597 this.unit = value; 598 return this; 599 } 600 601 /** 602 * @return {@link #conversionFactor} (Factor for converting value expressed with 603 * SI unit to value expressed with customary unit.). This is the 604 * underlying object with id, value and extensions. The accessor 605 * "getConversionFactor" gives direct access to the value 606 */ 607 public DecimalType getConversionFactorElement() { 608 if (this.conversionFactor == null) 609 if (Configuration.errorOnAutoCreate()) 610 throw new Error("Attempt to auto-create ObservationDefinitionQuantitativeDetailsComponent.conversionFactor"); 611 else if (Configuration.doAutoCreate()) 612 this.conversionFactor = new DecimalType(); // bb 613 return this.conversionFactor; 614 } 615 616 public boolean hasConversionFactorElement() { 617 return this.conversionFactor != null && !this.conversionFactor.isEmpty(); 618 } 619 620 public boolean hasConversionFactor() { 621 return this.conversionFactor != null && !this.conversionFactor.isEmpty(); 622 } 623 624 /** 625 * @param value {@link #conversionFactor} (Factor for converting value expressed 626 * with SI unit to value expressed with customary unit.). This is 627 * the underlying object with id, value and extensions. The 628 * accessor "getConversionFactor" gives direct access to the value 629 */ 630 public ObservationDefinitionQuantitativeDetailsComponent setConversionFactorElement(DecimalType value) { 631 this.conversionFactor = value; 632 return this; 633 } 634 635 /** 636 * @return Factor for converting value expressed with SI unit to value expressed 637 * with customary unit. 638 */ 639 public BigDecimal getConversionFactor() { 640 return this.conversionFactor == null ? null : this.conversionFactor.getValue(); 641 } 642 643 /** 644 * @param value Factor for converting value expressed with SI unit to value 645 * expressed with customary unit. 646 */ 647 public ObservationDefinitionQuantitativeDetailsComponent setConversionFactor(BigDecimal value) { 648 if (value == null) 649 this.conversionFactor = null; 650 else { 651 if (this.conversionFactor == null) 652 this.conversionFactor = new DecimalType(); 653 this.conversionFactor.setValue(value); 654 } 655 return this; 656 } 657 658 /** 659 * @param value Factor for converting value expressed with SI unit to value 660 * expressed with customary unit. 661 */ 662 public ObservationDefinitionQuantitativeDetailsComponent setConversionFactor(long value) { 663 this.conversionFactor = new DecimalType(); 664 this.conversionFactor.setValue(value); 665 return this; 666 } 667 668 /** 669 * @param value Factor for converting value expressed with SI unit to value 670 * expressed with customary unit. 671 */ 672 public ObservationDefinitionQuantitativeDetailsComponent setConversionFactor(double value) { 673 this.conversionFactor = new DecimalType(); 674 this.conversionFactor.setValue(value); 675 return this; 676 } 677 678 /** 679 * @return {@link #decimalPrecision} (Number of digits after decimal separator 680 * when the results of such observations are of type Quantity.). This is 681 * the underlying object with id, value and extensions. The accessor 682 * "getDecimalPrecision" gives direct access to the value 683 */ 684 public IntegerType getDecimalPrecisionElement() { 685 if (this.decimalPrecision == null) 686 if (Configuration.errorOnAutoCreate()) 687 throw new Error("Attempt to auto-create ObservationDefinitionQuantitativeDetailsComponent.decimalPrecision"); 688 else if (Configuration.doAutoCreate()) 689 this.decimalPrecision = new IntegerType(); // bb 690 return this.decimalPrecision; 691 } 692 693 public boolean hasDecimalPrecisionElement() { 694 return this.decimalPrecision != null && !this.decimalPrecision.isEmpty(); 695 } 696 697 public boolean hasDecimalPrecision() { 698 return this.decimalPrecision != null && !this.decimalPrecision.isEmpty(); 699 } 700 701 /** 702 * @param value {@link #decimalPrecision} (Number of digits after decimal 703 * separator when the results of such observations are of type 704 * Quantity.). This is the underlying object with id, value and 705 * extensions. The accessor "getDecimalPrecision" gives direct 706 * access to the value 707 */ 708 public ObservationDefinitionQuantitativeDetailsComponent setDecimalPrecisionElement(IntegerType value) { 709 this.decimalPrecision = value; 710 return this; 711 } 712 713 /** 714 * @return Number of digits after decimal separator when the results of such 715 * observations are of type Quantity. 716 */ 717 public int getDecimalPrecision() { 718 return this.decimalPrecision == null || this.decimalPrecision.isEmpty() ? 0 : this.decimalPrecision.getValue(); 719 } 720 721 /** 722 * @param value Number of digits after decimal separator when the results of 723 * such observations are of type Quantity. 724 */ 725 public ObservationDefinitionQuantitativeDetailsComponent setDecimalPrecision(int value) { 726 if (this.decimalPrecision == null) 727 this.decimalPrecision = new IntegerType(); 728 this.decimalPrecision.setValue(value); 729 return this; 730 } 731 732 protected void listChildren(List<Property> children) { 733 super.listChildren(children); 734 children.add(new Property("customaryUnit", "CodeableConcept", 735 "Customary unit used to report quantitative results of observations conforming to this ObservationDefinition.", 736 0, 1, customaryUnit)); 737 children.add(new Property("unit", "CodeableConcept", 738 "SI unit used to report quantitative results of observations conforming to this ObservationDefinition.", 0, 1, 739 unit)); 740 children.add(new Property("conversionFactor", "decimal", 741 "Factor for converting value expressed with SI unit to value expressed with customary unit.", 0, 1, 742 conversionFactor)); 743 children.add(new Property("decimalPrecision", "integer", 744 "Number of digits after decimal separator when the results of such observations are of type Quantity.", 0, 1, 745 decimalPrecision)); 746 } 747 748 @Override 749 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 750 switch (_hash) { 751 case -1375586437: 752 /* customaryUnit */ return new Property("customaryUnit", "CodeableConcept", 753 "Customary unit used to report quantitative results of observations conforming to this ObservationDefinition.", 754 0, 1, customaryUnit); 755 case 3594628: 756 /* unit */ return new Property("unit", "CodeableConcept", 757 "SI unit used to report quantitative results of observations conforming to this ObservationDefinition.", 0, 758 1, unit); 759 case 1438876165: 760 /* conversionFactor */ return new Property("conversionFactor", "decimal", 761 "Factor for converting value expressed with SI unit to value expressed with customary unit.", 0, 1, 762 conversionFactor); 763 case -1564447699: 764 /* decimalPrecision */ return new Property("decimalPrecision", "integer", 765 "Number of digits after decimal separator when the results of such observations are of type Quantity.", 0, 766 1, decimalPrecision); 767 default: 768 return super.getNamedProperty(_hash, _name, _checkValid); 769 } 770 771 } 772 773 @Override 774 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 775 switch (hash) { 776 case -1375586437: 777 /* customaryUnit */ return this.customaryUnit == null ? new Base[0] : new Base[] { this.customaryUnit }; // CodeableConcept 778 case 3594628: 779 /* unit */ return this.unit == null ? new Base[0] : new Base[] { this.unit }; // CodeableConcept 780 case 1438876165: 781 /* conversionFactor */ return this.conversionFactor == null ? new Base[0] 782 : new Base[] { this.conversionFactor }; // DecimalType 783 case -1564447699: 784 /* decimalPrecision */ return this.decimalPrecision == null ? new Base[0] 785 : new Base[] { this.decimalPrecision }; // IntegerType 786 default: 787 return super.getProperty(hash, name, checkValid); 788 } 789 790 } 791 792 @Override 793 public Base setProperty(int hash, String name, Base value) throws FHIRException { 794 switch (hash) { 795 case -1375586437: // customaryUnit 796 this.customaryUnit = castToCodeableConcept(value); // CodeableConcept 797 return value; 798 case 3594628: // unit 799 this.unit = castToCodeableConcept(value); // CodeableConcept 800 return value; 801 case 1438876165: // conversionFactor 802 this.conversionFactor = castToDecimal(value); // DecimalType 803 return value; 804 case -1564447699: // decimalPrecision 805 this.decimalPrecision = castToInteger(value); // IntegerType 806 return value; 807 default: 808 return super.setProperty(hash, name, value); 809 } 810 811 } 812 813 @Override 814 public Base setProperty(String name, Base value) throws FHIRException { 815 if (name.equals("customaryUnit")) { 816 this.customaryUnit = castToCodeableConcept(value); // CodeableConcept 817 } else if (name.equals("unit")) { 818 this.unit = castToCodeableConcept(value); // CodeableConcept 819 } else if (name.equals("conversionFactor")) { 820 this.conversionFactor = castToDecimal(value); // DecimalType 821 } else if (name.equals("decimalPrecision")) { 822 this.decimalPrecision = castToInteger(value); // IntegerType 823 } else 824 return super.setProperty(name, value); 825 return value; 826 } 827 828 @Override 829 public Base makeProperty(int hash, String name) throws FHIRException { 830 switch (hash) { 831 case -1375586437: 832 return getCustomaryUnit(); 833 case 3594628: 834 return getUnit(); 835 case 1438876165: 836 return getConversionFactorElement(); 837 case -1564447699: 838 return getDecimalPrecisionElement(); 839 default: 840 return super.makeProperty(hash, name); 841 } 842 843 } 844 845 @Override 846 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 847 switch (hash) { 848 case -1375586437: 849 /* customaryUnit */ return new String[] { "CodeableConcept" }; 850 case 3594628: 851 /* unit */ return new String[] { "CodeableConcept" }; 852 case 1438876165: 853 /* conversionFactor */ return new String[] { "decimal" }; 854 case -1564447699: 855 /* decimalPrecision */ return new String[] { "integer" }; 856 default: 857 return super.getTypesForProperty(hash, name); 858 } 859 860 } 861 862 @Override 863 public Base addChild(String name) throws FHIRException { 864 if (name.equals("customaryUnit")) { 865 this.customaryUnit = new CodeableConcept(); 866 return this.customaryUnit; 867 } else if (name.equals("unit")) { 868 this.unit = new CodeableConcept(); 869 return this.unit; 870 } else if (name.equals("conversionFactor")) { 871 throw new FHIRException("Cannot call addChild on a singleton property ObservationDefinition.conversionFactor"); 872 } else if (name.equals("decimalPrecision")) { 873 throw new FHIRException("Cannot call addChild on a singleton property ObservationDefinition.decimalPrecision"); 874 } else 875 return super.addChild(name); 876 } 877 878 public ObservationDefinitionQuantitativeDetailsComponent copy() { 879 ObservationDefinitionQuantitativeDetailsComponent dst = new ObservationDefinitionQuantitativeDetailsComponent(); 880 copyValues(dst); 881 return dst; 882 } 883 884 public void copyValues(ObservationDefinitionQuantitativeDetailsComponent dst) { 885 super.copyValues(dst); 886 dst.customaryUnit = customaryUnit == null ? null : customaryUnit.copy(); 887 dst.unit = unit == null ? null : unit.copy(); 888 dst.conversionFactor = conversionFactor == null ? null : conversionFactor.copy(); 889 dst.decimalPrecision = decimalPrecision == null ? null : decimalPrecision.copy(); 890 } 891 892 @Override 893 public boolean equalsDeep(Base other_) { 894 if (!super.equalsDeep(other_)) 895 return false; 896 if (!(other_ instanceof ObservationDefinitionQuantitativeDetailsComponent)) 897 return false; 898 ObservationDefinitionQuantitativeDetailsComponent o = (ObservationDefinitionQuantitativeDetailsComponent) other_; 899 return compareDeep(customaryUnit, o.customaryUnit, true) && compareDeep(unit, o.unit, true) 900 && compareDeep(conversionFactor, o.conversionFactor, true) 901 && compareDeep(decimalPrecision, o.decimalPrecision, true); 902 } 903 904 @Override 905 public boolean equalsShallow(Base other_) { 906 if (!super.equalsShallow(other_)) 907 return false; 908 if (!(other_ instanceof ObservationDefinitionQuantitativeDetailsComponent)) 909 return false; 910 ObservationDefinitionQuantitativeDetailsComponent o = (ObservationDefinitionQuantitativeDetailsComponent) other_; 911 return compareValues(conversionFactor, o.conversionFactor, true) 912 && compareValues(decimalPrecision, o.decimalPrecision, true); 913 } 914 915 public boolean isEmpty() { 916 return super.isEmpty() 917 && ca.uhn.fhir.util.ElementUtil.isEmpty(customaryUnit, unit, conversionFactor, decimalPrecision); 918 } 919 920 public String fhirType() { 921 return "ObservationDefinition.quantitativeDetails"; 922 923 } 924 925 } 926 927 @Block() 928 public static class ObservationDefinitionQualifiedIntervalComponent extends BackboneElement 929 implements IBaseBackboneElement { 930 /** 931 * The category of interval of values for continuous or ordinal observations 932 * conforming to this ObservationDefinition. 933 */ 934 @Child(name = "category", type = { CodeType.class }, order = 1, min = 0, max = 1, modifier = false, summary = false) 935 @Description(shortDefinition = "reference | critical | absolute", formalDefinition = "The category of interval of values for continuous or ordinal observations conforming to this ObservationDefinition.") 936 @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/observation-range-category") 937 protected Enumeration<ObservationRangeCategory> category; 938 939 /** 940 * The low and high values determining the interval. There may be only one of 941 * the two. 942 */ 943 @Child(name = "range", type = { Range.class }, order = 2, min = 0, max = 1, modifier = false, summary = false) 944 @Description(shortDefinition = "The interval itself, for continuous or ordinal observations", formalDefinition = "The low and high values determining the interval. There may be only one of the two.") 945 protected Range range; 946 947 /** 948 * Codes to indicate the health context the range applies to. For example, the 949 * normal or therapeutic range. 950 */ 951 @Child(name = "context", type = { 952 CodeableConcept.class }, order = 3, min = 0, max = 1, modifier = false, summary = false) 953 @Description(shortDefinition = "Range context qualifier", formalDefinition = "Codes to indicate the health context the range applies to. For example, the normal or therapeutic range.") 954 @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/referencerange-meaning") 955 protected CodeableConcept context; 956 957 /** 958 * Codes to indicate the target population this reference range applies to. 959 */ 960 @Child(name = "appliesTo", type = { 961 CodeableConcept.class }, order = 4, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false) 962 @Description(shortDefinition = "Targetted population of the range", formalDefinition = "Codes to indicate the target population this reference range applies to.") 963 @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/referencerange-appliesto") 964 protected List<CodeableConcept> appliesTo; 965 966 /** 967 * Sex of the population the range applies to. 968 */ 969 @Child(name = "gender", type = { CodeType.class }, order = 5, min = 0, max = 1, modifier = false, summary = false) 970 @Description(shortDefinition = "male | female | other | unknown", formalDefinition = "Sex of the population the range applies to.") 971 @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/administrative-gender") 972 protected Enumeration<AdministrativeGender> gender; 973 974 /** 975 * The age at which this reference range is applicable. This is a neonatal age 976 * (e.g. number of weeks at term) if the meaning says so. 977 */ 978 @Child(name = "age", type = { Range.class }, order = 6, min = 0, max = 1, modifier = false, summary = false) 979 @Description(shortDefinition = "Applicable age range, if relevant", formalDefinition = "The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.") 980 protected Range age; 981 982 /** 983 * The gestational age to which this reference range is applicable, in the 984 * context of pregnancy. 985 */ 986 @Child(name = "gestationalAge", type = { 987 Range.class }, order = 7, min = 0, max = 1, modifier = false, summary = false) 988 @Description(shortDefinition = "Applicable gestational age range, if relevant", formalDefinition = "The gestational age to which this reference range is applicable, in the context of pregnancy.") 989 protected Range gestationalAge; 990 991 /** 992 * Text based condition for which the reference range is valid. 993 */ 994 @Child(name = "condition", type = { 995 StringType.class }, order = 8, min = 0, max = 1, modifier = false, summary = false) 996 @Description(shortDefinition = "Condition associated with the reference range", formalDefinition = "Text based condition for which the reference range is valid.") 997 protected StringType condition; 998 999 private static final long serialVersionUID = -416423468L; 1000 1001 /** 1002 * Constructor 1003 */ 1004 public ObservationDefinitionQualifiedIntervalComponent() { 1005 super(); 1006 } 1007 1008 /** 1009 * @return {@link #category} (The category of interval of values for continuous 1010 * or ordinal observations conforming to this ObservationDefinition.). 1011 * This is the underlying object with id, value and extensions. The 1012 * accessor "getCategory" gives direct access to the value 1013 */ 1014 public Enumeration<ObservationRangeCategory> getCategoryElement() { 1015 if (this.category == null) 1016 if (Configuration.errorOnAutoCreate()) 1017 throw new Error("Attempt to auto-create ObservationDefinitionQualifiedIntervalComponent.category"); 1018 else if (Configuration.doAutoCreate()) 1019 this.category = new Enumeration<ObservationRangeCategory>(new ObservationRangeCategoryEnumFactory()); // bb 1020 return this.category; 1021 } 1022 1023 public boolean hasCategoryElement() { 1024 return this.category != null && !this.category.isEmpty(); 1025 } 1026 1027 public boolean hasCategory() { 1028 return this.category != null && !this.category.isEmpty(); 1029 } 1030 1031 /** 1032 * @param value {@link #category} (The category of interval of values for 1033 * continuous or ordinal observations conforming to this 1034 * ObservationDefinition.). This is the underlying object with id, 1035 * value and extensions. The accessor "getCategory" gives direct 1036 * access to the value 1037 */ 1038 public ObservationDefinitionQualifiedIntervalComponent setCategoryElement( 1039 Enumeration<ObservationRangeCategory> value) { 1040 this.category = value; 1041 return this; 1042 } 1043 1044 /** 1045 * @return The category of interval of values for continuous or ordinal 1046 * observations conforming to this ObservationDefinition. 1047 */ 1048 public ObservationRangeCategory getCategory() { 1049 return this.category == null ? null : this.category.getValue(); 1050 } 1051 1052 /** 1053 * @param value The category of interval of values for continuous or ordinal 1054 * observations conforming to this ObservationDefinition. 1055 */ 1056 public ObservationDefinitionQualifiedIntervalComponent setCategory(ObservationRangeCategory value) { 1057 if (value == null) 1058 this.category = null; 1059 else { 1060 if (this.category == null) 1061 this.category = new Enumeration<ObservationRangeCategory>(new ObservationRangeCategoryEnumFactory()); 1062 this.category.setValue(value); 1063 } 1064 return this; 1065 } 1066 1067 /** 1068 * @return {@link #range} (The low and high values determining the interval. 1069 * There may be only one of the two.) 1070 */ 1071 public Range getRange() { 1072 if (this.range == null) 1073 if (Configuration.errorOnAutoCreate()) 1074 throw new Error("Attempt to auto-create ObservationDefinitionQualifiedIntervalComponent.range"); 1075 else if (Configuration.doAutoCreate()) 1076 this.range = new Range(); // cc 1077 return this.range; 1078 } 1079 1080 public boolean hasRange() { 1081 return this.range != null && !this.range.isEmpty(); 1082 } 1083 1084 /** 1085 * @param value {@link #range} (The low and high values determining the 1086 * interval. There may be only one of the two.) 1087 */ 1088 public ObservationDefinitionQualifiedIntervalComponent setRange(Range value) { 1089 this.range = value; 1090 return this; 1091 } 1092 1093 /** 1094 * @return {@link #context} (Codes to indicate the health context the range 1095 * applies to. For example, the normal or therapeutic range.) 1096 */ 1097 public CodeableConcept getContext() { 1098 if (this.context == null) 1099 if (Configuration.errorOnAutoCreate()) 1100 throw new Error("Attempt to auto-create ObservationDefinitionQualifiedIntervalComponent.context"); 1101 else if (Configuration.doAutoCreate()) 1102 this.context = new CodeableConcept(); // cc 1103 return this.context; 1104 } 1105 1106 public boolean hasContext() { 1107 return this.context != null && !this.context.isEmpty(); 1108 } 1109 1110 /** 1111 * @param value {@link #context} (Codes to indicate the health context the range 1112 * applies to. For example, the normal or therapeutic range.) 1113 */ 1114 public ObservationDefinitionQualifiedIntervalComponent setContext(CodeableConcept value) { 1115 this.context = value; 1116 return this; 1117 } 1118 1119 /** 1120 * @return {@link #appliesTo} (Codes to indicate the target population this 1121 * reference range applies to.) 1122 */ 1123 public List<CodeableConcept> getAppliesTo() { 1124 if (this.appliesTo == null) 1125 this.appliesTo = new ArrayList<CodeableConcept>(); 1126 return this.appliesTo; 1127 } 1128 1129 /** 1130 * @return Returns a reference to <code>this</code> for easy method chaining 1131 */ 1132 public ObservationDefinitionQualifiedIntervalComponent setAppliesTo(List<CodeableConcept> theAppliesTo) { 1133 this.appliesTo = theAppliesTo; 1134 return this; 1135 } 1136 1137 public boolean hasAppliesTo() { 1138 if (this.appliesTo == null) 1139 return false; 1140 for (CodeableConcept item : this.appliesTo) 1141 if (!item.isEmpty()) 1142 return true; 1143 return false; 1144 } 1145 1146 public CodeableConcept addAppliesTo() { // 3 1147 CodeableConcept t = new CodeableConcept(); 1148 if (this.appliesTo == null) 1149 this.appliesTo = new ArrayList<CodeableConcept>(); 1150 this.appliesTo.add(t); 1151 return t; 1152 } 1153 1154 public ObservationDefinitionQualifiedIntervalComponent addAppliesTo(CodeableConcept t) { // 3 1155 if (t == null) 1156 return this; 1157 if (this.appliesTo == null) 1158 this.appliesTo = new ArrayList<CodeableConcept>(); 1159 this.appliesTo.add(t); 1160 return this; 1161 } 1162 1163 /** 1164 * @return The first repetition of repeating field {@link #appliesTo}, creating 1165 * it if it does not already exist 1166 */ 1167 public CodeableConcept getAppliesToFirstRep() { 1168 if (getAppliesTo().isEmpty()) { 1169 addAppliesTo(); 1170 } 1171 return getAppliesTo().get(0); 1172 } 1173 1174 /** 1175 * @return {@link #gender} (Sex of the population the range applies to.). This 1176 * is the underlying object with id, value and extensions. The accessor 1177 * "getGender" gives direct access to the value 1178 */ 1179 public Enumeration<AdministrativeGender> getGenderElement() { 1180 if (this.gender == null) 1181 if (Configuration.errorOnAutoCreate()) 1182 throw new Error("Attempt to auto-create ObservationDefinitionQualifiedIntervalComponent.gender"); 1183 else if (Configuration.doAutoCreate()) 1184 this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory()); // bb 1185 return this.gender; 1186 } 1187 1188 public boolean hasGenderElement() { 1189 return this.gender != null && !this.gender.isEmpty(); 1190 } 1191 1192 public boolean hasGender() { 1193 return this.gender != null && !this.gender.isEmpty(); 1194 } 1195 1196 /** 1197 * @param value {@link #gender} (Sex of the population the range applies to.). 1198 * This is the underlying object with id, value and extensions. The 1199 * accessor "getGender" gives direct access to the value 1200 */ 1201 public ObservationDefinitionQualifiedIntervalComponent setGenderElement(Enumeration<AdministrativeGender> value) { 1202 this.gender = value; 1203 return this; 1204 } 1205 1206 /** 1207 * @return Sex of the population the range applies to. 1208 */ 1209 public AdministrativeGender getGender() { 1210 return this.gender == null ? null : this.gender.getValue(); 1211 } 1212 1213 /** 1214 * @param value Sex of the population the range applies to. 1215 */ 1216 public ObservationDefinitionQualifiedIntervalComponent setGender(AdministrativeGender value) { 1217 if (value == null) 1218 this.gender = null; 1219 else { 1220 if (this.gender == null) 1221 this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory()); 1222 this.gender.setValue(value); 1223 } 1224 return this; 1225 } 1226 1227 /** 1228 * @return {@link #age} (The age at which this reference range is applicable. 1229 * This is a neonatal age (e.g. number of weeks at term) if the meaning 1230 * says so.) 1231 */ 1232 public Range getAge() { 1233 if (this.age == null) 1234 if (Configuration.errorOnAutoCreate()) 1235 throw new Error("Attempt to auto-create ObservationDefinitionQualifiedIntervalComponent.age"); 1236 else if (Configuration.doAutoCreate()) 1237 this.age = new Range(); // cc 1238 return this.age; 1239 } 1240 1241 public boolean hasAge() { 1242 return this.age != null && !this.age.isEmpty(); 1243 } 1244 1245 /** 1246 * @param value {@link #age} (The age at which this reference range is 1247 * applicable. This is a neonatal age (e.g. number of weeks at 1248 * term) if the meaning says so.) 1249 */ 1250 public ObservationDefinitionQualifiedIntervalComponent setAge(Range value) { 1251 this.age = value; 1252 return this; 1253 } 1254 1255 /** 1256 * @return {@link #gestationalAge} (The gestational age to which this reference 1257 * range is applicable, in the context of pregnancy.) 1258 */ 1259 public Range getGestationalAge() { 1260 if (this.gestationalAge == null) 1261 if (Configuration.errorOnAutoCreate()) 1262 throw new Error("Attempt to auto-create ObservationDefinitionQualifiedIntervalComponent.gestationalAge"); 1263 else if (Configuration.doAutoCreate()) 1264 this.gestationalAge = new Range(); // cc 1265 return this.gestationalAge; 1266 } 1267 1268 public boolean hasGestationalAge() { 1269 return this.gestationalAge != null && !this.gestationalAge.isEmpty(); 1270 } 1271 1272 /** 1273 * @param value {@link #gestationalAge} (The gestational age to which this 1274 * reference range is applicable, in the context of pregnancy.) 1275 */ 1276 public ObservationDefinitionQualifiedIntervalComponent setGestationalAge(Range value) { 1277 this.gestationalAge = value; 1278 return this; 1279 } 1280 1281 /** 1282 * @return {@link #condition} (Text based condition for which the reference 1283 * range is valid.). This is the underlying object with id, value and 1284 * extensions. The accessor "getCondition" gives direct access to the 1285 * value 1286 */ 1287 public StringType getConditionElement() { 1288 if (this.condition == null) 1289 if (Configuration.errorOnAutoCreate()) 1290 throw new Error("Attempt to auto-create ObservationDefinitionQualifiedIntervalComponent.condition"); 1291 else if (Configuration.doAutoCreate()) 1292 this.condition = new StringType(); // bb 1293 return this.condition; 1294 } 1295 1296 public boolean hasConditionElement() { 1297 return this.condition != null && !this.condition.isEmpty(); 1298 } 1299 1300 public boolean hasCondition() { 1301 return this.condition != null && !this.condition.isEmpty(); 1302 } 1303 1304 /** 1305 * @param value {@link #condition} (Text based condition for which the reference 1306 * range is valid.). This is the underlying object with id, value 1307 * and extensions. The accessor "getCondition" gives direct access 1308 * to the value 1309 */ 1310 public ObservationDefinitionQualifiedIntervalComponent setConditionElement(StringType value) { 1311 this.condition = value; 1312 return this; 1313 } 1314 1315 /** 1316 * @return Text based condition for which the reference range is valid. 1317 */ 1318 public String getCondition() { 1319 return this.condition == null ? null : this.condition.getValue(); 1320 } 1321 1322 /** 1323 * @param value Text based condition for which the reference range is valid. 1324 */ 1325 public ObservationDefinitionQualifiedIntervalComponent setCondition(String value) { 1326 if (Utilities.noString(value)) 1327 this.condition = null; 1328 else { 1329 if (this.condition == null) 1330 this.condition = new StringType(); 1331 this.condition.setValue(value); 1332 } 1333 return this; 1334 } 1335 1336 protected void listChildren(List<Property> children) { 1337 super.listChildren(children); 1338 children.add(new Property("category", "code", 1339 "The category of interval of values for continuous or ordinal observations conforming to this ObservationDefinition.", 1340 0, 1, category)); 1341 children.add(new Property("range", "Range", 1342 "The low and high values determining the interval. There may be only one of the two.", 0, 1, range)); 1343 children.add(new Property("context", "CodeableConcept", 1344 "Codes to indicate the health context the range applies to. For example, the normal or therapeutic range.", 0, 1345 1, context)); 1346 children.add(new Property("appliesTo", "CodeableConcept", 1347 "Codes to indicate the target population this reference range applies to.", 0, java.lang.Integer.MAX_VALUE, 1348 appliesTo)); 1349 children.add(new Property("gender", "code", "Sex of the population the range applies to.", 0, 1, gender)); 1350 children.add(new Property("age", "Range", 1351 "The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.", 1352 0, 1, age)); 1353 children.add(new Property("gestationalAge", "Range", 1354 "The gestational age to which this reference range is applicable, in the context of pregnancy.", 0, 1, 1355 gestationalAge)); 1356 children.add(new Property("condition", "string", "Text based condition for which the reference range is valid.", 1357 0, 1, condition)); 1358 } 1359 1360 @Override 1361 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1362 switch (_hash) { 1363 case 50511102: 1364 /* category */ return new Property("category", "code", 1365 "The category of interval of values for continuous or ordinal observations conforming to this ObservationDefinition.", 1366 0, 1, category); 1367 case 108280125: 1368 /* range */ return new Property("range", "Range", 1369 "The low and high values determining the interval. There may be only one of the two.", 0, 1, range); 1370 case 951530927: 1371 /* context */ return new Property("context", "CodeableConcept", 1372 "Codes to indicate the health context the range applies to. For example, the normal or therapeutic range.", 1373 0, 1, context); 1374 case -2089924569: 1375 /* appliesTo */ return new Property("appliesTo", "CodeableConcept", 1376 "Codes to indicate the target population this reference range applies to.", 0, java.lang.Integer.MAX_VALUE, 1377 appliesTo); 1378 case -1249512767: 1379 /* gender */ return new Property("gender", "code", "Sex of the population the range applies to.", 0, 1, gender); 1380 case 96511: 1381 /* age */ return new Property("age", "Range", 1382 "The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.", 1383 0, 1, age); 1384 case -241217538: 1385 /* gestationalAge */ return new Property("gestationalAge", "Range", 1386 "The gestational age to which this reference range is applicable, in the context of pregnancy.", 0, 1, 1387 gestationalAge); 1388 case -861311717: 1389 /* condition */ return new Property("condition", "string", 1390 "Text based condition for which the reference range is valid.", 0, 1, condition); 1391 default: 1392 return super.getNamedProperty(_hash, _name, _checkValid); 1393 } 1394 1395 } 1396 1397 @Override 1398 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1399 switch (hash) { 1400 case 50511102: 1401 /* category */ return this.category == null ? new Base[0] : new Base[] { this.category }; // Enumeration<ObservationRangeCategory> 1402 case 108280125: 1403 /* range */ return this.range == null ? new Base[0] : new Base[] { this.range }; // Range 1404 case 951530927: 1405 /* context */ return this.context == null ? new Base[0] : new Base[] { this.context }; // CodeableConcept 1406 case -2089924569: 1407 /* appliesTo */ return this.appliesTo == null ? new Base[0] 1408 : this.appliesTo.toArray(new Base[this.appliesTo.size()]); // CodeableConcept 1409 case -1249512767: 1410 /* gender */ return this.gender == null ? new Base[0] : new Base[] { this.gender }; // Enumeration<AdministrativeGender> 1411 case 96511: 1412 /* age */ return this.age == null ? new Base[0] : new Base[] { this.age }; // Range 1413 case -241217538: 1414 /* gestationalAge */ return this.gestationalAge == null ? new Base[0] : new Base[] { this.gestationalAge }; // Range 1415 case -861311717: 1416 /* condition */ return this.condition == null ? new Base[0] : new Base[] { this.condition }; // StringType 1417 default: 1418 return super.getProperty(hash, name, checkValid); 1419 } 1420 1421 } 1422 1423 @Override 1424 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1425 switch (hash) { 1426 case 50511102: // category 1427 value = new ObservationRangeCategoryEnumFactory().fromType(castToCode(value)); 1428 this.category = (Enumeration) value; // Enumeration<ObservationRangeCategory> 1429 return value; 1430 case 108280125: // range 1431 this.range = castToRange(value); // Range 1432 return value; 1433 case 951530927: // context 1434 this.context = castToCodeableConcept(value); // CodeableConcept 1435 return value; 1436 case -2089924569: // appliesTo 1437 this.getAppliesTo().add(castToCodeableConcept(value)); // CodeableConcept 1438 return value; 1439 case -1249512767: // gender 1440 value = new AdministrativeGenderEnumFactory().fromType(castToCode(value)); 1441 this.gender = (Enumeration) value; // Enumeration<AdministrativeGender> 1442 return value; 1443 case 96511: // age 1444 this.age = castToRange(value); // Range 1445 return value; 1446 case -241217538: // gestationalAge 1447 this.gestationalAge = castToRange(value); // Range 1448 return value; 1449 case -861311717: // condition 1450 this.condition = castToString(value); // StringType 1451 return value; 1452 default: 1453 return super.setProperty(hash, name, value); 1454 } 1455 1456 } 1457 1458 @Override 1459 public Base setProperty(String name, Base value) throws FHIRException { 1460 if (name.equals("category")) { 1461 value = new ObservationRangeCategoryEnumFactory().fromType(castToCode(value)); 1462 this.category = (Enumeration) value; // Enumeration<ObservationRangeCategory> 1463 } else if (name.equals("range")) { 1464 this.range = castToRange(value); // Range 1465 } else if (name.equals("context")) { 1466 this.context = castToCodeableConcept(value); // CodeableConcept 1467 } else if (name.equals("appliesTo")) { 1468 this.getAppliesTo().add(castToCodeableConcept(value)); 1469 } else if (name.equals("gender")) { 1470 value = new AdministrativeGenderEnumFactory().fromType(castToCode(value)); 1471 this.gender = (Enumeration) value; // Enumeration<AdministrativeGender> 1472 } else if (name.equals("age")) { 1473 this.age = castToRange(value); // Range 1474 } else if (name.equals("gestationalAge")) { 1475 this.gestationalAge = castToRange(value); // Range 1476 } else if (name.equals("condition")) { 1477 this.condition = castToString(value); // StringType 1478 } else 1479 return super.setProperty(name, value); 1480 return value; 1481 } 1482 1483 @Override 1484 public Base makeProperty(int hash, String name) throws FHIRException { 1485 switch (hash) { 1486 case 50511102: 1487 return getCategoryElement(); 1488 case 108280125: 1489 return getRange(); 1490 case 951530927: 1491 return getContext(); 1492 case -2089924569: 1493 return addAppliesTo(); 1494 case -1249512767: 1495 return getGenderElement(); 1496 case 96511: 1497 return getAge(); 1498 case -241217538: 1499 return getGestationalAge(); 1500 case -861311717: 1501 return getConditionElement(); 1502 default: 1503 return super.makeProperty(hash, name); 1504 } 1505 1506 } 1507 1508 @Override 1509 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1510 switch (hash) { 1511 case 50511102: 1512 /* category */ return new String[] { "code" }; 1513 case 108280125: 1514 /* range */ return new String[] { "Range" }; 1515 case 951530927: 1516 /* context */ return new String[] { "CodeableConcept" }; 1517 case -2089924569: 1518 /* appliesTo */ return new String[] { "CodeableConcept" }; 1519 case -1249512767: 1520 /* gender */ return new String[] { "code" }; 1521 case 96511: 1522 /* age */ return new String[] { "Range" }; 1523 case -241217538: 1524 /* gestationalAge */ return new String[] { "Range" }; 1525 case -861311717: 1526 /* condition */ return new String[] { "string" }; 1527 default: 1528 return super.getTypesForProperty(hash, name); 1529 } 1530 1531 } 1532 1533 @Override 1534 public Base addChild(String name) throws FHIRException { 1535 if (name.equals("category")) { 1536 throw new FHIRException("Cannot call addChild on a singleton property ObservationDefinition.category"); 1537 } else if (name.equals("range")) { 1538 this.range = new Range(); 1539 return this.range; 1540 } else if (name.equals("context")) { 1541 this.context = new CodeableConcept(); 1542 return this.context; 1543 } else if (name.equals("appliesTo")) { 1544 return addAppliesTo(); 1545 } else if (name.equals("gender")) { 1546 throw new FHIRException("Cannot call addChild on a singleton property ObservationDefinition.gender"); 1547 } else if (name.equals("age")) { 1548 this.age = new Range(); 1549 return this.age; 1550 } else if (name.equals("gestationalAge")) { 1551 this.gestationalAge = new Range(); 1552 return this.gestationalAge; 1553 } else if (name.equals("condition")) { 1554 throw new FHIRException("Cannot call addChild on a singleton property ObservationDefinition.condition"); 1555 } else 1556 return super.addChild(name); 1557 } 1558 1559 public ObservationDefinitionQualifiedIntervalComponent copy() { 1560 ObservationDefinitionQualifiedIntervalComponent dst = new ObservationDefinitionQualifiedIntervalComponent(); 1561 copyValues(dst); 1562 return dst; 1563 } 1564 1565 public void copyValues(ObservationDefinitionQualifiedIntervalComponent dst) { 1566 super.copyValues(dst); 1567 dst.category = category == null ? null : category.copy(); 1568 dst.range = range == null ? null : range.copy(); 1569 dst.context = context == null ? null : context.copy(); 1570 if (appliesTo != null) { 1571 dst.appliesTo = new ArrayList<CodeableConcept>(); 1572 for (CodeableConcept i : appliesTo) 1573 dst.appliesTo.add(i.copy()); 1574 } 1575 ; 1576 dst.gender = gender == null ? null : gender.copy(); 1577 dst.age = age == null ? null : age.copy(); 1578 dst.gestationalAge = gestationalAge == null ? null : gestationalAge.copy(); 1579 dst.condition = condition == null ? null : condition.copy(); 1580 } 1581 1582 @Override 1583 public boolean equalsDeep(Base other_) { 1584 if (!super.equalsDeep(other_)) 1585 return false; 1586 if (!(other_ instanceof ObservationDefinitionQualifiedIntervalComponent)) 1587 return false; 1588 ObservationDefinitionQualifiedIntervalComponent o = (ObservationDefinitionQualifiedIntervalComponent) other_; 1589 return compareDeep(category, o.category, true) && compareDeep(range, o.range, true) 1590 && compareDeep(context, o.context, true) && compareDeep(appliesTo, o.appliesTo, true) 1591 && compareDeep(gender, o.gender, true) && compareDeep(age, o.age, true) 1592 && compareDeep(gestationalAge, o.gestationalAge, true) && compareDeep(condition, o.condition, true); 1593 } 1594 1595 @Override 1596 public boolean equalsShallow(Base other_) { 1597 if (!super.equalsShallow(other_)) 1598 return false; 1599 if (!(other_ instanceof ObservationDefinitionQualifiedIntervalComponent)) 1600 return false; 1601 ObservationDefinitionQualifiedIntervalComponent o = (ObservationDefinitionQualifiedIntervalComponent) other_; 1602 return compareValues(category, o.category, true) && compareValues(gender, o.gender, true) 1603 && compareValues(condition, o.condition, true); 1604 } 1605 1606 public boolean isEmpty() { 1607 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(category, range, context, appliesTo, gender, age, 1608 gestationalAge, condition); 1609 } 1610 1611 public String fhirType() { 1612 return "ObservationDefinition.qualifiedInterval"; 1613 1614 } 1615 1616 } 1617 1618 /** 1619 * A code that classifies the general type of observation. 1620 */ 1621 @Child(name = "category", type = { 1622 CodeableConcept.class }, order = 0, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true) 1623 @Description(shortDefinition = "Category of observation", formalDefinition = "A code that classifies the general type of observation.") 1624 @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/observation-category") 1625 protected List<CodeableConcept> category; 1626 1627 /** 1628 * Describes what will be observed. Sometimes this is called the observation 1629 * "name". 1630 */ 1631 @Child(name = "code", type = { CodeableConcept.class }, order = 1, min = 1, max = 1, modifier = false, summary = true) 1632 @Description(shortDefinition = "Type of observation (code / type)", formalDefinition = "Describes what will be observed. Sometimes this is called the observation \"name\".") 1633 @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/observation-codes") 1634 protected CodeableConcept code; 1635 1636 /** 1637 * A unique identifier assigned to this ObservationDefinition artifact. 1638 */ 1639 @Child(name = "identifier", type = { 1640 Identifier.class }, order = 2, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true) 1641 @Description(shortDefinition = "Business identifier for this ObservationDefinition instance", formalDefinition = "A unique identifier assigned to this ObservationDefinition artifact.") 1642 protected List<Identifier> identifier; 1643 1644 /** 1645 * The data types allowed for the value element of the instance observations 1646 * conforming to this ObservationDefinition. 1647 */ 1648 @Child(name = "permittedDataType", type = { 1649 CodeType.class }, order = 3, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false) 1650 @Description(shortDefinition = "Quantity | CodeableConcept | string | boolean | integer | Range | Ratio | SampledData | time | dateTime | Period", formalDefinition = "The data types allowed for the value element of the instance observations conforming to this ObservationDefinition.") 1651 @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/permitted-data-type") 1652 protected List<Enumeration<ObservationDataType>> permittedDataType; 1653 1654 /** 1655 * Multiple results allowed for observations conforming to this 1656 * ObservationDefinition. 1657 */ 1658 @Child(name = "multipleResultsAllowed", type = { 1659 BooleanType.class }, order = 4, min = 0, max = 1, modifier = false, summary = false) 1660 @Description(shortDefinition = "Multiple results allowed", formalDefinition = "Multiple results allowed for observations conforming to this ObservationDefinition.") 1661 protected BooleanType multipleResultsAllowed; 1662 1663 /** 1664 * The method or technique used to perform the observation. 1665 */ 1666 @Child(name = "method", type = { 1667 CodeableConcept.class }, order = 5, min = 0, max = 1, modifier = false, summary = false) 1668 @Description(shortDefinition = "Method used to produce the observation", formalDefinition = "The method or technique used to perform the observation.") 1669 @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/observation-methods") 1670 protected CodeableConcept method; 1671 1672 /** 1673 * The preferred name to be used when reporting the results of observations 1674 * conforming to this ObservationDefinition. 1675 */ 1676 @Child(name = "preferredReportName", type = { 1677 StringType.class }, order = 6, min = 0, max = 1, modifier = false, summary = false) 1678 @Description(shortDefinition = "Preferred report name", formalDefinition = "The preferred name to be used when reporting the results of observations conforming to this ObservationDefinition.") 1679 protected StringType preferredReportName; 1680 1681 /** 1682 * Characteristics for quantitative results of this observation. 1683 */ 1684 @Child(name = "quantitativeDetails", type = {}, order = 7, min = 0, max = 1, modifier = false, summary = false) 1685 @Description(shortDefinition = "Characteristics of quantitative results", formalDefinition = "Characteristics for quantitative results of this observation.") 1686 protected ObservationDefinitionQuantitativeDetailsComponent quantitativeDetails; 1687 1688 /** 1689 * Multiple ranges of results qualified by different contexts for ordinal or 1690 * continuous observations conforming to this ObservationDefinition. 1691 */ 1692 @Child(name = "qualifiedInterval", type = {}, order = 8, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false) 1693 @Description(shortDefinition = "Qualified range for continuous and ordinal observation results", formalDefinition = "Multiple ranges of results qualified by different contexts for ordinal or continuous observations conforming to this ObservationDefinition.") 1694 protected List<ObservationDefinitionQualifiedIntervalComponent> qualifiedInterval; 1695 1696 /** 1697 * The set of valid coded results for the observations conforming to this 1698 * ObservationDefinition. 1699 */ 1700 @Child(name = "validCodedValueSet", type = { 1701 ValueSet.class }, order = 9, min = 0, max = 1, modifier = false, summary = false) 1702 @Description(shortDefinition = "Value set of valid coded values for the observations conforming to this ObservationDefinition", formalDefinition = "The set of valid coded results for the observations conforming to this ObservationDefinition.") 1703 protected Reference validCodedValueSet; 1704 1705 /** 1706 * The actual object that is the target of the reference (The set of valid coded 1707 * results for the observations conforming to this ObservationDefinition.) 1708 */ 1709 protected ValueSet validCodedValueSetTarget; 1710 1711 /** 1712 * The set of normal coded results for the observations conforming to this 1713 * ObservationDefinition. 1714 */ 1715 @Child(name = "normalCodedValueSet", type = { 1716 ValueSet.class }, order = 10, min = 0, max = 1, modifier = false, summary = false) 1717 @Description(shortDefinition = "Value set of normal coded values for the observations conforming to this ObservationDefinition", formalDefinition = "The set of normal coded results for the observations conforming to this ObservationDefinition.") 1718 protected Reference normalCodedValueSet; 1719 1720 /** 1721 * The actual object that is the target of the reference (The set of normal 1722 * coded results for the observations conforming to this ObservationDefinition.) 1723 */ 1724 protected ValueSet normalCodedValueSetTarget; 1725 1726 /** 1727 * The set of abnormal coded results for the observation conforming to this 1728 * ObservationDefinition. 1729 */ 1730 @Child(name = "abnormalCodedValueSet", type = { 1731 ValueSet.class }, order = 11, min = 0, max = 1, modifier = false, summary = false) 1732 @Description(shortDefinition = "Value set of abnormal coded values for the observations conforming to this ObservationDefinition", formalDefinition = "The set of abnormal coded results for the observation conforming to this ObservationDefinition.") 1733 protected Reference abnormalCodedValueSet; 1734 1735 /** 1736 * The actual object that is the target of the reference (The set of abnormal 1737 * coded results for the observation conforming to this ObservationDefinition.) 1738 */ 1739 protected ValueSet abnormalCodedValueSetTarget; 1740 1741 /** 1742 * The set of critical coded results for the observation conforming to this 1743 * ObservationDefinition. 1744 */ 1745 @Child(name = "criticalCodedValueSet", type = { 1746 ValueSet.class }, order = 12, min = 0, max = 1, modifier = false, summary = false) 1747 @Description(shortDefinition = "Value set of critical coded values for the observations conforming to this ObservationDefinition", formalDefinition = "The set of critical coded results for the observation conforming to this ObservationDefinition.") 1748 protected Reference criticalCodedValueSet; 1749 1750 /** 1751 * The actual object that is the target of the reference (The set of critical 1752 * coded results for the observation conforming to this ObservationDefinition.) 1753 */ 1754 protected ValueSet criticalCodedValueSetTarget; 1755 1756 private static final long serialVersionUID = 2136752757L; 1757 1758 /** 1759 * Constructor 1760 */ 1761 public ObservationDefinition() { 1762 super(); 1763 } 1764 1765 /** 1766 * Constructor 1767 */ 1768 public ObservationDefinition(CodeableConcept code) { 1769 super(); 1770 this.code = code; 1771 } 1772 1773 /** 1774 * @return {@link #category} (A code that classifies the general type of 1775 * observation.) 1776 */ 1777 public List<CodeableConcept> getCategory() { 1778 if (this.category == null) 1779 this.category = new ArrayList<CodeableConcept>(); 1780 return this.category; 1781 } 1782 1783 /** 1784 * @return Returns a reference to <code>this</code> for easy method chaining 1785 */ 1786 public ObservationDefinition setCategory(List<CodeableConcept> theCategory) { 1787 this.category = theCategory; 1788 return this; 1789 } 1790 1791 public boolean hasCategory() { 1792 if (this.category == null) 1793 return false; 1794 for (CodeableConcept item : this.category) 1795 if (!item.isEmpty()) 1796 return true; 1797 return false; 1798 } 1799 1800 public CodeableConcept addCategory() { // 3 1801 CodeableConcept t = new CodeableConcept(); 1802 if (this.category == null) 1803 this.category = new ArrayList<CodeableConcept>(); 1804 this.category.add(t); 1805 return t; 1806 } 1807 1808 public ObservationDefinition addCategory(CodeableConcept t) { // 3 1809 if (t == null) 1810 return this; 1811 if (this.category == null) 1812 this.category = new ArrayList<CodeableConcept>(); 1813 this.category.add(t); 1814 return this; 1815 } 1816 1817 /** 1818 * @return The first repetition of repeating field {@link #category}, creating 1819 * it if it does not already exist 1820 */ 1821 public CodeableConcept getCategoryFirstRep() { 1822 if (getCategory().isEmpty()) { 1823 addCategory(); 1824 } 1825 return getCategory().get(0); 1826 } 1827 1828 /** 1829 * @return {@link #code} (Describes what will be observed. Sometimes this is 1830 * called the observation "name".) 1831 */ 1832 public CodeableConcept getCode() { 1833 if (this.code == null) 1834 if (Configuration.errorOnAutoCreate()) 1835 throw new Error("Attempt to auto-create ObservationDefinition.code"); 1836 else if (Configuration.doAutoCreate()) 1837 this.code = new CodeableConcept(); // cc 1838 return this.code; 1839 } 1840 1841 public boolean hasCode() { 1842 return this.code != null && !this.code.isEmpty(); 1843 } 1844 1845 /** 1846 * @param value {@link #code} (Describes what will be observed. Sometimes this 1847 * is called the observation "name".) 1848 */ 1849 public ObservationDefinition setCode(CodeableConcept value) { 1850 this.code = value; 1851 return this; 1852 } 1853 1854 /** 1855 * @return {@link #identifier} (A unique identifier assigned to this 1856 * ObservationDefinition artifact.) 1857 */ 1858 public List<Identifier> getIdentifier() { 1859 if (this.identifier == null) 1860 this.identifier = new ArrayList<Identifier>(); 1861 return this.identifier; 1862 } 1863 1864 /** 1865 * @return Returns a reference to <code>this</code> for easy method chaining 1866 */ 1867 public ObservationDefinition setIdentifier(List<Identifier> theIdentifier) { 1868 this.identifier = theIdentifier; 1869 return this; 1870 } 1871 1872 public boolean hasIdentifier() { 1873 if (this.identifier == null) 1874 return false; 1875 for (Identifier item : this.identifier) 1876 if (!item.isEmpty()) 1877 return true; 1878 return false; 1879 } 1880 1881 public Identifier addIdentifier() { // 3 1882 Identifier t = new Identifier(); 1883 if (this.identifier == null) 1884 this.identifier = new ArrayList<Identifier>(); 1885 this.identifier.add(t); 1886 return t; 1887 } 1888 1889 public ObservationDefinition addIdentifier(Identifier t) { // 3 1890 if (t == null) 1891 return this; 1892 if (this.identifier == null) 1893 this.identifier = new ArrayList<Identifier>(); 1894 this.identifier.add(t); 1895 return this; 1896 } 1897 1898 /** 1899 * @return The first repetition of repeating field {@link #identifier}, creating 1900 * it if it does not already exist 1901 */ 1902 public Identifier getIdentifierFirstRep() { 1903 if (getIdentifier().isEmpty()) { 1904 addIdentifier(); 1905 } 1906 return getIdentifier().get(0); 1907 } 1908 1909 /** 1910 * @return {@link #permittedDataType} (The data types allowed for the value 1911 * element of the instance observations conforming to this 1912 * ObservationDefinition.) 1913 */ 1914 public List<Enumeration<ObservationDataType>> getPermittedDataType() { 1915 if (this.permittedDataType == null) 1916 this.permittedDataType = new ArrayList<Enumeration<ObservationDataType>>(); 1917 return this.permittedDataType; 1918 } 1919 1920 /** 1921 * @return Returns a reference to <code>this</code> for easy method chaining 1922 */ 1923 public ObservationDefinition setPermittedDataType(List<Enumeration<ObservationDataType>> thePermittedDataType) { 1924 this.permittedDataType = thePermittedDataType; 1925 return this; 1926 } 1927 1928 public boolean hasPermittedDataType() { 1929 if (this.permittedDataType == null) 1930 return false; 1931 for (Enumeration<ObservationDataType> item : this.permittedDataType) 1932 if (!item.isEmpty()) 1933 return true; 1934 return false; 1935 } 1936 1937 /** 1938 * @return {@link #permittedDataType} (The data types allowed for the value 1939 * element of the instance observations conforming to this 1940 * ObservationDefinition.) 1941 */ 1942 public Enumeration<ObservationDataType> addPermittedDataTypeElement() {// 2 1943 Enumeration<ObservationDataType> t = new Enumeration<ObservationDataType>(new ObservationDataTypeEnumFactory()); 1944 if (this.permittedDataType == null) 1945 this.permittedDataType = new ArrayList<Enumeration<ObservationDataType>>(); 1946 this.permittedDataType.add(t); 1947 return t; 1948 } 1949 1950 /** 1951 * @param value {@link #permittedDataType} (The data types allowed for the value 1952 * element of the instance observations conforming to this 1953 * ObservationDefinition.) 1954 */ 1955 public ObservationDefinition addPermittedDataType(ObservationDataType value) { // 1 1956 Enumeration<ObservationDataType> t = new Enumeration<ObservationDataType>(new ObservationDataTypeEnumFactory()); 1957 t.setValue(value); 1958 if (this.permittedDataType == null) 1959 this.permittedDataType = new ArrayList<Enumeration<ObservationDataType>>(); 1960 this.permittedDataType.add(t); 1961 return this; 1962 } 1963 1964 /** 1965 * @param value {@link #permittedDataType} (The data types allowed for the value 1966 * element of the instance observations conforming to this 1967 * ObservationDefinition.) 1968 */ 1969 public boolean hasPermittedDataType(ObservationDataType value) { 1970 if (this.permittedDataType == null) 1971 return false; 1972 for (Enumeration<ObservationDataType> v : this.permittedDataType) 1973 if (v.getValue().equals(value)) // code 1974 return true; 1975 return false; 1976 } 1977 1978 /** 1979 * @return {@link #multipleResultsAllowed} (Multiple results allowed for 1980 * observations conforming to this ObservationDefinition.). This is the 1981 * underlying object with id, value and extensions. The accessor 1982 * "getMultipleResultsAllowed" gives direct access to the value 1983 */ 1984 public BooleanType getMultipleResultsAllowedElement() { 1985 if (this.multipleResultsAllowed == null) 1986 if (Configuration.errorOnAutoCreate()) 1987 throw new Error("Attempt to auto-create ObservationDefinition.multipleResultsAllowed"); 1988 else if (Configuration.doAutoCreate()) 1989 this.multipleResultsAllowed = new BooleanType(); // bb 1990 return this.multipleResultsAllowed; 1991 } 1992 1993 public boolean hasMultipleResultsAllowedElement() { 1994 return this.multipleResultsAllowed != null && !this.multipleResultsAllowed.isEmpty(); 1995 } 1996 1997 public boolean hasMultipleResultsAllowed() { 1998 return this.multipleResultsAllowed != null && !this.multipleResultsAllowed.isEmpty(); 1999 } 2000 2001 /** 2002 * @param value {@link #multipleResultsAllowed} (Multiple results allowed for 2003 * observations conforming to this ObservationDefinition.). This is 2004 * the underlying object with id, value and extensions. The 2005 * accessor "getMultipleResultsAllowed" gives direct access to the 2006 * value 2007 */ 2008 public ObservationDefinition setMultipleResultsAllowedElement(BooleanType value) { 2009 this.multipleResultsAllowed = value; 2010 return this; 2011 } 2012 2013 /** 2014 * @return Multiple results allowed for observations conforming to this 2015 * ObservationDefinition. 2016 */ 2017 public boolean getMultipleResultsAllowed() { 2018 return this.multipleResultsAllowed == null || this.multipleResultsAllowed.isEmpty() ? false 2019 : this.multipleResultsAllowed.getValue(); 2020 } 2021 2022 /** 2023 * @param value Multiple results allowed for observations conforming to this 2024 * ObservationDefinition. 2025 */ 2026 public ObservationDefinition setMultipleResultsAllowed(boolean value) { 2027 if (this.multipleResultsAllowed == null) 2028 this.multipleResultsAllowed = new BooleanType(); 2029 this.multipleResultsAllowed.setValue(value); 2030 return this; 2031 } 2032 2033 /** 2034 * @return {@link #method} (The method or technique used to perform the 2035 * observation.) 2036 */ 2037 public CodeableConcept getMethod() { 2038 if (this.method == null) 2039 if (Configuration.errorOnAutoCreate()) 2040 throw new Error("Attempt to auto-create ObservationDefinition.method"); 2041 else if (Configuration.doAutoCreate()) 2042 this.method = new CodeableConcept(); // cc 2043 return this.method; 2044 } 2045 2046 public boolean hasMethod() { 2047 return this.method != null && !this.method.isEmpty(); 2048 } 2049 2050 /** 2051 * @param value {@link #method} (The method or technique used to perform the 2052 * observation.) 2053 */ 2054 public ObservationDefinition setMethod(CodeableConcept value) { 2055 this.method = value; 2056 return this; 2057 } 2058 2059 /** 2060 * @return {@link #preferredReportName} (The preferred name to be used when 2061 * reporting the results of observations conforming to this 2062 * ObservationDefinition.). This is the underlying object with id, value 2063 * and extensions. The accessor "getPreferredReportName" gives direct 2064 * access to the value 2065 */ 2066 public StringType getPreferredReportNameElement() { 2067 if (this.preferredReportName == null) 2068 if (Configuration.errorOnAutoCreate()) 2069 throw new Error("Attempt to auto-create ObservationDefinition.preferredReportName"); 2070 else if (Configuration.doAutoCreate()) 2071 this.preferredReportName = new StringType(); // bb 2072 return this.preferredReportName; 2073 } 2074 2075 public boolean hasPreferredReportNameElement() { 2076 return this.preferredReportName != null && !this.preferredReportName.isEmpty(); 2077 } 2078 2079 public boolean hasPreferredReportName() { 2080 return this.preferredReportName != null && !this.preferredReportName.isEmpty(); 2081 } 2082 2083 /** 2084 * @param value {@link #preferredReportName} (The preferred name to be used when 2085 * reporting the results of observations conforming to this 2086 * ObservationDefinition.). This is the underlying object with id, 2087 * value and extensions. The accessor "getPreferredReportName" 2088 * gives direct access to the value 2089 */ 2090 public ObservationDefinition setPreferredReportNameElement(StringType value) { 2091 this.preferredReportName = value; 2092 return this; 2093 } 2094 2095 /** 2096 * @return The preferred name to be used when reporting the results of 2097 * observations conforming to this ObservationDefinition. 2098 */ 2099 public String getPreferredReportName() { 2100 return this.preferredReportName == null ? null : this.preferredReportName.getValue(); 2101 } 2102 2103 /** 2104 * @param value The preferred name to be used when reporting the results of 2105 * observations conforming to this ObservationDefinition. 2106 */ 2107 public ObservationDefinition setPreferredReportName(String value) { 2108 if (Utilities.noString(value)) 2109 this.preferredReportName = null; 2110 else { 2111 if (this.preferredReportName == null) 2112 this.preferredReportName = new StringType(); 2113 this.preferredReportName.setValue(value); 2114 } 2115 return this; 2116 } 2117 2118 /** 2119 * @return {@link #quantitativeDetails} (Characteristics for quantitative 2120 * results of this observation.) 2121 */ 2122 public ObservationDefinitionQuantitativeDetailsComponent getQuantitativeDetails() { 2123 if (this.quantitativeDetails == null) 2124 if (Configuration.errorOnAutoCreate()) 2125 throw new Error("Attempt to auto-create ObservationDefinition.quantitativeDetails"); 2126 else if (Configuration.doAutoCreate()) 2127 this.quantitativeDetails = new ObservationDefinitionQuantitativeDetailsComponent(); // cc 2128 return this.quantitativeDetails; 2129 } 2130 2131 public boolean hasQuantitativeDetails() { 2132 return this.quantitativeDetails != null && !this.quantitativeDetails.isEmpty(); 2133 } 2134 2135 /** 2136 * @param value {@link #quantitativeDetails} (Characteristics for quantitative 2137 * results of this observation.) 2138 */ 2139 public ObservationDefinition setQuantitativeDetails(ObservationDefinitionQuantitativeDetailsComponent value) { 2140 this.quantitativeDetails = value; 2141 return this; 2142 } 2143 2144 /** 2145 * @return {@link #qualifiedInterval} (Multiple ranges of results qualified by 2146 * different contexts for ordinal or continuous observations conforming 2147 * to this ObservationDefinition.) 2148 */ 2149 public List<ObservationDefinitionQualifiedIntervalComponent> getQualifiedInterval() { 2150 if (this.qualifiedInterval == null) 2151 this.qualifiedInterval = new ArrayList<ObservationDefinitionQualifiedIntervalComponent>(); 2152 return this.qualifiedInterval; 2153 } 2154 2155 /** 2156 * @return Returns a reference to <code>this</code> for easy method chaining 2157 */ 2158 public ObservationDefinition setQualifiedInterval( 2159 List<ObservationDefinitionQualifiedIntervalComponent> theQualifiedInterval) { 2160 this.qualifiedInterval = theQualifiedInterval; 2161 return this; 2162 } 2163 2164 public boolean hasQualifiedInterval() { 2165 if (this.qualifiedInterval == null) 2166 return false; 2167 for (ObservationDefinitionQualifiedIntervalComponent item : this.qualifiedInterval) 2168 if (!item.isEmpty()) 2169 return true; 2170 return false; 2171 } 2172 2173 public ObservationDefinitionQualifiedIntervalComponent addQualifiedInterval() { // 3 2174 ObservationDefinitionQualifiedIntervalComponent t = new ObservationDefinitionQualifiedIntervalComponent(); 2175 if (this.qualifiedInterval == null) 2176 this.qualifiedInterval = new ArrayList<ObservationDefinitionQualifiedIntervalComponent>(); 2177 this.qualifiedInterval.add(t); 2178 return t; 2179 } 2180 2181 public ObservationDefinition addQualifiedInterval(ObservationDefinitionQualifiedIntervalComponent t) { // 3 2182 if (t == null) 2183 return this; 2184 if (this.qualifiedInterval == null) 2185 this.qualifiedInterval = new ArrayList<ObservationDefinitionQualifiedIntervalComponent>(); 2186 this.qualifiedInterval.add(t); 2187 return this; 2188 } 2189 2190 /** 2191 * @return The first repetition of repeating field {@link #qualifiedInterval}, 2192 * creating it if it does not already exist 2193 */ 2194 public ObservationDefinitionQualifiedIntervalComponent getQualifiedIntervalFirstRep() { 2195 if (getQualifiedInterval().isEmpty()) { 2196 addQualifiedInterval(); 2197 } 2198 return getQualifiedInterval().get(0); 2199 } 2200 2201 /** 2202 * @return {@link #validCodedValueSet} (The set of valid coded results for the 2203 * observations conforming to this ObservationDefinition.) 2204 */ 2205 public Reference getValidCodedValueSet() { 2206 if (this.validCodedValueSet == null) 2207 if (Configuration.errorOnAutoCreate()) 2208 throw new Error("Attempt to auto-create ObservationDefinition.validCodedValueSet"); 2209 else if (Configuration.doAutoCreate()) 2210 this.validCodedValueSet = new Reference(); // cc 2211 return this.validCodedValueSet; 2212 } 2213 2214 public boolean hasValidCodedValueSet() { 2215 return this.validCodedValueSet != null && !this.validCodedValueSet.isEmpty(); 2216 } 2217 2218 /** 2219 * @param value {@link #validCodedValueSet} (The set of valid coded results for 2220 * the observations conforming to this ObservationDefinition.) 2221 */ 2222 public ObservationDefinition setValidCodedValueSet(Reference value) { 2223 this.validCodedValueSet = value; 2224 return this; 2225 } 2226 2227 /** 2228 * @return {@link #validCodedValueSet} The actual object that is the target of 2229 * the reference. The reference library doesn't populate this, but you 2230 * can use it to hold the resource if you resolve it. (The set of valid 2231 * coded results for the observations conforming to this 2232 * ObservationDefinition.) 2233 */ 2234 public ValueSet getValidCodedValueSetTarget() { 2235 if (this.validCodedValueSetTarget == null) 2236 if (Configuration.errorOnAutoCreate()) 2237 throw new Error("Attempt to auto-create ObservationDefinition.validCodedValueSet"); 2238 else if (Configuration.doAutoCreate()) 2239 this.validCodedValueSetTarget = new ValueSet(); // aa 2240 return this.validCodedValueSetTarget; 2241 } 2242 2243 /** 2244 * @param value {@link #validCodedValueSet} The actual object that is the target 2245 * of the reference. The reference library doesn't use these, but 2246 * you can use it to hold the resource if you resolve it. (The set 2247 * of valid coded results for the observations conforming to this 2248 * ObservationDefinition.) 2249 */ 2250 public ObservationDefinition setValidCodedValueSetTarget(ValueSet value) { 2251 this.validCodedValueSetTarget = value; 2252 return this; 2253 } 2254 2255 /** 2256 * @return {@link #normalCodedValueSet} (The set of normal coded results for the 2257 * observations conforming to this ObservationDefinition.) 2258 */ 2259 public Reference getNormalCodedValueSet() { 2260 if (this.normalCodedValueSet == null) 2261 if (Configuration.errorOnAutoCreate()) 2262 throw new Error("Attempt to auto-create ObservationDefinition.normalCodedValueSet"); 2263 else if (Configuration.doAutoCreate()) 2264 this.normalCodedValueSet = new Reference(); // cc 2265 return this.normalCodedValueSet; 2266 } 2267 2268 public boolean hasNormalCodedValueSet() { 2269 return this.normalCodedValueSet != null && !this.normalCodedValueSet.isEmpty(); 2270 } 2271 2272 /** 2273 * @param value {@link #normalCodedValueSet} (The set of normal coded results 2274 * for the observations conforming to this ObservationDefinition.) 2275 */ 2276 public ObservationDefinition setNormalCodedValueSet(Reference value) { 2277 this.normalCodedValueSet = value; 2278 return this; 2279 } 2280 2281 /** 2282 * @return {@link #normalCodedValueSet} The actual object that is the target of 2283 * the reference. The reference library doesn't populate this, but you 2284 * can use it to hold the resource if you resolve it. (The set of normal 2285 * coded results for the observations conforming to this 2286 * ObservationDefinition.) 2287 */ 2288 public ValueSet getNormalCodedValueSetTarget() { 2289 if (this.normalCodedValueSetTarget == null) 2290 if (Configuration.errorOnAutoCreate()) 2291 throw new Error("Attempt to auto-create ObservationDefinition.normalCodedValueSet"); 2292 else if (Configuration.doAutoCreate()) 2293 this.normalCodedValueSetTarget = new ValueSet(); // aa 2294 return this.normalCodedValueSetTarget; 2295 } 2296 2297 /** 2298 * @param value {@link #normalCodedValueSet} The actual object that is the 2299 * target of the reference. The reference library doesn't use 2300 * these, but you can use it to hold the resource if you resolve 2301 * it. (The set of normal coded results for the observations 2302 * conforming to this ObservationDefinition.) 2303 */ 2304 public ObservationDefinition setNormalCodedValueSetTarget(ValueSet value) { 2305 this.normalCodedValueSetTarget = value; 2306 return this; 2307 } 2308 2309 /** 2310 * @return {@link #abnormalCodedValueSet} (The set of abnormal coded results for 2311 * the observation conforming to this ObservationDefinition.) 2312 */ 2313 public Reference getAbnormalCodedValueSet() { 2314 if (this.abnormalCodedValueSet == null) 2315 if (Configuration.errorOnAutoCreate()) 2316 throw new Error("Attempt to auto-create ObservationDefinition.abnormalCodedValueSet"); 2317 else if (Configuration.doAutoCreate()) 2318 this.abnormalCodedValueSet = new Reference(); // cc 2319 return this.abnormalCodedValueSet; 2320 } 2321 2322 public boolean hasAbnormalCodedValueSet() { 2323 return this.abnormalCodedValueSet != null && !this.abnormalCodedValueSet.isEmpty(); 2324 } 2325 2326 /** 2327 * @param value {@link #abnormalCodedValueSet} (The set of abnormal coded 2328 * results for the observation conforming to this 2329 * ObservationDefinition.) 2330 */ 2331 public ObservationDefinition setAbnormalCodedValueSet(Reference value) { 2332 this.abnormalCodedValueSet = value; 2333 return this; 2334 } 2335 2336 /** 2337 * @return {@link #abnormalCodedValueSet} The actual object that is the target 2338 * of the reference. The reference library doesn't populate this, but 2339 * you can use it to hold the resource if you resolve it. (The set of 2340 * abnormal coded results for the observation conforming to this 2341 * ObservationDefinition.) 2342 */ 2343 public ValueSet getAbnormalCodedValueSetTarget() { 2344 if (this.abnormalCodedValueSetTarget == null) 2345 if (Configuration.errorOnAutoCreate()) 2346 throw new Error("Attempt to auto-create ObservationDefinition.abnormalCodedValueSet"); 2347 else if (Configuration.doAutoCreate()) 2348 this.abnormalCodedValueSetTarget = new ValueSet(); // aa 2349 return this.abnormalCodedValueSetTarget; 2350 } 2351 2352 /** 2353 * @param value {@link #abnormalCodedValueSet} The actual object that is the 2354 * target of the reference. The reference library doesn't use 2355 * these, but you can use it to hold the resource if you resolve 2356 * it. (The set of abnormal coded results for the observation 2357 * conforming to this ObservationDefinition.) 2358 */ 2359 public ObservationDefinition setAbnormalCodedValueSetTarget(ValueSet value) { 2360 this.abnormalCodedValueSetTarget = value; 2361 return this; 2362 } 2363 2364 /** 2365 * @return {@link #criticalCodedValueSet} (The set of critical coded results for 2366 * the observation conforming to this ObservationDefinition.) 2367 */ 2368 public Reference getCriticalCodedValueSet() { 2369 if (this.criticalCodedValueSet == null) 2370 if (Configuration.errorOnAutoCreate()) 2371 throw new Error("Attempt to auto-create ObservationDefinition.criticalCodedValueSet"); 2372 else if (Configuration.doAutoCreate()) 2373 this.criticalCodedValueSet = new Reference(); // cc 2374 return this.criticalCodedValueSet; 2375 } 2376 2377 public boolean hasCriticalCodedValueSet() { 2378 return this.criticalCodedValueSet != null && !this.criticalCodedValueSet.isEmpty(); 2379 } 2380 2381 /** 2382 * @param value {@link #criticalCodedValueSet} (The set of critical coded 2383 * results for the observation conforming to this 2384 * ObservationDefinition.) 2385 */ 2386 public ObservationDefinition setCriticalCodedValueSet(Reference value) { 2387 this.criticalCodedValueSet = value; 2388 return this; 2389 } 2390 2391 /** 2392 * @return {@link #criticalCodedValueSet} The actual object that is the target 2393 * of the reference. The reference library doesn't populate this, but 2394 * you can use it to hold the resource if you resolve it. (The set of 2395 * critical coded results for the observation conforming to this 2396 * ObservationDefinition.) 2397 */ 2398 public ValueSet getCriticalCodedValueSetTarget() { 2399 if (this.criticalCodedValueSetTarget == null) 2400 if (Configuration.errorOnAutoCreate()) 2401 throw new Error("Attempt to auto-create ObservationDefinition.criticalCodedValueSet"); 2402 else if (Configuration.doAutoCreate()) 2403 this.criticalCodedValueSetTarget = new ValueSet(); // aa 2404 return this.criticalCodedValueSetTarget; 2405 } 2406 2407 /** 2408 * @param value {@link #criticalCodedValueSet} The actual object that is the 2409 * target of the reference. The reference library doesn't use 2410 * these, but you can use it to hold the resource if you resolve 2411 * it. (The set of critical coded results for the observation 2412 * conforming to this ObservationDefinition.) 2413 */ 2414 public ObservationDefinition setCriticalCodedValueSetTarget(ValueSet value) { 2415 this.criticalCodedValueSetTarget = value; 2416 return this; 2417 } 2418 2419 protected void listChildren(List<Property> children) { 2420 super.listChildren(children); 2421 children.add(new Property("category", "CodeableConcept", "A code that classifies the general type of observation.", 2422 0, java.lang.Integer.MAX_VALUE, category)); 2423 children.add(new Property("code", "CodeableConcept", 2424 "Describes what will be observed. Sometimes this is called the observation \"name\".", 0, 1, code)); 2425 children.add( 2426 new Property("identifier", "Identifier", "A unique identifier assigned to this ObservationDefinition artifact.", 2427 0, java.lang.Integer.MAX_VALUE, identifier)); 2428 children.add(new Property("permittedDataType", "code", 2429 "The data types allowed for the value element of the instance observations conforming to this ObservationDefinition.", 2430 0, java.lang.Integer.MAX_VALUE, permittedDataType)); 2431 children.add(new Property("multipleResultsAllowed", "boolean", 2432 "Multiple results allowed for observations conforming to this ObservationDefinition.", 0, 1, 2433 multipleResultsAllowed)); 2434 children.add(new Property("method", "CodeableConcept", "The method or technique used to perform the observation.", 2435 0, 1, method)); 2436 children.add(new Property("preferredReportName", "string", 2437 "The preferred name to be used when reporting the results of observations conforming to this ObservationDefinition.", 2438 0, 1, preferredReportName)); 2439 children.add(new Property("quantitativeDetails", "", 2440 "Characteristics for quantitative results of this observation.", 0, 1, quantitativeDetails)); 2441 children.add(new Property("qualifiedInterval", "", 2442 "Multiple ranges of results qualified by different contexts for ordinal or continuous observations conforming to this ObservationDefinition.", 2443 0, java.lang.Integer.MAX_VALUE, qualifiedInterval)); 2444 children.add(new Property("validCodedValueSet", "Reference(ValueSet)", 2445 "The set of valid coded results for the observations conforming to this ObservationDefinition.", 0, 1, 2446 validCodedValueSet)); 2447 children.add(new Property("normalCodedValueSet", "Reference(ValueSet)", 2448 "The set of normal coded results for the observations conforming to this ObservationDefinition.", 0, 1, 2449 normalCodedValueSet)); 2450 children.add(new Property("abnormalCodedValueSet", "Reference(ValueSet)", 2451 "The set of abnormal coded results for the observation conforming to this ObservationDefinition.", 0, 1, 2452 abnormalCodedValueSet)); 2453 children.add(new Property("criticalCodedValueSet", "Reference(ValueSet)", 2454 "The set of critical coded results for the observation conforming to this ObservationDefinition.", 0, 1, 2455 criticalCodedValueSet)); 2456 } 2457 2458 @Override 2459 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 2460 switch (_hash) { 2461 case 50511102: 2462 /* category */ return new Property("category", "CodeableConcept", 2463 "A code that classifies the general type of observation.", 0, java.lang.Integer.MAX_VALUE, category); 2464 case 3059181: 2465 /* code */ return new Property("code", "CodeableConcept", 2466 "Describes what will be observed. Sometimes this is called the observation \"name\".", 0, 1, code); 2467 case -1618432855: 2468 /* identifier */ return new Property("identifier", "Identifier", 2469 "A unique identifier assigned to this ObservationDefinition artifact.", 0, java.lang.Integer.MAX_VALUE, 2470 identifier); 2471 case -99492804: 2472 /* permittedDataType */ return new Property("permittedDataType", "code", 2473 "The data types allowed for the value element of the instance observations conforming to this ObservationDefinition.", 2474 0, java.lang.Integer.MAX_VALUE, permittedDataType); 2475 case -2102414590: 2476 /* multipleResultsAllowed */ return new Property("multipleResultsAllowed", "boolean", 2477 "Multiple results allowed for observations conforming to this ObservationDefinition.", 0, 1, 2478 multipleResultsAllowed); 2479 case -1077554975: 2480 /* method */ return new Property("method", "CodeableConcept", 2481 "The method or technique used to perform the observation.", 0, 1, method); 2482 case -1851030208: 2483 /* preferredReportName */ return new Property("preferredReportName", "string", 2484 "The preferred name to be used when reporting the results of observations conforming to this ObservationDefinition.", 2485 0, 1, preferredReportName); 2486 case 842150763: 2487 /* quantitativeDetails */ return new Property("quantitativeDetails", "", 2488 "Characteristics for quantitative results of this observation.", 0, 1, quantitativeDetails); 2489 case 1882971521: 2490 /* qualifiedInterval */ return new Property("qualifiedInterval", "", 2491 "Multiple ranges of results qualified by different contexts for ordinal or continuous observations conforming to this ObservationDefinition.", 2492 0, java.lang.Integer.MAX_VALUE, qualifiedInterval); 2493 case 1374640076: 2494 /* validCodedValueSet */ return new Property("validCodedValueSet", "Reference(ValueSet)", 2495 "The set of valid coded results for the observations conforming to this ObservationDefinition.", 0, 1, 2496 validCodedValueSet); 2497 case -837500735: 2498 /* normalCodedValueSet */ return new Property("normalCodedValueSet", "Reference(ValueSet)", 2499 "The set of normal coded results for the observations conforming to this ObservationDefinition.", 0, 1, 2500 normalCodedValueSet); 2501 case 1073600256: 2502 /* abnormalCodedValueSet */ return new Property("abnormalCodedValueSet", "Reference(ValueSet)", 2503 "The set of abnormal coded results for the observation conforming to this ObservationDefinition.", 0, 1, 2504 abnormalCodedValueSet); 2505 case 2568457: 2506 /* criticalCodedValueSet */ return new Property("criticalCodedValueSet", "Reference(ValueSet)", 2507 "The set of critical coded results for the observation conforming to this ObservationDefinition.", 0, 1, 2508 criticalCodedValueSet); 2509 default: 2510 return super.getNamedProperty(_hash, _name, _checkValid); 2511 } 2512 2513 } 2514 2515 @Override 2516 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 2517 switch (hash) { 2518 case 50511102: 2519 /* category */ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept 2520 case 3059181: 2521 /* code */ return this.code == null ? new Base[0] : new Base[] { this.code }; // CodeableConcept 2522 case -1618432855: 2523 /* identifier */ return this.identifier == null ? new Base[0] 2524 : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier 2525 case -99492804: 2526 /* permittedDataType */ return this.permittedDataType == null ? new Base[0] 2527 : this.permittedDataType.toArray(new Base[this.permittedDataType.size()]); // Enumeration<ObservationDataType> 2528 case -2102414590: 2529 /* multipleResultsAllowed */ return this.multipleResultsAllowed == null ? new Base[0] 2530 : new Base[] { this.multipleResultsAllowed }; // BooleanType 2531 case -1077554975: 2532 /* method */ return this.method == null ? new Base[0] : new Base[] { this.method }; // CodeableConcept 2533 case -1851030208: 2534 /* preferredReportName */ return this.preferredReportName == null ? new Base[0] 2535 : new Base[] { this.preferredReportName }; // StringType 2536 case 842150763: 2537 /* quantitativeDetails */ return this.quantitativeDetails == null ? new Base[0] 2538 : new Base[] { this.quantitativeDetails }; // ObservationDefinitionQuantitativeDetailsComponent 2539 case 1882971521: 2540 /* qualifiedInterval */ return this.qualifiedInterval == null ? new Base[0] 2541 : this.qualifiedInterval.toArray(new Base[this.qualifiedInterval.size()]); // ObservationDefinitionQualifiedIntervalComponent 2542 case 1374640076: 2543 /* validCodedValueSet */ return this.validCodedValueSet == null ? new Base[0] 2544 : new Base[] { this.validCodedValueSet }; // Reference 2545 case -837500735: 2546 /* normalCodedValueSet */ return this.normalCodedValueSet == null ? new Base[0] 2547 : new Base[] { this.normalCodedValueSet }; // Reference 2548 case 1073600256: 2549 /* abnormalCodedValueSet */ return this.abnormalCodedValueSet == null ? new Base[0] 2550 : new Base[] { this.abnormalCodedValueSet }; // Reference 2551 case 2568457: 2552 /* criticalCodedValueSet */ return this.criticalCodedValueSet == null ? new Base[0] 2553 : new Base[] { this.criticalCodedValueSet }; // Reference 2554 default: 2555 return super.getProperty(hash, name, checkValid); 2556 } 2557 2558 } 2559 2560 @Override 2561 public Base setProperty(int hash, String name, Base value) throws FHIRException { 2562 switch (hash) { 2563 case 50511102: // category 2564 this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept 2565 return value; 2566 case 3059181: // code 2567 this.code = castToCodeableConcept(value); // CodeableConcept 2568 return value; 2569 case -1618432855: // identifier 2570 this.getIdentifier().add(castToIdentifier(value)); // Identifier 2571 return value; 2572 case -99492804: // permittedDataType 2573 value = new ObservationDataTypeEnumFactory().fromType(castToCode(value)); 2574 this.getPermittedDataType().add((Enumeration) value); // Enumeration<ObservationDataType> 2575 return value; 2576 case -2102414590: // multipleResultsAllowed 2577 this.multipleResultsAllowed = castToBoolean(value); // BooleanType 2578 return value; 2579 case -1077554975: // method 2580 this.method = castToCodeableConcept(value); // CodeableConcept 2581 return value; 2582 case -1851030208: // preferredReportName 2583 this.preferredReportName = castToString(value); // StringType 2584 return value; 2585 case 842150763: // quantitativeDetails 2586 this.quantitativeDetails = (ObservationDefinitionQuantitativeDetailsComponent) value; // ObservationDefinitionQuantitativeDetailsComponent 2587 return value; 2588 case 1882971521: // qualifiedInterval 2589 this.getQualifiedInterval().add((ObservationDefinitionQualifiedIntervalComponent) value); // ObservationDefinitionQualifiedIntervalComponent 2590 return value; 2591 case 1374640076: // validCodedValueSet 2592 this.validCodedValueSet = castToReference(value); // Reference 2593 return value; 2594 case -837500735: // normalCodedValueSet 2595 this.normalCodedValueSet = castToReference(value); // Reference 2596 return value; 2597 case 1073600256: // abnormalCodedValueSet 2598 this.abnormalCodedValueSet = castToReference(value); // Reference 2599 return value; 2600 case 2568457: // criticalCodedValueSet 2601 this.criticalCodedValueSet = castToReference(value); // Reference 2602 return value; 2603 default: 2604 return super.setProperty(hash, name, value); 2605 } 2606 2607 } 2608 2609 @Override 2610 public Base setProperty(String name, Base value) throws FHIRException { 2611 if (name.equals("category")) { 2612 this.getCategory().add(castToCodeableConcept(value)); 2613 } else if (name.equals("code")) { 2614 this.code = castToCodeableConcept(value); // CodeableConcept 2615 } else if (name.equals("identifier")) { 2616 this.getIdentifier().add(castToIdentifier(value)); 2617 } else if (name.equals("permittedDataType")) { 2618 value = new ObservationDataTypeEnumFactory().fromType(castToCode(value)); 2619 this.getPermittedDataType().add((Enumeration) value); 2620 } else if (name.equals("multipleResultsAllowed")) { 2621 this.multipleResultsAllowed = castToBoolean(value); // BooleanType 2622 } else if (name.equals("method")) { 2623 this.method = castToCodeableConcept(value); // CodeableConcept 2624 } else if (name.equals("preferredReportName")) { 2625 this.preferredReportName = castToString(value); // StringType 2626 } else if (name.equals("quantitativeDetails")) { 2627 this.quantitativeDetails = (ObservationDefinitionQuantitativeDetailsComponent) value; // ObservationDefinitionQuantitativeDetailsComponent 2628 } else if (name.equals("qualifiedInterval")) { 2629 this.getQualifiedInterval().add((ObservationDefinitionQualifiedIntervalComponent) value); 2630 } else if (name.equals("validCodedValueSet")) { 2631 this.validCodedValueSet = castToReference(value); // Reference 2632 } else if (name.equals("normalCodedValueSet")) { 2633 this.normalCodedValueSet = castToReference(value); // Reference 2634 } else if (name.equals("abnormalCodedValueSet")) { 2635 this.abnormalCodedValueSet = castToReference(value); // Reference 2636 } else if (name.equals("criticalCodedValueSet")) { 2637 this.criticalCodedValueSet = castToReference(value); // Reference 2638 } else 2639 return super.setProperty(name, value); 2640 return value; 2641 } 2642 2643 @Override 2644 public Base makeProperty(int hash, String name) throws FHIRException { 2645 switch (hash) { 2646 case 50511102: 2647 return addCategory(); 2648 case 3059181: 2649 return getCode(); 2650 case -1618432855: 2651 return addIdentifier(); 2652 case -99492804: 2653 return addPermittedDataTypeElement(); 2654 case -2102414590: 2655 return getMultipleResultsAllowedElement(); 2656 case -1077554975: 2657 return getMethod(); 2658 case -1851030208: 2659 return getPreferredReportNameElement(); 2660 case 842150763: 2661 return getQuantitativeDetails(); 2662 case 1882971521: 2663 return addQualifiedInterval(); 2664 case 1374640076: 2665 return getValidCodedValueSet(); 2666 case -837500735: 2667 return getNormalCodedValueSet(); 2668 case 1073600256: 2669 return getAbnormalCodedValueSet(); 2670 case 2568457: 2671 return getCriticalCodedValueSet(); 2672 default: 2673 return super.makeProperty(hash, name); 2674 } 2675 2676 } 2677 2678 @Override 2679 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 2680 switch (hash) { 2681 case 50511102: 2682 /* category */ return new String[] { "CodeableConcept" }; 2683 case 3059181: 2684 /* code */ return new String[] { "CodeableConcept" }; 2685 case -1618432855: 2686 /* identifier */ return new String[] { "Identifier" }; 2687 case -99492804: 2688 /* permittedDataType */ return new String[] { "code" }; 2689 case -2102414590: 2690 /* multipleResultsAllowed */ return new String[] { "boolean" }; 2691 case -1077554975: 2692 /* method */ return new String[] { "CodeableConcept" }; 2693 case -1851030208: 2694 /* preferredReportName */ return new String[] { "string" }; 2695 case 842150763: 2696 /* quantitativeDetails */ return new String[] {}; 2697 case 1882971521: 2698 /* qualifiedInterval */ return new String[] {}; 2699 case 1374640076: 2700 /* validCodedValueSet */ return new String[] { "Reference" }; 2701 case -837500735: 2702 /* normalCodedValueSet */ return new String[] { "Reference" }; 2703 case 1073600256: 2704 /* abnormalCodedValueSet */ return new String[] { "Reference" }; 2705 case 2568457: 2706 /* criticalCodedValueSet */ return new String[] { "Reference" }; 2707 default: 2708 return super.getTypesForProperty(hash, name); 2709 } 2710 2711 } 2712 2713 @Override 2714 public Base addChild(String name) throws FHIRException { 2715 if (name.equals("category")) { 2716 return addCategory(); 2717 } else if (name.equals("code")) { 2718 this.code = new CodeableConcept(); 2719 return this.code; 2720 } else if (name.equals("identifier")) { 2721 return addIdentifier(); 2722 } else if (name.equals("permittedDataType")) { 2723 throw new FHIRException("Cannot call addChild on a singleton property ObservationDefinition.permittedDataType"); 2724 } else if (name.equals("multipleResultsAllowed")) { 2725 throw new FHIRException("Cannot call addChild on a singleton property ObservationDefinition.multipleResultsAllowed"); 2726 } else if (name.equals("method")) { 2727 this.method = new CodeableConcept(); 2728 return this.method; 2729 } else if (name.equals("preferredReportName")) { 2730 throw new FHIRException("Cannot call addChild on a singleton property ObservationDefinition.preferredReportName"); 2731 } else if (name.equals("quantitativeDetails")) { 2732 this.quantitativeDetails = new ObservationDefinitionQuantitativeDetailsComponent(); 2733 return this.quantitativeDetails; 2734 } else if (name.equals("qualifiedInterval")) { 2735 return addQualifiedInterval(); 2736 } else if (name.equals("validCodedValueSet")) { 2737 this.validCodedValueSet = new Reference(); 2738 return this.validCodedValueSet; 2739 } else if (name.equals("normalCodedValueSet")) { 2740 this.normalCodedValueSet = new Reference(); 2741 return this.normalCodedValueSet; 2742 } else if (name.equals("abnormalCodedValueSet")) { 2743 this.abnormalCodedValueSet = new Reference(); 2744 return this.abnormalCodedValueSet; 2745 } else if (name.equals("criticalCodedValueSet")) { 2746 this.criticalCodedValueSet = new Reference(); 2747 return this.criticalCodedValueSet; 2748 } else 2749 return super.addChild(name); 2750 } 2751 2752 public String fhirType() { 2753 return "ObservationDefinition"; 2754 2755 } 2756 2757 public ObservationDefinition copy() { 2758 ObservationDefinition dst = new ObservationDefinition(); 2759 copyValues(dst); 2760 return dst; 2761 } 2762 2763 public void copyValues(ObservationDefinition dst) { 2764 super.copyValues(dst); 2765 if (category != null) { 2766 dst.category = new ArrayList<CodeableConcept>(); 2767 for (CodeableConcept i : category) 2768 dst.category.add(i.copy()); 2769 } 2770 ; 2771 dst.code = code == null ? null : code.copy(); 2772 if (identifier != null) { 2773 dst.identifier = new ArrayList<Identifier>(); 2774 for (Identifier i : identifier) 2775 dst.identifier.add(i.copy()); 2776 } 2777 ; 2778 if (permittedDataType != null) { 2779 dst.permittedDataType = new ArrayList<Enumeration<ObservationDataType>>(); 2780 for (Enumeration<ObservationDataType> i : permittedDataType) 2781 dst.permittedDataType.add(i.copy()); 2782 } 2783 ; 2784 dst.multipleResultsAllowed = multipleResultsAllowed == null ? null : multipleResultsAllowed.copy(); 2785 dst.method = method == null ? null : method.copy(); 2786 dst.preferredReportName = preferredReportName == null ? null : preferredReportName.copy(); 2787 dst.quantitativeDetails = quantitativeDetails == null ? null : quantitativeDetails.copy(); 2788 if (qualifiedInterval != null) { 2789 dst.qualifiedInterval = new ArrayList<ObservationDefinitionQualifiedIntervalComponent>(); 2790 for (ObservationDefinitionQualifiedIntervalComponent i : qualifiedInterval) 2791 dst.qualifiedInterval.add(i.copy()); 2792 } 2793 ; 2794 dst.validCodedValueSet = validCodedValueSet == null ? null : validCodedValueSet.copy(); 2795 dst.normalCodedValueSet = normalCodedValueSet == null ? null : normalCodedValueSet.copy(); 2796 dst.abnormalCodedValueSet = abnormalCodedValueSet == null ? null : abnormalCodedValueSet.copy(); 2797 dst.criticalCodedValueSet = criticalCodedValueSet == null ? null : criticalCodedValueSet.copy(); 2798 } 2799 2800 protected ObservationDefinition typedCopy() { 2801 return copy(); 2802 } 2803 2804 @Override 2805 public boolean equalsDeep(Base other_) { 2806 if (!super.equalsDeep(other_)) 2807 return false; 2808 if (!(other_ instanceof ObservationDefinition)) 2809 return false; 2810 ObservationDefinition o = (ObservationDefinition) other_; 2811 return compareDeep(category, o.category, true) && compareDeep(code, o.code, true) 2812 && compareDeep(identifier, o.identifier, true) && compareDeep(permittedDataType, o.permittedDataType, true) 2813 && compareDeep(multipleResultsAllowed, o.multipleResultsAllowed, true) && compareDeep(method, o.method, true) 2814 && compareDeep(preferredReportName, o.preferredReportName, true) 2815 && compareDeep(quantitativeDetails, o.quantitativeDetails, true) 2816 && compareDeep(qualifiedInterval, o.qualifiedInterval, true) 2817 && compareDeep(validCodedValueSet, o.validCodedValueSet, true) 2818 && compareDeep(normalCodedValueSet, o.normalCodedValueSet, true) 2819 && compareDeep(abnormalCodedValueSet, o.abnormalCodedValueSet, true) 2820 && compareDeep(criticalCodedValueSet, o.criticalCodedValueSet, true); 2821 } 2822 2823 @Override 2824 public boolean equalsShallow(Base other_) { 2825 if (!super.equalsShallow(other_)) 2826 return false; 2827 if (!(other_ instanceof ObservationDefinition)) 2828 return false; 2829 ObservationDefinition o = (ObservationDefinition) other_; 2830 return compareValues(permittedDataType, o.permittedDataType, true) 2831 && compareValues(multipleResultsAllowed, o.multipleResultsAllowed, true) 2832 && compareValues(preferredReportName, o.preferredReportName, true); 2833 } 2834 2835 public boolean isEmpty() { 2836 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(category, code, identifier, permittedDataType, 2837 multipleResultsAllowed, method, preferredReportName, quantitativeDetails, qualifiedInterval, validCodedValueSet, 2838 normalCodedValueSet, abnormalCodedValueSet, criticalCodedValueSet); 2839 } 2840 2841 @Override 2842 public ResourceType getResourceType() { 2843 return ResourceType.ObservationDefinition; 2844 } 2845 2846}