001package org.hl7.fhir.dstu3.model; 002 003/*- 004 * #%L 005 * org.hl7.fhir.dstu3 006 * %% 007 * Copyright (C) 2014 - 2019 Health Level 7 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023 024/* 025 Copyright (c) 2011+, HL7, Inc. 026 All rights reserved. 027 028 Redistribution and use in source and binary forms, with or without modification, 029 are permitted provided that the following conditions are met: 030 031 * Redistributions of source code must retain the above copyright notice, this 032 list of conditions and the following disclaimer. 033 * Redistributions in binary form must reproduce the above copyright notice, 034 this list of conditions and the following disclaimer in the documentation 035 and/or other materials provided with the distribution. 036 * Neither the name of HL7 nor the names of its contributors may be used to 037 endorse or promote products derived from this software without specific 038 prior written permission. 039 040 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 041 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 042 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 043 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 044 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 045 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 046 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 047 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 048 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 049 POSSIBILITY OF SUCH DAMAGE. 050 051*/ 052 053// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x 054import java.util.List; 055 056import org.hl7.fhir.exceptions.FHIRException; 057import org.hl7.fhir.exceptions.FHIRFormatError; 058import org.hl7.fhir.instance.model.api.ICompositeType; 059import org.hl7.fhir.utilities.Utilities; 060 061import ca.uhn.fhir.model.api.annotation.Child; 062import ca.uhn.fhir.model.api.annotation.DatatypeDef; 063import ca.uhn.fhir.model.api.annotation.Description; 064/** 065 * A description of a triggering event. 066 */ 067@DatatypeDef(name="TriggerDefinition") 068public class TriggerDefinition extends Type implements ICompositeType { 069 070 public enum TriggerType { 071 /** 072 * The trigger occurs in response to a specific named event 073 */ 074 NAMEDEVENT, 075 /** 076 * The trigger occurs at a specific time or periodically as described by a timing or schedule 077 */ 078 PERIODIC, 079 /** 080 * The trigger occurs whenever data of a particular type is added 081 */ 082 DATAADDED, 083 /** 084 * The trigger occurs whenever data of a particular type is modified 085 */ 086 DATAMODIFIED, 087 /** 088 * The trigger occurs whenever data of a particular type is removed 089 */ 090 DATAREMOVED, 091 /** 092 * The trigger occurs whenever data of a particular type is accessed 093 */ 094 DATAACCESSED, 095 /** 096 * The trigger occurs whenever access to data of a particular type is completed 097 */ 098 DATAACCESSENDED, 099 /** 100 * added to help the parsers with the generic types 101 */ 102 NULL; 103 public static TriggerType fromCode(String codeString) throws FHIRException { 104 if (codeString == null || "".equals(codeString)) 105 return null; 106 if ("named-event".equals(codeString)) 107 return NAMEDEVENT; 108 if ("periodic".equals(codeString)) 109 return PERIODIC; 110 if ("data-added".equals(codeString)) 111 return DATAADDED; 112 if ("data-modified".equals(codeString)) 113 return DATAMODIFIED; 114 if ("data-removed".equals(codeString)) 115 return DATAREMOVED; 116 if ("data-accessed".equals(codeString)) 117 return DATAACCESSED; 118 if ("data-access-ended".equals(codeString)) 119 return DATAACCESSENDED; 120 if (Configuration.isAcceptInvalidEnums()) 121 return null; 122 else 123 throw new FHIRException("Unknown TriggerType code '"+codeString+"'"); 124 } 125 public String toCode() { 126 switch (this) { 127 case NAMEDEVENT: return "named-event"; 128 case PERIODIC: return "periodic"; 129 case DATAADDED: return "data-added"; 130 case DATAMODIFIED: return "data-modified"; 131 case DATAREMOVED: return "data-removed"; 132 case DATAACCESSED: return "data-accessed"; 133 case DATAACCESSENDED: return "data-access-ended"; 134 default: return "?"; 135 } 136 } 137 public String getSystem() { 138 switch (this) { 139 case NAMEDEVENT: return "http://hl7.org/fhir/trigger-type"; 140 case PERIODIC: return "http://hl7.org/fhir/trigger-type"; 141 case DATAADDED: return "http://hl7.org/fhir/trigger-type"; 142 case DATAMODIFIED: return "http://hl7.org/fhir/trigger-type"; 143 case DATAREMOVED: return "http://hl7.org/fhir/trigger-type"; 144 case DATAACCESSED: return "http://hl7.org/fhir/trigger-type"; 145 case DATAACCESSENDED: return "http://hl7.org/fhir/trigger-type"; 146 default: return "?"; 147 } 148 } 149 public String getDefinition() { 150 switch (this) { 151 case NAMEDEVENT: return "The trigger occurs in response to a specific named event"; 152 case PERIODIC: return "The trigger occurs at a specific time or periodically as described by a timing or schedule"; 153 case DATAADDED: return "The trigger occurs whenever data of a particular type is added"; 154 case DATAMODIFIED: return "The trigger occurs whenever data of a particular type is modified"; 155 case DATAREMOVED: return "The trigger occurs whenever data of a particular type is removed"; 156 case DATAACCESSED: return "The trigger occurs whenever data of a particular type is accessed"; 157 case DATAACCESSENDED: return "The trigger occurs whenever access to data of a particular type is completed"; 158 default: return "?"; 159 } 160 } 161 public String getDisplay() { 162 switch (this) { 163 case NAMEDEVENT: return "Named Event"; 164 case PERIODIC: return "Periodic"; 165 case DATAADDED: return "Data Added"; 166 case DATAMODIFIED: return "Data Modified"; 167 case DATAREMOVED: return "Data Removed"; 168 case DATAACCESSED: return "Data Accessed"; 169 case DATAACCESSENDED: return "Data Access Ended"; 170 default: return "?"; 171 } 172 } 173 } 174 175 public static class TriggerTypeEnumFactory implements EnumFactory<TriggerType> { 176 public TriggerType fromCode(String codeString) throws IllegalArgumentException { 177 if (codeString == null || "".equals(codeString)) 178 if (codeString == null || "".equals(codeString)) 179 return null; 180 if ("named-event".equals(codeString)) 181 return TriggerType.NAMEDEVENT; 182 if ("periodic".equals(codeString)) 183 return TriggerType.PERIODIC; 184 if ("data-added".equals(codeString)) 185 return TriggerType.DATAADDED; 186 if ("data-modified".equals(codeString)) 187 return TriggerType.DATAMODIFIED; 188 if ("data-removed".equals(codeString)) 189 return TriggerType.DATAREMOVED; 190 if ("data-accessed".equals(codeString)) 191 return TriggerType.DATAACCESSED; 192 if ("data-access-ended".equals(codeString)) 193 return TriggerType.DATAACCESSENDED; 194 throw new IllegalArgumentException("Unknown TriggerType code '"+codeString+"'"); 195 } 196 public Enumeration<TriggerType> fromType(Base code) throws FHIRException { 197 if (code == null) 198 return null; 199 if (code.isEmpty()) 200 return new Enumeration<TriggerType>(this); 201 String codeString = ((PrimitiveType) code).asStringValue(); 202 if (codeString == null || "".equals(codeString)) 203 return null; 204 if ("named-event".equals(codeString)) 205 return new Enumeration<TriggerType>(this, TriggerType.NAMEDEVENT); 206 if ("periodic".equals(codeString)) 207 return new Enumeration<TriggerType>(this, TriggerType.PERIODIC); 208 if ("data-added".equals(codeString)) 209 return new Enumeration<TriggerType>(this, TriggerType.DATAADDED); 210 if ("data-modified".equals(codeString)) 211 return new Enumeration<TriggerType>(this, TriggerType.DATAMODIFIED); 212 if ("data-removed".equals(codeString)) 213 return new Enumeration<TriggerType>(this, TriggerType.DATAREMOVED); 214 if ("data-accessed".equals(codeString)) 215 return new Enumeration<TriggerType>(this, TriggerType.DATAACCESSED); 216 if ("data-access-ended".equals(codeString)) 217 return new Enumeration<TriggerType>(this, TriggerType.DATAACCESSENDED); 218 throw new FHIRException("Unknown TriggerType code '"+codeString+"'"); 219 } 220 public String toCode(TriggerType code) { 221 if (code == TriggerType.NAMEDEVENT) 222 return "named-event"; 223 if (code == TriggerType.PERIODIC) 224 return "periodic"; 225 if (code == TriggerType.DATAADDED) 226 return "data-added"; 227 if (code == TriggerType.DATAMODIFIED) 228 return "data-modified"; 229 if (code == TriggerType.DATAREMOVED) 230 return "data-removed"; 231 if (code == TriggerType.DATAACCESSED) 232 return "data-accessed"; 233 if (code == TriggerType.DATAACCESSENDED) 234 return "data-access-ended"; 235 return "?"; 236 } 237 public String toSystem(TriggerType code) { 238 return code.getSystem(); 239 } 240 } 241 242 /** 243 * The type of triggering event. 244 */ 245 @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=true) 246 @Description(shortDefinition="named-event | periodic | data-added | data-modified | data-removed | data-accessed | data-access-ended", formalDefinition="The type of triggering event." ) 247 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/trigger-type") 248 protected Enumeration<TriggerType> type; 249 250 /** 251 * The name of the event (if this is a named-event trigger). 252 */ 253 @Child(name = "eventName", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) 254 @Description(shortDefinition="Triggering event name", formalDefinition="The name of the event (if this is a named-event trigger)." ) 255 protected StringType eventName; 256 257 /** 258 * The timing of the event (if this is a period trigger). 259 */ 260 @Child(name = "eventTiming", type = {Timing.class, Schedule.class, DateType.class, DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) 261 @Description(shortDefinition="Timing of the event", formalDefinition="The timing of the event (if this is a period trigger)." ) 262 protected Type eventTiming; 263 264 /** 265 * The triggering data of the event (if this is a data trigger). 266 */ 267 @Child(name = "eventData", type = {DataRequirement.class}, order=3, min=0, max=1, modifier=false, summary=true) 268 @Description(shortDefinition="Triggering data of the event", formalDefinition="The triggering data of the event (if this is a data trigger)." ) 269 protected DataRequirement eventData; 270 271 private static final long serialVersionUID = -1695534864L; 272 273 /** 274 * Constructor 275 */ 276 public TriggerDefinition() { 277 super(); 278 } 279 280 /** 281 * Constructor 282 */ 283 public TriggerDefinition(Enumeration<TriggerType> type) { 284 super(); 285 this.type = type; 286 } 287 288 /** 289 * @return {@link #type} (The type of triggering event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value 290 */ 291 public Enumeration<TriggerType> getTypeElement() { 292 if (this.type == null) 293 if (Configuration.errorOnAutoCreate()) 294 throw new Error("Attempt to auto-create TriggerDefinition.type"); 295 else if (Configuration.doAutoCreate()) 296 this.type = new Enumeration<TriggerType>(new TriggerTypeEnumFactory()); // bb 297 return this.type; 298 } 299 300 public boolean hasTypeElement() { 301 return this.type != null && !this.type.isEmpty(); 302 } 303 304 public boolean hasType() { 305 return this.type != null && !this.type.isEmpty(); 306 } 307 308 /** 309 * @param value {@link #type} (The type of triggering event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value 310 */ 311 public TriggerDefinition setTypeElement(Enumeration<TriggerType> value) { 312 this.type = value; 313 return this; 314 } 315 316 /** 317 * @return The type of triggering event. 318 */ 319 public TriggerType getType() { 320 return this.type == null ? null : this.type.getValue(); 321 } 322 323 /** 324 * @param value The type of triggering event. 325 */ 326 public TriggerDefinition setType(TriggerType value) { 327 if (this.type == null) 328 this.type = new Enumeration<TriggerType>(new TriggerTypeEnumFactory()); 329 this.type.setValue(value); 330 return this; 331 } 332 333 /** 334 * @return {@link #eventName} (The name of the event (if this is a named-event trigger).). This is the underlying object with id, value and extensions. The accessor "getEventName" gives direct access to the value 335 */ 336 public StringType getEventNameElement() { 337 if (this.eventName == null) 338 if (Configuration.errorOnAutoCreate()) 339 throw new Error("Attempt to auto-create TriggerDefinition.eventName"); 340 else if (Configuration.doAutoCreate()) 341 this.eventName = new StringType(); // bb 342 return this.eventName; 343 } 344 345 public boolean hasEventNameElement() { 346 return this.eventName != null && !this.eventName.isEmpty(); 347 } 348 349 public boolean hasEventName() { 350 return this.eventName != null && !this.eventName.isEmpty(); 351 } 352 353 /** 354 * @param value {@link #eventName} (The name of the event (if this is a named-event trigger).). This is the underlying object with id, value and extensions. The accessor "getEventName" gives direct access to the value 355 */ 356 public TriggerDefinition setEventNameElement(StringType value) { 357 this.eventName = value; 358 return this; 359 } 360 361 /** 362 * @return The name of the event (if this is a named-event trigger). 363 */ 364 public String getEventName() { 365 return this.eventName == null ? null : this.eventName.getValue(); 366 } 367 368 /** 369 * @param value The name of the event (if this is a named-event trigger). 370 */ 371 public TriggerDefinition setEventName(String value) { 372 if (Utilities.noString(value)) 373 this.eventName = null; 374 else { 375 if (this.eventName == null) 376 this.eventName = new StringType(); 377 this.eventName.setValue(value); 378 } 379 return this; 380 } 381 382 /** 383 * @return {@link #eventTiming} (The timing of the event (if this is a period trigger).) 384 */ 385 public Type getEventTiming() { 386 return this.eventTiming; 387 } 388 389 /** 390 * @return {@link #eventTiming} (The timing of the event (if this is a period trigger).) 391 */ 392 public Timing getEventTimingTiming() throws FHIRException { 393 if (this.eventTiming == null) 394 return null; 395 if (!(this.eventTiming instanceof Timing)) 396 throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.eventTiming.getClass().getName()+" was encountered"); 397 return (Timing) this.eventTiming; 398 } 399 400 public boolean hasEventTimingTiming() { 401 return this != null && this.eventTiming instanceof Timing; 402 } 403 404 /** 405 * @return {@link #eventTiming} (The timing of the event (if this is a period trigger).) 406 */ 407 public Reference getEventTimingReference() throws FHIRException { 408 if (this.eventTiming == null) 409 return null; 410 if (!(this.eventTiming instanceof Reference)) 411 throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.eventTiming.getClass().getName()+" was encountered"); 412 return (Reference) this.eventTiming; 413 } 414 415 public boolean hasEventTimingReference() { 416 return this != null && this.eventTiming instanceof Reference; 417 } 418 419 /** 420 * @return {@link #eventTiming} (The timing of the event (if this is a period trigger).) 421 */ 422 public DateType getEventTimingDateType() throws FHIRException { 423 if (this.eventTiming == null) 424 return null; 425 if (!(this.eventTiming instanceof DateType)) 426 throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.eventTiming.getClass().getName()+" was encountered"); 427 return (DateType) this.eventTiming; 428 } 429 430 public boolean hasEventTimingDateType() { 431 return this != null && this.eventTiming instanceof DateType; 432 } 433 434 /** 435 * @return {@link #eventTiming} (The timing of the event (if this is a period trigger).) 436 */ 437 public DateTimeType getEventTimingDateTimeType() throws FHIRException { 438 if (this.eventTiming == null) 439 return null; 440 if (!(this.eventTiming instanceof DateTimeType)) 441 throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.eventTiming.getClass().getName()+" was encountered"); 442 return (DateTimeType) this.eventTiming; 443 } 444 445 public boolean hasEventTimingDateTimeType() { 446 return this != null && this.eventTiming instanceof DateTimeType; 447 } 448 449 public boolean hasEventTiming() { 450 return this.eventTiming != null && !this.eventTiming.isEmpty(); 451 } 452 453 /** 454 * @param value {@link #eventTiming} (The timing of the event (if this is a period trigger).) 455 */ 456 public TriggerDefinition setEventTiming(Type value) throws FHIRFormatError { 457 if (value != null && !(value instanceof Timing || value instanceof Reference || value instanceof DateType || value instanceof DateTimeType)) 458 throw new FHIRFormatError("Not the right type for TriggerDefinition.eventTiming[x]: "+value.fhirType()); 459 this.eventTiming = value; 460 return this; 461 } 462 463 /** 464 * @return {@link #eventData} (The triggering data of the event (if this is a data trigger).) 465 */ 466 public DataRequirement getEventData() { 467 if (this.eventData == null) 468 if (Configuration.errorOnAutoCreate()) 469 throw new Error("Attempt to auto-create TriggerDefinition.eventData"); 470 else if (Configuration.doAutoCreate()) 471 this.eventData = new DataRequirement(); // cc 472 return this.eventData; 473 } 474 475 public boolean hasEventData() { 476 return this.eventData != null && !this.eventData.isEmpty(); 477 } 478 479 /** 480 * @param value {@link #eventData} (The triggering data of the event (if this is a data trigger).) 481 */ 482 public TriggerDefinition setEventData(DataRequirement value) { 483 this.eventData = value; 484 return this; 485 } 486 487 protected void listChildren(List<Property> children) { 488 super.listChildren(children); 489 children.add(new Property("type", "code", "The type of triggering event.", 0, 1, type)); 490 children.add(new Property("eventName", "string", "The name of the event (if this is a named-event trigger).", 0, 1, eventName)); 491 children.add(new Property("eventTiming[x]", "Timing|Reference(Schedule)|date|dateTime", "The timing of the event (if this is a period trigger).", 0, 1, eventTiming)); 492 children.add(new Property("eventData", "DataRequirement", "The triggering data of the event (if this is a data trigger).", 0, 1, eventData)); 493 } 494 495 @Override 496 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 497 switch (_hash) { 498 case 3575610: /*type*/ return new Property("type", "code", "The type of triggering event.", 0, 1, type); 499 case 31228997: /*eventName*/ return new Property("eventName", "string", "The name of the event (if this is a named-event trigger).", 0, 1, eventName); 500 case 1120539260: /*eventTiming[x]*/ return new Property("eventTiming[x]", "Timing|Reference(Schedule)|date|dateTime", "The timing of the event (if this is a period trigger).", 0, 1, eventTiming); 501 case 125465476: /*eventTiming*/ return new Property("eventTiming[x]", "Timing|Reference(Schedule)|date|dateTime", "The timing of the event (if this is a period trigger).", 0, 1, eventTiming); 502 case 1285594350: /*eventTimingTiming*/ return new Property("eventTiming[x]", "Timing|Reference(Schedule)|date|dateTime", "The timing of the event (if this is a period trigger).", 0, 1, eventTiming); 503 case -171794393: /*eventTimingReference*/ return new Property("eventTiming[x]", "Timing|Reference(Schedule)|date|dateTime", "The timing of the event (if this is a period trigger).", 0, 1, eventTiming); 504 case 376272210: /*eventTimingDate*/ return new Property("eventTiming[x]", "Timing|Reference(Schedule)|date|dateTime", "The timing of the event (if this is a period trigger).", 0, 1, eventTiming); 505 case -1923726529: /*eventTimingDateTime*/ return new Property("eventTiming[x]", "Timing|Reference(Schedule)|date|dateTime", "The timing of the event (if this is a period trigger).", 0, 1, eventTiming); 506 case 30931300: /*eventData*/ return new Property("eventData", "DataRequirement", "The triggering data of the event (if this is a data trigger).", 0, 1, eventData); 507 default: return super.getNamedProperty(_hash, _name, _checkValid); 508 } 509 510 } 511 512 @Override 513 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 514 switch (hash) { 515 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<TriggerType> 516 case 31228997: /*eventName*/ return this.eventName == null ? new Base[0] : new Base[] {this.eventName}; // StringType 517 case 125465476: /*eventTiming*/ return this.eventTiming == null ? new Base[0] : new Base[] {this.eventTiming}; // Type 518 case 30931300: /*eventData*/ return this.eventData == null ? new Base[0] : new Base[] {this.eventData}; // DataRequirement 519 default: return super.getProperty(hash, name, checkValid); 520 } 521 522 } 523 524 @Override 525 public Base setProperty(int hash, String name, Base value) throws FHIRException { 526 switch (hash) { 527 case 3575610: // type 528 value = new TriggerTypeEnumFactory().fromType(castToCode(value)); 529 this.type = (Enumeration) value; // Enumeration<TriggerType> 530 return value; 531 case 31228997: // eventName 532 this.eventName = castToString(value); // StringType 533 return value; 534 case 125465476: // eventTiming 535 this.eventTiming = castToType(value); // Type 536 return value; 537 case 30931300: // eventData 538 this.eventData = castToDataRequirement(value); // DataRequirement 539 return value; 540 default: return super.setProperty(hash, name, value); 541 } 542 543 } 544 545 @Override 546 public Base setProperty(String name, Base value) throws FHIRException { 547 if (name.equals("type")) { 548 value = new TriggerTypeEnumFactory().fromType(castToCode(value)); 549 this.type = (Enumeration) value; // Enumeration<TriggerType> 550 } else if (name.equals("eventName")) { 551 this.eventName = castToString(value); // StringType 552 } else if (name.equals("eventTiming[x]")) { 553 this.eventTiming = castToType(value); // Type 554 } else if (name.equals("eventData")) { 555 this.eventData = castToDataRequirement(value); // DataRequirement 556 } else 557 return super.setProperty(name, value); 558 return value; 559 } 560 561 @Override 562 public Base makeProperty(int hash, String name) throws FHIRException { 563 switch (hash) { 564 case 3575610: return getTypeElement(); 565 case 31228997: return getEventNameElement(); 566 case 1120539260: return getEventTiming(); 567 case 125465476: return getEventTiming(); 568 case 30931300: return getEventData(); 569 default: return super.makeProperty(hash, name); 570 } 571 572 } 573 574 @Override 575 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 576 switch (hash) { 577 case 3575610: /*type*/ return new String[] {"code"}; 578 case 31228997: /*eventName*/ return new String[] {"string"}; 579 case 125465476: /*eventTiming*/ return new String[] {"Timing", "Reference", "date", "dateTime"}; 580 case 30931300: /*eventData*/ return new String[] {"DataRequirement"}; 581 default: return super.getTypesForProperty(hash, name); 582 } 583 584 } 585 586 @Override 587 public Base addChild(String name) throws FHIRException { 588 if (name.equals("type")) { 589 throw new FHIRException("Cannot call addChild on a primitive type TriggerDefinition.type"); 590 } 591 else if (name.equals("eventName")) { 592 throw new FHIRException("Cannot call addChild on a primitive type TriggerDefinition.eventName"); 593 } 594 else if (name.equals("eventTimingTiming")) { 595 this.eventTiming = new Timing(); 596 return this.eventTiming; 597 } 598 else if (name.equals("eventTimingReference")) { 599 this.eventTiming = new Reference(); 600 return this.eventTiming; 601 } 602 else if (name.equals("eventTimingDate")) { 603 this.eventTiming = new DateType(); 604 return this.eventTiming; 605 } 606 else if (name.equals("eventTimingDateTime")) { 607 this.eventTiming = new DateTimeType(); 608 return this.eventTiming; 609 } 610 else if (name.equals("eventData")) { 611 this.eventData = new DataRequirement(); 612 return this.eventData; 613 } 614 else 615 return super.addChild(name); 616 } 617 618 public String fhirType() { 619 return "TriggerDefinition"; 620 621 } 622 623 public TriggerDefinition copy() { 624 TriggerDefinition dst = new TriggerDefinition(); 625 copyValues(dst); 626 dst.type = type == null ? null : type.copy(); 627 dst.eventName = eventName == null ? null : eventName.copy(); 628 dst.eventTiming = eventTiming == null ? null : eventTiming.copy(); 629 dst.eventData = eventData == null ? null : eventData.copy(); 630 return dst; 631 } 632 633 protected TriggerDefinition typedCopy() { 634 return copy(); 635 } 636 637 @Override 638 public boolean equalsDeep(Base other_) { 639 if (!super.equalsDeep(other_)) 640 return false; 641 if (!(other_ instanceof TriggerDefinition)) 642 return false; 643 TriggerDefinition o = (TriggerDefinition) other_; 644 return compareDeep(type, o.type, true) && compareDeep(eventName, o.eventName, true) && compareDeep(eventTiming, o.eventTiming, true) 645 && compareDeep(eventData, o.eventData, true); 646 } 647 648 @Override 649 public boolean equalsShallow(Base other_) { 650 if (!super.equalsShallow(other_)) 651 return false; 652 if (!(other_ instanceof TriggerDefinition)) 653 return false; 654 TriggerDefinition o = (TriggerDefinition) other_; 655 return compareValues(type, o.type, true) && compareValues(eventName, o.eventName, true); 656 } 657 658 public boolean isEmpty() { 659 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, eventName, eventTiming 660 , eventData); 661 } 662 663 664} 665