001package org.hl7.fhir.r4b.model; 002 003 004/* 005 Copyright (c) 2011+, HL7, Inc. 006 All rights reserved. 007 008 Redistribution and use in source and binary forms, with or without modification, \ 009 are permitted provided that the following conditions are met: 010 011 * Redistributions of source code must retain the above copyright notice, this \ 012 list of conditions and the following disclaimer. 013 * Redistributions in binary form must reproduce the above copyright notice, \ 014 this list of conditions and the following disclaimer in the documentation \ 015 and/or other materials provided with the distribution. 016 * Neither the name of HL7 nor the names of its contributors may be used to 017 endorse or promote products derived from this software without specific 018 prior written permission. 019 020 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \ 021 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \ 022 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \ 023 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \ 024 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \ 025 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \ 026 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \ 027 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \ 028 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \ 029 POSSIBILITY OF SUCH DAMAGE. 030 */ 031 032// Generated on Fri, Dec 31, 2021 05:58+1100 for FHIR v4.3.0-snapshot1 033 034import java.util.ArrayList; 035import java.util.Date; 036import java.util.List; 037import org.hl7.fhir.utilities.Utilities; 038import org.hl7.fhir.r4b.model.Enumerations.*; 039import org.hl7.fhir.instance.model.api.IBaseBackboneElement; 040import org.hl7.fhir.exceptions.FHIRException; 041import org.hl7.fhir.instance.model.api.ICompositeType; 042import ca.uhn.fhir.model.api.annotation.ResourceDef; 043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; 044import org.hl7.fhir.instance.model.api.IBaseBackboneElement; 045import ca.uhn.fhir.model.api.annotation.Child; 046import ca.uhn.fhir.model.api.annotation.ChildOrder; 047import ca.uhn.fhir.model.api.annotation.Description; 048import ca.uhn.fhir.model.api.annotation.Block; 049 050import org.hl7.fhir.instance.model.api.IBaseParameters; 051import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; 052/** 053 * This resource is a non-persisted resource used to pass information into and back from an [operation](operations.html). It has no other use, and there is no RESTful endpoint associated with it. 054 */ 055@ResourceDef(name="Parameters", profile="http://hl7.org/fhir/StructureDefinition/Parameters") 056public class Parameters extends Resource implements IBaseParameters { 057 058 @Block() 059 public static class ParametersParameterComponent extends BackboneElement implements IBaseBackboneElement { 060 /** 061 * The name of the parameter (reference to the operation definition). 062 */ 063 @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) 064 @Description(shortDefinition="Name from the definition", formalDefinition="The name of the parameter (reference to the operation definition)." ) 065 protected StringType name; 066 067 /** 068 * Conveys the content if the parameter is a data type. 069 */ 070 @Child(name = "value", type = {Base64BinaryType.class, BooleanType.class, CanonicalType.class, CodeType.class, DateType.class, DateTimeType.class, DecimalType.class, IdType.class, InstantType.class, IntegerType.class, MarkdownType.class, OidType.class, PositiveIntType.class, StringType.class, TimeType.class, UnsignedIntType.class, UriType.class, UrlType.class, UuidType.class, Address.class, Age.class, Annotation.class, Attachment.class, CodeableConcept.class, Coding.class, ContactPoint.class, Count.class, Distance.class, Duration.class, HumanName.class, Identifier.class, Money.class, Period.class, Quantity.class, Range.class, Ratio.class, Reference.class, SampledData.class, Signature.class, Timing.class, ContactDetail.class, Contributor.class, DataRequirement.class, Expression.class, ParameterDefinition.class, RelatedArtifact.class, TriggerDefinition.class, UsageContext.class, Dosage.class, Meta.class}, order=2, min=0, max=1, modifier=false, summary=true) 071 @Description(shortDefinition="If parameter is a data type", formalDefinition="Conveys the content if the parameter is a data type." ) 072 protected DataType value; 073 074 /** 075 * If the parameter is a whole resource. 076 */ 077 @Child(name = "resource", type = {Resource.class}, order=3, min=0, max=1, modifier=false, summary=true) 078 @Description(shortDefinition="If parameter is a whole resource", formalDefinition="If the parameter is a whole resource." ) 079 protected Resource resource; 080 081 /** 082 * A named part of a multi-part parameter. 083 */ 084 @Child(name = "part", type = {ParametersParameterComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 085 @Description(shortDefinition="Named part of a multi-part parameter", formalDefinition="A named part of a multi-part parameter." ) 086 protected List<ParametersParameterComponent> part; 087 088 private static final long serialVersionUID = -1755858390L; 089 090 /** 091 * Constructor 092 */ 093 public ParametersParameterComponent() { 094 super(); 095 } 096 097 /** 098 * Constructor 099 */ 100 public ParametersParameterComponent(String name) { 101 super(); 102 this.setName(name); 103 } 104 105 /** 106 * @return {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 107 */ 108 public StringType getNameElement() { 109 if (this.name == null) 110 if (Configuration.errorOnAutoCreate()) 111 throw new Error("Attempt to auto-create ParametersParameterComponent.name"); 112 else if (Configuration.doAutoCreate()) 113 this.name = new StringType(); // bb 114 return this.name; 115 } 116 117 public boolean hasNameElement() { 118 return this.name != null && !this.name.isEmpty(); 119 } 120 121 public boolean hasName() { 122 return this.name != null && !this.name.isEmpty(); 123 } 124 125 /** 126 * @param value {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 127 */ 128 public ParametersParameterComponent setNameElement(StringType value) { 129 this.name = value; 130 return this; 131 } 132 133 /** 134 * @return The name of the parameter (reference to the operation definition). 135 */ 136 public String getName() { 137 return this.name == null ? null : this.name.getValue(); 138 } 139 140 /** 141 * @param value The name of the parameter (reference to the operation definition). 142 */ 143 public ParametersParameterComponent setName(String value) { 144 if (this.name == null) 145 this.name = new StringType(); 146 this.name.setValue(value); 147 return this; 148 } 149 150 /** 151 * @return {@link #value} (Conveys the content if the parameter is a data type.) 152 */ 153 public DataType getValue() { 154 return this.value; 155 } 156 157 /** 158 * @return {@link #value} (Conveys the content if the parameter is a data type.) 159 */ 160 public Base64BinaryType getValueBase64BinaryType() throws FHIRException { 161 if (this.value == null) 162 this.value = new Base64BinaryType(); 163 if (!(this.value instanceof Base64BinaryType)) 164 throw new FHIRException("Type mismatch: the type Base64BinaryType was expected, but "+this.value.getClass().getName()+" was encountered"); 165 return (Base64BinaryType) this.value; 166 } 167 168 public boolean hasValueBase64BinaryType() { 169 return this != null && this.value instanceof Base64BinaryType; 170 } 171 172 /** 173 * @return {@link #value} (Conveys the content if the parameter is a data type.) 174 */ 175 public BooleanType getValueBooleanType() throws FHIRException { 176 if (this.value == null) 177 this.value = new BooleanType(); 178 if (!(this.value instanceof BooleanType)) 179 throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); 180 return (BooleanType) this.value; 181 } 182 183 public boolean hasValueBooleanType() { 184 return this != null && this.value instanceof BooleanType; 185 } 186 187 /** 188 * @return {@link #value} (Conveys the content if the parameter is a data type.) 189 */ 190 public CanonicalType getValueCanonicalType() throws FHIRException { 191 if (this.value == null) 192 this.value = new CanonicalType(); 193 if (!(this.value instanceof CanonicalType)) 194 throw new FHIRException("Type mismatch: the type CanonicalType was expected, but "+this.value.getClass().getName()+" was encountered"); 195 return (CanonicalType) this.value; 196 } 197 198 public boolean hasValueCanonicalType() { 199 return this != null && this.value instanceof CanonicalType; 200 } 201 202 /** 203 * @return {@link #value} (Conveys the content if the parameter is a data type.) 204 */ 205 public CodeType getValueCodeType() throws FHIRException { 206 if (this.value == null) 207 this.value = new CodeType(); 208 if (!(this.value instanceof CodeType)) 209 throw new FHIRException("Type mismatch: the type CodeType was expected, but "+this.value.getClass().getName()+" was encountered"); 210 return (CodeType) this.value; 211 } 212 213 public boolean hasValueCodeType() { 214 return this != null && this.value instanceof CodeType; 215 } 216 217 /** 218 * @return {@link #value} (Conveys the content if the parameter is a data type.) 219 */ 220 public DateType getValueDateType() throws FHIRException { 221 if (this.value == null) 222 this.value = new DateType(); 223 if (!(this.value instanceof DateType)) 224 throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered"); 225 return (DateType) this.value; 226 } 227 228 public boolean hasValueDateType() { 229 return this != null && this.value instanceof DateType; 230 } 231 232 /** 233 * @return {@link #value} (Conveys the content if the parameter is a data type.) 234 */ 235 public DateTimeType getValueDateTimeType() throws FHIRException { 236 if (this.value == null) 237 this.value = new DateTimeType(); 238 if (!(this.value instanceof DateTimeType)) 239 throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); 240 return (DateTimeType) this.value; 241 } 242 243 public boolean hasValueDateTimeType() { 244 return this != null && this.value instanceof DateTimeType; 245 } 246 247 /** 248 * @return {@link #value} (Conveys the content if the parameter is a data type.) 249 */ 250 public DecimalType getValueDecimalType() throws FHIRException { 251 if (this.value == null) 252 this.value = new DecimalType(); 253 if (!(this.value instanceof DecimalType)) 254 throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered"); 255 return (DecimalType) this.value; 256 } 257 258 public boolean hasValueDecimalType() { 259 return this != null && this.value instanceof DecimalType; 260 } 261 262 /** 263 * @return {@link #value} (Conveys the content if the parameter is a data type.) 264 */ 265 public IdType getValueIdType() throws FHIRException { 266 if (this.value == null) 267 this.value = new IdType(); 268 if (!(this.value instanceof IdType)) 269 throw new FHIRException("Type mismatch: the type IdType was expected, but "+this.value.getClass().getName()+" was encountered"); 270 return (IdType) this.value; 271 } 272 273 public boolean hasValueIdType() { 274 return this != null && this.value instanceof IdType; 275 } 276 277 /** 278 * @return {@link #value} (Conveys the content if the parameter is a data type.) 279 */ 280 public InstantType getValueInstantType() throws FHIRException { 281 if (this.value == null) 282 this.value = new InstantType(); 283 if (!(this.value instanceof InstantType)) 284 throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.value.getClass().getName()+" was encountered"); 285 return (InstantType) this.value; 286 } 287 288 public boolean hasValueInstantType() { 289 return this != null && this.value instanceof InstantType; 290 } 291 292 /** 293 * @return {@link #value} (Conveys the content if the parameter is a data type.) 294 */ 295 public IntegerType getValueIntegerType() throws FHIRException { 296 if (this.value == null) 297 this.value = new IntegerType(); 298 if (!(this.value instanceof IntegerType)) 299 throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered"); 300 return (IntegerType) this.value; 301 } 302 303 public boolean hasValueIntegerType() { 304 return this != null && this.value instanceof IntegerType; 305 } 306 307 /** 308 * @return {@link #value} (Conveys the content if the parameter is a data type.) 309 */ 310 public MarkdownType getValueMarkdownType() throws FHIRException { 311 if (this.value == null) 312 this.value = new MarkdownType(); 313 if (!(this.value instanceof MarkdownType)) 314 throw new FHIRException("Type mismatch: the type MarkdownType was expected, but "+this.value.getClass().getName()+" was encountered"); 315 return (MarkdownType) this.value; 316 } 317 318 public boolean hasValueMarkdownType() { 319 return this != null && this.value instanceof MarkdownType; 320 } 321 322 /** 323 * @return {@link #value} (Conveys the content if the parameter is a data type.) 324 */ 325 public OidType getValueOidType() throws FHIRException { 326 if (this.value == null) 327 this.value = new OidType(); 328 if (!(this.value instanceof OidType)) 329 throw new FHIRException("Type mismatch: the type OidType was expected, but "+this.value.getClass().getName()+" was encountered"); 330 return (OidType) this.value; 331 } 332 333 public boolean hasValueOidType() { 334 return this != null && this.value instanceof OidType; 335 } 336 337 /** 338 * @return {@link #value} (Conveys the content if the parameter is a data type.) 339 */ 340 public PositiveIntType getValuePositiveIntType() throws FHIRException { 341 if (this.value == null) 342 this.value = new PositiveIntType(); 343 if (!(this.value instanceof PositiveIntType)) 344 throw new FHIRException("Type mismatch: the type PositiveIntType was expected, but "+this.value.getClass().getName()+" was encountered"); 345 return (PositiveIntType) this.value; 346 } 347 348 public boolean hasValuePositiveIntType() { 349 return this != null && this.value instanceof PositiveIntType; 350 } 351 352 /** 353 * @return {@link #value} (Conveys the content if the parameter is a data type.) 354 */ 355 public StringType getValueStringType() throws FHIRException { 356 if (this.value == null) 357 this.value = new StringType(); 358 if (!(this.value instanceof StringType)) 359 throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); 360 return (StringType) this.value; 361 } 362 363 public boolean hasValueStringType() { 364 return this != null && this.value instanceof StringType; 365 } 366 367 /** 368 * @return {@link #value} (Conveys the content if the parameter is a data type.) 369 */ 370 public TimeType getValueTimeType() throws FHIRException { 371 if (this.value == null) 372 this.value = new TimeType(); 373 if (!(this.value instanceof TimeType)) 374 throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered"); 375 return (TimeType) this.value; 376 } 377 378 public boolean hasValueTimeType() { 379 return this != null && this.value instanceof TimeType; 380 } 381 382 /** 383 * @return {@link #value} (Conveys the content if the parameter is a data type.) 384 */ 385 public UnsignedIntType getValueUnsignedIntType() throws FHIRException { 386 if (this.value == null) 387 this.value = new UnsignedIntType(); 388 if (!(this.value instanceof UnsignedIntType)) 389 throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.value.getClass().getName()+" was encountered"); 390 return (UnsignedIntType) this.value; 391 } 392 393 public boolean hasValueUnsignedIntType() { 394 return this != null && this.value instanceof UnsignedIntType; 395 } 396 397 /** 398 * @return {@link #value} (Conveys the content if the parameter is a data type.) 399 */ 400 public UriType getValueUriType() throws FHIRException { 401 if (this.value == null) 402 this.value = new UriType(); 403 if (!(this.value instanceof UriType)) 404 throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered"); 405 return (UriType) this.value; 406 } 407 408 public boolean hasValueUriType() { 409 return this != null && this.value instanceof UriType; 410 } 411 412 /** 413 * @return {@link #value} (Conveys the content if the parameter is a data type.) 414 */ 415 public UrlType getValueUrlType() throws FHIRException { 416 if (this.value == null) 417 this.value = new UrlType(); 418 if (!(this.value instanceof UrlType)) 419 throw new FHIRException("Type mismatch: the type UrlType was expected, but "+this.value.getClass().getName()+" was encountered"); 420 return (UrlType) this.value; 421 } 422 423 public boolean hasValueUrlType() { 424 return this != null && this.value instanceof UrlType; 425 } 426 427 /** 428 * @return {@link #value} (Conveys the content if the parameter is a data type.) 429 */ 430 public UuidType getValueUuidType() throws FHIRException { 431 if (this.value == null) 432 this.value = new UuidType(); 433 if (!(this.value instanceof UuidType)) 434 throw new FHIRException("Type mismatch: the type UuidType was expected, but "+this.value.getClass().getName()+" was encountered"); 435 return (UuidType) this.value; 436 } 437 438 public boolean hasValueUuidType() { 439 return this != null && this.value instanceof UuidType; 440 } 441 442 /** 443 * @return {@link #value} (Conveys the content if the parameter is a data type.) 444 */ 445 public Address getValueAddress() throws FHIRException { 446 if (this.value == null) 447 this.value = new Address(); 448 if (!(this.value instanceof Address)) 449 throw new FHIRException("Type mismatch: the type Address was expected, but "+this.value.getClass().getName()+" was encountered"); 450 return (Address) this.value; 451 } 452 453 public boolean hasValueAddress() { 454 return this != null && this.value instanceof Address; 455 } 456 457 /** 458 * @return {@link #value} (Conveys the content if the parameter is a data type.) 459 */ 460 public Age getValueAge() throws FHIRException { 461 if (this.value == null) 462 this.value = new Age(); 463 if (!(this.value instanceof Age)) 464 throw new FHIRException("Type mismatch: the type Age was expected, but "+this.value.getClass().getName()+" was encountered"); 465 return (Age) this.value; 466 } 467 468 public boolean hasValueAge() { 469 return this != null && this.value instanceof Age; 470 } 471 472 /** 473 * @return {@link #value} (Conveys the content if the parameter is a data type.) 474 */ 475 public Annotation getValueAnnotation() throws FHIRException { 476 if (this.value == null) 477 this.value = new Annotation(); 478 if (!(this.value instanceof Annotation)) 479 throw new FHIRException("Type mismatch: the type Annotation was expected, but "+this.value.getClass().getName()+" was encountered"); 480 return (Annotation) this.value; 481 } 482 483 public boolean hasValueAnnotation() { 484 return this != null && this.value instanceof Annotation; 485 } 486 487 /** 488 * @return {@link #value} (Conveys the content if the parameter is a data type.) 489 */ 490 public Attachment getValueAttachment() throws FHIRException { 491 if (this.value == null) 492 this.value = new Attachment(); 493 if (!(this.value instanceof Attachment)) 494 throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered"); 495 return (Attachment) this.value; 496 } 497 498 public boolean hasValueAttachment() { 499 return this != null && this.value instanceof Attachment; 500 } 501 502 /** 503 * @return {@link #value} (Conveys the content if the parameter is a data type.) 504 */ 505 public CodeableConcept getValueCodeableConcept() throws FHIRException { 506 if (this.value == null) 507 this.value = new CodeableConcept(); 508 if (!(this.value instanceof CodeableConcept)) 509 throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered"); 510 return (CodeableConcept) this.value; 511 } 512 513 public boolean hasValueCodeableConcept() { 514 return this != null && this.value instanceof CodeableConcept; 515 } 516 517 /** 518 * @return {@link #value} (Conveys the content if the parameter is a data type.) 519 */ 520 public Coding getValueCoding() throws FHIRException { 521 if (this.value == null) 522 this.value = new Coding(); 523 if (!(this.value instanceof Coding)) 524 throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered"); 525 return (Coding) this.value; 526 } 527 528 public boolean hasValueCoding() { 529 return this != null && this.value instanceof Coding; 530 } 531 532 /** 533 * @return {@link #value} (Conveys the content if the parameter is a data type.) 534 */ 535 public ContactPoint getValueContactPoint() throws FHIRException { 536 if (this.value == null) 537 this.value = new ContactPoint(); 538 if (!(this.value instanceof ContactPoint)) 539 throw new FHIRException("Type mismatch: the type ContactPoint was expected, but "+this.value.getClass().getName()+" was encountered"); 540 return (ContactPoint) this.value; 541 } 542 543 public boolean hasValueContactPoint() { 544 return this != null && this.value instanceof ContactPoint; 545 } 546 547 /** 548 * @return {@link #value} (Conveys the content if the parameter is a data type.) 549 */ 550 public Count getValueCount() throws FHIRException { 551 if (this.value == null) 552 this.value = new Count(); 553 if (!(this.value instanceof Count)) 554 throw new FHIRException("Type mismatch: the type Count was expected, but "+this.value.getClass().getName()+" was encountered"); 555 return (Count) this.value; 556 } 557 558 public boolean hasValueCount() { 559 return this != null && this.value instanceof Count; 560 } 561 562 /** 563 * @return {@link #value} (Conveys the content if the parameter is a data type.) 564 */ 565 public Distance getValueDistance() throws FHIRException { 566 if (this.value == null) 567 this.value = new Distance(); 568 if (!(this.value instanceof Distance)) 569 throw new FHIRException("Type mismatch: the type Distance was expected, but "+this.value.getClass().getName()+" was encountered"); 570 return (Distance) this.value; 571 } 572 573 public boolean hasValueDistance() { 574 return this != null && this.value instanceof Distance; 575 } 576 577 /** 578 * @return {@link #value} (Conveys the content if the parameter is a data type.) 579 */ 580 public Duration getValueDuration() throws FHIRException { 581 if (this.value == null) 582 this.value = new Duration(); 583 if (!(this.value instanceof Duration)) 584 throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.value.getClass().getName()+" was encountered"); 585 return (Duration) this.value; 586 } 587 588 public boolean hasValueDuration() { 589 return this != null && this.value instanceof Duration; 590 } 591 592 /** 593 * @return {@link #value} (Conveys the content if the parameter is a data type.) 594 */ 595 public HumanName getValueHumanName() throws FHIRException { 596 if (this.value == null) 597 this.value = new HumanName(); 598 if (!(this.value instanceof HumanName)) 599 throw new FHIRException("Type mismatch: the type HumanName was expected, but "+this.value.getClass().getName()+" was encountered"); 600 return (HumanName) this.value; 601 } 602 603 public boolean hasValueHumanName() { 604 return this != null && this.value instanceof HumanName; 605 } 606 607 /** 608 * @return {@link #value} (Conveys the content if the parameter is a data type.) 609 */ 610 public Identifier getValueIdentifier() throws FHIRException { 611 if (this.value == null) 612 this.value = new Identifier(); 613 if (!(this.value instanceof Identifier)) 614 throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.value.getClass().getName()+" was encountered"); 615 return (Identifier) this.value; 616 } 617 618 public boolean hasValueIdentifier() { 619 return this != null && this.value instanceof Identifier; 620 } 621 622 /** 623 * @return {@link #value} (Conveys the content if the parameter is a data type.) 624 */ 625 public Money getValueMoney() throws FHIRException { 626 if (this.value == null) 627 this.value = new Money(); 628 if (!(this.value instanceof Money)) 629 throw new FHIRException("Type mismatch: the type Money was expected, but "+this.value.getClass().getName()+" was encountered"); 630 return (Money) this.value; 631 } 632 633 public boolean hasValueMoney() { 634 return this != null && this.value instanceof Money; 635 } 636 637 /** 638 * @return {@link #value} (Conveys the content if the parameter is a data type.) 639 */ 640 public Period getValuePeriod() throws FHIRException { 641 if (this.value == null) 642 this.value = new Period(); 643 if (!(this.value instanceof Period)) 644 throw new FHIRException("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered"); 645 return (Period) this.value; 646 } 647 648 public boolean hasValuePeriod() { 649 return this != null && this.value instanceof Period; 650 } 651 652 /** 653 * @return {@link #value} (Conveys the content if the parameter is a data type.) 654 */ 655 public Quantity getValueQuantity() throws FHIRException { 656 if (this.value == null) 657 this.value = new Quantity(); 658 if (!(this.value instanceof Quantity)) 659 throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); 660 return (Quantity) this.value; 661 } 662 663 public boolean hasValueQuantity() { 664 return this != null && this.value instanceof Quantity; 665 } 666 667 /** 668 * @return {@link #value} (Conveys the content if the parameter is a data type.) 669 */ 670 public Range getValueRange() throws FHIRException { 671 if (this.value == null) 672 this.value = new Range(); 673 if (!(this.value instanceof Range)) 674 throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered"); 675 return (Range) this.value; 676 } 677 678 public boolean hasValueRange() { 679 return this != null && this.value instanceof Range; 680 } 681 682 /** 683 * @return {@link #value} (Conveys the content if the parameter is a data type.) 684 */ 685 public Ratio getValueRatio() throws FHIRException { 686 if (this.value == null) 687 this.value = new Ratio(); 688 if (!(this.value instanceof Ratio)) 689 throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.value.getClass().getName()+" was encountered"); 690 return (Ratio) this.value; 691 } 692 693 public boolean hasValueRatio() { 694 return this != null && this.value instanceof Ratio; 695 } 696 697 /** 698 * @return {@link #value} (Conveys the content if the parameter is a data type.) 699 */ 700 public Reference getValueReference() throws FHIRException { 701 if (this.value == null) 702 this.value = new Reference(); 703 if (!(this.value instanceof Reference)) 704 throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered"); 705 return (Reference) this.value; 706 } 707 708 public boolean hasValueReference() { 709 return this != null && this.value instanceof Reference; 710 } 711 712 /** 713 * @return {@link #value} (Conveys the content if the parameter is a data type.) 714 */ 715 public SampledData getValueSampledData() throws FHIRException { 716 if (this.value == null) 717 this.value = new SampledData(); 718 if (!(this.value instanceof SampledData)) 719 throw new FHIRException("Type mismatch: the type SampledData was expected, but "+this.value.getClass().getName()+" was encountered"); 720 return (SampledData) this.value; 721 } 722 723 public boolean hasValueSampledData() { 724 return this != null && this.value instanceof SampledData; 725 } 726 727 /** 728 * @return {@link #value} (Conveys the content if the parameter is a data type.) 729 */ 730 public Signature getValueSignature() throws FHIRException { 731 if (this.value == null) 732 this.value = new Signature(); 733 if (!(this.value instanceof Signature)) 734 throw new FHIRException("Type mismatch: the type Signature was expected, but "+this.value.getClass().getName()+" was encountered"); 735 return (Signature) this.value; 736 } 737 738 public boolean hasValueSignature() { 739 return this != null && this.value instanceof Signature; 740 } 741 742 /** 743 * @return {@link #value} (Conveys the content if the parameter is a data type.) 744 */ 745 public Timing getValueTiming() throws FHIRException { 746 if (this.value == null) 747 this.value = new Timing(); 748 if (!(this.value instanceof Timing)) 749 throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.value.getClass().getName()+" was encountered"); 750 return (Timing) this.value; 751 } 752 753 public boolean hasValueTiming() { 754 return this != null && this.value instanceof Timing; 755 } 756 757 /** 758 * @return {@link #value} (Conveys the content if the parameter is a data type.) 759 */ 760 public ContactDetail getValueContactDetail() throws FHIRException { 761 if (this.value == null) 762 this.value = new ContactDetail(); 763 if (!(this.value instanceof ContactDetail)) 764 throw new FHIRException("Type mismatch: the type ContactDetail was expected, but "+this.value.getClass().getName()+" was encountered"); 765 return (ContactDetail) this.value; 766 } 767 768 public boolean hasValueContactDetail() { 769 return this != null && this.value instanceof ContactDetail; 770 } 771 772 /** 773 * @return {@link #value} (Conveys the content if the parameter is a data type.) 774 */ 775 public Contributor getValueContributor() throws FHIRException { 776 if (this.value == null) 777 this.value = new Contributor(); 778 if (!(this.value instanceof Contributor)) 779 throw new FHIRException("Type mismatch: the type Contributor was expected, but "+this.value.getClass().getName()+" was encountered"); 780 return (Contributor) this.value; 781 } 782 783 public boolean hasValueContributor() { 784 return this != null && this.value instanceof Contributor; 785 } 786 787 /** 788 * @return {@link #value} (Conveys the content if the parameter is a data type.) 789 */ 790 public DataRequirement getValueDataRequirement() throws FHIRException { 791 if (this.value == null) 792 this.value = new DataRequirement(); 793 if (!(this.value instanceof DataRequirement)) 794 throw new FHIRException("Type mismatch: the type DataRequirement was expected, but "+this.value.getClass().getName()+" was encountered"); 795 return (DataRequirement) this.value; 796 } 797 798 public boolean hasValueDataRequirement() { 799 return this != null && this.value instanceof DataRequirement; 800 } 801 802 /** 803 * @return {@link #value} (Conveys the content if the parameter is a data type.) 804 */ 805 public Expression getValueExpression() throws FHIRException { 806 if (this.value == null) 807 this.value = new Expression(); 808 if (!(this.value instanceof Expression)) 809 throw new FHIRException("Type mismatch: the type Expression was expected, but "+this.value.getClass().getName()+" was encountered"); 810 return (Expression) this.value; 811 } 812 813 public boolean hasValueExpression() { 814 return this != null && this.value instanceof Expression; 815 } 816 817 /** 818 * @return {@link #value} (Conveys the content if the parameter is a data type.) 819 */ 820 public ParameterDefinition getValueParameterDefinition() throws FHIRException { 821 if (this.value == null) 822 this.value = new ParameterDefinition(); 823 if (!(this.value instanceof ParameterDefinition)) 824 throw new FHIRException("Type mismatch: the type ParameterDefinition was expected, but "+this.value.getClass().getName()+" was encountered"); 825 return (ParameterDefinition) this.value; 826 } 827 828 public boolean hasValueParameterDefinition() { 829 return this != null && this.value instanceof ParameterDefinition; 830 } 831 832 /** 833 * @return {@link #value} (Conveys the content if the parameter is a data type.) 834 */ 835 public RelatedArtifact getValueRelatedArtifact() throws FHIRException { 836 if (this.value == null) 837 this.value = new RelatedArtifact(); 838 if (!(this.value instanceof RelatedArtifact)) 839 throw new FHIRException("Type mismatch: the type RelatedArtifact was expected, but "+this.value.getClass().getName()+" was encountered"); 840 return (RelatedArtifact) this.value; 841 } 842 843 public boolean hasValueRelatedArtifact() { 844 return this != null && this.value instanceof RelatedArtifact; 845 } 846 847 /** 848 * @return {@link #value} (Conveys the content if the parameter is a data type.) 849 */ 850 public TriggerDefinition getValueTriggerDefinition() throws FHIRException { 851 if (this.value == null) 852 this.value = new TriggerDefinition(); 853 if (!(this.value instanceof TriggerDefinition)) 854 throw new FHIRException("Type mismatch: the type TriggerDefinition was expected, but "+this.value.getClass().getName()+" was encountered"); 855 return (TriggerDefinition) this.value; 856 } 857 858 public boolean hasValueTriggerDefinition() { 859 return this != null && this.value instanceof TriggerDefinition; 860 } 861 862 /** 863 * @return {@link #value} (Conveys the content if the parameter is a data type.) 864 */ 865 public UsageContext getValueUsageContext() throws FHIRException { 866 if (this.value == null) 867 this.value = new UsageContext(); 868 if (!(this.value instanceof UsageContext)) 869 throw new FHIRException("Type mismatch: the type UsageContext was expected, but "+this.value.getClass().getName()+" was encountered"); 870 return (UsageContext) this.value; 871 } 872 873 public boolean hasValueUsageContext() { 874 return this != null && this.value instanceof UsageContext; 875 } 876 877 /** 878 * @return {@link #value} (Conveys the content if the parameter is a data type.) 879 */ 880 public Dosage getValueDosage() throws FHIRException { 881 if (this.value == null) 882 this.value = new Dosage(); 883 if (!(this.value instanceof Dosage)) 884 throw new FHIRException("Type mismatch: the type Dosage was expected, but "+this.value.getClass().getName()+" was encountered"); 885 return (Dosage) this.value; 886 } 887 888 public boolean hasValueDosage() { 889 return this != null && this.value instanceof Dosage; 890 } 891 892 /** 893 * @return {@link #value} (Conveys the content if the parameter is a data type.) 894 */ 895 public Meta getValueMeta() throws FHIRException { 896 if (this.value == null) 897 this.value = new Meta(); 898 if (!(this.value instanceof Meta)) 899 throw new FHIRException("Type mismatch: the type Meta was expected, but "+this.value.getClass().getName()+" was encountered"); 900 return (Meta) this.value; 901 } 902 903 public boolean hasValueMeta() { 904 return this != null && this.value instanceof Meta; 905 } 906 907 public boolean hasValue() { 908 return this.value != null && !this.value.isEmpty(); 909 } 910 911 /** 912 * @param value {@link #value} (Conveys the content if the parameter is a data type.) 913 */ 914 public ParametersParameterComponent setValue(DataType value) { 915 if (value != null && !(value instanceof Base64BinaryType || value instanceof BooleanType || value instanceof CanonicalType || value instanceof CodeType || value instanceof DateType || value instanceof DateTimeType || value instanceof DecimalType || value instanceof IdType || value instanceof InstantType || value instanceof IntegerType || value instanceof MarkdownType || value instanceof OidType || value instanceof PositiveIntType || value instanceof StringType || value instanceof TimeType || value instanceof UnsignedIntType || value instanceof UriType || value instanceof UrlType || value instanceof UuidType || value instanceof Address || value instanceof Age || value instanceof Annotation || value instanceof Attachment || value instanceof CodeableConcept || value instanceof Coding || value instanceof ContactPoint || value instanceof Count || value instanceof Distance || value instanceof Duration || value instanceof HumanName || value instanceof Identifier || value instanceof Money || value instanceof Period || value instanceof Quantity || value instanceof Range || value instanceof Ratio || value instanceof Reference || value instanceof SampledData || value instanceof Signature || value instanceof Timing || value instanceof ContactDetail || value instanceof Contributor || value instanceof DataRequirement || value instanceof Expression || value instanceof ParameterDefinition || value instanceof RelatedArtifact || value instanceof TriggerDefinition || value instanceof UsageContext || value instanceof Dosage || value instanceof Meta)) 916 throw new Error("Not the right type for Parameters.parameter.value[x]: "+value.fhirType()); 917 this.value = value; 918 return this; 919 } 920 921 /** 922 * @return {@link #resource} (If the parameter is a whole resource.) 923 */ 924 public Resource getResource() { 925 return this.resource; 926 } 927 928 public boolean hasResource() { 929 return this.resource != null && !this.resource.isEmpty(); 930 } 931 932 /** 933 * @param value {@link #resource} (If the parameter is a whole resource.) 934 */ 935 public ParametersParameterComponent setResource(Resource value) { 936 this.resource = value; 937 return this; 938 } 939 940 /** 941 * @return {@link #part} (A named part of a multi-part parameter.) 942 */ 943 public List<ParametersParameterComponent> getPart() { 944 if (this.part == null) 945 this.part = new ArrayList<ParametersParameterComponent>(); 946 return this.part; 947 } 948 949 /** 950 * @return Returns a reference to <code>this</code> for easy method chaining 951 */ 952 public ParametersParameterComponent setPart(List<ParametersParameterComponent> thePart) { 953 this.part = thePart; 954 return this; 955 } 956 957 public boolean hasPart() { 958 if (this.part == null) 959 return false; 960 for (ParametersParameterComponent item : this.part) 961 if (!item.isEmpty()) 962 return true; 963 return false; 964 } 965 966 public ParametersParameterComponent addPart() { //3 967 ParametersParameterComponent t = new ParametersParameterComponent(); 968 if (this.part == null) 969 this.part = new ArrayList<ParametersParameterComponent>(); 970 this.part.add(t); 971 return t; 972 } 973 974 public ParametersParameterComponent addPart(ParametersParameterComponent t) { //3 975 if (t == null) 976 return this; 977 if (this.part == null) 978 this.part = new ArrayList<ParametersParameterComponent>(); 979 this.part.add(t); 980 return this; 981 } 982 983 /** 984 * @return The first repetition of repeating field {@link #part}, creating it if it does not already exist {3} 985 */ 986 public ParametersParameterComponent getPartFirstRep() { 987 if (getPart().isEmpty()) { 988 addPart(); 989 } 990 return getPart().get(0); 991 } 992 993 protected void listChildren(List<Property> children) { 994 super.listChildren(children); 995 children.add(new Property("name", "string", "The name of the parameter (reference to the operation definition).", 0, 1, name)); 996 children.add(new Property("value[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "Conveys the content if the parameter is a data type.", 0, 1, value)); 997 children.add(new Property("resource", "Resource", "If the parameter is a whole resource.", 0, 1, resource)); 998 children.add(new Property("part", "@Parameters.parameter", "A named part of a multi-part parameter.", 0, java.lang.Integer.MAX_VALUE, part)); 999 } 1000 1001 @Override 1002 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1003 switch (_hash) { 1004 case 3373707: /*name*/ return new Property("name", "string", "The name of the parameter (reference to the operation definition).", 0, 1, name); 1005 case -1410166417: /*value[x]*/ return new Property("value[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "Conveys the content if the parameter is a data type.", 0, 1, value); 1006 case 111972721: /*value*/ return new Property("value[x]", "base64Binary|boolean|canonical|code|date|dateTime|decimal|id|instant|integer|markdown|oid|positiveInt|string|time|unsignedInt|uri|url|uuid|Address|Age|Annotation|Attachment|CodeableConcept|Coding|ContactPoint|Count|Distance|Duration|HumanName|Identifier|Money|Period|Quantity|Range|Ratio|Reference|SampledData|Signature|Timing|ContactDetail|Contributor|DataRequirement|Expression|ParameterDefinition|RelatedArtifact|TriggerDefinition|UsageContext|Dosage|Meta", "Conveys the content if the parameter is a data type.", 0, 1, value); 1007 case -1535024575: /*valueBase64Binary*/ return new Property("value[x]", "base64Binary", "Conveys the content if the parameter is a data type.", 0, 1, value); 1008 case 733421943: /*valueBoolean*/ return new Property("value[x]", "boolean", "Conveys the content if the parameter is a data type.", 0, 1, value); 1009 case -786218365: /*valueCanonical*/ return new Property("value[x]", "canonical", "Conveys the content if the parameter is a data type.", 0, 1, value); 1010 case -766209282: /*valueCode*/ return new Property("value[x]", "code", "Conveys the content if the parameter is a data type.", 0, 1, value); 1011 case -766192449: /*valueDate*/ return new Property("value[x]", "date", "Conveys the content if the parameter is a data type.", 0, 1, value); 1012 case 1047929900: /*valueDateTime*/ return new Property("value[x]", "dateTime", "Conveys the content if the parameter is a data type.", 0, 1, value); 1013 case -2083993440: /*valueDecimal*/ return new Property("value[x]", "decimal", "Conveys the content if the parameter is a data type.", 0, 1, value); 1014 case 231604844: /*valueId*/ return new Property("value[x]", "id", "Conveys the content if the parameter is a data type.", 0, 1, value); 1015 case -1668687056: /*valueInstant*/ return new Property("value[x]", "instant", "Conveys the content if the parameter is a data type.", 0, 1, value); 1016 case -1668204915: /*valueInteger*/ return new Property("value[x]", "integer", "Conveys the content if the parameter is a data type.", 0, 1, value); 1017 case -497880704: /*valueMarkdown*/ return new Property("value[x]", "markdown", "Conveys the content if the parameter is a data type.", 0, 1, value); 1018 case -1410178407: /*valueOid*/ return new Property("value[x]", "oid", "Conveys the content if the parameter is a data type.", 0, 1, value); 1019 case -1249932027: /*valuePositiveInt*/ return new Property("value[x]", "positiveInt", "Conveys the content if the parameter is a data type.", 0, 1, value); 1020 case -1424603934: /*valueString*/ return new Property("value[x]", "string", "Conveys the content if the parameter is a data type.", 0, 1, value); 1021 case -765708322: /*valueTime*/ return new Property("value[x]", "time", "Conveys the content if the parameter is a data type.", 0, 1, value); 1022 case 26529417: /*valueUnsignedInt*/ return new Property("value[x]", "unsignedInt", "Conveys the content if the parameter is a data type.", 0, 1, value); 1023 case -1410172357: /*valueUri*/ return new Property("value[x]", "uri", "Conveys the content if the parameter is a data type.", 0, 1, value); 1024 case -1410172354: /*valueUrl*/ return new Property("value[x]", "url", "Conveys the content if the parameter is a data type.", 0, 1, value); 1025 case -765667124: /*valueUuid*/ return new Property("value[x]", "uuid", "Conveys the content if the parameter is a data type.", 0, 1, value); 1026 case -478981821: /*valueAddress*/ return new Property("value[x]", "Address", "Conveys the content if the parameter is a data type.", 0, 1, value); 1027 case -1410191922: /*valueAge*/ return new Property("value[x]", "Age", "Conveys the content if the parameter is a data type.", 0, 1, value); 1028 case -67108992: /*valueAnnotation*/ return new Property("value[x]", "Annotation", "Conveys the content if the parameter is a data type.", 0, 1, value); 1029 case -475566732: /*valueAttachment*/ return new Property("value[x]", "Attachment", "Conveys the content if the parameter is a data type.", 0, 1, value); 1030 case 924902896: /*valueCodeableConcept*/ return new Property("value[x]", "CodeableConcept", "Conveys the content if the parameter is a data type.", 0, 1, value); 1031 case -1887705029: /*valueCoding*/ return new Property("value[x]", "Coding", "Conveys the content if the parameter is a data type.", 0, 1, value); 1032 case 944904545: /*valueContactPoint*/ return new Property("value[x]", "ContactPoint", "Conveys the content if the parameter is a data type.", 0, 1, value); 1033 case 2017332766: /*valueCount*/ return new Property("value[x]", "Count", "Conveys the content if the parameter is a data type.", 0, 1, value); 1034 case -456359802: /*valueDistance*/ return new Property("value[x]", "Distance", "Conveys the content if the parameter is a data type.", 0, 1, value); 1035 case 1558135333: /*valueDuration*/ return new Property("value[x]", "Duration", "Conveys the content if the parameter is a data type.", 0, 1, value); 1036 case -2026205465: /*valueHumanName*/ return new Property("value[x]", "HumanName", "Conveys the content if the parameter is a data type.", 0, 1, value); 1037 case -130498310: /*valueIdentifier*/ return new Property("value[x]", "Identifier", "Conveys the content if the parameter is a data type.", 0, 1, value); 1038 case 2026560975: /*valueMoney*/ return new Property("value[x]", "Money", "Conveys the content if the parameter is a data type.", 0, 1, value); 1039 case -1524344174: /*valuePeriod*/ return new Property("value[x]", "Period", "Conveys the content if the parameter is a data type.", 0, 1, value); 1040 case -2029823716: /*valueQuantity*/ return new Property("value[x]", "Quantity", "Conveys the content if the parameter is a data type.", 0, 1, value); 1041 case 2030761548: /*valueRange*/ return new Property("value[x]", "Range", "Conveys the content if the parameter is a data type.", 0, 1, value); 1042 case 2030767386: /*valueRatio*/ return new Property("value[x]", "Ratio", "Conveys the content if the parameter is a data type.", 0, 1, value); 1043 case 1755241690: /*valueReference*/ return new Property("value[x]", "Reference", "Conveys the content if the parameter is a data type.", 0, 1, value); 1044 case -962229101: /*valueSampledData*/ return new Property("value[x]", "SampledData", "Conveys the content if the parameter is a data type.", 0, 1, value); 1045 case -540985785: /*valueSignature*/ return new Property("value[x]", "Signature", "Conveys the content if the parameter is a data type.", 0, 1, value); 1046 case -1406282469: /*valueTiming*/ return new Property("value[x]", "Timing", "Conveys the content if the parameter is a data type.", 0, 1, value); 1047 case -1125200224: /*valueContactDetail*/ return new Property("value[x]", "ContactDetail", "Conveys the content if the parameter is a data type.", 0, 1, value); 1048 case 1281021610: /*valueContributor*/ return new Property("value[x]", "Contributor", "Conveys the content if the parameter is a data type.", 0, 1, value); 1049 case 1710554248: /*valueDataRequirement*/ return new Property("value[x]", "DataRequirement", "Conveys the content if the parameter is a data type.", 0, 1, value); 1050 case -307517719: /*valueExpression*/ return new Property("value[x]", "Expression", "Conveys the content if the parameter is a data type.", 0, 1, value); 1051 case 1387478187: /*valueParameterDefinition*/ return new Property("value[x]", "ParameterDefinition", "Conveys the content if the parameter is a data type.", 0, 1, value); 1052 case 1748214124: /*valueRelatedArtifact*/ return new Property("value[x]", "RelatedArtifact", "Conveys the content if the parameter is a data type.", 0, 1, value); 1053 case 976830394: /*valueTriggerDefinition*/ return new Property("value[x]", "TriggerDefinition", "Conveys the content if the parameter is a data type.", 0, 1, value); 1054 case 588000479: /*valueUsageContext*/ return new Property("value[x]", "UsageContext", "Conveys the content if the parameter is a data type.", 0, 1, value); 1055 case -1858636920: /*valueDosage*/ return new Property("value[x]", "Dosage", "Conveys the content if the parameter is a data type.", 0, 1, value); 1056 case -765920490: /*valueMeta*/ return new Property("value[x]", "Meta", "Conveys the content if the parameter is a data type.", 0, 1, value); 1057 case -341064690: /*resource*/ return new Property("resource", "Resource", "If the parameter is a whole resource.", 0, 1, resource); 1058 case 3433459: /*part*/ return new Property("part", "@Parameters.parameter", "A named part of a multi-part parameter.", 0, java.lang.Integer.MAX_VALUE, part); 1059 default: return super.getNamedProperty(_hash, _name, _checkValid); 1060 } 1061 1062 } 1063 1064 @Override 1065 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1066 switch (hash) { 1067 case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType 1068 case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType 1069 case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Resource 1070 case 3433459: /*part*/ return this.part == null ? new Base[0] : this.part.toArray(new Base[this.part.size()]); // ParametersParameterComponent 1071 default: return super.getProperty(hash, name, checkValid); 1072 } 1073 1074 } 1075 1076 @Override 1077 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1078 switch (hash) { 1079 case 3373707: // name 1080 this.name = TypeConvertor.castToString(value); // StringType 1081 return value; 1082 case 111972721: // value 1083 this.value = TypeConvertor.castToType(value); // DataType 1084 return value; 1085 case -341064690: // resource 1086 this.resource = TypeConvertor.castToResource(value); // Resource 1087 return value; 1088 case 3433459: // part 1089 this.getPart().add((ParametersParameterComponent) value); // ParametersParameterComponent 1090 return value; 1091 default: return super.setProperty(hash, name, value); 1092 } 1093 1094 } 1095 1096 @Override 1097 public Base setProperty(String name, Base value) throws FHIRException { 1098 if (name.equals("name")) { 1099 this.name = TypeConvertor.castToString(value); // StringType 1100 } else if (name.equals("value[x]")) { 1101 this.value = TypeConvertor.castToType(value); // DataType 1102 } else if (name.equals("resource")) { 1103 this.resource = TypeConvertor.castToResource(value); // Resource 1104 } else if (name.equals("part")) { 1105 this.getPart().add((ParametersParameterComponent) value); 1106 } else 1107 return super.setProperty(name, value); 1108 return value; 1109 } 1110 1111 @Override 1112 public Base makeProperty(int hash, String name) throws FHIRException { 1113 switch (hash) { 1114 case 3373707: return getNameElement(); 1115 case -1410166417: return getValue(); 1116 case 111972721: return getValue(); 1117 case -341064690: throw new FHIRException("Cannot make property resource as it is not a complex type"); // Resource 1118 case 3433459: return addPart(); 1119 default: return super.makeProperty(hash, name); 1120 } 1121 1122 } 1123 1124 @Override 1125 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1126 switch (hash) { 1127 case 3373707: /*name*/ return new String[] {"string"}; 1128 case 111972721: /*value*/ return new String[] {"base64Binary", "boolean", "canonical", "code", "date", "dateTime", "decimal", "id", "instant", "integer", "markdown", "oid", "positiveInt", "string", "time", "unsignedInt", "uri", "url", "uuid", "Address", "Age", "Annotation", "Attachment", "CodeableConcept", "Coding", "ContactPoint", "Count", "Distance", "Duration", "HumanName", "Identifier", "Money", "Period", "Quantity", "Range", "Ratio", "Reference", "SampledData", "Signature", "Timing", "ContactDetail", "Contributor", "DataRequirement", "Expression", "ParameterDefinition", "RelatedArtifact", "TriggerDefinition", "UsageContext", "Dosage", "Meta"}; 1129 case -341064690: /*resource*/ return new String[] {"Resource"}; 1130 case 3433459: /*part*/ return new String[] {"@Parameters.parameter"}; 1131 default: return super.getTypesForProperty(hash, name); 1132 } 1133 1134 } 1135 1136 @Override 1137 public Base addChild(String name) throws FHIRException { 1138 if (name.equals("name")) { 1139 throw new FHIRException("Cannot call addChild on a primitive type Parameters.parameter.name"); 1140 } 1141 else if (name.equals("valueBase64Binary")) { 1142 this.value = new Base64BinaryType(); 1143 return this.value; 1144 } 1145 else if (name.equals("valueBoolean")) { 1146 this.value = new BooleanType(); 1147 return this.value; 1148 } 1149 else if (name.equals("valueCanonical")) { 1150 this.value = new CanonicalType(); 1151 return this.value; 1152 } 1153 else if (name.equals("valueCode")) { 1154 this.value = new CodeType(); 1155 return this.value; 1156 } 1157 else if (name.equals("valueDate")) { 1158 this.value = new DateType(); 1159 return this.value; 1160 } 1161 else if (name.equals("valueDateTime")) { 1162 this.value = new DateTimeType(); 1163 return this.value; 1164 } 1165 else if (name.equals("valueDecimal")) { 1166 this.value = new DecimalType(); 1167 return this.value; 1168 } 1169 else if (name.equals("valueId")) { 1170 this.value = new IdType(); 1171 return this.value; 1172 } 1173 else if (name.equals("valueInstant")) { 1174 this.value = new InstantType(); 1175 return this.value; 1176 } 1177 else if (name.equals("valueInteger")) { 1178 this.value = new IntegerType(); 1179 return this.value; 1180 } 1181 else if (name.equals("valueMarkdown")) { 1182 this.value = new MarkdownType(); 1183 return this.value; 1184 } 1185 else if (name.equals("valueOid")) { 1186 this.value = new OidType(); 1187 return this.value; 1188 } 1189 else if (name.equals("valuePositiveInt")) { 1190 this.value = new PositiveIntType(); 1191 return this.value; 1192 } 1193 else if (name.equals("valueString")) { 1194 this.value = new StringType(); 1195 return this.value; 1196 } 1197 else if (name.equals("valueTime")) { 1198 this.value = new TimeType(); 1199 return this.value; 1200 } 1201 else if (name.equals("valueUnsignedInt")) { 1202 this.value = new UnsignedIntType(); 1203 return this.value; 1204 } 1205 else if (name.equals("valueUri")) { 1206 this.value = new UriType(); 1207 return this.value; 1208 } 1209 else if (name.equals("valueUrl")) { 1210 this.value = new UrlType(); 1211 return this.value; 1212 } 1213 else if (name.equals("valueUuid")) { 1214 this.value = new UuidType(); 1215 return this.value; 1216 } 1217 else if (name.equals("valueAddress")) { 1218 this.value = new Address(); 1219 return this.value; 1220 } 1221 else if (name.equals("valueAge")) { 1222 this.value = new Age(); 1223 return this.value; 1224 } 1225 else if (name.equals("valueAnnotation")) { 1226 this.value = new Annotation(); 1227 return this.value; 1228 } 1229 else if (name.equals("valueAttachment")) { 1230 this.value = new Attachment(); 1231 return this.value; 1232 } 1233 else if (name.equals("valueCodeableConcept")) { 1234 this.value = new CodeableConcept(); 1235 return this.value; 1236 } 1237 else if (name.equals("valueCoding")) { 1238 this.value = new Coding(); 1239 return this.value; 1240 } 1241 else if (name.equals("valueContactPoint")) { 1242 this.value = new ContactPoint(); 1243 return this.value; 1244 } 1245 else if (name.equals("valueCount")) { 1246 this.value = new Count(); 1247 return this.value; 1248 } 1249 else if (name.equals("valueDistance")) { 1250 this.value = new Distance(); 1251 return this.value; 1252 } 1253 else if (name.equals("valueDuration")) { 1254 this.value = new Duration(); 1255 return this.value; 1256 } 1257 else if (name.equals("valueHumanName")) { 1258 this.value = new HumanName(); 1259 return this.value; 1260 } 1261 else if (name.equals("valueIdentifier")) { 1262 this.value = new Identifier(); 1263 return this.value; 1264 } 1265 else if (name.equals("valueMoney")) { 1266 this.value = new Money(); 1267 return this.value; 1268 } 1269 else if (name.equals("valuePeriod")) { 1270 this.value = new Period(); 1271 return this.value; 1272 } 1273 else if (name.equals("valueQuantity")) { 1274 this.value = new Quantity(); 1275 return this.value; 1276 } 1277 else if (name.equals("valueRange")) { 1278 this.value = new Range(); 1279 return this.value; 1280 } 1281 else if (name.equals("valueRatio")) { 1282 this.value = new Ratio(); 1283 return this.value; 1284 } 1285 else if (name.equals("valueReference")) { 1286 this.value = new Reference(); 1287 return this.value; 1288 } 1289 else if (name.equals("valueSampledData")) { 1290 this.value = new SampledData(); 1291 return this.value; 1292 } 1293 else if (name.equals("valueSignature")) { 1294 this.value = new Signature(); 1295 return this.value; 1296 } 1297 else if (name.equals("valueTiming")) { 1298 this.value = new Timing(); 1299 return this.value; 1300 } 1301 else if (name.equals("valueContactDetail")) { 1302 this.value = new ContactDetail(); 1303 return this.value; 1304 } 1305 else if (name.equals("valueContributor")) { 1306 this.value = new Contributor(); 1307 return this.value; 1308 } 1309 else if (name.equals("valueDataRequirement")) { 1310 this.value = new DataRequirement(); 1311 return this.value; 1312 } 1313 else if (name.equals("valueExpression")) { 1314 this.value = new Expression(); 1315 return this.value; 1316 } 1317 else if (name.equals("valueParameterDefinition")) { 1318 this.value = new ParameterDefinition(); 1319 return this.value; 1320 } 1321 else if (name.equals("valueRelatedArtifact")) { 1322 this.value = new RelatedArtifact(); 1323 return this.value; 1324 } 1325 else if (name.equals("valueTriggerDefinition")) { 1326 this.value = new TriggerDefinition(); 1327 return this.value; 1328 } 1329 else if (name.equals("valueUsageContext")) { 1330 this.value = new UsageContext(); 1331 return this.value; 1332 } 1333 else if (name.equals("valueDosage")) { 1334 this.value = new Dosage(); 1335 return this.value; 1336 } 1337 else if (name.equals("valueMeta")) { 1338 this.value = new Meta(); 1339 return this.value; 1340 } 1341 else if (name.equals("resource")) { 1342 throw new FHIRException("Cannot call addChild on an abstract type Parameters.parameter.resource"); 1343 } 1344 else if (name.equals("part")) { 1345 return addPart(); 1346 } 1347 else 1348 return super.addChild(name); 1349 } 1350 1351 public ParametersParameterComponent copy() { 1352 ParametersParameterComponent dst = new ParametersParameterComponent(); 1353 copyValues(dst); 1354 return dst; 1355 } 1356 1357 public void copyValues(ParametersParameterComponent dst) { 1358 super.copyValues(dst); 1359 dst.name = name == null ? null : name.copy(); 1360 dst.value = value == null ? null : value.copy(); 1361 dst.resource = resource == null ? null : resource.copy(); 1362 if (part != null) { 1363 dst.part = new ArrayList<ParametersParameterComponent>(); 1364 for (ParametersParameterComponent i : part) 1365 dst.part.add(i.copy()); 1366 }; 1367 } 1368 1369 @Override 1370 public boolean equalsDeep(Base other_) { 1371 if (!super.equalsDeep(other_)) 1372 return false; 1373 if (!(other_ instanceof ParametersParameterComponent)) 1374 return false; 1375 ParametersParameterComponent o = (ParametersParameterComponent) other_; 1376 return compareDeep(name, o.name, true) && compareDeep(value, o.value, true) && compareDeep(resource, o.resource, true) 1377 && compareDeep(part, o.part, true); 1378 } 1379 1380 @Override 1381 public boolean equalsShallow(Base other_) { 1382 if (!super.equalsShallow(other_)) 1383 return false; 1384 if (!(other_ instanceof ParametersParameterComponent)) 1385 return false; 1386 ParametersParameterComponent o = (ParametersParameterComponent) other_; 1387 return compareValues(name, o.name, true); 1388 } 1389 1390 public boolean isEmpty() { 1391 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, value, resource, part 1392 ); 1393 } 1394 1395 public String fhirType() { 1396 return "Parameters.parameter"; 1397 1398 } 1399 1400// added from java-adornments.txt: 1401public String toString() { 1402 String s = getName() + " = "; 1403 if (hasValue()) { 1404 if (getValue().isPrimitive()) { 1405 s = s + getValue().primitiveValue(); 1406 } else { 1407 s = s + "["+getValue().fhirType()+"]"; 1408 } 1409 } else if (hasResource()) { 1410 s = s + "["+getResource().fhirType()+"]"; 1411 } else { 1412 CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); 1413 for (ParametersParameterComponent p : getPart()) { 1414 b.append(p.getName()); 1415 } 1416 s = s + "{"+b.toString()+"}"; 1417 } 1418 return s; 1419 } 1420// end addition 1421 } 1422 1423 /** 1424 * A parameter passed to or received from the operation. 1425 */ 1426 @Child(name = "parameter", type = {}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 1427 @Description(shortDefinition="Operation Parameter", formalDefinition="A parameter passed to or received from the operation." ) 1428 protected List<ParametersParameterComponent> parameter; 1429 1430 private static final long serialVersionUID = -1495940293L; 1431 1432 /** 1433 * Constructor 1434 */ 1435 public Parameters() { 1436 super(); 1437 } 1438 1439 /** 1440 * @return {@link #parameter} (A parameter passed to or received from the operation.) 1441 */ 1442 public List<ParametersParameterComponent> getParameter() { 1443 if (this.parameter == null) 1444 this.parameter = new ArrayList<ParametersParameterComponent>(); 1445 return this.parameter; 1446 } 1447 1448 /** 1449 * @return Returns a reference to <code>this</code> for easy method chaining 1450 */ 1451 public Parameters setParameter(List<ParametersParameterComponent> theParameter) { 1452 this.parameter = theParameter; 1453 return this; 1454 } 1455 1456 public boolean hasParameter() { 1457 if (this.parameter == null) 1458 return false; 1459 for (ParametersParameterComponent item : this.parameter) 1460 if (!item.isEmpty()) 1461 return true; 1462 return false; 1463 } 1464 1465 public ParametersParameterComponent addParameter() { //3 1466 ParametersParameterComponent t = new ParametersParameterComponent(); 1467 if (this.parameter == null) 1468 this.parameter = new ArrayList<ParametersParameterComponent>(); 1469 this.parameter.add(t); 1470 return t; 1471 } 1472 1473 public Parameters addParameter(ParametersParameterComponent t) { //3 1474 if (t == null) 1475 return this; 1476 if (this.parameter == null) 1477 this.parameter = new ArrayList<ParametersParameterComponent>(); 1478 this.parameter.add(t); 1479 return this; 1480 } 1481 1482 /** 1483 * @return The first repetition of repeating field {@link #parameter}, creating it if it does not already exist {3} 1484 */ 1485 public ParametersParameterComponent getParameterFirstRep() { 1486 if (getParameter().isEmpty()) { 1487 addParameter(); 1488 } 1489 return getParameter().get(0); 1490 } 1491 1492 protected void listChildren(List<Property> children) { 1493 super.listChildren(children); 1494 children.add(new Property("parameter", "", "A parameter passed to or received from the operation.", 0, java.lang.Integer.MAX_VALUE, parameter)); 1495 } 1496 1497 @Override 1498 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1499 switch (_hash) { 1500 case 1954460585: /*parameter*/ return new Property("parameter", "", "A parameter passed to or received from the operation.", 0, java.lang.Integer.MAX_VALUE, parameter); 1501 default: return super.getNamedProperty(_hash, _name, _checkValid); 1502 } 1503 1504 } 1505 1506 @Override 1507 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1508 switch (hash) { 1509 case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // ParametersParameterComponent 1510 default: return super.getProperty(hash, name, checkValid); 1511 } 1512 1513 } 1514 1515 @Override 1516 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1517 switch (hash) { 1518 case 1954460585: // parameter 1519 this.getParameter().add((ParametersParameterComponent) value); // ParametersParameterComponent 1520 return value; 1521 default: return super.setProperty(hash, name, value); 1522 } 1523 1524 } 1525 1526 @Override 1527 public Base setProperty(String name, Base value) throws FHIRException { 1528 if (name.equals("parameter")) { 1529 this.getParameter().add((ParametersParameterComponent) value); 1530 } else 1531 return super.setProperty(name, value); 1532 return value; 1533 } 1534 1535 @Override 1536 public Base makeProperty(int hash, String name) throws FHIRException { 1537 switch (hash) { 1538 case 1954460585: return addParameter(); 1539 default: return super.makeProperty(hash, name); 1540 } 1541 1542 } 1543 1544 @Override 1545 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1546 switch (hash) { 1547 case 1954460585: /*parameter*/ return new String[] {}; 1548 default: return super.getTypesForProperty(hash, name); 1549 } 1550 1551 } 1552 1553 @Override 1554 public Base addChild(String name) throws FHIRException { 1555 if (name.equals("parameter")) { 1556 return addParameter(); 1557 } 1558 else 1559 return super.addChild(name); 1560 } 1561 1562 public String fhirType() { 1563 return "Parameters"; 1564 1565 } 1566 1567 public Parameters copy() { 1568 Parameters dst = new Parameters(); 1569 copyValues(dst); 1570 return dst; 1571 } 1572 1573 public void copyValues(Parameters dst) { 1574 super.copyValues(dst); 1575 if (parameter != null) { 1576 dst.parameter = new ArrayList<ParametersParameterComponent>(); 1577 for (ParametersParameterComponent i : parameter) 1578 dst.parameter.add(i.copy()); 1579 }; 1580 } 1581 1582 protected Parameters typedCopy() { 1583 return copy(); 1584 } 1585 1586 @Override 1587 public boolean equalsDeep(Base other_) { 1588 if (!super.equalsDeep(other_)) 1589 return false; 1590 if (!(other_ instanceof Parameters)) 1591 return false; 1592 Parameters o = (Parameters) other_; 1593 return compareDeep(parameter, o.parameter, true); 1594 } 1595 1596 @Override 1597 public boolean equalsShallow(Base other_) { 1598 if (!super.equalsShallow(other_)) 1599 return false; 1600 if (!(other_ instanceof Parameters)) 1601 return false; 1602 Parameters o = (Parameters) other_; 1603 return true; 1604 } 1605 1606 public boolean isEmpty() { 1607 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(parameter); 1608 } 1609 1610 @Override 1611 public ResourceType getResourceType() { 1612 return ResourceType.Parameters; 1613 } 1614 1615// Manual code (from Configuration.txt): 1616public Parameters addParameter(String name, boolean b) { 1617 addParameter().setName(name).setValue(new BooleanType(b)); 1618 return this; 1619 } 1620 1621 public Parameters addParameter(String name, String s) { 1622 if (s != null) 1623 addParameter().setName(name).setValue(new StringType(s)); 1624 return this; 1625 } 1626 1627 public Parameters addParameter(String name, DataType v) { 1628 if (v != null) 1629 addParameter().setName(name).setValue(v); 1630 return this; 1631 } 1632 1633 public Parameters setParameter(String name, boolean b) { 1634 for (ParametersParameterComponent p : getParameter()) { 1635 if (p.getName().equals(name)) { 1636 p.setValue(new BooleanType(b)); 1637 return this; 1638 } 1639 } 1640 addParameter().setName(name).setValue(new BooleanType(b)); 1641 return this; 1642 } 1643 1644 public Parameters setParameter(String name, String s) { 1645 if (s != null) { 1646 for (ParametersParameterComponent p : getParameter()) { 1647 if (p.getName().equals(name)) { 1648 p.setValue(new StringType(s)); 1649 return this; 1650 } 1651 } 1652 addParameter().setName(name).setValue(new StringType(s)); 1653 } 1654 return this; 1655 } 1656 1657 public Parameters setParameter(String name, DataType v) { 1658 if (v != null) { 1659 for (ParametersParameterComponent p : getParameter() ) { 1660 if (p.getName().equals(name)) { 1661 p.setValue(v); 1662 return this; 1663 } 1664 } 1665 addParameter().setName(name).setValue(v); 1666 } 1667 return this; 1668 } 1669 1670 public boolean hasParameter(String name) { 1671 for (ParametersParameterComponent p : getParameter()) { 1672 if (p.getName().equals(name)) 1673 return true; 1674 } 1675 return false; 1676 } 1677 1678 public DataType getParameter(String name) { 1679 for (ParametersParameterComponent p : getParameter()) { 1680 if (p.getName().equals(name)) 1681 return p.getValue(); 1682 } 1683 return null; 1684 } 1685 1686 public List<DataType> getParameters(String name) { 1687 List<DataType> res = new ArrayList<>(); 1688 for (ParametersParameterComponent p : getParameter()) { 1689 if (p.getName().equals(name)) 1690 res.add(p.getValue()); 1691 } 1692 return res; 1693 } 1694 1695 1696 public boolean getParameterBool(String name) { 1697 for (ParametersParameterComponent p : getParameter()) { 1698 if (p.getName().equals(name)) { 1699 if (p.getValue() instanceof BooleanType) 1700 return ((BooleanType) p.getValue()).booleanValue(); 1701 boolean ok = Boolean.getBoolean(p.getValue().primitiveValue()); 1702 return ok; 1703 } 1704 } 1705 return false; 1706 } 1707// end addition 1708 1709} 1710