001package org.hl7.fhir.dstu2016may.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 Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 035import java.util.ArrayList; 036import java.util.Date; 037import java.util.List; 038 039import org.hl7.fhir.exceptions.FHIRException; 040import org.hl7.fhir.instance.model.api.IBaseDatatypeElement; 041import org.hl7.fhir.instance.model.api.ICompositeType; 042 043import ca.uhn.fhir.model.api.annotation.Block; 044import ca.uhn.fhir.model.api.annotation.Child; 045import ca.uhn.fhir.model.api.annotation.DatatypeDef; 046import ca.uhn.fhir.model.api.annotation.Description; 047/** 048 * Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds. 049 */ 050@DatatypeDef(name="Timing") 051public class Timing extends Type implements ICompositeType { 052 053 public enum UnitsOfTime { 054 /** 055 * null 056 */ 057 S, 058 /** 059 * null 060 */ 061 MIN, 062 /** 063 * null 064 */ 065 H, 066 /** 067 * null 068 */ 069 D, 070 /** 071 * null 072 */ 073 WK, 074 /** 075 * null 076 */ 077 MO, 078 /** 079 * null 080 */ 081 A, 082 /** 083 * added to help the parsers 084 */ 085 NULL; 086 public static UnitsOfTime fromCode(String codeString) throws FHIRException { 087 if (codeString == null || "".equals(codeString)) 088 return null; 089 if ("s".equals(codeString)) 090 return S; 091 if ("min".equals(codeString)) 092 return MIN; 093 if ("h".equals(codeString)) 094 return H; 095 if ("d".equals(codeString)) 096 return D; 097 if ("wk".equals(codeString)) 098 return WK; 099 if ("mo".equals(codeString)) 100 return MO; 101 if ("a".equals(codeString)) 102 return A; 103 throw new FHIRException("Unknown UnitsOfTime code '"+codeString+"'"); 104 } 105 public String toCode() { 106 switch (this) { 107 case S: return "s"; 108 case MIN: return "min"; 109 case H: return "h"; 110 case D: return "d"; 111 case WK: return "wk"; 112 case MO: return "mo"; 113 case A: return "a"; 114 default: return "?"; 115 } 116 } 117 public String getSystem() { 118 switch (this) { 119 case S: return "http://unitsofmeasure.org"; 120 case MIN: return "http://unitsofmeasure.org"; 121 case H: return "http://unitsofmeasure.org"; 122 case D: return "http://unitsofmeasure.org"; 123 case WK: return "http://unitsofmeasure.org"; 124 case MO: return "http://unitsofmeasure.org"; 125 case A: return "http://unitsofmeasure.org"; 126 default: return "?"; 127 } 128 } 129 public String getDefinition() { 130 switch (this) { 131 case S: return ""; 132 case MIN: return ""; 133 case H: return ""; 134 case D: return ""; 135 case WK: return ""; 136 case MO: return ""; 137 case A: return ""; 138 default: return "?"; 139 } 140 } 141 public String getDisplay() { 142 switch (this) { 143 case S: return "s"; 144 case MIN: return "min"; 145 case H: return "h"; 146 case D: return "d"; 147 case WK: return "wk"; 148 case MO: return "mo"; 149 case A: return "a"; 150 default: return "?"; 151 } 152 } 153 } 154 155 public static class UnitsOfTimeEnumFactory implements EnumFactory<UnitsOfTime> { 156 public UnitsOfTime fromCode(String codeString) throws IllegalArgumentException { 157 if (codeString == null || "".equals(codeString)) 158 if (codeString == null || "".equals(codeString)) 159 return null; 160 if ("s".equals(codeString)) 161 return UnitsOfTime.S; 162 if ("min".equals(codeString)) 163 return UnitsOfTime.MIN; 164 if ("h".equals(codeString)) 165 return UnitsOfTime.H; 166 if ("d".equals(codeString)) 167 return UnitsOfTime.D; 168 if ("wk".equals(codeString)) 169 return UnitsOfTime.WK; 170 if ("mo".equals(codeString)) 171 return UnitsOfTime.MO; 172 if ("a".equals(codeString)) 173 return UnitsOfTime.A; 174 throw new IllegalArgumentException("Unknown UnitsOfTime code '"+codeString+"'"); 175 } 176 public Enumeration<UnitsOfTime> fromType(Base code) throws FHIRException { 177 if (code == null || code.isEmpty()) 178 return null; 179 String codeString = ((PrimitiveType) code).asStringValue(); 180 if (codeString == null || "".equals(codeString)) 181 return null; 182 if ("s".equals(codeString)) 183 return new Enumeration<UnitsOfTime>(this, UnitsOfTime.S); 184 if ("min".equals(codeString)) 185 return new Enumeration<UnitsOfTime>(this, UnitsOfTime.MIN); 186 if ("h".equals(codeString)) 187 return new Enumeration<UnitsOfTime>(this, UnitsOfTime.H); 188 if ("d".equals(codeString)) 189 return new Enumeration<UnitsOfTime>(this, UnitsOfTime.D); 190 if ("wk".equals(codeString)) 191 return new Enumeration<UnitsOfTime>(this, UnitsOfTime.WK); 192 if ("mo".equals(codeString)) 193 return new Enumeration<UnitsOfTime>(this, UnitsOfTime.MO); 194 if ("a".equals(codeString)) 195 return new Enumeration<UnitsOfTime>(this, UnitsOfTime.A); 196 throw new FHIRException("Unknown UnitsOfTime code '"+codeString+"'"); 197 } 198 public String toCode(UnitsOfTime code) { 199 if (code == UnitsOfTime.S) 200 return "s"; 201 if (code == UnitsOfTime.MIN) 202 return "min"; 203 if (code == UnitsOfTime.H) 204 return "h"; 205 if (code == UnitsOfTime.D) 206 return "d"; 207 if (code == UnitsOfTime.WK) 208 return "wk"; 209 if (code == UnitsOfTime.MO) 210 return "mo"; 211 if (code == UnitsOfTime.A) 212 return "a"; 213 return "?"; 214 } 215 public String toSystem(UnitsOfTime code) { 216 return code.getSystem(); 217 } 218 } 219 220 public enum EventTiming { 221 /** 222 * null 223 */ 224 HS, 225 /** 226 * null 227 */ 228 WAKE, 229 /** 230 * null 231 */ 232 C, 233 /** 234 * null 235 */ 236 CM, 237 /** 238 * null 239 */ 240 CD, 241 /** 242 * null 243 */ 244 CV, 245 /** 246 * null 247 */ 248 AC, 249 /** 250 * null 251 */ 252 ACM, 253 /** 254 * null 255 */ 256 ACD, 257 /** 258 * null 259 */ 260 ACV, 261 /** 262 * null 263 */ 264 PC, 265 /** 266 * null 267 */ 268 PCM, 269 /** 270 * null 271 */ 272 PCD, 273 /** 274 * null 275 */ 276 PCV, 277 /** 278 * added to help the parsers 279 */ 280 NULL; 281 public static EventTiming fromCode(String codeString) throws FHIRException { 282 if (codeString == null || "".equals(codeString)) 283 return null; 284 if ("HS".equals(codeString)) 285 return HS; 286 if ("WAKE".equals(codeString)) 287 return WAKE; 288 if ("C".equals(codeString)) 289 return C; 290 if ("CM".equals(codeString)) 291 return CM; 292 if ("CD".equals(codeString)) 293 return CD; 294 if ("CV".equals(codeString)) 295 return CV; 296 if ("AC".equals(codeString)) 297 return AC; 298 if ("ACM".equals(codeString)) 299 return ACM; 300 if ("ACD".equals(codeString)) 301 return ACD; 302 if ("ACV".equals(codeString)) 303 return ACV; 304 if ("PC".equals(codeString)) 305 return PC; 306 if ("PCM".equals(codeString)) 307 return PCM; 308 if ("PCD".equals(codeString)) 309 return PCD; 310 if ("PCV".equals(codeString)) 311 return PCV; 312 throw new FHIRException("Unknown EventTiming code '"+codeString+"'"); 313 } 314 public String toCode() { 315 switch (this) { 316 case HS: return "HS"; 317 case WAKE: return "WAKE"; 318 case C: return "C"; 319 case CM: return "CM"; 320 case CD: return "CD"; 321 case CV: return "CV"; 322 case AC: return "AC"; 323 case ACM: return "ACM"; 324 case ACD: return "ACD"; 325 case ACV: return "ACV"; 326 case PC: return "PC"; 327 case PCM: return "PCM"; 328 case PCD: return "PCD"; 329 case PCV: return "PCV"; 330 default: return "?"; 331 } 332 } 333 public String getSystem() { 334 switch (this) { 335 case HS: return "http://hl7.org/fhir/v3/TimingEvent"; 336 case WAKE: return "http://hl7.org/fhir/v3/TimingEvent"; 337 case C: return "http://hl7.org/fhir/v3/TimingEvent"; 338 case CM: return "http://hl7.org/fhir/v3/TimingEvent"; 339 case CD: return "http://hl7.org/fhir/v3/TimingEvent"; 340 case CV: return "http://hl7.org/fhir/v3/TimingEvent"; 341 case AC: return "http://hl7.org/fhir/v3/TimingEvent"; 342 case ACM: return "http://hl7.org/fhir/v3/TimingEvent"; 343 case ACD: return "http://hl7.org/fhir/v3/TimingEvent"; 344 case ACV: return "http://hl7.org/fhir/v3/TimingEvent"; 345 case PC: return "http://hl7.org/fhir/v3/TimingEvent"; 346 case PCM: return "http://hl7.org/fhir/v3/TimingEvent"; 347 case PCD: return "http://hl7.org/fhir/v3/TimingEvent"; 348 case PCV: return "http://hl7.org/fhir/v3/TimingEvent"; 349 default: return "?"; 350 } 351 } 352 public String getDefinition() { 353 switch (this) { 354 case HS: return ""; 355 case WAKE: return ""; 356 case C: return ""; 357 case CM: return ""; 358 case CD: return ""; 359 case CV: return ""; 360 case AC: return ""; 361 case ACM: return ""; 362 case ACD: return ""; 363 case ACV: return ""; 364 case PC: return ""; 365 case PCM: return ""; 366 case PCD: return ""; 367 case PCV: return ""; 368 default: return "?"; 369 } 370 } 371 public String getDisplay() { 372 switch (this) { 373 case HS: return "HS"; 374 case WAKE: return "WAKE"; 375 case C: return "C"; 376 case CM: return "CM"; 377 case CD: return "CD"; 378 case CV: return "CV"; 379 case AC: return "AC"; 380 case ACM: return "ACM"; 381 case ACD: return "ACD"; 382 case ACV: return "ACV"; 383 case PC: return "PC"; 384 case PCM: return "PCM"; 385 case PCD: return "PCD"; 386 case PCV: return "PCV"; 387 default: return "?"; 388 } 389 } 390 } 391 392 public static class EventTimingEnumFactory implements EnumFactory<EventTiming> { 393 public EventTiming fromCode(String codeString) throws IllegalArgumentException { 394 if (codeString == null || "".equals(codeString)) 395 if (codeString == null || "".equals(codeString)) 396 return null; 397 if ("HS".equals(codeString)) 398 return EventTiming.HS; 399 if ("WAKE".equals(codeString)) 400 return EventTiming.WAKE; 401 if ("C".equals(codeString)) 402 return EventTiming.C; 403 if ("CM".equals(codeString)) 404 return EventTiming.CM; 405 if ("CD".equals(codeString)) 406 return EventTiming.CD; 407 if ("CV".equals(codeString)) 408 return EventTiming.CV; 409 if ("AC".equals(codeString)) 410 return EventTiming.AC; 411 if ("ACM".equals(codeString)) 412 return EventTiming.ACM; 413 if ("ACD".equals(codeString)) 414 return EventTiming.ACD; 415 if ("ACV".equals(codeString)) 416 return EventTiming.ACV; 417 if ("PC".equals(codeString)) 418 return EventTiming.PC; 419 if ("PCM".equals(codeString)) 420 return EventTiming.PCM; 421 if ("PCD".equals(codeString)) 422 return EventTiming.PCD; 423 if ("PCV".equals(codeString)) 424 return EventTiming.PCV; 425 throw new IllegalArgumentException("Unknown EventTiming code '"+codeString+"'"); 426 } 427 public Enumeration<EventTiming> fromType(Base code) throws FHIRException { 428 if (code == null || code.isEmpty()) 429 return null; 430 String codeString = ((PrimitiveType) code).asStringValue(); 431 if (codeString == null || "".equals(codeString)) 432 return null; 433 if ("HS".equals(codeString)) 434 return new Enumeration<EventTiming>(this, EventTiming.HS); 435 if ("WAKE".equals(codeString)) 436 return new Enumeration<EventTiming>(this, EventTiming.WAKE); 437 if ("C".equals(codeString)) 438 return new Enumeration<EventTiming>(this, EventTiming.C); 439 if ("CM".equals(codeString)) 440 return new Enumeration<EventTiming>(this, EventTiming.CM); 441 if ("CD".equals(codeString)) 442 return new Enumeration<EventTiming>(this, EventTiming.CD); 443 if ("CV".equals(codeString)) 444 return new Enumeration<EventTiming>(this, EventTiming.CV); 445 if ("AC".equals(codeString)) 446 return new Enumeration<EventTiming>(this, EventTiming.AC); 447 if ("ACM".equals(codeString)) 448 return new Enumeration<EventTiming>(this, EventTiming.ACM); 449 if ("ACD".equals(codeString)) 450 return new Enumeration<EventTiming>(this, EventTiming.ACD); 451 if ("ACV".equals(codeString)) 452 return new Enumeration<EventTiming>(this, EventTiming.ACV); 453 if ("PC".equals(codeString)) 454 return new Enumeration<EventTiming>(this, EventTiming.PC); 455 if ("PCM".equals(codeString)) 456 return new Enumeration<EventTiming>(this, EventTiming.PCM); 457 if ("PCD".equals(codeString)) 458 return new Enumeration<EventTiming>(this, EventTiming.PCD); 459 if ("PCV".equals(codeString)) 460 return new Enumeration<EventTiming>(this, EventTiming.PCV); 461 throw new FHIRException("Unknown EventTiming code '"+codeString+"'"); 462 } 463 public String toCode(EventTiming code) { 464 if (code == EventTiming.HS) 465 return "HS"; 466 if (code == EventTiming.WAKE) 467 return "WAKE"; 468 if (code == EventTiming.C) 469 return "C"; 470 if (code == EventTiming.CM) 471 return "CM"; 472 if (code == EventTiming.CD) 473 return "CD"; 474 if (code == EventTiming.CV) 475 return "CV"; 476 if (code == EventTiming.AC) 477 return "AC"; 478 if (code == EventTiming.ACM) 479 return "ACM"; 480 if (code == EventTiming.ACD) 481 return "ACD"; 482 if (code == EventTiming.ACV) 483 return "ACV"; 484 if (code == EventTiming.PC) 485 return "PC"; 486 if (code == EventTiming.PCM) 487 return "PCM"; 488 if (code == EventTiming.PCD) 489 return "PCD"; 490 if (code == EventTiming.PCV) 491 return "PCV"; 492 return "?"; 493 } 494 public String toSystem(EventTiming code) { 495 return code.getSystem(); 496 } 497 } 498 499 @Block() 500 public static class TimingRepeatComponent extends Element implements IBaseDatatypeElement { 501 /** 502 * Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule. 503 */ 504 @Child(name = "bounds", type = {Duration.class, Range.class, Period.class}, order=1, min=0, max=1, modifier=false, summary=true) 505 @Description(shortDefinition="Length/Range of lengths, or (Start and/or end) limits", formalDefinition="Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule." ) 506 protected Type bounds; 507 508 /** 509 * A total count of the desired number of repetitions. 510 */ 511 @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) 512 @Description(shortDefinition="Number of times to repeat", formalDefinition="A total count of the desired number of repetitions." ) 513 protected IntegerType count; 514 515 /** 516 * A maximum value for the count of the desired repetitions (e.g. do something 6-8 times). 517 */ 518 @Child(name = "countMax", type = {IntegerType.class}, order=3, min=0, max=1, modifier=false, summary=true) 519 @Description(shortDefinition="Maximum number of times to repeat", formalDefinition="A maximum value for the count of the desired repetitions (e.g. do something 6-8 times)." ) 520 protected IntegerType countMax; 521 522 /** 523 * How long this thing happens for when it happens. 524 */ 525 @Child(name = "duration", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) 526 @Description(shortDefinition="How long when it happens", formalDefinition="How long this thing happens for when it happens." ) 527 protected DecimalType duration; 528 529 /** 530 * The upper limit of how long this thing happens for when it happens. 531 */ 532 @Child(name = "durationMax", type = {DecimalType.class}, order=5, min=0, max=1, modifier=false, summary=true) 533 @Description(shortDefinition="How long when it happens (Max)", formalDefinition="The upper limit of how long this thing happens for when it happens." ) 534 protected DecimalType durationMax; 535 536 /** 537 * The units of time for the duration, in UCUM units. 538 */ 539 @Child(name = "durationUnit", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=true) 540 @Description(shortDefinition="s | min | h | d | wk | mo | a - unit of time (UCUM)", formalDefinition="The units of time for the duration, in UCUM units." ) 541 protected Enumeration<UnitsOfTime> durationUnit; 542 543 /** 544 * The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided). 545 */ 546 @Child(name = "frequency", type = {IntegerType.class}, order=7, min=0, max=1, modifier=false, summary=true) 547 @Description(shortDefinition="Event occurs frequency times per period", formalDefinition="The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided)." ) 548 protected IntegerType frequency; 549 550 /** 551 * If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range. 552 */ 553 @Child(name = "frequencyMax", type = {IntegerType.class}, order=8, min=0, max=1, modifier=false, summary=true) 554 @Description(shortDefinition="Event occurs up to frequencyMax times per period", formalDefinition="If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range." ) 555 protected IntegerType frequencyMax; 556 557 /** 558 * Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. 559 */ 560 @Child(name = "period", type = {DecimalType.class}, order=9, min=0, max=1, modifier=false, summary=true) 561 @Description(shortDefinition="Event occurs frequency times per period", formalDefinition="Indicates the duration of time over which repetitions are to occur; e.g. to express \"3 times per day\", 3 would be the frequency and \"1 day\" would be the period." ) 562 protected DecimalType period; 563 564 /** 565 * If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. 566 */ 567 @Child(name = "periodMax", type = {DecimalType.class}, order=10, min=0, max=1, modifier=false, summary=true) 568 @Description(shortDefinition="Upper limit of period (3-4 hours)", formalDefinition="If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as \"do this once every 3-5 days." ) 569 protected DecimalType periodMax; 570 571 /** 572 * The units of time for the period in UCUM units. 573 */ 574 @Child(name = "periodUnit", type = {CodeType.class}, order=11, min=0, max=1, modifier=false, summary=true) 575 @Description(shortDefinition="s | min | h | d | wk | mo | a - unit of time (UCUM)", formalDefinition="The units of time for the period in UCUM units." ) 576 protected Enumeration<UnitsOfTime> periodUnit; 577 578 /** 579 * A real world event that the occurrence of the event should be tied to. 580 */ 581 @Child(name = "when", type = {CodeType.class}, order=12, min=0, max=1, modifier=false, summary=true) 582 @Description(shortDefinition="Regular life events the event is tied to", formalDefinition="A real world event that the occurrence of the event should be tied to." ) 583 protected Enumeration<EventTiming> when; 584 585 /** 586 * The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event. 587 */ 588 @Child(name = "offset", type = {UnsignedIntType.class}, order=13, min=0, max=1, modifier=false, summary=true) 589 @Description(shortDefinition="Minutes from event (before or after)", formalDefinition="The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event." ) 590 protected UnsignedIntType offset; 591 592 private static final long serialVersionUID = -1317919984L; 593 594 /** 595 * Constructor 596 */ 597 public TimingRepeatComponent() { 598 super(); 599 } 600 601 /** 602 * @return {@link #bounds} (Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.) 603 */ 604 public Type getBounds() { 605 return this.bounds; 606 } 607 608 /** 609 * @return {@link #bounds} (Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.) 610 */ 611 public Duration getBoundsDuration() throws FHIRException { 612 if (!(this.bounds instanceof Duration)) 613 throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.bounds.getClass().getName()+" was encountered"); 614 return (Duration) this.bounds; 615 } 616 617 public boolean hasBoundsDuration() { 618 return this.bounds instanceof Duration; 619 } 620 621 /** 622 * @return {@link #bounds} (Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.) 623 */ 624 public Range getBoundsRange() throws FHIRException { 625 if (!(this.bounds instanceof Range)) 626 throw new FHIRException("Type mismatch: the type Range was expected, but "+this.bounds.getClass().getName()+" was encountered"); 627 return (Range) this.bounds; 628 } 629 630 public boolean hasBoundsRange() { 631 return this.bounds instanceof Range; 632 } 633 634 /** 635 * @return {@link #bounds} (Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.) 636 */ 637 public Period getBoundsPeriod() throws FHIRException { 638 if (!(this.bounds instanceof Period)) 639 throw new FHIRException("Type mismatch: the type Period was expected, but "+this.bounds.getClass().getName()+" was encountered"); 640 return (Period) this.bounds; 641 } 642 643 public boolean hasBoundsPeriod() { 644 return this.bounds instanceof Period; 645 } 646 647 public boolean hasBounds() { 648 return this.bounds != null && !this.bounds.isEmpty(); 649 } 650 651 /** 652 * @param value {@link #bounds} (Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.) 653 */ 654 public TimingRepeatComponent setBounds(Type value) { 655 this.bounds = value; 656 return this; 657 } 658 659 /** 660 * @return {@link #count} (A total count of the desired number of repetitions.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value 661 */ 662 public IntegerType getCountElement() { 663 if (this.count == null) 664 if (Configuration.errorOnAutoCreate()) 665 throw new Error("Attempt to auto-create TimingRepeatComponent.count"); 666 else if (Configuration.doAutoCreate()) 667 this.count = new IntegerType(); // bb 668 return this.count; 669 } 670 671 public boolean hasCountElement() { 672 return this.count != null && !this.count.isEmpty(); 673 } 674 675 public boolean hasCount() { 676 return this.count != null && !this.count.isEmpty(); 677 } 678 679 /** 680 * @param value {@link #count} (A total count of the desired number of repetitions.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value 681 */ 682 public TimingRepeatComponent setCountElement(IntegerType value) { 683 this.count = value; 684 return this; 685 } 686 687 /** 688 * @return A total count of the desired number of repetitions. 689 */ 690 public int getCount() { 691 return this.count == null || this.count.isEmpty() ? 0 : this.count.getValue(); 692 } 693 694 /** 695 * @param value A total count of the desired number of repetitions. 696 */ 697 public TimingRepeatComponent setCount(int value) { 698 if (this.count == null) 699 this.count = new IntegerType(); 700 this.count.setValue(value); 701 return this; 702 } 703 704 /** 705 * @return {@link #countMax} (A maximum value for the count of the desired repetitions (e.g. do something 6-8 times).). This is the underlying object with id, value and extensions. The accessor "getCountMax" gives direct access to the value 706 */ 707 public IntegerType getCountMaxElement() { 708 if (this.countMax == null) 709 if (Configuration.errorOnAutoCreate()) 710 throw new Error("Attempt to auto-create TimingRepeatComponent.countMax"); 711 else if (Configuration.doAutoCreate()) 712 this.countMax = new IntegerType(); // bb 713 return this.countMax; 714 } 715 716 public boolean hasCountMaxElement() { 717 return this.countMax != null && !this.countMax.isEmpty(); 718 } 719 720 public boolean hasCountMax() { 721 return this.countMax != null && !this.countMax.isEmpty(); 722 } 723 724 /** 725 * @param value {@link #countMax} (A maximum value for the count of the desired repetitions (e.g. do something 6-8 times).). This is the underlying object with id, value and extensions. The accessor "getCountMax" gives direct access to the value 726 */ 727 public TimingRepeatComponent setCountMaxElement(IntegerType value) { 728 this.countMax = value; 729 return this; 730 } 731 732 /** 733 * @return A maximum value for the count of the desired repetitions (e.g. do something 6-8 times). 734 */ 735 public int getCountMax() { 736 return this.countMax == null || this.countMax.isEmpty() ? 0 : this.countMax.getValue(); 737 } 738 739 /** 740 * @param value A maximum value for the count of the desired repetitions (e.g. do something 6-8 times). 741 */ 742 public TimingRepeatComponent setCountMax(int value) { 743 if (this.countMax == null) 744 this.countMax = new IntegerType(); 745 this.countMax.setValue(value); 746 return this; 747 } 748 749 /** 750 * @return {@link #duration} (How long this thing happens for when it happens.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value 751 */ 752 public DecimalType getDurationElement() { 753 if (this.duration == null) 754 if (Configuration.errorOnAutoCreate()) 755 throw new Error("Attempt to auto-create TimingRepeatComponent.duration"); 756 else if (Configuration.doAutoCreate()) 757 this.duration = new DecimalType(); // bb 758 return this.duration; 759 } 760 761 public boolean hasDurationElement() { 762 return this.duration != null && !this.duration.isEmpty(); 763 } 764 765 public boolean hasDuration() { 766 return this.duration != null && !this.duration.isEmpty(); 767 } 768 769 /** 770 * @param value {@link #duration} (How long this thing happens for when it happens.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value 771 */ 772 public TimingRepeatComponent setDurationElement(DecimalType value) { 773 this.duration = value; 774 return this; 775 } 776 777 /** 778 * @return How long this thing happens for when it happens. 779 */ 780 public BigDecimal getDuration() { 781 return this.duration == null ? null : this.duration.getValue(); 782 } 783 784 /** 785 * @param value How long this thing happens for when it happens. 786 */ 787 public TimingRepeatComponent setDuration(BigDecimal value) { 788 if (value == null) 789 this.duration = null; 790 else { 791 if (this.duration == null) 792 this.duration = new DecimalType(); 793 this.duration.setValue(value); 794 } 795 return this; 796 } 797 798 /** 799 * @param value How long this thing happens for when it happens. 800 */ 801 public TimingRepeatComponent setDuration(long value) { 802 this.duration = new DecimalType(); 803 this.duration.setValue(value); 804 return this; 805 } 806 807 /** 808 * @param value How long this thing happens for when it happens. 809 */ 810 public TimingRepeatComponent setDuration(double value) { 811 this.duration = new DecimalType(); 812 this.duration.setValue(value); 813 return this; 814 } 815 816 /** 817 * @return {@link #durationMax} (The upper limit of how long this thing happens for when it happens.). This is the underlying object with id, value and extensions. The accessor "getDurationMax" gives direct access to the value 818 */ 819 public DecimalType getDurationMaxElement() { 820 if (this.durationMax == null) 821 if (Configuration.errorOnAutoCreate()) 822 throw new Error("Attempt to auto-create TimingRepeatComponent.durationMax"); 823 else if (Configuration.doAutoCreate()) 824 this.durationMax = new DecimalType(); // bb 825 return this.durationMax; 826 } 827 828 public boolean hasDurationMaxElement() { 829 return this.durationMax != null && !this.durationMax.isEmpty(); 830 } 831 832 public boolean hasDurationMax() { 833 return this.durationMax != null && !this.durationMax.isEmpty(); 834 } 835 836 /** 837 * @param value {@link #durationMax} (The upper limit of how long this thing happens for when it happens.). This is the underlying object with id, value and extensions. The accessor "getDurationMax" gives direct access to the value 838 */ 839 public TimingRepeatComponent setDurationMaxElement(DecimalType value) { 840 this.durationMax = value; 841 return this; 842 } 843 844 /** 845 * @return The upper limit of how long this thing happens for when it happens. 846 */ 847 public BigDecimal getDurationMax() { 848 return this.durationMax == null ? null : this.durationMax.getValue(); 849 } 850 851 /** 852 * @param value The upper limit of how long this thing happens for when it happens. 853 */ 854 public TimingRepeatComponent setDurationMax(BigDecimal value) { 855 if (value == null) 856 this.durationMax = null; 857 else { 858 if (this.durationMax == null) 859 this.durationMax = new DecimalType(); 860 this.durationMax.setValue(value); 861 } 862 return this; 863 } 864 865 /** 866 * @param value The upper limit of how long this thing happens for when it happens. 867 */ 868 public TimingRepeatComponent setDurationMax(long value) { 869 this.durationMax = new DecimalType(); 870 this.durationMax.setValue(value); 871 return this; 872 } 873 874 /** 875 * @param value The upper limit of how long this thing happens for when it happens. 876 */ 877 public TimingRepeatComponent setDurationMax(double value) { 878 this.durationMax = new DecimalType(); 879 this.durationMax.setValue(value); 880 return this; 881 } 882 883 /** 884 * @return {@link #durationUnit} (The units of time for the duration, in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getDurationUnit" gives direct access to the value 885 */ 886 public Enumeration<UnitsOfTime> getDurationUnitElement() { 887 if (this.durationUnit == null) 888 if (Configuration.errorOnAutoCreate()) 889 throw new Error("Attempt to auto-create TimingRepeatComponent.durationUnit"); 890 else if (Configuration.doAutoCreate()) 891 this.durationUnit = new Enumeration<UnitsOfTime>(new UnitsOfTimeEnumFactory()); // bb 892 return this.durationUnit; 893 } 894 895 public boolean hasDurationUnitElement() { 896 return this.durationUnit != null && !this.durationUnit.isEmpty(); 897 } 898 899 public boolean hasDurationUnit() { 900 return this.durationUnit != null && !this.durationUnit.isEmpty(); 901 } 902 903 /** 904 * @param value {@link #durationUnit} (The units of time for the duration, in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getDurationUnit" gives direct access to the value 905 */ 906 public TimingRepeatComponent setDurationUnitElement(Enumeration<UnitsOfTime> value) { 907 this.durationUnit = value; 908 return this; 909 } 910 911 /** 912 * @return The units of time for the duration, in UCUM units. 913 */ 914 public UnitsOfTime getDurationUnit() { 915 return this.durationUnit == null ? null : this.durationUnit.getValue(); 916 } 917 918 /** 919 * @param value The units of time for the duration, in UCUM units. 920 */ 921 public TimingRepeatComponent setDurationUnit(UnitsOfTime value) { 922 if (value == null) 923 this.durationUnit = null; 924 else { 925 if (this.durationUnit == null) 926 this.durationUnit = new Enumeration<UnitsOfTime>(new UnitsOfTimeEnumFactory()); 927 this.durationUnit.setValue(value); 928 } 929 return this; 930 } 931 932 /** 933 * @return {@link #frequency} (The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided).). This is the underlying object with id, value and extensions. The accessor "getFrequency" gives direct access to the value 934 */ 935 public IntegerType getFrequencyElement() { 936 if (this.frequency == null) 937 if (Configuration.errorOnAutoCreate()) 938 throw new Error("Attempt to auto-create TimingRepeatComponent.frequency"); 939 else if (Configuration.doAutoCreate()) 940 this.frequency = new IntegerType(); // bb 941 return this.frequency; 942 } 943 944 public boolean hasFrequencyElement() { 945 return this.frequency != null && !this.frequency.isEmpty(); 946 } 947 948 public boolean hasFrequency() { 949 return this.frequency != null && !this.frequency.isEmpty(); 950 } 951 952 /** 953 * @param value {@link #frequency} (The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided).). This is the underlying object with id, value and extensions. The accessor "getFrequency" gives direct access to the value 954 */ 955 public TimingRepeatComponent setFrequencyElement(IntegerType value) { 956 this.frequency = value; 957 return this; 958 } 959 960 /** 961 * @return The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided). 962 */ 963 public int getFrequency() { 964 return this.frequency == null || this.frequency.isEmpty() ? 0 : this.frequency.getValue(); 965 } 966 967 /** 968 * @param value The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided). 969 */ 970 public TimingRepeatComponent setFrequency(int value) { 971 if (this.frequency == null) 972 this.frequency = new IntegerType(); 973 this.frequency.setValue(value); 974 return this; 975 } 976 977 /** 978 * @return {@link #frequencyMax} (If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range.). This is the underlying object with id, value and extensions. The accessor "getFrequencyMax" gives direct access to the value 979 */ 980 public IntegerType getFrequencyMaxElement() { 981 if (this.frequencyMax == null) 982 if (Configuration.errorOnAutoCreate()) 983 throw new Error("Attempt to auto-create TimingRepeatComponent.frequencyMax"); 984 else if (Configuration.doAutoCreate()) 985 this.frequencyMax = new IntegerType(); // bb 986 return this.frequencyMax; 987 } 988 989 public boolean hasFrequencyMaxElement() { 990 return this.frequencyMax != null && !this.frequencyMax.isEmpty(); 991 } 992 993 public boolean hasFrequencyMax() { 994 return this.frequencyMax != null && !this.frequencyMax.isEmpty(); 995 } 996 997 /** 998 * @param value {@link #frequencyMax} (If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range.). This is the underlying object with id, value and extensions. The accessor "getFrequencyMax" gives direct access to the value 999 */ 1000 public TimingRepeatComponent setFrequencyMaxElement(IntegerType value) { 1001 this.frequencyMax = value; 1002 return this; 1003 } 1004 1005 /** 1006 * @return If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range. 1007 */ 1008 public int getFrequencyMax() { 1009 return this.frequencyMax == null || this.frequencyMax.isEmpty() ? 0 : this.frequencyMax.getValue(); 1010 } 1011 1012 /** 1013 * @param value If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range. 1014 */ 1015 public TimingRepeatComponent setFrequencyMax(int value) { 1016 if (this.frequencyMax == null) 1017 this.frequencyMax = new IntegerType(); 1018 this.frequencyMax.setValue(value); 1019 return this; 1020 } 1021 1022 /** 1023 * @return {@link #period} (Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value 1024 */ 1025 public DecimalType getPeriodElement() { 1026 if (this.period == null) 1027 if (Configuration.errorOnAutoCreate()) 1028 throw new Error("Attempt to auto-create TimingRepeatComponent.period"); 1029 else if (Configuration.doAutoCreate()) 1030 this.period = new DecimalType(); // bb 1031 return this.period; 1032 } 1033 1034 public boolean hasPeriodElement() { 1035 return this.period != null && !this.period.isEmpty(); 1036 } 1037 1038 public boolean hasPeriod() { 1039 return this.period != null && !this.period.isEmpty(); 1040 } 1041 1042 /** 1043 * @param value {@link #period} (Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value 1044 */ 1045 public TimingRepeatComponent setPeriodElement(DecimalType value) { 1046 this.period = value; 1047 return this; 1048 } 1049 1050 /** 1051 * @return Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. 1052 */ 1053 public BigDecimal getPeriod() { 1054 return this.period == null ? null : this.period.getValue(); 1055 } 1056 1057 /** 1058 * @param value Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. 1059 */ 1060 public TimingRepeatComponent setPeriod(BigDecimal value) { 1061 if (value == null) 1062 this.period = null; 1063 else { 1064 if (this.period == null) 1065 this.period = new DecimalType(); 1066 this.period.setValue(value); 1067 } 1068 return this; 1069 } 1070 1071 /** 1072 * @param value Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. 1073 */ 1074 public TimingRepeatComponent setPeriod(long value) { 1075 this.period = new DecimalType(); 1076 this.period.setValue(value); 1077 return this; 1078 } 1079 1080 /** 1081 * @param value Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. 1082 */ 1083 public TimingRepeatComponent setPeriod(double value) { 1084 this.period = new DecimalType(); 1085 this.period.setValue(value); 1086 return this; 1087 } 1088 1089 /** 1090 * @return {@link #periodMax} (If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days.). This is the underlying object with id, value and extensions. The accessor "getPeriodMax" gives direct access to the value 1091 */ 1092 public DecimalType getPeriodMaxElement() { 1093 if (this.periodMax == null) 1094 if (Configuration.errorOnAutoCreate()) 1095 throw new Error("Attempt to auto-create TimingRepeatComponent.periodMax"); 1096 else if (Configuration.doAutoCreate()) 1097 this.periodMax = new DecimalType(); // bb 1098 return this.periodMax; 1099 } 1100 1101 public boolean hasPeriodMaxElement() { 1102 return this.periodMax != null && !this.periodMax.isEmpty(); 1103 } 1104 1105 public boolean hasPeriodMax() { 1106 return this.periodMax != null && !this.periodMax.isEmpty(); 1107 } 1108 1109 /** 1110 * @param value {@link #periodMax} (If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days.). This is the underlying object with id, value and extensions. The accessor "getPeriodMax" gives direct access to the value 1111 */ 1112 public TimingRepeatComponent setPeriodMaxElement(DecimalType value) { 1113 this.periodMax = value; 1114 return this; 1115 } 1116 1117 /** 1118 * @return If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. 1119 */ 1120 public BigDecimal getPeriodMax() { 1121 return this.periodMax == null ? null : this.periodMax.getValue(); 1122 } 1123 1124 /** 1125 * @param value If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. 1126 */ 1127 public TimingRepeatComponent setPeriodMax(BigDecimal value) { 1128 if (value == null) 1129 this.periodMax = null; 1130 else { 1131 if (this.periodMax == null) 1132 this.periodMax = new DecimalType(); 1133 this.periodMax.setValue(value); 1134 } 1135 return this; 1136 } 1137 1138 /** 1139 * @param value If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. 1140 */ 1141 public TimingRepeatComponent setPeriodMax(long value) { 1142 this.periodMax = new DecimalType(); 1143 this.periodMax.setValue(value); 1144 return this; 1145 } 1146 1147 /** 1148 * @param value If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. 1149 */ 1150 public TimingRepeatComponent setPeriodMax(double value) { 1151 this.periodMax = new DecimalType(); 1152 this.periodMax.setValue(value); 1153 return this; 1154 } 1155 1156 /** 1157 * @return {@link #periodUnit} (The units of time for the period in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getPeriodUnit" gives direct access to the value 1158 */ 1159 public Enumeration<UnitsOfTime> getPeriodUnitElement() { 1160 if (this.periodUnit == null) 1161 if (Configuration.errorOnAutoCreate()) 1162 throw new Error("Attempt to auto-create TimingRepeatComponent.periodUnit"); 1163 else if (Configuration.doAutoCreate()) 1164 this.periodUnit = new Enumeration<UnitsOfTime>(new UnitsOfTimeEnumFactory()); // bb 1165 return this.periodUnit; 1166 } 1167 1168 public boolean hasPeriodUnitElement() { 1169 return this.periodUnit != null && !this.periodUnit.isEmpty(); 1170 } 1171 1172 public boolean hasPeriodUnit() { 1173 return this.periodUnit != null && !this.periodUnit.isEmpty(); 1174 } 1175 1176 /** 1177 * @param value {@link #periodUnit} (The units of time for the period in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getPeriodUnit" gives direct access to the value 1178 */ 1179 public TimingRepeatComponent setPeriodUnitElement(Enumeration<UnitsOfTime> value) { 1180 this.periodUnit = value; 1181 return this; 1182 } 1183 1184 /** 1185 * @return The units of time for the period in UCUM units. 1186 */ 1187 public UnitsOfTime getPeriodUnit() { 1188 return this.periodUnit == null ? null : this.periodUnit.getValue(); 1189 } 1190 1191 /** 1192 * @param value The units of time for the period in UCUM units. 1193 */ 1194 public TimingRepeatComponent setPeriodUnit(UnitsOfTime value) { 1195 if (value == null) 1196 this.periodUnit = null; 1197 else { 1198 if (this.periodUnit == null) 1199 this.periodUnit = new Enumeration<UnitsOfTime>(new UnitsOfTimeEnumFactory()); 1200 this.periodUnit.setValue(value); 1201 } 1202 return this; 1203 } 1204 1205 /** 1206 * @return {@link #when} (A real world event that the occurrence of the event should be tied to.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value 1207 */ 1208 public Enumeration<EventTiming> getWhenElement() { 1209 if (this.when == null) 1210 if (Configuration.errorOnAutoCreate()) 1211 throw new Error("Attempt to auto-create TimingRepeatComponent.when"); 1212 else if (Configuration.doAutoCreate()) 1213 this.when = new Enumeration<EventTiming>(new EventTimingEnumFactory()); // bb 1214 return this.when; 1215 } 1216 1217 public boolean hasWhenElement() { 1218 return this.when != null && !this.when.isEmpty(); 1219 } 1220 1221 public boolean hasWhen() { 1222 return this.when != null && !this.when.isEmpty(); 1223 } 1224 1225 /** 1226 * @param value {@link #when} (A real world event that the occurrence of the event should be tied to.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value 1227 */ 1228 public TimingRepeatComponent setWhenElement(Enumeration<EventTiming> value) { 1229 this.when = value; 1230 return this; 1231 } 1232 1233 /** 1234 * @return A real world event that the occurrence of the event should be tied to. 1235 */ 1236 public EventTiming getWhen() { 1237 return this.when == null ? null : this.when.getValue(); 1238 } 1239 1240 /** 1241 * @param value A real world event that the occurrence of the event should be tied to. 1242 */ 1243 public TimingRepeatComponent setWhen(EventTiming value) { 1244 if (value == null) 1245 this.when = null; 1246 else { 1247 if (this.when == null) 1248 this.when = new Enumeration<EventTiming>(new EventTimingEnumFactory()); 1249 this.when.setValue(value); 1250 } 1251 return this; 1252 } 1253 1254 /** 1255 * @return {@link #offset} (The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event.). This is the underlying object with id, value and extensions. The accessor "getOffset" gives direct access to the value 1256 */ 1257 public UnsignedIntType getOffsetElement() { 1258 if (this.offset == null) 1259 if (Configuration.errorOnAutoCreate()) 1260 throw new Error("Attempt to auto-create TimingRepeatComponent.offset"); 1261 else if (Configuration.doAutoCreate()) 1262 this.offset = new UnsignedIntType(); // bb 1263 return this.offset; 1264 } 1265 1266 public boolean hasOffsetElement() { 1267 return this.offset != null && !this.offset.isEmpty(); 1268 } 1269 1270 public boolean hasOffset() { 1271 return this.offset != null && !this.offset.isEmpty(); 1272 } 1273 1274 /** 1275 * @param value {@link #offset} (The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event.). This is the underlying object with id, value and extensions. The accessor "getOffset" gives direct access to the value 1276 */ 1277 public TimingRepeatComponent setOffsetElement(UnsignedIntType value) { 1278 this.offset = value; 1279 return this; 1280 } 1281 1282 /** 1283 * @return The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event. 1284 */ 1285 public int getOffset() { 1286 return this.offset == null || this.offset.isEmpty() ? 0 : this.offset.getValue(); 1287 } 1288 1289 /** 1290 * @param value The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event. 1291 */ 1292 public TimingRepeatComponent setOffset(int value) { 1293 if (this.offset == null) 1294 this.offset = new UnsignedIntType(); 1295 this.offset.setValue(value); 1296 return this; 1297 } 1298 1299 protected void listChildren(List<Property> childrenList) { 1300 super.listChildren(childrenList); 1301 childrenList.add(new Property("bounds[x]", "Duration|Range|Period", "Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.", 0, java.lang.Integer.MAX_VALUE, bounds)); 1302 childrenList.add(new Property("count", "integer", "A total count of the desired number of repetitions.", 0, java.lang.Integer.MAX_VALUE, count)); 1303 childrenList.add(new Property("countMax", "integer", "A maximum value for the count of the desired repetitions (e.g. do something 6-8 times).", 0, java.lang.Integer.MAX_VALUE, countMax)); 1304 childrenList.add(new Property("duration", "decimal", "How long this thing happens for when it happens.", 0, java.lang.Integer.MAX_VALUE, duration)); 1305 childrenList.add(new Property("durationMax", "decimal", "The upper limit of how long this thing happens for when it happens.", 0, java.lang.Integer.MAX_VALUE, durationMax)); 1306 childrenList.add(new Property("durationUnit", "code", "The units of time for the duration, in UCUM units.", 0, java.lang.Integer.MAX_VALUE, durationUnit)); 1307 childrenList.add(new Property("frequency", "integer", "The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided).", 0, java.lang.Integer.MAX_VALUE, frequency)); 1308 childrenList.add(new Property("frequencyMax", "integer", "If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range.", 0, java.lang.Integer.MAX_VALUE, frequencyMax)); 1309 childrenList.add(new Property("period", "decimal", "Indicates the duration of time over which repetitions are to occur; e.g. to express \"3 times per day\", 3 would be the frequency and \"1 day\" would be the period.", 0, java.lang.Integer.MAX_VALUE, period)); 1310 childrenList.add(new Property("periodMax", "decimal", "If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as \"do this once every 3-5 days.", 0, java.lang.Integer.MAX_VALUE, periodMax)); 1311 childrenList.add(new Property("periodUnit", "code", "The units of time for the period in UCUM units.", 0, java.lang.Integer.MAX_VALUE, periodUnit)); 1312 childrenList.add(new Property("when", "code", "A real world event that the occurrence of the event should be tied to.", 0, java.lang.Integer.MAX_VALUE, when)); 1313 childrenList.add(new Property("offset", "unsignedInt", "The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event.", 0, java.lang.Integer.MAX_VALUE, offset)); 1314 } 1315 1316 @Override 1317 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1318 switch (hash) { 1319 case -1383205195: /*bounds*/ return this.bounds == null ? new Base[0] : new Base[] {this.bounds}; // Type 1320 case 94851343: /*count*/ return this.count == null ? new Base[0] : new Base[] {this.count}; // IntegerType 1321 case -372044331: /*countMax*/ return this.countMax == null ? new Base[0] : new Base[] {this.countMax}; // IntegerType 1322 case -1992012396: /*duration*/ return this.duration == null ? new Base[0] : new Base[] {this.duration}; // DecimalType 1323 case -478083280: /*durationMax*/ return this.durationMax == null ? new Base[0] : new Base[] {this.durationMax}; // DecimalType 1324 case -1935429320: /*durationUnit*/ return this.durationUnit == null ? new Base[0] : new Base[] {this.durationUnit}; // Enumeration<UnitsOfTime> 1325 case -70023844: /*frequency*/ return this.frequency == null ? new Base[0] : new Base[] {this.frequency}; // IntegerType 1326 case 1273846376: /*frequencyMax*/ return this.frequencyMax == null ? new Base[0] : new Base[] {this.frequencyMax}; // IntegerType 1327 case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // DecimalType 1328 case 566580195: /*periodMax*/ return this.periodMax == null ? new Base[0] : new Base[] {this.periodMax}; // DecimalType 1329 case 384367333: /*periodUnit*/ return this.periodUnit == null ? new Base[0] : new Base[] {this.periodUnit}; // Enumeration<UnitsOfTime> 1330 case 3648314: /*when*/ return this.when == null ? new Base[0] : new Base[] {this.when}; // Enumeration<EventTiming> 1331 case -1019779949: /*offset*/ return this.offset == null ? new Base[0] : new Base[] {this.offset}; // UnsignedIntType 1332 default: return super.getProperty(hash, name, checkValid); 1333 } 1334 1335 } 1336 1337 @Override 1338 public void setProperty(int hash, String name, Base value) throws FHIRException { 1339 switch (hash) { 1340 case -1383205195: // bounds 1341 this.bounds = (Type) value; // Type 1342 break; 1343 case 94851343: // count 1344 this.count = castToInteger(value); // IntegerType 1345 break; 1346 case -372044331: // countMax 1347 this.countMax = castToInteger(value); // IntegerType 1348 break; 1349 case -1992012396: // duration 1350 this.duration = castToDecimal(value); // DecimalType 1351 break; 1352 case -478083280: // durationMax 1353 this.durationMax = castToDecimal(value); // DecimalType 1354 break; 1355 case -1935429320: // durationUnit 1356 this.durationUnit = new UnitsOfTimeEnumFactory().fromType(value); // Enumeration<UnitsOfTime> 1357 break; 1358 case -70023844: // frequency 1359 this.frequency = castToInteger(value); // IntegerType 1360 break; 1361 case 1273846376: // frequencyMax 1362 this.frequencyMax = castToInteger(value); // IntegerType 1363 break; 1364 case -991726143: // period 1365 this.period = castToDecimal(value); // DecimalType 1366 break; 1367 case 566580195: // periodMax 1368 this.periodMax = castToDecimal(value); // DecimalType 1369 break; 1370 case 384367333: // periodUnit 1371 this.periodUnit = new UnitsOfTimeEnumFactory().fromType(value); // Enumeration<UnitsOfTime> 1372 break; 1373 case 3648314: // when 1374 this.when = new EventTimingEnumFactory().fromType(value); // Enumeration<EventTiming> 1375 break; 1376 case -1019779949: // offset 1377 this.offset = castToUnsignedInt(value); // UnsignedIntType 1378 break; 1379 default: super.setProperty(hash, name, value); 1380 } 1381 1382 } 1383 1384 @Override 1385 public void setProperty(String name, Base value) throws FHIRException { 1386 if (name.equals("bounds[x]")) 1387 this.bounds = (Type) value; // Type 1388 else if (name.equals("count")) 1389 this.count = castToInteger(value); // IntegerType 1390 else if (name.equals("countMax")) 1391 this.countMax = castToInteger(value); // IntegerType 1392 else if (name.equals("duration")) 1393 this.duration = castToDecimal(value); // DecimalType 1394 else if (name.equals("durationMax")) 1395 this.durationMax = castToDecimal(value); // DecimalType 1396 else if (name.equals("durationUnit")) 1397 this.durationUnit = new UnitsOfTimeEnumFactory().fromType(value); // Enumeration<UnitsOfTime> 1398 else if (name.equals("frequency")) 1399 this.frequency = castToInteger(value); // IntegerType 1400 else if (name.equals("frequencyMax")) 1401 this.frequencyMax = castToInteger(value); // IntegerType 1402 else if (name.equals("period")) 1403 this.period = castToDecimal(value); // DecimalType 1404 else if (name.equals("periodMax")) 1405 this.periodMax = castToDecimal(value); // DecimalType 1406 else if (name.equals("periodUnit")) 1407 this.periodUnit = new UnitsOfTimeEnumFactory().fromType(value); // Enumeration<UnitsOfTime> 1408 else if (name.equals("when")) 1409 this.when = new EventTimingEnumFactory().fromType(value); // Enumeration<EventTiming> 1410 else if (name.equals("offset")) 1411 this.offset = castToUnsignedInt(value); // UnsignedIntType 1412 else 1413 super.setProperty(name, value); 1414 } 1415 1416 @Override 1417 public Base makeProperty(int hash, String name) throws FHIRException { 1418 switch (hash) { 1419 case -1149635157: return getBounds(); // Type 1420 case 94851343: throw new FHIRException("Cannot make property count as it is not a complex type"); // IntegerType 1421 case -372044331: throw new FHIRException("Cannot make property countMax as it is not a complex type"); // IntegerType 1422 case -1992012396: throw new FHIRException("Cannot make property duration as it is not a complex type"); // DecimalType 1423 case -478083280: throw new FHIRException("Cannot make property durationMax as it is not a complex type"); // DecimalType 1424 case -1935429320: throw new FHIRException("Cannot make property durationUnit as it is not a complex type"); // Enumeration<UnitsOfTime> 1425 case -70023844: throw new FHIRException("Cannot make property frequency as it is not a complex type"); // IntegerType 1426 case 1273846376: throw new FHIRException("Cannot make property frequencyMax as it is not a complex type"); // IntegerType 1427 case -991726143: throw new FHIRException("Cannot make property period as it is not a complex type"); // DecimalType 1428 case 566580195: throw new FHIRException("Cannot make property periodMax as it is not a complex type"); // DecimalType 1429 case 384367333: throw new FHIRException("Cannot make property periodUnit as it is not a complex type"); // Enumeration<UnitsOfTime> 1430 case 3648314: throw new FHIRException("Cannot make property when as it is not a complex type"); // Enumeration<EventTiming> 1431 case -1019779949: throw new FHIRException("Cannot make property offset as it is not a complex type"); // UnsignedIntType 1432 default: return super.makeProperty(hash, name); 1433 } 1434 1435 } 1436 1437 @Override 1438 public Base addChild(String name) throws FHIRException { 1439 if (name.equals("boundsDuration")) { 1440 this.bounds = new Duration(); 1441 return this.bounds; 1442 } 1443 else if (name.equals("boundsRange")) { 1444 this.bounds = new Range(); 1445 return this.bounds; 1446 } 1447 else if (name.equals("boundsPeriod")) { 1448 this.bounds = new Period(); 1449 return this.bounds; 1450 } 1451 else if (name.equals("count")) { 1452 throw new FHIRException("Cannot call addChild on a primitive type Timing.count"); 1453 } 1454 else if (name.equals("countMax")) { 1455 throw new FHIRException("Cannot call addChild on a primitive type Timing.countMax"); 1456 } 1457 else if (name.equals("duration")) { 1458 throw new FHIRException("Cannot call addChild on a primitive type Timing.duration"); 1459 } 1460 else if (name.equals("durationMax")) { 1461 throw new FHIRException("Cannot call addChild on a primitive type Timing.durationMax"); 1462 } 1463 else if (name.equals("durationUnit")) { 1464 throw new FHIRException("Cannot call addChild on a primitive type Timing.durationUnit"); 1465 } 1466 else if (name.equals("frequency")) { 1467 throw new FHIRException("Cannot call addChild on a primitive type Timing.frequency"); 1468 } 1469 else if (name.equals("frequencyMax")) { 1470 throw new FHIRException("Cannot call addChild on a primitive type Timing.frequencyMax"); 1471 } 1472 else if (name.equals("period")) { 1473 throw new FHIRException("Cannot call addChild on a primitive type Timing.period"); 1474 } 1475 else if (name.equals("periodMax")) { 1476 throw new FHIRException("Cannot call addChild on a primitive type Timing.periodMax"); 1477 } 1478 else if (name.equals("periodUnit")) { 1479 throw new FHIRException("Cannot call addChild on a primitive type Timing.periodUnit"); 1480 } 1481 else if (name.equals("when")) { 1482 throw new FHIRException("Cannot call addChild on a primitive type Timing.when"); 1483 } 1484 else if (name.equals("offset")) { 1485 throw new FHIRException("Cannot call addChild on a primitive type Timing.offset"); 1486 } 1487 else 1488 return super.addChild(name); 1489 } 1490 1491 public TimingRepeatComponent copy() { 1492 TimingRepeatComponent dst = new TimingRepeatComponent(); 1493 copyValues(dst); 1494 dst.bounds = bounds == null ? null : bounds.copy(); 1495 dst.count = count == null ? null : count.copy(); 1496 dst.countMax = countMax == null ? null : countMax.copy(); 1497 dst.duration = duration == null ? null : duration.copy(); 1498 dst.durationMax = durationMax == null ? null : durationMax.copy(); 1499 dst.durationUnit = durationUnit == null ? null : durationUnit.copy(); 1500 dst.frequency = frequency == null ? null : frequency.copy(); 1501 dst.frequencyMax = frequencyMax == null ? null : frequencyMax.copy(); 1502 dst.period = period == null ? null : period.copy(); 1503 dst.periodMax = periodMax == null ? null : periodMax.copy(); 1504 dst.periodUnit = periodUnit == null ? null : periodUnit.copy(); 1505 dst.when = when == null ? null : when.copy(); 1506 dst.offset = offset == null ? null : offset.copy(); 1507 return dst; 1508 } 1509 1510 @Override 1511 public boolean equalsDeep(Base other) { 1512 if (!super.equalsDeep(other)) 1513 return false; 1514 if (!(other instanceof TimingRepeatComponent)) 1515 return false; 1516 TimingRepeatComponent o = (TimingRepeatComponent) other; 1517 return compareDeep(bounds, o.bounds, true) && compareDeep(count, o.count, true) && compareDeep(countMax, o.countMax, true) 1518 && compareDeep(duration, o.duration, true) && compareDeep(durationMax, o.durationMax, true) && compareDeep(durationUnit, o.durationUnit, true) 1519 && compareDeep(frequency, o.frequency, true) && compareDeep(frequencyMax, o.frequencyMax, true) 1520 && compareDeep(period, o.period, true) && compareDeep(periodMax, o.periodMax, true) && compareDeep(periodUnit, o.periodUnit, true) 1521 && compareDeep(when, o.when, true) && compareDeep(offset, o.offset, true); 1522 } 1523 1524 @Override 1525 public boolean equalsShallow(Base other) { 1526 if (!super.equalsShallow(other)) 1527 return false; 1528 if (!(other instanceof TimingRepeatComponent)) 1529 return false; 1530 TimingRepeatComponent o = (TimingRepeatComponent) other; 1531 return compareValues(count, o.count, true) && compareValues(countMax, o.countMax, true) && compareValues(duration, o.duration, true) 1532 && compareValues(durationMax, o.durationMax, true) && compareValues(durationUnit, o.durationUnit, true) 1533 && compareValues(frequency, o.frequency, true) && compareValues(frequencyMax, o.frequencyMax, true) 1534 && compareValues(period, o.period, true) && compareValues(periodMax, o.periodMax, true) && compareValues(periodUnit, o.periodUnit, true) 1535 && compareValues(when, o.when, true) && compareValues(offset, o.offset, true); 1536 } 1537 1538 public boolean isEmpty() { 1539 return super.isEmpty() && (bounds == null || bounds.isEmpty()) && (count == null || count.isEmpty()) 1540 && (countMax == null || countMax.isEmpty()) && (duration == null || duration.isEmpty()) && (durationMax == null || durationMax.isEmpty()) 1541 && (durationUnit == null || durationUnit.isEmpty()) && (frequency == null || frequency.isEmpty()) 1542 && (frequencyMax == null || frequencyMax.isEmpty()) && (period == null || period.isEmpty()) 1543 && (periodMax == null || periodMax.isEmpty()) && (periodUnit == null || periodUnit.isEmpty()) 1544 && (when == null || when.isEmpty()) && (offset == null || offset.isEmpty()); 1545 } 1546 1547 public String fhirType() { 1548 return "Timing.repeat"; 1549 1550 } 1551 1552 } 1553 1554 /** 1555 * Identifies specific times when the event occurs. 1556 */ 1557 @Child(name = "event", type = {DateTimeType.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 1558 @Description(shortDefinition="When the event occurs", formalDefinition="Identifies specific times when the event occurs." ) 1559 protected List<DateTimeType> event; 1560 1561 /** 1562 * A set of rules that describe when the event should occur. 1563 */ 1564 @Child(name = "repeat", type = {}, order=1, min=0, max=1, modifier=false, summary=true) 1565 @Description(shortDefinition="When the event is to occur", formalDefinition="A set of rules that describe when the event should occur." ) 1566 protected TimingRepeatComponent repeat; 1567 1568 /** 1569 * A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing. 1570 */ 1571 @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) 1572 @Description(shortDefinition="QD | QOD | Q4H | Q6H | BID | TID | QID | AM | PM +", formalDefinition="A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing." ) 1573 protected CodeableConcept code; 1574 1575 private static final long serialVersionUID = 791565112L; 1576 1577 /** 1578 * Constructor 1579 */ 1580 public Timing() { 1581 super(); 1582 } 1583 1584 /** 1585 * @return {@link #event} (Identifies specific times when the event occurs.) 1586 */ 1587 public List<DateTimeType> getEvent() { 1588 if (this.event == null) 1589 this.event = new ArrayList<DateTimeType>(); 1590 return this.event; 1591 } 1592 1593 public boolean hasEvent() { 1594 if (this.event == null) 1595 return false; 1596 for (DateTimeType item : this.event) 1597 if (!item.isEmpty()) 1598 return true; 1599 return false; 1600 } 1601 1602 /** 1603 * @return {@link #event} (Identifies specific times when the event occurs.) 1604 */ 1605 // syntactic sugar 1606 public DateTimeType addEventElement() {//2 1607 DateTimeType t = new DateTimeType(); 1608 if (this.event == null) 1609 this.event = new ArrayList<DateTimeType>(); 1610 this.event.add(t); 1611 return t; 1612 } 1613 1614 /** 1615 * @param value {@link #event} (Identifies specific times when the event occurs.) 1616 */ 1617 public Timing addEvent(Date value) { //1 1618 DateTimeType t = new DateTimeType(); 1619 t.setValue(value); 1620 if (this.event == null) 1621 this.event = new ArrayList<DateTimeType>(); 1622 this.event.add(t); 1623 return this; 1624 } 1625 1626 /** 1627 * @param value {@link #event} (Identifies specific times when the event occurs.) 1628 */ 1629 public boolean hasEvent(Date value) { 1630 if (this.event == null) 1631 return false; 1632 for (DateTimeType v : this.event) 1633 if (v.equals(value)) // dateTime 1634 return true; 1635 return false; 1636 } 1637 1638 /** 1639 * @return {@link #repeat} (A set of rules that describe when the event should occur.) 1640 */ 1641 public TimingRepeatComponent getRepeat() { 1642 if (this.repeat == null) 1643 if (Configuration.errorOnAutoCreate()) 1644 throw new Error("Attempt to auto-create Timing.repeat"); 1645 else if (Configuration.doAutoCreate()) 1646 this.repeat = new TimingRepeatComponent(); // cc 1647 return this.repeat; 1648 } 1649 1650 public boolean hasRepeat() { 1651 return this.repeat != null && !this.repeat.isEmpty(); 1652 } 1653 1654 /** 1655 * @param value {@link #repeat} (A set of rules that describe when the event should occur.) 1656 */ 1657 public Timing setRepeat(TimingRepeatComponent value) { 1658 this.repeat = value; 1659 return this; 1660 } 1661 1662 /** 1663 * @return {@link #code} (A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing.) 1664 */ 1665 public CodeableConcept getCode() { 1666 if (this.code == null) 1667 if (Configuration.errorOnAutoCreate()) 1668 throw new Error("Attempt to auto-create Timing.code"); 1669 else if (Configuration.doAutoCreate()) 1670 this.code = new CodeableConcept(); // cc 1671 return this.code; 1672 } 1673 1674 public boolean hasCode() { 1675 return this.code != null && !this.code.isEmpty(); 1676 } 1677 1678 /** 1679 * @param value {@link #code} (A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing.) 1680 */ 1681 public Timing setCode(CodeableConcept value) { 1682 this.code = value; 1683 return this; 1684 } 1685 1686 protected void listChildren(List<Property> childrenList) { 1687 super.listChildren(childrenList); 1688 childrenList.add(new Property("event", "dateTime", "Identifies specific times when the event occurs.", 0, java.lang.Integer.MAX_VALUE, event)); 1689 childrenList.add(new Property("repeat", "", "A set of rules that describe when the event should occur.", 0, java.lang.Integer.MAX_VALUE, repeat)); 1690 childrenList.add(new Property("code", "CodeableConcept", "A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing.", 0, java.lang.Integer.MAX_VALUE, code)); 1691 } 1692 1693 @Override 1694 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1695 switch (hash) { 1696 case 96891546: /*event*/ return this.event == null ? new Base[0] : this.event.toArray(new Base[this.event.size()]); // DateTimeType 1697 case -934531685: /*repeat*/ return this.repeat == null ? new Base[0] : new Base[] {this.repeat}; // TimingRepeatComponent 1698 case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept 1699 default: return super.getProperty(hash, name, checkValid); 1700 } 1701 1702 } 1703 1704 @Override 1705 public void setProperty(int hash, String name, Base value) throws FHIRException { 1706 switch (hash) { 1707 case 96891546: // event 1708 this.getEvent().add(castToDateTime(value)); // DateTimeType 1709 break; 1710 case -934531685: // repeat 1711 this.repeat = (TimingRepeatComponent) value; // TimingRepeatComponent 1712 break; 1713 case 3059181: // code 1714 this.code = castToCodeableConcept(value); // CodeableConcept 1715 break; 1716 default: super.setProperty(hash, name, value); 1717 } 1718 1719 } 1720 1721 @Override 1722 public void setProperty(String name, Base value) throws FHIRException { 1723 if (name.equals("event")) 1724 this.getEvent().add(castToDateTime(value)); 1725 else if (name.equals("repeat")) 1726 this.repeat = (TimingRepeatComponent) value; // TimingRepeatComponent 1727 else if (name.equals("code")) 1728 this.code = castToCodeableConcept(value); // CodeableConcept 1729 else 1730 super.setProperty(name, value); 1731 } 1732 1733 @Override 1734 public Base makeProperty(int hash, String name) throws FHIRException { 1735 switch (hash) { 1736 case 96891546: throw new FHIRException("Cannot make property event as it is not a complex type"); // DateTimeType 1737 case -934531685: return getRepeat(); // TimingRepeatComponent 1738 case 3059181: return getCode(); // CodeableConcept 1739 default: return super.makeProperty(hash, name); 1740 } 1741 1742 } 1743 1744 @Override 1745 public Base addChild(String name) throws FHIRException { 1746 if (name.equals("event")) { 1747 throw new FHIRException("Cannot call addChild on a primitive type Timing.event"); 1748 } 1749 else if (name.equals("repeat")) { 1750 this.repeat = new TimingRepeatComponent(); 1751 return this.repeat; 1752 } 1753 else if (name.equals("code")) { 1754 this.code = new CodeableConcept(); 1755 return this.code; 1756 } 1757 else 1758 return super.addChild(name); 1759 } 1760 1761 public String fhirType() { 1762 return "Timing"; 1763 1764 } 1765 1766 public Timing copy() { 1767 Timing dst = new Timing(); 1768 copyValues(dst); 1769 if (event != null) { 1770 dst.event = new ArrayList<DateTimeType>(); 1771 for (DateTimeType i : event) 1772 dst.event.add(i.copy()); 1773 }; 1774 dst.repeat = repeat == null ? null : repeat.copy(); 1775 dst.code = code == null ? null : code.copy(); 1776 return dst; 1777 } 1778 1779 protected Timing typedCopy() { 1780 return copy(); 1781 } 1782 1783 @Override 1784 public boolean equalsDeep(Base other) { 1785 if (!super.equalsDeep(other)) 1786 return false; 1787 if (!(other instanceof Timing)) 1788 return false; 1789 Timing o = (Timing) other; 1790 return compareDeep(event, o.event, true) && compareDeep(repeat, o.repeat, true) && compareDeep(code, o.code, true) 1791 ; 1792 } 1793 1794 @Override 1795 public boolean equalsShallow(Base other) { 1796 if (!super.equalsShallow(other)) 1797 return false; 1798 if (!(other instanceof Timing)) 1799 return false; 1800 Timing o = (Timing) other; 1801 return compareValues(event, o.event, true); 1802 } 1803 1804 public boolean isEmpty() { 1805 return super.isEmpty() && (event == null || event.isEmpty()) && (repeat == null || repeat.isEmpty()) 1806 && (code == null || code.isEmpty()); 1807 } 1808 1809 1810} 1811