001package org.hl7.fhir.r4.model; 002 003/* 004 Copyright (c) 2011+, HL7, Inc. 005 All rights reserved. 006 007 Redistribution and use in source and binary forms, with or without modification, 008 are permitted provided that the following conditions are met: 009 010 * Redistributions of source code must retain the above copyright notice, this 011 list of conditions and the following disclaimer. 012 * Redistributions in binary form must reproduce the above copyright notice, 013 this list of conditions and the following disclaimer in the documentation 014 and/or other materials provided with the distribution. 015 * Neither the name of HL7 nor the names of its contributors may be used to 016 endorse or promote products derived from this software without specific 017 prior written permission. 018 019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 020 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 021 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 022 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 023 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 024 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 025 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 026 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 027 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 028 POSSIBILITY OF SUCH DAMAGE. 029 030*/ 031 032// Generated on Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0 033 034import java.util.*; 035 036import org.hl7.fhir.utilities.Utilities; 037import org.hl7.fhir.r4.model.Enumerations.*; 038import ca.uhn.fhir.model.api.annotation.Child; 039import ca.uhn.fhir.model.api.annotation.ChildOrder; 040import ca.uhn.fhir.model.api.annotation.Description; 041import ca.uhn.fhir.model.api.annotation.DatatypeDef; 042import ca.uhn.fhir.model.api.annotation.Block; 043import org.hl7.fhir.instance.model.api.*; 044import org.hl7.fhir.exceptions.FHIRException; 045/** 046 * The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse. 047 */ 048@DatatypeDef(name="ParameterDefinition") 049public class ParameterDefinition extends Type implements ICompositeType { 050 051 public enum ParameterUse { 052 /** 053 * This is an input parameter. 054 */ 055 IN, 056 /** 057 * This is an output parameter. 058 */ 059 OUT, 060 /** 061 * added to help the parsers with the generic types 062 */ 063 NULL; 064 public static ParameterUse fromCode(String codeString) throws FHIRException { 065 if (codeString == null || "".equals(codeString)) 066 return null; 067 if ("in".equals(codeString)) 068 return IN; 069 if ("out".equals(codeString)) 070 return OUT; 071 if (Configuration.isAcceptInvalidEnums()) 072 return null; 073 else 074 throw new FHIRException("Unknown ParameterUse code '"+codeString+"'"); 075 } 076 public String toCode() { 077 switch (this) { 078 case IN: return "in"; 079 case OUT: return "out"; 080 default: return "?"; 081 } 082 } 083 public String getSystem() { 084 switch (this) { 085 case IN: return "http://hl7.org/fhir/operation-parameter-use"; 086 case OUT: return "http://hl7.org/fhir/operation-parameter-use"; 087 default: return "?"; 088 } 089 } 090 public String getDefinition() { 091 switch (this) { 092 case IN: return "This is an input parameter."; 093 case OUT: return "This is an output parameter."; 094 default: return "?"; 095 } 096 } 097 public String getDisplay() { 098 switch (this) { 099 case IN: return "In"; 100 case OUT: return "Out"; 101 default: return "?"; 102 } 103 } 104 } 105 106 public static class ParameterUseEnumFactory implements EnumFactory<ParameterUse> { 107 public ParameterUse fromCode(String codeString) throws IllegalArgumentException { 108 if (codeString == null || "".equals(codeString)) 109 if (codeString == null || "".equals(codeString)) 110 return null; 111 if ("in".equals(codeString)) 112 return ParameterUse.IN; 113 if ("out".equals(codeString)) 114 return ParameterUse.OUT; 115 throw new IllegalArgumentException("Unknown ParameterUse code '"+codeString+"'"); 116 } 117 public Enumeration<ParameterUse> fromType(Base code) throws FHIRException { 118 if (code == null) 119 return null; 120 if (code.isEmpty()) 121 return new Enumeration<ParameterUse>(this); 122 String codeString = ((PrimitiveType) code).asStringValue(); 123 if (codeString == null || "".equals(codeString)) 124 return null; 125 if ("in".equals(codeString)) 126 return new Enumeration<ParameterUse>(this, ParameterUse.IN); 127 if ("out".equals(codeString)) 128 return new Enumeration<ParameterUse>(this, ParameterUse.OUT); 129 throw new FHIRException("Unknown ParameterUse code '"+codeString+"'"); 130 } 131 public String toCode(ParameterUse code) { 132 if (code == ParameterUse.IN) 133 return "in"; 134 if (code == ParameterUse.OUT) 135 return "out"; 136 return "?"; 137 } 138 public String toSystem(ParameterUse code) { 139 return code.getSystem(); 140 } 141 } 142 143 /** 144 * The name of the parameter used to allow access to the value of the parameter in evaluation contexts. 145 */ 146 @Child(name = "name", type = {CodeType.class}, order=0, min=0, max=1, modifier=false, summary=true) 147 @Description(shortDefinition="Name used to access the parameter value", formalDefinition="The name of the parameter used to allow access to the value of the parameter in evaluation contexts." ) 148 protected CodeType name; 149 150 /** 151 * Whether the parameter is input or output for the module. 152 */ 153 @Child(name = "use", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) 154 @Description(shortDefinition="in | out", formalDefinition="Whether the parameter is input or output for the module." ) 155 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/operation-parameter-use") 156 protected Enumeration<ParameterUse> use; 157 158 /** 159 * The minimum number of times this parameter SHALL appear in the request or response. 160 */ 161 @Child(name = "min", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) 162 @Description(shortDefinition="Minimum cardinality", formalDefinition="The minimum number of times this parameter SHALL appear in the request or response." ) 163 protected IntegerType min; 164 165 /** 166 * The maximum number of times this element is permitted to appear in the request or response. 167 */ 168 @Child(name = "max", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) 169 @Description(shortDefinition="Maximum cardinality (a number of *)", formalDefinition="The maximum number of times this element is permitted to appear in the request or response." ) 170 protected StringType max; 171 172 /** 173 * A brief discussion of what the parameter is for and how it is used by the module. 174 */ 175 @Child(name = "documentation", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) 176 @Description(shortDefinition="A brief description of the parameter", formalDefinition="A brief discussion of what the parameter is for and how it is used by the module." ) 177 protected StringType documentation; 178 179 /** 180 * The type of the parameter. 181 */ 182 @Child(name = "type", type = {CodeType.class}, order=5, min=1, max=1, modifier=false, summary=true) 183 @Description(shortDefinition="What type of value", formalDefinition="The type of the parameter." ) 184 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/all-types") 185 protected CodeType type; 186 187 /** 188 * If specified, this indicates a profile that the input data must conform to, or that the output data will conform to. 189 */ 190 @Child(name = "profile", type = {CanonicalType.class}, order=6, min=0, max=1, modifier=false, summary=true) 191 @Description(shortDefinition="What profile the value is expected to be", formalDefinition="If specified, this indicates a profile that the input data must conform to, or that the output data will conform to." ) 192 protected CanonicalType profile; 193 194 private static final long serialVersionUID = -1891730734L; 195 196 /** 197 * Constructor 198 */ 199 public ParameterDefinition() { 200 super(); 201 } 202 203 /** 204 * Constructor 205 */ 206 public ParameterDefinition(Enumeration<ParameterUse> use, CodeType type) { 207 super(); 208 this.use = use; 209 this.type = type; 210 } 211 212 /** 213 * @return {@link #name} (The name of the parameter used to allow access to the value of the parameter in evaluation contexts.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 214 */ 215 public CodeType getNameElement() { 216 if (this.name == null) 217 if (Configuration.errorOnAutoCreate()) 218 throw new Error("Attempt to auto-create ParameterDefinition.name"); 219 else if (Configuration.doAutoCreate()) 220 this.name = new CodeType(); // bb 221 return this.name; 222 } 223 224 public boolean hasNameElement() { 225 return this.name != null && !this.name.isEmpty(); 226 } 227 228 public boolean hasName() { 229 return this.name != null && !this.name.isEmpty(); 230 } 231 232 /** 233 * @param value {@link #name} (The name of the parameter used to allow access to the value of the parameter in evaluation contexts.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 234 */ 235 public ParameterDefinition setNameElement(CodeType value) { 236 this.name = value; 237 return this; 238 } 239 240 /** 241 * @return The name of the parameter used to allow access to the value of the parameter in evaluation contexts. 242 */ 243 public String getName() { 244 return this.name == null ? null : this.name.getValue(); 245 } 246 247 /** 248 * @param value The name of the parameter used to allow access to the value of the parameter in evaluation contexts. 249 */ 250 public ParameterDefinition setName(String value) { 251 if (Utilities.noString(value)) 252 this.name = null; 253 else { 254 if (this.name == null) 255 this.name = new CodeType(); 256 this.name.setValue(value); 257 } 258 return this; 259 } 260 261 /** 262 * @return {@link #use} (Whether the parameter is input or output for the module.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value 263 */ 264 public Enumeration<ParameterUse> getUseElement() { 265 if (this.use == null) 266 if (Configuration.errorOnAutoCreate()) 267 throw new Error("Attempt to auto-create ParameterDefinition.use"); 268 else if (Configuration.doAutoCreate()) 269 this.use = new Enumeration<ParameterUse>(new ParameterUseEnumFactory()); // bb 270 return this.use; 271 } 272 273 public boolean hasUseElement() { 274 return this.use != null && !this.use.isEmpty(); 275 } 276 277 public boolean hasUse() { 278 return this.use != null && !this.use.isEmpty(); 279 } 280 281 /** 282 * @param value {@link #use} (Whether the parameter is input or output for the module.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value 283 */ 284 public ParameterDefinition setUseElement(Enumeration<ParameterUse> value) { 285 this.use = value; 286 return this; 287 } 288 289 /** 290 * @return Whether the parameter is input or output for the module. 291 */ 292 public ParameterUse getUse() { 293 return this.use == null ? null : this.use.getValue(); 294 } 295 296 /** 297 * @param value Whether the parameter is input or output for the module. 298 */ 299 public ParameterDefinition setUse(ParameterUse value) { 300 if (this.use == null) 301 this.use = new Enumeration<ParameterUse>(new ParameterUseEnumFactory()); 302 this.use.setValue(value); 303 return this; 304 } 305 306 /** 307 * @return {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value 308 */ 309 public IntegerType getMinElement() { 310 if (this.min == null) 311 if (Configuration.errorOnAutoCreate()) 312 throw new Error("Attempt to auto-create ParameterDefinition.min"); 313 else if (Configuration.doAutoCreate()) 314 this.min = new IntegerType(); // bb 315 return this.min; 316 } 317 318 public boolean hasMinElement() { 319 return this.min != null && !this.min.isEmpty(); 320 } 321 322 public boolean hasMin() { 323 return this.min != null && !this.min.isEmpty(); 324 } 325 326 /** 327 * @param value {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value 328 */ 329 public ParameterDefinition setMinElement(IntegerType value) { 330 this.min = value; 331 return this; 332 } 333 334 /** 335 * @return The minimum number of times this parameter SHALL appear in the request or response. 336 */ 337 public int getMin() { 338 return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue(); 339 } 340 341 /** 342 * @param value The minimum number of times this parameter SHALL appear in the request or response. 343 */ 344 public ParameterDefinition setMin(int value) { 345 if (this.min == null) 346 this.min = new IntegerType(); 347 this.min.setValue(value); 348 return this; 349 } 350 351 /** 352 * @return {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value 353 */ 354 public StringType getMaxElement() { 355 if (this.max == null) 356 if (Configuration.errorOnAutoCreate()) 357 throw new Error("Attempt to auto-create ParameterDefinition.max"); 358 else if (Configuration.doAutoCreate()) 359 this.max = new StringType(); // bb 360 return this.max; 361 } 362 363 public boolean hasMaxElement() { 364 return this.max != null && !this.max.isEmpty(); 365 } 366 367 public boolean hasMax() { 368 return this.max != null && !this.max.isEmpty(); 369 } 370 371 /** 372 * @param value {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value 373 */ 374 public ParameterDefinition setMaxElement(StringType value) { 375 this.max = value; 376 return this; 377 } 378 379 /** 380 * @return The maximum number of times this element is permitted to appear in the request or response. 381 */ 382 public String getMax() { 383 return this.max == null ? null : this.max.getValue(); 384 } 385 386 /** 387 * @param value The maximum number of times this element is permitted to appear in the request or response. 388 */ 389 public ParameterDefinition setMax(String value) { 390 if (Utilities.noString(value)) 391 this.max = null; 392 else { 393 if (this.max == null) 394 this.max = new StringType(); 395 this.max.setValue(value); 396 } 397 return this; 398 } 399 400 /** 401 * @return {@link #documentation} (A brief discussion of what the parameter is for and how it is used by the module.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value 402 */ 403 public StringType getDocumentationElement() { 404 if (this.documentation == null) 405 if (Configuration.errorOnAutoCreate()) 406 throw new Error("Attempt to auto-create ParameterDefinition.documentation"); 407 else if (Configuration.doAutoCreate()) 408 this.documentation = new StringType(); // bb 409 return this.documentation; 410 } 411 412 public boolean hasDocumentationElement() { 413 return this.documentation != null && !this.documentation.isEmpty(); 414 } 415 416 public boolean hasDocumentation() { 417 return this.documentation != null && !this.documentation.isEmpty(); 418 } 419 420 /** 421 * @param value {@link #documentation} (A brief discussion of what the parameter is for and how it is used by the module.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value 422 */ 423 public ParameterDefinition setDocumentationElement(StringType value) { 424 this.documentation = value; 425 return this; 426 } 427 428 /** 429 * @return A brief discussion of what the parameter is for and how it is used by the module. 430 */ 431 public String getDocumentation() { 432 return this.documentation == null ? null : this.documentation.getValue(); 433 } 434 435 /** 436 * @param value A brief discussion of what the parameter is for and how it is used by the module. 437 */ 438 public ParameterDefinition setDocumentation(String value) { 439 if (Utilities.noString(value)) 440 this.documentation = null; 441 else { 442 if (this.documentation == null) 443 this.documentation = new StringType(); 444 this.documentation.setValue(value); 445 } 446 return this; 447 } 448 449 /** 450 * @return {@link #type} (The type of the parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value 451 */ 452 public CodeType getTypeElement() { 453 if (this.type == null) 454 if (Configuration.errorOnAutoCreate()) 455 throw new Error("Attempt to auto-create ParameterDefinition.type"); 456 else if (Configuration.doAutoCreate()) 457 this.type = new CodeType(); // bb 458 return this.type; 459 } 460 461 public boolean hasTypeElement() { 462 return this.type != null && !this.type.isEmpty(); 463 } 464 465 public boolean hasType() { 466 return this.type != null && !this.type.isEmpty(); 467 } 468 469 /** 470 * @param value {@link #type} (The type of the parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value 471 */ 472 public ParameterDefinition setTypeElement(CodeType value) { 473 this.type = value; 474 return this; 475 } 476 477 /** 478 * @return The type of the parameter. 479 */ 480 public String getType() { 481 return this.type == null ? null : this.type.getValue(); 482 } 483 484 /** 485 * @param value The type of the parameter. 486 */ 487 public ParameterDefinition setType(String value) { 488 if (this.type == null) 489 this.type = new CodeType(); 490 this.type.setValue(value); 491 return this; 492 } 493 494 /** 495 * @return {@link #profile} (If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.). This is the underlying object with id, value and extensions. The accessor "getProfile" gives direct access to the value 496 */ 497 public CanonicalType getProfileElement() { 498 if (this.profile == null) 499 if (Configuration.errorOnAutoCreate()) 500 throw new Error("Attempt to auto-create ParameterDefinition.profile"); 501 else if (Configuration.doAutoCreate()) 502 this.profile = new CanonicalType(); // bb 503 return this.profile; 504 } 505 506 public boolean hasProfileElement() { 507 return this.profile != null && !this.profile.isEmpty(); 508 } 509 510 public boolean hasProfile() { 511 return this.profile != null && !this.profile.isEmpty(); 512 } 513 514 /** 515 * @param value {@link #profile} (If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.). This is the underlying object with id, value and extensions. The accessor "getProfile" gives direct access to the value 516 */ 517 public ParameterDefinition setProfileElement(CanonicalType value) { 518 this.profile = value; 519 return this; 520 } 521 522 /** 523 * @return If specified, this indicates a profile that the input data must conform to, or that the output data will conform to. 524 */ 525 public String getProfile() { 526 return this.profile == null ? null : this.profile.getValue(); 527 } 528 529 /** 530 * @param value If specified, this indicates a profile that the input data must conform to, or that the output data will conform to. 531 */ 532 public ParameterDefinition setProfile(String value) { 533 if (Utilities.noString(value)) 534 this.profile = null; 535 else { 536 if (this.profile == null) 537 this.profile = new CanonicalType(); 538 this.profile.setValue(value); 539 } 540 return this; 541 } 542 543 protected void listChildren(List<Property> children) { 544 super.listChildren(children); 545 children.add(new Property("name", "code", "The name of the parameter used to allow access to the value of the parameter in evaluation contexts.", 0, 1, name)); 546 children.add(new Property("use", "code", "Whether the parameter is input or output for the module.", 0, 1, use)); 547 children.add(new Property("min", "integer", "The minimum number of times this parameter SHALL appear in the request or response.", 0, 1, min)); 548 children.add(new Property("max", "string", "The maximum number of times this element is permitted to appear in the request or response.", 0, 1, max)); 549 children.add(new Property("documentation", "string", "A brief discussion of what the parameter is for and how it is used by the module.", 0, 1, documentation)); 550 children.add(new Property("type", "code", "The type of the parameter.", 0, 1, type)); 551 children.add(new Property("profile", "canonical(StructureDefinition)", "If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.", 0, 1, profile)); 552 } 553 554 @Override 555 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 556 switch (_hash) { 557 case 3373707: /*name*/ return new Property("name", "code", "The name of the parameter used to allow access to the value of the parameter in evaluation contexts.", 0, 1, name); 558 case 116103: /*use*/ return new Property("use", "code", "Whether the parameter is input or output for the module.", 0, 1, use); 559 case 108114: /*min*/ return new Property("min", "integer", "The minimum number of times this parameter SHALL appear in the request or response.", 0, 1, min); 560 case 107876: /*max*/ return new Property("max", "string", "The maximum number of times this element is permitted to appear in the request or response.", 0, 1, max); 561 case 1587405498: /*documentation*/ return new Property("documentation", "string", "A brief discussion of what the parameter is for and how it is used by the module.", 0, 1, documentation); 562 case 3575610: /*type*/ return new Property("type", "code", "The type of the parameter.", 0, 1, type); 563 case -309425751: /*profile*/ return new Property("profile", "canonical(StructureDefinition)", "If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.", 0, 1, profile); 564 default: return super.getNamedProperty(_hash, _name, _checkValid); 565 } 566 567 } 568 569 @Override 570 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 571 switch (hash) { 572 case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // CodeType 573 case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Enumeration<ParameterUse> 574 case 108114: /*min*/ return this.min == null ? new Base[0] : new Base[] {this.min}; // IntegerType 575 case 107876: /*max*/ return this.max == null ? new Base[0] : new Base[] {this.max}; // StringType 576 case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType 577 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType 578 case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // CanonicalType 579 default: return super.getProperty(hash, name, checkValid); 580 } 581 582 } 583 584 @Override 585 public Base setProperty(int hash, String name, Base value) throws FHIRException { 586 switch (hash) { 587 case 3373707: // name 588 this.name = castToCode(value); // CodeType 589 return value; 590 case 116103: // use 591 value = new ParameterUseEnumFactory().fromType(castToCode(value)); 592 this.use = (Enumeration) value; // Enumeration<ParameterUse> 593 return value; 594 case 108114: // min 595 this.min = castToInteger(value); // IntegerType 596 return value; 597 case 107876: // max 598 this.max = castToString(value); // StringType 599 return value; 600 case 1587405498: // documentation 601 this.documentation = castToString(value); // StringType 602 return value; 603 case 3575610: // type 604 this.type = castToCode(value); // CodeType 605 return value; 606 case -309425751: // profile 607 this.profile = castToCanonical(value); // CanonicalType 608 return value; 609 default: return super.setProperty(hash, name, value); 610 } 611 612 } 613 614 @Override 615 public Base setProperty(String name, Base value) throws FHIRException { 616 if (name.equals("name")) { 617 this.name = castToCode(value); // CodeType 618 } else if (name.equals("use")) { 619 value = new ParameterUseEnumFactory().fromType(castToCode(value)); 620 this.use = (Enumeration) value; // Enumeration<ParameterUse> 621 } else if (name.equals("min")) { 622 this.min = castToInteger(value); // IntegerType 623 } else if (name.equals("max")) { 624 this.max = castToString(value); // StringType 625 } else if (name.equals("documentation")) { 626 this.documentation = castToString(value); // StringType 627 } else if (name.equals("type")) { 628 this.type = castToCode(value); // CodeType 629 } else if (name.equals("profile")) { 630 this.profile = castToCanonical(value); // CanonicalType 631 } else 632 return super.setProperty(name, value); 633 return value; 634 } 635 636 @Override 637 public Base makeProperty(int hash, String name) throws FHIRException { 638 switch (hash) { 639 case 3373707: return getNameElement(); 640 case 116103: return getUseElement(); 641 case 108114: return getMinElement(); 642 case 107876: return getMaxElement(); 643 case 1587405498: return getDocumentationElement(); 644 case 3575610: return getTypeElement(); 645 case -309425751: return getProfileElement(); 646 default: return super.makeProperty(hash, name); 647 } 648 649 } 650 651 @Override 652 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 653 switch (hash) { 654 case 3373707: /*name*/ return new String[] {"code"}; 655 case 116103: /*use*/ return new String[] {"code"}; 656 case 108114: /*min*/ return new String[] {"integer"}; 657 case 107876: /*max*/ return new String[] {"string"}; 658 case 1587405498: /*documentation*/ return new String[] {"string"}; 659 case 3575610: /*type*/ return new String[] {"code"}; 660 case -309425751: /*profile*/ return new String[] {"canonical"}; 661 default: return super.getTypesForProperty(hash, name); 662 } 663 664 } 665 666 @Override 667 public Base addChild(String name) throws FHIRException { 668 if (name.equals("name")) { 669 throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.name"); 670 } 671 else if (name.equals("use")) { 672 throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.use"); 673 } 674 else if (name.equals("min")) { 675 throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.min"); 676 } 677 else if (name.equals("max")) { 678 throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.max"); 679 } 680 else if (name.equals("documentation")) { 681 throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.documentation"); 682 } 683 else if (name.equals("type")) { 684 throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.type"); 685 } 686 else if (name.equals("profile")) { 687 throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.profile"); 688 } 689 else 690 return super.addChild(name); 691 } 692 693 public String fhirType() { 694 return "ParameterDefinition"; 695 696 } 697 698 public ParameterDefinition copy() { 699 ParameterDefinition dst = new ParameterDefinition(); 700 copyValues(dst); 701 dst.name = name == null ? null : name.copy(); 702 dst.use = use == null ? null : use.copy(); 703 dst.min = min == null ? null : min.copy(); 704 dst.max = max == null ? null : max.copy(); 705 dst.documentation = documentation == null ? null : documentation.copy(); 706 dst.type = type == null ? null : type.copy(); 707 dst.profile = profile == null ? null : profile.copy(); 708 return dst; 709 } 710 711 protected ParameterDefinition typedCopy() { 712 return copy(); 713 } 714 715 @Override 716 public boolean equalsDeep(Base other_) { 717 if (!super.equalsDeep(other_)) 718 return false; 719 if (!(other_ instanceof ParameterDefinition)) 720 return false; 721 ParameterDefinition o = (ParameterDefinition) other_; 722 return compareDeep(name, o.name, true) && compareDeep(use, o.use, true) && compareDeep(min, o.min, true) 723 && compareDeep(max, o.max, true) && compareDeep(documentation, o.documentation, true) && compareDeep(type, o.type, true) 724 && compareDeep(profile, o.profile, true); 725 } 726 727 @Override 728 public boolean equalsShallow(Base other_) { 729 if (!super.equalsShallow(other_)) 730 return false; 731 if (!(other_ instanceof ParameterDefinition)) 732 return false; 733 ParameterDefinition o = (ParameterDefinition) other_; 734 return compareValues(name, o.name, true) && compareValues(use, o.use, true) && compareValues(min, o.min, true) 735 && compareValues(max, o.max, true) && compareValues(documentation, o.documentation, true) && compareValues(type, o.type, true) 736 ; 737 } 738 739 public boolean isEmpty() { 740 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, use, min, max, documentation 741 , type, profile); 742 } 743 744 745} 746