
001package org.hl7.fhir.r5.tools; 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 Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0 033 034import java.util.ArrayList; 035import java.util.Date; 036import java.util.List; 037import org.hl7.fhir.utilities.Utilities; 038import org.hl7.fhir.r5.tools.Enumerations.*; 039import org.hl7.fhir.exceptions.FHIRException; 040import org.hl7.fhir.r5.model.*; 041import org.hl7.fhir.instance.model.api.ICompositeType; 042import ca.uhn.fhir.model.api.annotation.Child; 043import ca.uhn.fhir.model.api.annotation.ChildOrder; 044import ca.uhn.fhir.model.api.annotation.DatatypeDef; 045import ca.uhn.fhir.model.api.annotation.Description; 046import ca.uhn.fhir.model.api.annotation.Block; 047 048/** 049 * A standard format for test cases used throughout the FHIR ecosystem 050 */ 051@DatatypeDef(name="TestCases") 052public class TestCases extends Resource implements ICompositeType { 053 054 @Block() 055 public static class TestCasesModeComponent extends LogicalBase { 056 /** 057 * The code by which the mode is identified when passed to runner 058 */ 059 @Child(name = "code", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) 060 @Description(shortDefinition="The code that identifies the mode", formalDefinition="The code by which the mode is identified when passed to runner" ) 061 protected StringType code; 062 063 /** 064 * Description of what this mode does / why it was defined. This should explain to a tester when they should use the mode 065 */ 066 @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) 067 @Description(shortDefinition="Description of what this mode exists / why it was defined", formalDefinition="Description of what this mode does / why it was defined. This should explain to a tester when they should use the mode" ) 068 protected StringType description; 069 070 private static final long serialVersionUID = 1295492279L; 071 072 /** 073 * Constructor 074 */ 075 public TestCasesModeComponent() { 076 super(); 077 } 078 079 /** 080 * Constructor 081 */ 082 public TestCasesModeComponent(String code) { 083 super(); 084 this.setCode(code); 085 } 086 087 /** 088 * @return {@link #code} (The code by which the mode is identified when passed to runner). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value 089 */ 090 public StringType getCodeElement() { 091 if (this.code == null) 092 if (Configuration.errorOnAutoCreate()) 093 throw new Error("Attempt to auto-create TestCasesModeComponent.code"); 094 else if (Configuration.doAutoCreate()) 095 this.code = new StringType(); // bb 096 return this.code; 097 } 098 099 public boolean hasCodeElement() { 100 return this.code != null && !this.code.isEmpty(); 101 } 102 103 public boolean hasCode() { 104 return this.code != null && !this.code.isEmpty(); 105 } 106 107 /** 108 * @param value {@link #code} (The code by which the mode is identified when passed to runner). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value 109 */ 110 public TestCasesModeComponent setCodeElement(StringType value) { 111 this.code = value; 112 return this; 113 } 114 115 /** 116 * @return The code by which the mode is identified when passed to runner 117 */ 118 public String getCode() { 119 return this.code == null ? null : this.code.getValue(); 120 } 121 122 /** 123 * @param value The code by which the mode is identified when passed to runner 124 */ 125 public TestCasesModeComponent setCode(String value) { 126 if (this.code == null) 127 this.code = new StringType(); 128 this.code.setValue(value); 129 return this; 130 } 131 132 /** 133 * @return {@link #description} (Description of what this mode does / why it was defined. This should explain to a tester when they should use the mode). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 134 */ 135 public StringType getDescriptionElement() { 136 if (this.description == null) 137 if (Configuration.errorOnAutoCreate()) 138 throw new Error("Attempt to auto-create TestCasesModeComponent.description"); 139 else if (Configuration.doAutoCreate()) 140 this.description = new StringType(); // bb 141 return this.description; 142 } 143 144 public boolean hasDescriptionElement() { 145 return this.description != null && !this.description.isEmpty(); 146 } 147 148 public boolean hasDescription() { 149 return this.description != null && !this.description.isEmpty(); 150 } 151 152 /** 153 * @param value {@link #description} (Description of what this mode does / why it was defined. This should explain to a tester when they should use the mode). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 154 */ 155 public TestCasesModeComponent setDescriptionElement(StringType value) { 156 this.description = value; 157 return this; 158 } 159 160 /** 161 * @return Description of what this mode does / why it was defined. This should explain to a tester when they should use the mode 162 */ 163 public String getDescription() { 164 return this.description == null ? null : this.description.getValue(); 165 } 166 167 /** 168 * @param value Description of what this mode does / why it was defined. This should explain to a tester when they should use the mode 169 */ 170 public TestCasesModeComponent setDescription(String value) { 171 if (Utilities.noString(value)) 172 this.description = null; 173 else { 174 if (this.description == null) 175 this.description = new StringType(); 176 this.description.setValue(value); 177 } 178 return this; 179 } 180 181 protected void listChildren(List<Property> children) { 182 super.listChildren(children); 183 children.add(new Property("code", "string", "The code by which the mode is identified when passed to runner", 0, 1, code)); 184 children.add(new Property("description", "string", "Description of what this mode does / why it was defined. This should explain to a tester when they should use the mode", 0, 1, description)); 185 } 186 187 @Override 188 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 189 switch (_hash) { 190 case 3059181: /*code*/ return new Property("code", "string", "The code by which the mode is identified when passed to runner", 0, 1, code); 191 case -1724546052: /*description*/ return new Property("description", "string", "Description of what this mode does / why it was defined. This should explain to a tester when they should use the mode", 0, 1, description); 192 default: return super.getNamedProperty(_hash, _name, _checkValid); 193 } 194 195 } 196 197 @Override 198 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 199 switch (hash) { 200 case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // StringType 201 case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType 202 default: return super.getProperty(hash, name, checkValid); 203 } 204 205 } 206 207 @Override 208 public Base setProperty(int hash, String name, Base value) throws FHIRException { 209 switch (hash) { 210 case 3059181: // code 211 this.code = TypeConvertor.castToString(value); // StringType 212 return value; 213 case -1724546052: // description 214 this.description = TypeConvertor.castToString(value); // StringType 215 return value; 216 default: return super.setProperty(hash, name, value); 217 } 218 219 } 220 221 @Override 222 public Base setProperty(String name, Base value) throws FHIRException { 223 if (name.equals("code")) { 224 this.code = TypeConvertor.castToString(value); // StringType 225 } else if (name.equals("description")) { 226 this.description = TypeConvertor.castToString(value); // StringType 227 } else 228 return super.setProperty(name, value); 229 return value; 230 } 231 232 @Override 233 public Base makeProperty(int hash, String name) throws FHIRException { 234 switch (hash) { 235 case 3059181: return getCodeElement(); 236 case -1724546052: return getDescriptionElement(); 237 default: return super.makeProperty(hash, name); 238 } 239 240 } 241 242 @Override 243 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 244 switch (hash) { 245 case 3059181: /*code*/ return new String[] {"string"}; 246 case -1724546052: /*description*/ return new String[] {"string"}; 247 default: return super.getTypesForProperty(hash, name); 248 } 249 250 } 251 252 @Override 253 public Base addChild(String name) throws FHIRException { 254 if (name.equals("code")) { 255 throw new FHIRException("Cannot call addChild on a singleton property TestCases.mode.code"); 256 } 257 else if (name.equals("description")) { 258 throw new FHIRException("Cannot call addChild on a singleton property TestCases.mode.description"); 259 } 260 else 261 return super.addChild(name); 262 } 263 264 public TestCasesModeComponent copy() { 265 TestCasesModeComponent dst = new TestCasesModeComponent(); 266 copyValues(dst); 267 return dst; 268 } 269 270 public void copyValues(TestCasesModeComponent dst) { 271 super.copyValues(dst); 272 dst.code = code == null ? null : code.copy(); 273 dst.description = description == null ? null : description.copy(); 274 } 275 276 @Override 277 public boolean equalsDeep(Base other_) { 278 if (!super.equalsDeep(other_)) 279 return false; 280 if (!(other_ instanceof TestCasesModeComponent)) 281 return false; 282 TestCasesModeComponent o = (TestCasesModeComponent) other_; 283 return compareDeep(code, o.code, true) && compareDeep(description, o.description, true); 284 } 285 286 @Override 287 public boolean equalsShallow(Base other_) { 288 if (!super.equalsShallow(other_)) 289 return false; 290 if (!(other_ instanceof TestCasesModeComponent)) 291 return false; 292 TestCasesModeComponent o = (TestCasesModeComponent) other_; 293 return compareValues(code, o.code, true) && compareValues(description, o.description, true); 294 } 295 296 public boolean isEmpty() { 297 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, description); 298 } 299 300 public String fhirType() { 301 return "TestCases.mode"; 302 303 } 304 305 } 306 307 @Block() 308 public static class TestCasesSuiteComponent extends LogicalBase { 309 /** 310 * The name by which this suite is known by in the test system. The name must be unique in the amongst the suites 311 */ 312 @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) 313 @Description(shortDefinition="The name of this suite - unique in the TestCases resource", formalDefinition="The name by which this suite is known by in the test system. The name must be unique in the amongst the suites" ) 314 protected StringType name; 315 316 /** 317 * Description of what this suite does / why it was defined. This should explain to a tester what they should know when deciding which tests to run 318 */ 319 @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) 320 @Description(shortDefinition="Description of what this suite does / why it was defined", formalDefinition="Description of what this suite does / why it was defined. This should explain to a tester what they should know when deciding which tests to run" ) 321 protected StringType description; 322 323 /** 324 * If this mode is not passed to the runner, then this suite will not be run 325 */ 326 @Child(name = "mode", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false) 327 @Description(shortDefinition="mode required to run this suite", formalDefinition="If this mode is not passed to the runner, then this suite will not be run" ) 328 protected CodeType mode; 329 330 /** 331 * The resources used in the tests in this suite. How exactly they are used depends on the definition of the runner 332 */ 333 @Child(name = "resource", type = {Base.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 334 @Description(shortDefinition="Resources used in the tests in this suite", formalDefinition="The resources used in the tests in this suite. How exactly they are used depends on the definition of the runner" ) 335 protected List<TestCasesSuiteResourceComponent> resource; 336 337 /** 338 * A parameter passed to the runner when executing tests. Which parameters are valid, and how exactly the parameter is used are used depends on the definition of the runner 339 */ 340 @Child(name = "parameter", type = {Base.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 341 @Description(shortDefinition="Parameter passed to the runner", formalDefinition="A parameter passed to the runner when executing tests. Which parameters are valid, and how exactly the parameter is used are used depends on the definition of the runner" ) 342 protected List<TestCasesSuiteParameterComponent> parameter; 343 344 /** 345 * An actual test in the test suite 346 */ 347 @Child(name = "test", type = {Base.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 348 @Description(shortDefinition="A test in the test suite", formalDefinition="An actual test in the test suite" ) 349 protected List<TestCasesSuiteTestComponent> test; 350 351 private static final long serialVersionUID = -1929975715L; 352 353 /** 354 * Constructor 355 */ 356 public TestCasesSuiteComponent() { 357 super(); 358 } 359 360 /** 361 * Constructor 362 */ 363 public TestCasesSuiteComponent(String name) { 364 super(); 365 this.setName(name); 366 } 367 368 /** 369 * @return {@link #name} (The name by which this suite is known by in the test system. The name must be unique in the amongst the suites). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 370 */ 371 public StringType getNameElement() { 372 if (this.name == null) 373 if (Configuration.errorOnAutoCreate()) 374 throw new Error("Attempt to auto-create TestCasesSuiteComponent.name"); 375 else if (Configuration.doAutoCreate()) 376 this.name = new StringType(); // bb 377 return this.name; 378 } 379 380 public boolean hasNameElement() { 381 return this.name != null && !this.name.isEmpty(); 382 } 383 384 public boolean hasName() { 385 return this.name != null && !this.name.isEmpty(); 386 } 387 388 /** 389 * @param value {@link #name} (The name by which this suite is known by in the test system. The name must be unique in the amongst the suites). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 390 */ 391 public TestCasesSuiteComponent setNameElement(StringType value) { 392 this.name = value; 393 return this; 394 } 395 396 /** 397 * @return The name by which this suite is known by in the test system. The name must be unique in the amongst the suites 398 */ 399 public String getName() { 400 return this.name == null ? null : this.name.getValue(); 401 } 402 403 /** 404 * @param value The name by which this suite is known by in the test system. The name must be unique in the amongst the suites 405 */ 406 public TestCasesSuiteComponent setName(String value) { 407 if (this.name == null) 408 this.name = new StringType(); 409 this.name.setValue(value); 410 return this; 411 } 412 413 /** 414 * @return {@link #description} (Description of what this suite does / why it was defined. This should explain to a tester what they should know when deciding which tests to run). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 415 */ 416 public StringType getDescriptionElement() { 417 if (this.description == null) 418 if (Configuration.errorOnAutoCreate()) 419 throw new Error("Attempt to auto-create TestCasesSuiteComponent.description"); 420 else if (Configuration.doAutoCreate()) 421 this.description = new StringType(); // bb 422 return this.description; 423 } 424 425 public boolean hasDescriptionElement() { 426 return this.description != null && !this.description.isEmpty(); 427 } 428 429 public boolean hasDescription() { 430 return this.description != null && !this.description.isEmpty(); 431 } 432 433 /** 434 * @param value {@link #description} (Description of what this suite does / why it was defined. This should explain to a tester what they should know when deciding which tests to run). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 435 */ 436 public TestCasesSuiteComponent setDescriptionElement(StringType value) { 437 this.description = value; 438 return this; 439 } 440 441 /** 442 * @return Description of what this suite does / why it was defined. This should explain to a tester what they should know when deciding which tests to run 443 */ 444 public String getDescription() { 445 return this.description == null ? null : this.description.getValue(); 446 } 447 448 /** 449 * @param value Description of what this suite does / why it was defined. This should explain to a tester what they should know when deciding which tests to run 450 */ 451 public TestCasesSuiteComponent setDescription(String value) { 452 if (Utilities.noString(value)) 453 this.description = null; 454 else { 455 if (this.description == null) 456 this.description = new StringType(); 457 this.description.setValue(value); 458 } 459 return this; 460 } 461 462 /** 463 * @return {@link #mode} (If this mode is not passed to the runner, then this suite will not be run). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value 464 */ 465 public CodeType getModeElement() { 466 if (this.mode == null) 467 if (Configuration.errorOnAutoCreate()) 468 throw new Error("Attempt to auto-create TestCasesSuiteComponent.mode"); 469 else if (Configuration.doAutoCreate()) 470 this.mode = new CodeType(); // bb 471 return this.mode; 472 } 473 474 public boolean hasModeElement() { 475 return this.mode != null && !this.mode.isEmpty(); 476 } 477 478 public boolean hasMode() { 479 return this.mode != null && !this.mode.isEmpty(); 480 } 481 482 /** 483 * @param value {@link #mode} (If this mode is not passed to the runner, then this suite will not be run). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value 484 */ 485 public TestCasesSuiteComponent setModeElement(CodeType value) { 486 this.mode = value; 487 return this; 488 } 489 490 /** 491 * @return If this mode is not passed to the runner, then this suite will not be run 492 */ 493 public String getMode() { 494 return this.mode == null ? null : this.mode.getValue(); 495 } 496 497 /** 498 * @param value If this mode is not passed to the runner, then this suite will not be run 499 */ 500 public TestCasesSuiteComponent setMode(String value) { 501 if (Utilities.noString(value)) 502 this.mode = null; 503 else { 504 if (this.mode == null) 505 this.mode = new CodeType(); 506 this.mode.setValue(value); 507 } 508 return this; 509 } 510 511 /** 512 * @return {@link #resource} (The resources used in the tests in this suite. How exactly they are used depends on the definition of the runner) 513 */ 514 public List<TestCasesSuiteResourceComponent> getResource() { 515 if (this.resource == null) 516 this.resource = new ArrayList<TestCasesSuiteResourceComponent>(); 517 return this.resource; 518 } 519 520 /** 521 * @return Returns a reference to <code>this</code> for easy method chaining 522 */ 523 public TestCasesSuiteComponent setResource(List<TestCasesSuiteResourceComponent> theResource) { 524 this.resource = theResource; 525 return this; 526 } 527 528 public boolean hasResource() { 529 if (this.resource == null) 530 return false; 531 for (TestCasesSuiteResourceComponent item : this.resource) 532 if (!item.isEmpty()) 533 return true; 534 return false; 535 } 536 537 public TestCasesSuiteResourceComponent addResource() { //3 538 TestCasesSuiteResourceComponent t = new TestCasesSuiteResourceComponent(); 539 if (this.resource == null) 540 this.resource = new ArrayList<TestCasesSuiteResourceComponent>(); 541 this.resource.add(t); 542 return t; 543 } 544 545 public TestCasesSuiteComponent addResource(TestCasesSuiteResourceComponent t) { //3 546 if (t == null) 547 return this; 548 if (this.resource == null) 549 this.resource = new ArrayList<TestCasesSuiteResourceComponent>(); 550 this.resource.add(t); 551 return this; 552 } 553 554 /** 555 * @return The first repetition of repeating field {@link #resource}, creating it if it does not already exist {3} 556 */ 557 public TestCasesSuiteResourceComponent getResourceFirstRep() { 558 if (getResource().isEmpty()) { 559 addResource(); 560 } 561 return getResource().get(0); 562 } 563 564 /** 565 * @return {@link #parameter} (A parameter passed to the runner when executing tests. Which parameters are valid, and how exactly the parameter is used are used depends on the definition of the runner) 566 */ 567 public List<TestCasesSuiteParameterComponent> getParameter() { 568 if (this.parameter == null) 569 this.parameter = new ArrayList<TestCasesSuiteParameterComponent>(); 570 return this.parameter; 571 } 572 573 /** 574 * @return Returns a reference to <code>this</code> for easy method chaining 575 */ 576 public TestCasesSuiteComponent setParameter(List<TestCasesSuiteParameterComponent> theParameter) { 577 this.parameter = theParameter; 578 return this; 579 } 580 581 public boolean hasParameter() { 582 if (this.parameter == null) 583 return false; 584 for (TestCasesSuiteParameterComponent item : this.parameter) 585 if (!item.isEmpty()) 586 return true; 587 return false; 588 } 589 590 public TestCasesSuiteParameterComponent addParameter() { //3 591 TestCasesSuiteParameterComponent t = new TestCasesSuiteParameterComponent(); 592 if (this.parameter == null) 593 this.parameter = new ArrayList<TestCasesSuiteParameterComponent>(); 594 this.parameter.add(t); 595 return t; 596 } 597 598 public TestCasesSuiteComponent addParameter(TestCasesSuiteParameterComponent t) { //3 599 if (t == null) 600 return this; 601 if (this.parameter == null) 602 this.parameter = new ArrayList<TestCasesSuiteParameterComponent>(); 603 this.parameter.add(t); 604 return this; 605 } 606 607 /** 608 * @return The first repetition of repeating field {@link #parameter}, creating it if it does not already exist {3} 609 */ 610 public TestCasesSuiteParameterComponent getParameterFirstRep() { 611 if (getParameter().isEmpty()) { 612 addParameter(); 613 } 614 return getParameter().get(0); 615 } 616 617 /** 618 * @return {@link #test} (An actual test in the test suite) 619 */ 620 public List<TestCasesSuiteTestComponent> getTest() { 621 if (this.test == null) 622 this.test = new ArrayList<TestCasesSuiteTestComponent>(); 623 return this.test; 624 } 625 626 /** 627 * @return Returns a reference to <code>this</code> for easy method chaining 628 */ 629 public TestCasesSuiteComponent setTest(List<TestCasesSuiteTestComponent> theTest) { 630 this.test = theTest; 631 return this; 632 } 633 634 public boolean hasTest() { 635 if (this.test == null) 636 return false; 637 for (TestCasesSuiteTestComponent item : this.test) 638 if (!item.isEmpty()) 639 return true; 640 return false; 641 } 642 643 public TestCasesSuiteTestComponent addTest() { //3 644 TestCasesSuiteTestComponent t = new TestCasesSuiteTestComponent(); 645 if (this.test == null) 646 this.test = new ArrayList<TestCasesSuiteTestComponent>(); 647 this.test.add(t); 648 return t; 649 } 650 651 public TestCasesSuiteComponent addTest(TestCasesSuiteTestComponent t) { //3 652 if (t == null) 653 return this; 654 if (this.test == null) 655 this.test = new ArrayList<TestCasesSuiteTestComponent>(); 656 this.test.add(t); 657 return this; 658 } 659 660 /** 661 * @return The first repetition of repeating field {@link #test}, creating it if it does not already exist {3} 662 */ 663 public TestCasesSuiteTestComponent getTestFirstRep() { 664 if (getTest().isEmpty()) { 665 addTest(); 666 } 667 return getTest().get(0); 668 } 669 670 protected void listChildren(List<Property> children) { 671 super.listChildren(children); 672 children.add(new Property("name", "string", "The name by which this suite is known by in the test system. The name must be unique in the amongst the suites", 0, 1, name)); 673 children.add(new Property("description", "string", "Description of what this suite does / why it was defined. This should explain to a tester what they should know when deciding which tests to run", 0, 1, description)); 674 children.add(new Property("mode", "code", "If this mode is not passed to the runner, then this suite will not be run", 0, 1, mode)); 675 children.add(new Property("resource", "Base", "The resources used in the tests in this suite. How exactly they are used depends on the definition of the runner", 0, java.lang.Integer.MAX_VALUE, resource)); 676 children.add(new Property("parameter", "Base", "A parameter passed to the runner when executing tests. Which parameters are valid, and how exactly the parameter is used are used depends on the definition of the runner", 0, java.lang.Integer.MAX_VALUE, parameter)); 677 children.add(new Property("test", "Base", "An actual test in the test suite", 0, java.lang.Integer.MAX_VALUE, test)); 678 } 679 680 @Override 681 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 682 switch (_hash) { 683 case 3373707: /*name*/ return new Property("name", "string", "The name by which this suite is known by in the test system. The name must be unique in the amongst the suites", 0, 1, name); 684 case -1724546052: /*description*/ return new Property("description", "string", "Description of what this suite does / why it was defined. This should explain to a tester what they should know when deciding which tests to run", 0, 1, description); 685 case 3357091: /*mode*/ return new Property("mode", "code", "If this mode is not passed to the runner, then this suite will not be run", 0, 1, mode); 686 case -341064690: /*resource*/ return new Property("resource", "Base", "The resources used in the tests in this suite. How exactly they are used depends on the definition of the runner", 0, java.lang.Integer.MAX_VALUE, resource); 687 case 1954460585: /*parameter*/ return new Property("parameter", "Base", "A parameter passed to the runner when executing tests. Which parameters are valid, and how exactly the parameter is used are used depends on the definition of the runner", 0, java.lang.Integer.MAX_VALUE, parameter); 688 case 3556498: /*test*/ return new Property("test", "Base", "An actual test in the test suite", 0, java.lang.Integer.MAX_VALUE, test); 689 default: return super.getNamedProperty(_hash, _name, _checkValid); 690 } 691 692 } 693 694 @Override 695 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 696 switch (hash) { 697 case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType 698 case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType 699 case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // CodeType 700 case -341064690: /*resource*/ return this.resource == null ? new Base[0] : this.resource.toArray(new Base[this.resource.size()]); // TestCasesSuiteResourceComponent 701 case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // TestCasesSuiteParameterComponent 702 case 3556498: /*test*/ return this.test == null ? new Base[0] : this.test.toArray(new Base[this.test.size()]); // TestCasesSuiteTestComponent 703 default: return super.getProperty(hash, name, checkValid); 704 } 705 706 } 707 708 @Override 709 public Base setProperty(int hash, String name, Base value) throws FHIRException { 710 switch (hash) { 711 case 3373707: // name 712 this.name = TypeConvertor.castToString(value); // StringType 713 return value; 714 case -1724546052: // description 715 this.description = TypeConvertor.castToString(value); // StringType 716 return value; 717 case 3357091: // mode 718 this.mode = TypeConvertor.castToCode(value); // CodeType 719 return value; 720 case -341064690: // resource 721 this.getResource().add((TestCasesSuiteResourceComponent) value); // TestCasesSuiteResourceComponent 722 return value; 723 case 1954460585: // parameter 724 this.getParameter().add((TestCasesSuiteParameterComponent) value); // TestCasesSuiteParameterComponent 725 return value; 726 case 3556498: // test 727 this.getTest().add((TestCasesSuiteTestComponent) value); // TestCasesSuiteTestComponent 728 return value; 729 default: return super.setProperty(hash, name, value); 730 } 731 732 } 733 734 @Override 735 public Base setProperty(String name, Base value) throws FHIRException { 736 if (name.equals("name")) { 737 this.name = TypeConvertor.castToString(value); // StringType 738 } else if (name.equals("description")) { 739 this.description = TypeConvertor.castToString(value); // StringType 740 } else if (name.equals("mode")) { 741 this.mode = TypeConvertor.castToCode(value); // CodeType 742 } else if (name.equals("resource")) { 743 this.getResource().add((TestCasesSuiteResourceComponent) value); // TestCasesSuiteResourceComponent 744 } else if (name.equals("parameter")) { 745 this.getParameter().add((TestCasesSuiteParameterComponent) value); // TestCasesSuiteParameterComponent 746 } else if (name.equals("test")) { 747 this.getTest().add((TestCasesSuiteTestComponent) value); // TestCasesSuiteTestComponent 748 } else 749 return super.setProperty(name, value); 750 return value; 751 } 752 753 @Override 754 public Base makeProperty(int hash, String name) throws FHIRException { 755 switch (hash) { 756 case 3373707: return getNameElement(); 757 case -1724546052: return getDescriptionElement(); 758 case 3357091: return getModeElement(); 759 case -341064690: return addResource(); 760 case 1954460585: return addParameter(); 761 case 3556498: return addTest(); 762 default: return super.makeProperty(hash, name); 763 } 764 765 } 766 767 @Override 768 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 769 switch (hash) { 770 case 3373707: /*name*/ return new String[] {"string"}; 771 case -1724546052: /*description*/ return new String[] {"string"}; 772 case 3357091: /*mode*/ return new String[] {"code"}; 773 case -341064690: /*resource*/ return new String[] {"Base"}; 774 case 1954460585: /*parameter*/ return new String[] {"Base"}; 775 case 3556498: /*test*/ return new String[] {"Base"}; 776 default: return super.getTypesForProperty(hash, name); 777 } 778 779 } 780 781 @Override 782 public Base addChild(String name) throws FHIRException { 783 if (name.equals("name")) { 784 throw new FHIRException("Cannot call addChild on a singleton property TestCases.suite.name"); 785 } 786 else if (name.equals("description")) { 787 throw new FHIRException("Cannot call addChild on a singleton property TestCases.suite.description"); 788 } 789 else if (name.equals("mode")) { 790 throw new FHIRException("Cannot call addChild on a singleton property TestCases.suite.mode"); 791 } 792 else if (name.equals("resource")) { 793 throw new FHIRException("Cannot call addChild on an abstract type TestCases.suite.resource"); 794 } 795 else if (name.equals("parameter")) { 796 throw new FHIRException("Cannot call addChild on an abstract type TestCases.suite.parameter"); 797 } 798 else if (name.equals("test")) { 799 throw new FHIRException("Cannot call addChild on an abstract type TestCases.suite.test"); 800 } 801 else 802 return super.addChild(name); 803 } 804 805 public TestCasesSuiteComponent copy() { 806 TestCasesSuiteComponent dst = new TestCasesSuiteComponent(); 807 copyValues(dst); 808 return dst; 809 } 810 811 public void copyValues(TestCasesSuiteComponent dst) { 812 super.copyValues(dst); 813 dst.name = name == null ? null : name.copy(); 814 dst.description = description == null ? null : description.copy(); 815 dst.mode = mode == null ? null : mode.copy(); 816 if (resource != null) { 817 dst.resource = new ArrayList<TestCasesSuiteResourceComponent>(); 818 for (TestCasesSuiteResourceComponent i : resource) 819 dst.resource.add(i.copy()); 820 }; 821 if (parameter != null) { 822 dst.parameter = new ArrayList<TestCasesSuiteParameterComponent>(); 823 for (TestCasesSuiteParameterComponent i : parameter) 824 dst.parameter.add(i.copy()); 825 }; 826 if (test != null) { 827 dst.test = new ArrayList<TestCasesSuiteTestComponent>(); 828 for (TestCasesSuiteTestComponent i : test) 829 dst.test.add(i.copy()); 830 }; 831 } 832 833 @Override 834 public boolean equalsDeep(Base other_) { 835 if (!super.equalsDeep(other_)) 836 return false; 837 if (!(other_ instanceof TestCasesSuiteComponent)) 838 return false; 839 TestCasesSuiteComponent o = (TestCasesSuiteComponent) other_; 840 return compareDeep(name, o.name, true) && compareDeep(description, o.description, true) && compareDeep(mode, o.mode, true) 841 && compareDeep(resource, o.resource, true) && compareDeep(parameter, o.parameter, true) && compareDeep(test, o.test, true) 842 ; 843 } 844 845 @Override 846 public boolean equalsShallow(Base other_) { 847 if (!super.equalsShallow(other_)) 848 return false; 849 if (!(other_ instanceof TestCasesSuiteComponent)) 850 return false; 851 TestCasesSuiteComponent o = (TestCasesSuiteComponent) other_; 852 return compareValues(name, o.name, true) && compareValues(description, o.description, true) && compareValues(mode, o.mode, true) 853 ; 854 } 855 856 public boolean isEmpty() { 857 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, description, mode 858 , resource, parameter, test); 859 } 860 861 public String fhirType() { 862 return "TestCases.suite"; 863 864 } 865 866 } 867 868 @Block() 869 public static class TestCasesSuiteResourceComponent extends LogicalBase { 870 /** 871 * A name that identifies this resource. The runner definition defines whether there must be a name, and what names there are 872 */ 873 @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) 874 @Description(shortDefinition="A name for this resource (per runner definition)", formalDefinition="A name that identifies this resource. The runner definition defines whether there must be a name, and what names there are" ) 875 protected StringType name; 876 877 /** 878 * A file containing a resource used in the tests 879 */ 880 @Child(name = "file", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) 881 @Description(shortDefinition="A file containing a resource used in the tests", formalDefinition="A file containing a resource used in the tests" ) 882 protected StringType file; 883 884 /** 885 * An inline resource used in the tests. How exactly it is used depends on the definition of the runner. 886 */ 887 @Child(name = "resource", type = {Resource.class}, order=3, min=0, max=1, modifier=false, summary=false) 888 @Description(shortDefinition="An inline resource used in the tests", formalDefinition="An inline resource used in the tests. How exactly it is used depends on the definition of the runner." ) 889 protected Resource resource; 890 891 /** 892 * If this mode is not passed to the runner, then this resource will not be used 893 */ 894 @Child(name = "mode", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=false) 895 @Description(shortDefinition="A mode that must be true for this resource to be used", formalDefinition="If this mode is not passed to the runner, then this resource will not be used" ) 896 protected CodeType mode; 897 898 private static final long serialVersionUID = 1036724891L; 899 900 /** 901 * Constructor 902 */ 903 public TestCasesSuiteResourceComponent() { 904 super(); 905 } 906 907 /** 908 * @return {@link #name} (A name that identifies this resource. The runner definition defines whether there must be a name, and what names there are). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 909 */ 910 public StringType getNameElement() { 911 if (this.name == null) 912 if (Configuration.errorOnAutoCreate()) 913 throw new Error("Attempt to auto-create TestCasesSuiteResourceComponent.name"); 914 else if (Configuration.doAutoCreate()) 915 this.name = new StringType(); // bb 916 return this.name; 917 } 918 919 public boolean hasNameElement() { 920 return this.name != null && !this.name.isEmpty(); 921 } 922 923 public boolean hasName() { 924 return this.name != null && !this.name.isEmpty(); 925 } 926 927 /** 928 * @param value {@link #name} (A name that identifies this resource. The runner definition defines whether there must be a name, and what names there are). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 929 */ 930 public TestCasesSuiteResourceComponent setNameElement(StringType value) { 931 this.name = value; 932 return this; 933 } 934 935 /** 936 * @return A name that identifies this resource. The runner definition defines whether there must be a name, and what names there are 937 */ 938 public String getName() { 939 return this.name == null ? null : this.name.getValue(); 940 } 941 942 /** 943 * @param value A name that identifies this resource. The runner definition defines whether there must be a name, and what names there are 944 */ 945 public TestCasesSuiteResourceComponent setName(String value) { 946 if (Utilities.noString(value)) 947 this.name = null; 948 else { 949 if (this.name == null) 950 this.name = new StringType(); 951 this.name.setValue(value); 952 } 953 return this; 954 } 955 956 /** 957 * @return {@link #file} (A file containing a resource used in the tests). This is the underlying object with id, value and extensions. The accessor "getFile" gives direct access to the value 958 */ 959 public StringType getFileElement() { 960 if (this.file == null) 961 if (Configuration.errorOnAutoCreate()) 962 throw new Error("Attempt to auto-create TestCasesSuiteResourceComponent.file"); 963 else if (Configuration.doAutoCreate()) 964 this.file = new StringType(); // bb 965 return this.file; 966 } 967 968 public boolean hasFileElement() { 969 return this.file != null && !this.file.isEmpty(); 970 } 971 972 public boolean hasFile() { 973 return this.file != null && !this.file.isEmpty(); 974 } 975 976 /** 977 * @param value {@link #file} (A file containing a resource used in the tests). This is the underlying object with id, value and extensions. The accessor "getFile" gives direct access to the value 978 */ 979 public TestCasesSuiteResourceComponent setFileElement(StringType value) { 980 this.file = value; 981 return this; 982 } 983 984 /** 985 * @return A file containing a resource used in the tests 986 */ 987 public String getFile() { 988 return this.file == null ? null : this.file.getValue(); 989 } 990 991 /** 992 * @param value A file containing a resource used in the tests 993 */ 994 public TestCasesSuiteResourceComponent setFile(String value) { 995 if (Utilities.noString(value)) 996 this.file = null; 997 else { 998 if (this.file == null) 999 this.file = new StringType(); 1000 this.file.setValue(value); 1001 } 1002 return this; 1003 } 1004 1005 /** 1006 * @return {@link #resource} (An inline resource used in the tests. How exactly it is used depends on the definition of the runner.) 1007 */ 1008 public Resource getResource() { 1009 return this.resource; 1010 } 1011 1012 public boolean hasResource() { 1013 return this.resource != null && !this.resource.isEmpty(); 1014 } 1015 1016 /** 1017 * @param value {@link #resource} (An inline resource used in the tests. How exactly it is used depends on the definition of the runner.) 1018 */ 1019 public TestCasesSuiteResourceComponent setResource(Resource value) { 1020 this.resource = value; 1021 return this; 1022 } 1023 1024 /** 1025 * @return {@link #mode} (If this mode is not passed to the runner, then this resource will not be used). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value 1026 */ 1027 public CodeType getModeElement() { 1028 if (this.mode == null) 1029 if (Configuration.errorOnAutoCreate()) 1030 throw new Error("Attempt to auto-create TestCasesSuiteResourceComponent.mode"); 1031 else if (Configuration.doAutoCreate()) 1032 this.mode = new CodeType(); // bb 1033 return this.mode; 1034 } 1035 1036 public boolean hasModeElement() { 1037 return this.mode != null && !this.mode.isEmpty(); 1038 } 1039 1040 public boolean hasMode() { 1041 return this.mode != null && !this.mode.isEmpty(); 1042 } 1043 1044 /** 1045 * @param value {@link #mode} (If this mode is not passed to the runner, then this resource will not be used). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value 1046 */ 1047 public TestCasesSuiteResourceComponent setModeElement(CodeType value) { 1048 this.mode = value; 1049 return this; 1050 } 1051 1052 /** 1053 * @return If this mode is not passed to the runner, then this resource will not be used 1054 */ 1055 public String getMode() { 1056 return this.mode == null ? null : this.mode.getValue(); 1057 } 1058 1059 /** 1060 * @param value If this mode is not passed to the runner, then this resource will not be used 1061 */ 1062 public TestCasesSuiteResourceComponent setMode(String value) { 1063 if (Utilities.noString(value)) 1064 this.mode = null; 1065 else { 1066 if (this.mode == null) 1067 this.mode = new CodeType(); 1068 this.mode.setValue(value); 1069 } 1070 return this; 1071 } 1072 1073 protected void listChildren(List<Property> children) { 1074 super.listChildren(children); 1075 children.add(new Property("name", "string", "A name that identifies this resource. The runner definition defines whether there must be a name, and what names there are", 0, 1, name)); 1076 children.add(new Property("file", "string", "A file containing a resource used in the tests", 0, 1, file)); 1077 children.add(new Property("resource", "Resource", "An inline resource used in the tests. How exactly it is used depends on the definition of the runner.", 0, 1, resource)); 1078 children.add(new Property("mode", "code", "If this mode is not passed to the runner, then this resource will not be used", 0, 1, mode)); 1079 } 1080 1081 @Override 1082 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1083 switch (_hash) { 1084 case 3373707: /*name*/ return new Property("name", "string", "A name that identifies this resource. The runner definition defines whether there must be a name, and what names there are", 0, 1, name); 1085 case 3143036: /*file*/ return new Property("file", "string", "A file containing a resource used in the tests", 0, 1, file); 1086 case -341064690: /*resource*/ return new Property("resource", "Resource", "An inline resource used in the tests. How exactly it is used depends on the definition of the runner.", 0, 1, resource); 1087 case 3357091: /*mode*/ return new Property("mode", "code", "If this mode is not passed to the runner, then this resource will not be used", 0, 1, mode); 1088 default: return super.getNamedProperty(_hash, _name, _checkValid); 1089 } 1090 1091 } 1092 1093 @Override 1094 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1095 switch (hash) { 1096 case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType 1097 case 3143036: /*file*/ return this.file == null ? new Base[0] : new Base[] {this.file}; // StringType 1098 case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Resource 1099 case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // CodeType 1100 default: return super.getProperty(hash, name, checkValid); 1101 } 1102 1103 } 1104 1105 @Override 1106 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1107 switch (hash) { 1108 case 3373707: // name 1109 this.name = TypeConvertor.castToString(value); // StringType 1110 return value; 1111 case 3143036: // file 1112 this.file = TypeConvertor.castToString(value); // StringType 1113 return value; 1114 case -341064690: // resource 1115 this.resource = (Resource) value; // Resource 1116 return value; 1117 case 3357091: // mode 1118 this.mode = TypeConvertor.castToCode(value); // CodeType 1119 return value; 1120 default: return super.setProperty(hash, name, value); 1121 } 1122 1123 } 1124 1125 @Override 1126 public Base setProperty(String name, Base value) throws FHIRException { 1127 if (name.equals("name")) { 1128 this.name = TypeConvertor.castToString(value); // StringType 1129 } else if (name.equals("file")) { 1130 this.file = TypeConvertor.castToString(value); // StringType 1131 } else if (name.equals("resource")) { 1132 this.resource = (Resource) value; // Resource 1133 } else if (name.equals("mode")) { 1134 this.mode = TypeConvertor.castToCode(value); // CodeType 1135 } else 1136 return super.setProperty(name, value); 1137 return value; 1138 } 1139 1140 @Override 1141 public Base makeProperty(int hash, String name) throws FHIRException { 1142 switch (hash) { 1143 case 3373707: return getNameElement(); 1144 case 3143036: return getFileElement(); 1145 case -341064690: throw new FHIRException("Cannot make property resource as it is not a complex type"); // Resource 1146 case 3357091: return getModeElement(); 1147 default: return super.makeProperty(hash, name); 1148 } 1149 1150 } 1151 1152 @Override 1153 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1154 switch (hash) { 1155 case 3373707: /*name*/ return new String[] {"string"}; 1156 case 3143036: /*file*/ return new String[] {"string"}; 1157 case -341064690: /*resource*/ return new String[] {"Resource"}; 1158 case 3357091: /*mode*/ return new String[] {"code"}; 1159 default: return super.getTypesForProperty(hash, name); 1160 } 1161 1162 } 1163 1164 @Override 1165 public Base addChild(String name) throws FHIRException { 1166 if (name.equals("name")) { 1167 throw new FHIRException("Cannot call addChild on a singleton property TestCases.suite.resource.name"); 1168 } 1169 else if (name.equals("file")) { 1170 throw new FHIRException("Cannot call addChild on a singleton property TestCases.suite.resource.file"); 1171 } 1172 else if (name.equals("resource")) { 1173 throw new FHIRException("Cannot call addChild on an abstract type TestCases.suite.resource.resource"); 1174 } 1175 else if (name.equals("mode")) { 1176 throw new FHIRException("Cannot call addChild on a singleton property TestCases.suite.resource.mode"); 1177 } 1178 else 1179 return super.addChild(name); 1180 } 1181 1182 public TestCasesSuiteResourceComponent copy() { 1183 TestCasesSuiteResourceComponent dst = new TestCasesSuiteResourceComponent(); 1184 copyValues(dst); 1185 return dst; 1186 } 1187 1188 public void copyValues(TestCasesSuiteResourceComponent dst) { 1189 super.copyValues(dst); 1190 dst.name = name == null ? null : name.copy(); 1191 dst.file = file == null ? null : file.copy(); 1192 dst.resource = resource == null ? null : resource.copy(); 1193 dst.mode = mode == null ? null : mode.copy(); 1194 } 1195 1196 @Override 1197 public boolean equalsDeep(Base other_) { 1198 if (!super.equalsDeep(other_)) 1199 return false; 1200 if (!(other_ instanceof TestCasesSuiteResourceComponent)) 1201 return false; 1202 TestCasesSuiteResourceComponent o = (TestCasesSuiteResourceComponent) other_; 1203 return compareDeep(name, o.name, true) && compareDeep(file, o.file, true) && compareDeep(resource, o.resource, true) 1204 && compareDeep(mode, o.mode, true); 1205 } 1206 1207 @Override 1208 public boolean equalsShallow(Base other_) { 1209 if (!super.equalsShallow(other_)) 1210 return false; 1211 if (!(other_ instanceof TestCasesSuiteResourceComponent)) 1212 return false; 1213 TestCasesSuiteResourceComponent o = (TestCasesSuiteResourceComponent) other_; 1214 return compareValues(name, o.name, true) && compareValues(file, o.file, true) && compareValues(mode, o.mode, true) 1215 ; 1216 } 1217 1218 public boolean isEmpty() { 1219 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, file, resource, mode 1220 ); 1221 } 1222 1223 public String fhirType() { 1224 return "TestCases.suite.resource"; 1225 1226 } 1227 1228 } 1229 1230 @Block() 1231 public static class TestCasesSuiteParameterComponent extends LogicalBase { 1232 /** 1233 * Name of parameter 1234 */ 1235 @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) 1236 @Description(shortDefinition="Name of parameter", formalDefinition="Name of parameter" ) 1237 protected StringType name; 1238 1239 /** 1240 * The value of the parameter 1241 */ 1242 @Child(name = "value", type = {StringType.class, BooleanType.class, IntegerType.class, DecimalType.class, DateTimeType.class, UriType.class, Coding.class, Quantity.class}, order=2, min=1, max=1, modifier=false, summary=false) 1243 @Description(shortDefinition="Value of this parameter", formalDefinition="The value of the parameter" ) 1244 protected DataType value; 1245 1246 /** 1247 * If this mode is not passed to the runner, then this parameter will not be used 1248 */ 1249 @Child(name = "mode", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false) 1250 @Description(shortDefinition="A mode that must be true for this parameter to be used", formalDefinition="If this mode is not passed to the runner, then this parameter will not be used" ) 1251 protected CodeType mode; 1252 1253 private static final long serialVersionUID = -410765611L; 1254 1255 /** 1256 * Constructor 1257 */ 1258 public TestCasesSuiteParameterComponent() { 1259 super(); 1260 } 1261 1262 /** 1263 * Constructor 1264 */ 1265 public TestCasesSuiteParameterComponent(String name, DataType value) { 1266 super(); 1267 this.setName(name); 1268 this.setValue(value); 1269 } 1270 1271 /** 1272 * @return {@link #name} (Name of parameter). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 1273 */ 1274 public StringType getNameElement() { 1275 if (this.name == null) 1276 if (Configuration.errorOnAutoCreate()) 1277 throw new Error("Attempt to auto-create TestCasesSuiteParameterComponent.name"); 1278 else if (Configuration.doAutoCreate()) 1279 this.name = new StringType(); // bb 1280 return this.name; 1281 } 1282 1283 public boolean hasNameElement() { 1284 return this.name != null && !this.name.isEmpty(); 1285 } 1286 1287 public boolean hasName() { 1288 return this.name != null && !this.name.isEmpty(); 1289 } 1290 1291 /** 1292 * @param value {@link #name} (Name of parameter). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 1293 */ 1294 public TestCasesSuiteParameterComponent setNameElement(StringType value) { 1295 this.name = value; 1296 return this; 1297 } 1298 1299 /** 1300 * @return Name of parameter 1301 */ 1302 public String getName() { 1303 return this.name == null ? null : this.name.getValue(); 1304 } 1305 1306 /** 1307 * @param value Name of parameter 1308 */ 1309 public TestCasesSuiteParameterComponent setName(String value) { 1310 if (this.name == null) 1311 this.name = new StringType(); 1312 this.name.setValue(value); 1313 return this; 1314 } 1315 1316 /** 1317 * @return {@link #value} (The value of the parameter) 1318 */ 1319 public DataType getValue() { 1320 return this.value; 1321 } 1322 1323 /** 1324 * @return {@link #value} (The value of the parameter) 1325 */ 1326 public StringType getValueStringType() throws FHIRException { 1327 if (this.value == null) 1328 this.value = new StringType(); 1329 if (!(this.value instanceof StringType)) 1330 throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); 1331 return (StringType) this.value; 1332 } 1333 1334 public boolean hasValueStringType() { 1335 return this != null && this.value instanceof StringType; 1336 } 1337 1338 /** 1339 * @return {@link #value} (The value of the parameter) 1340 */ 1341 public BooleanType getValueBooleanType() throws FHIRException { 1342 if (this.value == null) 1343 this.value = new BooleanType(); 1344 if (!(this.value instanceof BooleanType)) 1345 throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); 1346 return (BooleanType) this.value; 1347 } 1348 1349 public boolean hasValueBooleanType() { 1350 return this != null && this.value instanceof BooleanType; 1351 } 1352 1353 /** 1354 * @return {@link #value} (The value of the parameter) 1355 */ 1356 public IntegerType getValueIntegerType() throws FHIRException { 1357 if (this.value == null) 1358 this.value = new IntegerType(); 1359 if (!(this.value instanceof IntegerType)) 1360 throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered"); 1361 return (IntegerType) this.value; 1362 } 1363 1364 public boolean hasValueIntegerType() { 1365 return this != null && this.value instanceof IntegerType; 1366 } 1367 1368 /** 1369 * @return {@link #value} (The value of the parameter) 1370 */ 1371 public DecimalType getValueDecimalType() throws FHIRException { 1372 if (this.value == null) 1373 this.value = new DecimalType(); 1374 if (!(this.value instanceof DecimalType)) 1375 throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered"); 1376 return (DecimalType) this.value; 1377 } 1378 1379 public boolean hasValueDecimalType() { 1380 return this != null && this.value instanceof DecimalType; 1381 } 1382 1383 /** 1384 * @return {@link #value} (The value of the parameter) 1385 */ 1386 public DateTimeType getValueDateTimeType() throws FHIRException { 1387 if (this.value == null) 1388 this.value = new DateTimeType(); 1389 if (!(this.value instanceof DateTimeType)) 1390 throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); 1391 return (DateTimeType) this.value; 1392 } 1393 1394 public boolean hasValueDateTimeType() { 1395 return this != null && this.value instanceof DateTimeType; 1396 } 1397 1398 /** 1399 * @return {@link #value} (The value of the parameter) 1400 */ 1401 public UriType getValueUriType() throws FHIRException { 1402 if (this.value == null) 1403 this.value = new UriType(); 1404 if (!(this.value instanceof UriType)) 1405 throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered"); 1406 return (UriType) this.value; 1407 } 1408 1409 public boolean hasValueUriType() { 1410 return this != null && this.value instanceof UriType; 1411 } 1412 1413 /** 1414 * @return {@link #value} (The value of the parameter) 1415 */ 1416 public Coding getValueCoding() throws FHIRException { 1417 if (this.value == null) 1418 this.value = new Coding(); 1419 if (!(this.value instanceof Coding)) 1420 throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered"); 1421 return (Coding) this.value; 1422 } 1423 1424 public boolean hasValueCoding() { 1425 return this != null && this.value instanceof Coding; 1426 } 1427 1428 /** 1429 * @return {@link #value} (The value of the parameter) 1430 */ 1431 public Quantity getValueQuantity() throws FHIRException { 1432 if (this.value == null) 1433 this.value = new Quantity(); 1434 if (!(this.value instanceof Quantity)) 1435 throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); 1436 return (Quantity) this.value; 1437 } 1438 1439 public boolean hasValueQuantity() { 1440 return this != null && this.value instanceof Quantity; 1441 } 1442 1443 public boolean hasValue() { 1444 return this.value != null && !this.value.isEmpty(); 1445 } 1446 1447 /** 1448 * @param value {@link #value} (The value of the parameter) 1449 */ 1450 public TestCasesSuiteParameterComponent setValue(DataType value) { 1451 if (value != null && !(value instanceof StringType || value instanceof BooleanType || value instanceof IntegerType || value instanceof DecimalType || value instanceof DateTimeType || value instanceof UriType || value instanceof Coding || value instanceof Quantity)) 1452 throw new FHIRException("Not the right type for TestCases.suite.parameter.value[x]: "+value.fhirType()); 1453 this.value = value; 1454 return this; 1455 } 1456 1457 /** 1458 * @return {@link #mode} (If this mode is not passed to the runner, then this parameter will not be used). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value 1459 */ 1460 public CodeType getModeElement() { 1461 if (this.mode == null) 1462 if (Configuration.errorOnAutoCreate()) 1463 throw new Error("Attempt to auto-create TestCasesSuiteParameterComponent.mode"); 1464 else if (Configuration.doAutoCreate()) 1465 this.mode = new CodeType(); // bb 1466 return this.mode; 1467 } 1468 1469 public boolean hasModeElement() { 1470 return this.mode != null && !this.mode.isEmpty(); 1471 } 1472 1473 public boolean hasMode() { 1474 return this.mode != null && !this.mode.isEmpty(); 1475 } 1476 1477 /** 1478 * @param value {@link #mode} (If this mode is not passed to the runner, then this parameter will not be used). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value 1479 */ 1480 public TestCasesSuiteParameterComponent setModeElement(CodeType value) { 1481 this.mode = value; 1482 return this; 1483 } 1484 1485 /** 1486 * @return If this mode is not passed to the runner, then this parameter will not be used 1487 */ 1488 public String getMode() { 1489 return this.mode == null ? null : this.mode.getValue(); 1490 } 1491 1492 /** 1493 * @param value If this mode is not passed to the runner, then this parameter will not be used 1494 */ 1495 public TestCasesSuiteParameterComponent setMode(String value) { 1496 if (Utilities.noString(value)) 1497 this.mode = null; 1498 else { 1499 if (this.mode == null) 1500 this.mode = new CodeType(); 1501 this.mode.setValue(value); 1502 } 1503 return this; 1504 } 1505 1506 protected void listChildren(List<Property> children) { 1507 super.listChildren(children); 1508 children.add(new Property("name", "string", "Name of parameter", 0, 1, name)); 1509 children.add(new Property("value[x]", "string|boolean|integer|decimal|dateTime|uri|Coding|Quantity", "The value of the parameter", 0, 1, value)); 1510 children.add(new Property("mode", "code", "If this mode is not passed to the runner, then this parameter will not be used", 0, 1, mode)); 1511 } 1512 1513 @Override 1514 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1515 switch (_hash) { 1516 case 3373707: /*name*/ return new Property("name", "string", "Name of parameter", 0, 1, name); 1517 case -1410166417: /*value[x]*/ return new Property("value[x]", "string|boolean|integer|decimal|dateTime|uri|Coding|Quantity", "The value of the parameter", 0, 1, value); 1518 case 111972721: /*value*/ return new Property("value[x]", "string|boolean|integer|decimal|dateTime|uri|Coding|Quantity", "The value of the parameter", 0, 1, value); 1519 case -1424603934: /*valueString*/ return new Property("value[x]", "string", "The value of the parameter", 0, 1, value); 1520 case 733421943: /*valueBoolean*/ return new Property("value[x]", "boolean", "The value of the parameter", 0, 1, value); 1521 case -1668204915: /*valueInteger*/ return new Property("value[x]", "integer", "The value of the parameter", 0, 1, value); 1522 case -2083993440: /*valueDecimal*/ return new Property("value[x]", "decimal", "The value of the parameter", 0, 1, value); 1523 case 1047929900: /*valueDateTime*/ return new Property("value[x]", "dateTime", "The value of the parameter", 0, 1, value); 1524 case -1410172357: /*valueUri*/ return new Property("value[x]", "uri", "The value of the parameter", 0, 1, value); 1525 case -1887705029: /*valueCoding*/ return new Property("value[x]", "Coding", "The value of the parameter", 0, 1, value); 1526 case -2029823716: /*valueQuantity*/ return new Property("value[x]", "Quantity", "The value of the parameter", 0, 1, value); 1527 case 3357091: /*mode*/ return new Property("mode", "code", "If this mode is not passed to the runner, then this parameter will not be used", 0, 1, mode); 1528 default: return super.getNamedProperty(_hash, _name, _checkValid); 1529 } 1530 1531 } 1532 1533 @Override 1534 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1535 switch (hash) { 1536 case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType 1537 case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType 1538 case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // CodeType 1539 default: return super.getProperty(hash, name, checkValid); 1540 } 1541 1542 } 1543 1544 @Override 1545 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1546 switch (hash) { 1547 case 3373707: // name 1548 this.name = TypeConvertor.castToString(value); // StringType 1549 return value; 1550 case 111972721: // value 1551 this.value = TypeConvertor.castToType(value); // DataType 1552 return value; 1553 case 3357091: // mode 1554 this.mode = TypeConvertor.castToCode(value); // CodeType 1555 return value; 1556 default: return super.setProperty(hash, name, value); 1557 } 1558 1559 } 1560 1561 @Override 1562 public Base setProperty(String name, Base value) throws FHIRException { 1563 if (name.equals("name")) { 1564 this.name = TypeConvertor.castToString(value); // StringType 1565 } else if (name.equals("value[x]")) { 1566 this.value = TypeConvertor.castToType(value); // DataType 1567 } else if (name.equals("mode")) { 1568 this.mode = TypeConvertor.castToCode(value); // CodeType 1569 } else 1570 return super.setProperty(name, value); 1571 return value; 1572 } 1573 1574 @Override 1575 public Base makeProperty(int hash, String name) throws FHIRException { 1576 switch (hash) { 1577 case 3373707: return getNameElement(); 1578 case -1410166417: return getValue(); 1579 case 111972721: return getValue(); 1580 case 3357091: return getModeElement(); 1581 default: return super.makeProperty(hash, name); 1582 } 1583 1584 } 1585 1586 @Override 1587 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1588 switch (hash) { 1589 case 3373707: /*name*/ return new String[] {"string"}; 1590 case 111972721: /*value*/ return new String[] {"string", "boolean", "integer", "decimal", "dateTime", "uri", "Coding", "Quantity"}; 1591 case 3357091: /*mode*/ return new String[] {"code"}; 1592 default: return super.getTypesForProperty(hash, name); 1593 } 1594 1595 } 1596 1597 @Override 1598 public Base addChild(String name) throws FHIRException { 1599 if (name.equals("name")) { 1600 throw new FHIRException("Cannot call addChild on a singleton property TestCases.suite.parameter.name"); 1601 } 1602 else if (name.equals("valueString")) { 1603 this.value = new StringType(); 1604 return this.value; 1605 } 1606 else if (name.equals("valueBoolean")) { 1607 this.value = new BooleanType(); 1608 return this.value; 1609 } 1610 else if (name.equals("valueInteger")) { 1611 this.value = new IntegerType(); 1612 return this.value; 1613 } 1614 else if (name.equals("valueDecimal")) { 1615 this.value = new DecimalType(); 1616 return this.value; 1617 } 1618 else if (name.equals("valueDateTime")) { 1619 this.value = new DateTimeType(); 1620 return this.value; 1621 } 1622 else if (name.equals("valueUri")) { 1623 this.value = new UriType(); 1624 return this.value; 1625 } 1626 else if (name.equals("valueCoding")) { 1627 this.value = new Coding(); 1628 return this.value; 1629 } 1630 else if (name.equals("valueQuantity")) { 1631 this.value = new Quantity(); 1632 return this.value; 1633 } 1634 else if (name.equals("mode")) { 1635 throw new FHIRException("Cannot call addChild on a singleton property TestCases.suite.parameter.mode"); 1636 } 1637 else 1638 return super.addChild(name); 1639 } 1640 1641 public TestCasesSuiteParameterComponent copy() { 1642 TestCasesSuiteParameterComponent dst = new TestCasesSuiteParameterComponent(); 1643 copyValues(dst); 1644 return dst; 1645 } 1646 1647 public void copyValues(TestCasesSuiteParameterComponent dst) { 1648 super.copyValues(dst); 1649 dst.name = name == null ? null : name.copy(); 1650 dst.value = value == null ? null : value.copy(); 1651 dst.mode = mode == null ? null : mode.copy(); 1652 } 1653 1654 @Override 1655 public boolean equalsDeep(Base other_) { 1656 if (!super.equalsDeep(other_)) 1657 return false; 1658 if (!(other_ instanceof TestCasesSuiteParameterComponent)) 1659 return false; 1660 TestCasesSuiteParameterComponent o = (TestCasesSuiteParameterComponent) other_; 1661 return compareDeep(name, o.name, true) && compareDeep(value, o.value, true) && compareDeep(mode, o.mode, true) 1662 ; 1663 } 1664 1665 @Override 1666 public boolean equalsShallow(Base other_) { 1667 if (!super.equalsShallow(other_)) 1668 return false; 1669 if (!(other_ instanceof TestCasesSuiteParameterComponent)) 1670 return false; 1671 TestCasesSuiteParameterComponent o = (TestCasesSuiteParameterComponent) other_; 1672 return compareValues(name, o.name, true) && compareValues(mode, o.mode, true); 1673 } 1674 1675 public boolean isEmpty() { 1676 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, value, mode); 1677 } 1678 1679 public String fhirType() { 1680 return "TestCases.suite.parameter"; 1681 1682 } 1683 1684 } 1685 1686 @Block() 1687 public static class TestCasesSuiteTestComponent extends LogicalBase { 1688 /** 1689 * The name by which this test is known by in the test system. The name must be unique in the suite 1690 */ 1691 @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) 1692 @Description(shortDefinition="The name of this test - unique in the suite", formalDefinition="The name by which this test is known by in the test system. The name must be unique in the suite" ) 1693 protected StringType name; 1694 1695 /** 1696 * Description of what this test does / why it was defined. This should explain to a tester what they should know when looking at failing test results 1697 */ 1698 @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) 1699 @Description(shortDefinition="Description of what this test does / why it was defined", formalDefinition="Description of what this test does / why it was defined. This should explain to a tester what they should know when looking at failing test results" ) 1700 protected StringType description; 1701 1702 /** 1703 * A code that identifies the operation executed for this test. One of the codes defined in the definition of the runner 1704 */ 1705 @Child(name = "operation", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false) 1706 @Description(shortDefinition="Operation that is executed during this test (per definition of runner)", formalDefinition="A code that identifies the operation executed for this test. One of the codes defined in the definition of the runner" ) 1707 protected CodeType operation; 1708 1709 /** 1710 * If this mode is not passed to the runner, then this test will not be run 1711 */ 1712 @Child(name = "mode", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) 1713 @Description(shortDefinition="mode required to run this test", formalDefinition="If this mode is not passed to the runner, then this test will not be run" ) 1714 protected StringType mode; 1715 1716 /** 1717 * 1718 */ 1719 @Child(name = "parameter", type = {TestCasesSuiteParameterComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 1720 @Description(shortDefinition="", formalDefinition="" ) 1721 protected List<TestCasesSuiteParameterComponent> parameter; 1722 1723 /** 1724 * The resources used when executing this test. How exactly they are used depends on the definition of the runner. 1725 */ 1726 @Child(name = "input", type = {TestCasesSuiteResourceComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 1727 @Description(shortDefinition="Resources used when executing this test (per runner definition)", formalDefinition="The resources used when executing this test. How exactly they are used depends on the definition of the runner." ) 1728 protected List<TestCasesSuiteResourceComponent> input; 1729 1730 /** 1731 * Resources expected as output from this test. Often, but not always, these resources are Matchetype resources. How exactly it is used depends on the definition of the runner 1732 */ 1733 @Child(name = "output", type = {TestCasesSuiteResourceComponent.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 1734 @Description(shortDefinition="Resources expected as output from this test (per runner definition, often Matchetypes)", formalDefinition="Resources expected as output from this test. Often, but not always, these resources are Matchetype resources. How exactly it is used depends on the definition of the runner" ) 1735 protected List<TestCasesSuiteResourceComponent> output; 1736 1737 private static final long serialVersionUID = -321392022L; 1738 1739 /** 1740 * Constructor 1741 */ 1742 public TestCasesSuiteTestComponent() { 1743 super(); 1744 } 1745 1746 /** 1747 * Constructor 1748 */ 1749 public TestCasesSuiteTestComponent(String name) { 1750 super(); 1751 this.setName(name); 1752 } 1753 1754 /** 1755 * @return {@link #name} (The name by which this test is known by in the test system. The name must be unique in the suite). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 1756 */ 1757 public StringType getNameElement() { 1758 if (this.name == null) 1759 if (Configuration.errorOnAutoCreate()) 1760 throw new Error("Attempt to auto-create TestCasesSuiteTestComponent.name"); 1761 else if (Configuration.doAutoCreate()) 1762 this.name = new StringType(); // bb 1763 return this.name; 1764 } 1765 1766 public boolean hasNameElement() { 1767 return this.name != null && !this.name.isEmpty(); 1768 } 1769 1770 public boolean hasName() { 1771 return this.name != null && !this.name.isEmpty(); 1772 } 1773 1774 /** 1775 * @param value {@link #name} (The name by which this test is known by in the test system. The name must be unique in the suite). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 1776 */ 1777 public TestCasesSuiteTestComponent setNameElement(StringType value) { 1778 this.name = value; 1779 return this; 1780 } 1781 1782 /** 1783 * @return The name by which this test is known by in the test system. The name must be unique in the suite 1784 */ 1785 public String getName() { 1786 return this.name == null ? null : this.name.getValue(); 1787 } 1788 1789 /** 1790 * @param value The name by which this test is known by in the test system. The name must be unique in the suite 1791 */ 1792 public TestCasesSuiteTestComponent setName(String value) { 1793 if (this.name == null) 1794 this.name = new StringType(); 1795 this.name.setValue(value); 1796 return this; 1797 } 1798 1799 /** 1800 * @return {@link #description} (Description of what this test does / why it was defined. This should explain to a tester what they should know when looking at failing test results). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 1801 */ 1802 public StringType getDescriptionElement() { 1803 if (this.description == null) 1804 if (Configuration.errorOnAutoCreate()) 1805 throw new Error("Attempt to auto-create TestCasesSuiteTestComponent.description"); 1806 else if (Configuration.doAutoCreate()) 1807 this.description = new StringType(); // bb 1808 return this.description; 1809 } 1810 1811 public boolean hasDescriptionElement() { 1812 return this.description != null && !this.description.isEmpty(); 1813 } 1814 1815 public boolean hasDescription() { 1816 return this.description != null && !this.description.isEmpty(); 1817 } 1818 1819 /** 1820 * @param value {@link #description} (Description of what this test does / why it was defined. This should explain to a tester what they should know when looking at failing test results). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 1821 */ 1822 public TestCasesSuiteTestComponent setDescriptionElement(StringType value) { 1823 this.description = value; 1824 return this; 1825 } 1826 1827 /** 1828 * @return Description of what this test does / why it was defined. This should explain to a tester what they should know when looking at failing test results 1829 */ 1830 public String getDescription() { 1831 return this.description == null ? null : this.description.getValue(); 1832 } 1833 1834 /** 1835 * @param value Description of what this test does / why it was defined. This should explain to a tester what they should know when looking at failing test results 1836 */ 1837 public TestCasesSuiteTestComponent setDescription(String value) { 1838 if (Utilities.noString(value)) 1839 this.description = null; 1840 else { 1841 if (this.description == null) 1842 this.description = new StringType(); 1843 this.description.setValue(value); 1844 } 1845 return this; 1846 } 1847 1848 /** 1849 * @return {@link #operation} (A code that identifies the operation executed for this test. One of the codes defined in the definition of the runner). This is the underlying object with id, value and extensions. The accessor "getOperation" gives direct access to the value 1850 */ 1851 public CodeType getOperationElement() { 1852 if (this.operation == null) 1853 if (Configuration.errorOnAutoCreate()) 1854 throw new Error("Attempt to auto-create TestCasesSuiteTestComponent.operation"); 1855 else if (Configuration.doAutoCreate()) 1856 this.operation = new CodeType(); // bb 1857 return this.operation; 1858 } 1859 1860 public boolean hasOperationElement() { 1861 return this.operation != null && !this.operation.isEmpty(); 1862 } 1863 1864 public boolean hasOperation() { 1865 return this.operation != null && !this.operation.isEmpty(); 1866 } 1867 1868 /** 1869 * @param value {@link #operation} (A code that identifies the operation executed for this test. One of the codes defined in the definition of the runner). This is the underlying object with id, value and extensions. The accessor "getOperation" gives direct access to the value 1870 */ 1871 public TestCasesSuiteTestComponent setOperationElement(CodeType value) { 1872 this.operation = value; 1873 return this; 1874 } 1875 1876 /** 1877 * @return A code that identifies the operation executed for this test. One of the codes defined in the definition of the runner 1878 */ 1879 public String getOperation() { 1880 return this.operation == null ? null : this.operation.getValue(); 1881 } 1882 1883 /** 1884 * @param value A code that identifies the operation executed for this test. One of the codes defined in the definition of the runner 1885 */ 1886 public TestCasesSuiteTestComponent setOperation(String value) { 1887 if (Utilities.noString(value)) 1888 this.operation = null; 1889 else { 1890 if (this.operation == null) 1891 this.operation = new CodeType(); 1892 this.operation.setValue(value); 1893 } 1894 return this; 1895 } 1896 1897 /** 1898 * @return {@link #mode} (If this mode is not passed to the runner, then this test will not be run). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value 1899 */ 1900 public StringType getModeElement() { 1901 if (this.mode == null) 1902 if (Configuration.errorOnAutoCreate()) 1903 throw new Error("Attempt to auto-create TestCasesSuiteTestComponent.mode"); 1904 else if (Configuration.doAutoCreate()) 1905 this.mode = new StringType(); // bb 1906 return this.mode; 1907 } 1908 1909 public boolean hasModeElement() { 1910 return this.mode != null && !this.mode.isEmpty(); 1911 } 1912 1913 public boolean hasMode() { 1914 return this.mode != null && !this.mode.isEmpty(); 1915 } 1916 1917 /** 1918 * @param value {@link #mode} (If this mode is not passed to the runner, then this test will not be run). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value 1919 */ 1920 public TestCasesSuiteTestComponent setModeElement(StringType value) { 1921 this.mode = value; 1922 return this; 1923 } 1924 1925 /** 1926 * @return If this mode is not passed to the runner, then this test will not be run 1927 */ 1928 public String getMode() { 1929 return this.mode == null ? null : this.mode.getValue(); 1930 } 1931 1932 /** 1933 * @param value If this mode is not passed to the runner, then this test will not be run 1934 */ 1935 public TestCasesSuiteTestComponent setMode(String value) { 1936 if (Utilities.noString(value)) 1937 this.mode = null; 1938 else { 1939 if (this.mode == null) 1940 this.mode = new StringType(); 1941 this.mode.setValue(value); 1942 } 1943 return this; 1944 } 1945 1946 /** 1947 * @return {@link #parameter} () 1948 */ 1949 public List<TestCasesSuiteParameterComponent> getParameter() { 1950 if (this.parameter == null) 1951 this.parameter = new ArrayList<TestCasesSuiteParameterComponent>(); 1952 return this.parameter; 1953 } 1954 1955 /** 1956 * @return Returns a reference to <code>this</code> for easy method chaining 1957 */ 1958 public TestCasesSuiteTestComponent setParameter(List<TestCasesSuiteParameterComponent> theParameter) { 1959 this.parameter = theParameter; 1960 return this; 1961 } 1962 1963 public boolean hasParameter() { 1964 if (this.parameter == null) 1965 return false; 1966 for (TestCasesSuiteParameterComponent item : this.parameter) 1967 if (!item.isEmpty()) 1968 return true; 1969 return false; 1970 } 1971 1972 public TestCasesSuiteParameterComponent addParameter() { //3 1973 TestCasesSuiteParameterComponent t = new TestCasesSuiteParameterComponent(); 1974 if (this.parameter == null) 1975 this.parameter = new ArrayList<TestCasesSuiteParameterComponent>(); 1976 this.parameter.add(t); 1977 return t; 1978 } 1979 1980 public TestCasesSuiteTestComponent addParameter(TestCasesSuiteParameterComponent t) { //3 1981 if (t == null) 1982 return this; 1983 if (this.parameter == null) 1984 this.parameter = new ArrayList<TestCasesSuiteParameterComponent>(); 1985 this.parameter.add(t); 1986 return this; 1987 } 1988 1989 /** 1990 * @return The first repetition of repeating field {@link #parameter}, creating it if it does not already exist {3} 1991 */ 1992 public TestCasesSuiteParameterComponent getParameterFirstRep() { 1993 if (getParameter().isEmpty()) { 1994 addParameter(); 1995 } 1996 return getParameter().get(0); 1997 } 1998 1999 /** 2000 * @return {@link #input} (The resources used when executing this test. How exactly they are used depends on the definition of the runner.) 2001 */ 2002 public List<TestCasesSuiteResourceComponent> getInput() { 2003 if (this.input == null) 2004 this.input = new ArrayList<TestCasesSuiteResourceComponent>(); 2005 return this.input; 2006 } 2007 2008 /** 2009 * @return Returns a reference to <code>this</code> for easy method chaining 2010 */ 2011 public TestCasesSuiteTestComponent setInput(List<TestCasesSuiteResourceComponent> theInput) { 2012 this.input = theInput; 2013 return this; 2014 } 2015 2016 public boolean hasInput() { 2017 if (this.input == null) 2018 return false; 2019 for (TestCasesSuiteResourceComponent item : this.input) 2020 if (!item.isEmpty()) 2021 return true; 2022 return false; 2023 } 2024 2025 public TestCasesSuiteResourceComponent addInput() { //3 2026 TestCasesSuiteResourceComponent t = new TestCasesSuiteResourceComponent(); 2027 if (this.input == null) 2028 this.input = new ArrayList<TestCasesSuiteResourceComponent>(); 2029 this.input.add(t); 2030 return t; 2031 } 2032 2033 public TestCasesSuiteTestComponent addInput(TestCasesSuiteResourceComponent t) { //3 2034 if (t == null) 2035 return this; 2036 if (this.input == null) 2037 this.input = new ArrayList<TestCasesSuiteResourceComponent>(); 2038 this.input.add(t); 2039 return this; 2040 } 2041 2042 /** 2043 * @return The first repetition of repeating field {@link #input}, creating it if it does not already exist {3} 2044 */ 2045 public TestCasesSuiteResourceComponent getInputFirstRep() { 2046 if (getInput().isEmpty()) { 2047 addInput(); 2048 } 2049 return getInput().get(0); 2050 } 2051 2052 /** 2053 * @return {@link #output} (Resources expected as output from this test. Often, but not always, these resources are Matchetype resources. How exactly it is used depends on the definition of the runner) 2054 */ 2055 public List<TestCasesSuiteResourceComponent> getOutput() { 2056 if (this.output == null) 2057 this.output = new ArrayList<TestCasesSuiteResourceComponent>(); 2058 return this.output; 2059 } 2060 2061 /** 2062 * @return Returns a reference to <code>this</code> for easy method chaining 2063 */ 2064 public TestCasesSuiteTestComponent setOutput(List<TestCasesSuiteResourceComponent> theOutput) { 2065 this.output = theOutput; 2066 return this; 2067 } 2068 2069 public boolean hasOutput() { 2070 if (this.output == null) 2071 return false; 2072 for (TestCasesSuiteResourceComponent item : this.output) 2073 if (!item.isEmpty()) 2074 return true; 2075 return false; 2076 } 2077 2078 public TestCasesSuiteResourceComponent addOutput() { //3 2079 TestCasesSuiteResourceComponent t = new TestCasesSuiteResourceComponent(); 2080 if (this.output == null) 2081 this.output = new ArrayList<TestCasesSuiteResourceComponent>(); 2082 this.output.add(t); 2083 return t; 2084 } 2085 2086 public TestCasesSuiteTestComponent addOutput(TestCasesSuiteResourceComponent t) { //3 2087 if (t == null) 2088 return this; 2089 if (this.output == null) 2090 this.output = new ArrayList<TestCasesSuiteResourceComponent>(); 2091 this.output.add(t); 2092 return this; 2093 } 2094 2095 /** 2096 * @return The first repetition of repeating field {@link #output}, creating it if it does not already exist {3} 2097 */ 2098 public TestCasesSuiteResourceComponent getOutputFirstRep() { 2099 if (getOutput().isEmpty()) { 2100 addOutput(); 2101 } 2102 return getOutput().get(0); 2103 } 2104 2105 protected void listChildren(List<Property> children) { 2106 super.listChildren(children); 2107 children.add(new Property("name", "string", "The name by which this test is known by in the test system. The name must be unique in the suite", 0, 1, name)); 2108 children.add(new Property("description", "string", "Description of what this test does / why it was defined. This should explain to a tester what they should know when looking at failing test results", 0, 1, description)); 2109 children.add(new Property("operation", "code", "A code that identifies the operation executed for this test. One of the codes defined in the definition of the runner", 0, 1, operation)); 2110 children.add(new Property("mode", "string", "If this mode is not passed to the runner, then this test will not be run", 0, 1, mode)); 2111 children.add(new Property("parameter", "http://hl7.org/fhir/tools/StructureDefinition/TestCases@TestCases.suite.parameter", "", 0, java.lang.Integer.MAX_VALUE, parameter)); 2112 children.add(new Property("input", "http://hl7.org/fhir/tools/StructureDefinition/TestCases@TestCases.suite.resource", "The resources used when executing this test. How exactly they are used depends on the definition of the runner.", 0, java.lang.Integer.MAX_VALUE, input)); 2113 children.add(new Property("output", "http://hl7.org/fhir/tools/StructureDefinition/TestCases@TestCases.suite.resource", "Resources expected as output from this test. Often, but not always, these resources are Matchetype resources. How exactly it is used depends on the definition of the runner", 0, java.lang.Integer.MAX_VALUE, output)); 2114 } 2115 2116 @Override 2117 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 2118 switch (_hash) { 2119 case 3373707: /*name*/ return new Property("name", "string", "The name by which this test is known by in the test system. The name must be unique in the suite", 0, 1, name); 2120 case -1724546052: /*description*/ return new Property("description", "string", "Description of what this test does / why it was defined. This should explain to a tester what they should know when looking at failing test results", 0, 1, description); 2121 case 1662702951: /*operation*/ return new Property("operation", "code", "A code that identifies the operation executed for this test. One of the codes defined in the definition of the runner", 0, 1, operation); 2122 case 3357091: /*mode*/ return new Property("mode", "string", "If this mode is not passed to the runner, then this test will not be run", 0, 1, mode); 2123 case 1954460585: /*parameter*/ return new Property("parameter", "http://hl7.org/fhir/tools/StructureDefinition/TestCases@TestCases.suite.parameter", "", 0, java.lang.Integer.MAX_VALUE, parameter); 2124 case 100358090: /*input*/ return new Property("input", "http://hl7.org/fhir/tools/StructureDefinition/TestCases@TestCases.suite.resource", "The resources used when executing this test. How exactly they are used depends on the definition of the runner.", 0, java.lang.Integer.MAX_VALUE, input); 2125 case -1005512447: /*output*/ return new Property("output", "http://hl7.org/fhir/tools/StructureDefinition/TestCases@TestCases.suite.resource", "Resources expected as output from this test. Often, but not always, these resources are Matchetype resources. How exactly it is used depends on the definition of the runner", 0, java.lang.Integer.MAX_VALUE, output); 2126 default: return super.getNamedProperty(_hash, _name, _checkValid); 2127 } 2128 2129 } 2130 2131 @Override 2132 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 2133 switch (hash) { 2134 case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType 2135 case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType 2136 case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : new Base[] {this.operation}; // CodeType 2137 case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // StringType 2138 case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // TestCasesSuiteParameterComponent 2139 case 100358090: /*input*/ return this.input == null ? new Base[0] : this.input.toArray(new Base[this.input.size()]); // TestCasesSuiteResourceComponent 2140 case -1005512447: /*output*/ return this.output == null ? new Base[0] : this.output.toArray(new Base[this.output.size()]); // TestCasesSuiteResourceComponent 2141 default: return super.getProperty(hash, name, checkValid); 2142 } 2143 2144 } 2145 2146 @Override 2147 public Base setProperty(int hash, String name, Base value) throws FHIRException { 2148 switch (hash) { 2149 case 3373707: // name 2150 this.name = TypeConvertor.castToString(value); // StringType 2151 return value; 2152 case -1724546052: // description 2153 this.description = TypeConvertor.castToString(value); // StringType 2154 return value; 2155 case 1662702951: // operation 2156 this.operation = TypeConvertor.castToCode(value); // CodeType 2157 return value; 2158 case 3357091: // mode 2159 this.mode = TypeConvertor.castToString(value); // StringType 2160 return value; 2161 case 1954460585: // parameter 2162 this.getParameter().add((TestCasesSuiteParameterComponent) value); // TestCasesSuiteParameterComponent 2163 return value; 2164 case 100358090: // input 2165 this.getInput().add((TestCasesSuiteResourceComponent) value); // TestCasesSuiteResourceComponent 2166 return value; 2167 case -1005512447: // output 2168 this.getOutput().add((TestCasesSuiteResourceComponent) value); // TestCasesSuiteResourceComponent 2169 return value; 2170 default: return super.setProperty(hash, name, value); 2171 } 2172 2173 } 2174 2175 @Override 2176 public Base setProperty(String name, Base value) throws FHIRException { 2177 if (name.equals("name")) { 2178 this.name = TypeConvertor.castToString(value); // StringType 2179 } else if (name.equals("description")) { 2180 this.description = TypeConvertor.castToString(value); // StringType 2181 } else if (name.equals("operation")) { 2182 this.operation = TypeConvertor.castToCode(value); // CodeType 2183 } else if (name.equals("mode")) { 2184 this.mode = TypeConvertor.castToString(value); // StringType 2185 } else if (name.equals("parameter")) { 2186 this.getParameter().add((TestCasesSuiteParameterComponent) value); // TestCasesSuiteParameterComponent 2187 } else if (name.equals("input")) { 2188 this.getInput().add((TestCasesSuiteResourceComponent) value); // TestCasesSuiteResourceComponent 2189 } else if (name.equals("output")) { 2190 this.getOutput().add((TestCasesSuiteResourceComponent) value); // TestCasesSuiteResourceComponent 2191 } else 2192 return super.setProperty(name, value); 2193 return value; 2194 } 2195 2196 @Override 2197 public Base makeProperty(int hash, String name) throws FHIRException { 2198 switch (hash) { 2199 case 3373707: return getNameElement(); 2200 case -1724546052: return getDescriptionElement(); 2201 case 1662702951: return getOperationElement(); 2202 case 3357091: return getModeElement(); 2203 case 1954460585: return addParameter(); 2204 case 100358090: return addInput(); 2205 case -1005512447: return addOutput(); 2206 default: return super.makeProperty(hash, name); 2207 } 2208 2209 } 2210 2211 @Override 2212 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 2213 switch (hash) { 2214 case 3373707: /*name*/ return new String[] {"string"}; 2215 case -1724546052: /*description*/ return new String[] {"string"}; 2216 case 1662702951: /*operation*/ return new String[] {"code"}; 2217 case 3357091: /*mode*/ return new String[] {"string"}; 2218 case 1954460585: /*parameter*/ return new String[] {"http://hl7.org/fhir/tools/StructureDefinition/TestCases@TestCases.suite.parameter"}; 2219 case 100358090: /*input*/ return new String[] {"http://hl7.org/fhir/tools/StructureDefinition/TestCases@TestCases.suite.resource"}; 2220 case -1005512447: /*output*/ return new String[] {"http://hl7.org/fhir/tools/StructureDefinition/TestCases@TestCases.suite.resource"}; 2221 default: return super.getTypesForProperty(hash, name); 2222 } 2223 2224 } 2225 2226 @Override 2227 public Base addChild(String name) throws FHIRException { 2228 if (name.equals("name")) { 2229 throw new FHIRException("Cannot call addChild on a singleton property TestCases.suite.test.name"); 2230 } 2231 else if (name.equals("description")) { 2232 throw new FHIRException("Cannot call addChild on a singleton property TestCases.suite.test.description"); 2233 } 2234 else if (name.equals("operation")) { 2235 throw new FHIRException("Cannot call addChild on a singleton property TestCases.suite.test.operation"); 2236 } 2237 else if (name.equals("mode")) { 2238 throw new FHIRException("Cannot call addChild on a singleton property TestCases.suite.test.mode"); 2239 } 2240 else if (name.equals("parameter")) { 2241 return addParameter(); 2242 } 2243 else if (name.equals("input")) { 2244 return addInput(); 2245 } 2246 else if (name.equals("output")) { 2247 return addOutput(); 2248 } 2249 else 2250 return super.addChild(name); 2251 } 2252 2253 public TestCasesSuiteTestComponent copy() { 2254 TestCasesSuiteTestComponent dst = new TestCasesSuiteTestComponent(); 2255 copyValues(dst); 2256 return dst; 2257 } 2258 2259 public void copyValues(TestCasesSuiteTestComponent dst) { 2260 super.copyValues(dst); 2261 dst.name = name == null ? null : name.copy(); 2262 dst.description = description == null ? null : description.copy(); 2263 dst.operation = operation == null ? null : operation.copy(); 2264 dst.mode = mode == null ? null : mode.copy(); 2265 if (parameter != null) { 2266 dst.parameter = new ArrayList<TestCasesSuiteParameterComponent>(); 2267 for (TestCasesSuiteParameterComponent i : parameter) 2268 dst.parameter.add(i.copy()); 2269 }; 2270 if (input != null) { 2271 dst.input = new ArrayList<TestCasesSuiteResourceComponent>(); 2272 for (TestCasesSuiteResourceComponent i : input) 2273 dst.input.add(i.copy()); 2274 }; 2275 if (output != null) { 2276 dst.output = new ArrayList<TestCasesSuiteResourceComponent>(); 2277 for (TestCasesSuiteResourceComponent i : output) 2278 dst.output.add(i.copy()); 2279 }; 2280 } 2281 2282 @Override 2283 public boolean equalsDeep(Base other_) { 2284 if (!super.equalsDeep(other_)) 2285 return false; 2286 if (!(other_ instanceof TestCasesSuiteTestComponent)) 2287 return false; 2288 TestCasesSuiteTestComponent o = (TestCasesSuiteTestComponent) other_; 2289 return compareDeep(name, o.name, true) && compareDeep(description, o.description, true) && compareDeep(operation, o.operation, true) 2290 && compareDeep(mode, o.mode, true) && compareDeep(parameter, o.parameter, true) && compareDeep(input, o.input, true) 2291 && compareDeep(output, o.output, true); 2292 } 2293 2294 @Override 2295 public boolean equalsShallow(Base other_) { 2296 if (!super.equalsShallow(other_)) 2297 return false; 2298 if (!(other_ instanceof TestCasesSuiteTestComponent)) 2299 return false; 2300 TestCasesSuiteTestComponent o = (TestCasesSuiteTestComponent) other_; 2301 return compareValues(name, o.name, true) && compareValues(description, o.description, true) && compareValues(operation, o.operation, true) 2302 && compareValues(mode, o.mode, true); 2303 } 2304 2305 public boolean isEmpty() { 2306 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, description, operation 2307 , mode, parameter, input, output); 2308 } 2309 2310 public String fhirType() { 2311 return "TestCases.suite.test"; 2312 2313 } 2314 2315 } 2316 2317 /** 2318 * An absolute URI that is used to identify test tests. 2319 */ 2320 @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) 2321 @Description(shortDefinition="Canonical identifier for these tests, represented as a URI (globally unique)", formalDefinition="An absolute URI that is used to identify test tests." ) 2322 protected UriType url; 2323 2324 /** 2325 * The identifier that is used to identify this version of these tests. Version must use SemVer 2326 */ 2327 @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) 2328 @Description(shortDefinition="Business version of the test set (semver)", formalDefinition="The identifier that is used to identify this version of these tests. Version must use SemVer" ) 2329 protected StringType version; 2330 2331 /** 2332 * A natural language name identifying the tests. This name should be usable as an identifier for the module by machine processing applications such as code generation. 2333 */ 2334 @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) 2335 @Description(shortDefinition="Name for these tests", formalDefinition="A natural language name identifying the tests. This name should be usable as an identifier for the module by machine processing applications such as code generation." ) 2336 protected StringType name; 2337 2338 /** 2339 * General description of these teats. 2340 */ 2341 @Child(name = "description", type = {MarkdownType.class}, order=3, min=0, max=1, modifier=false, summary=true) 2342 @Description(shortDefinition="General Description of these tests", formalDefinition="General description of these teats." ) 2343 protected MarkdownType description; 2344 2345 /** 2346 * URL of documentation that explains how a runner would read these tests, and use them to actually test out a tool. 2347 */ 2348 @Child(name = "runner", type = {UrlType.class}, order=4, min=1, max=1, modifier=false, summary=false) 2349 @Description(shortDefinition="URL Documentation for a runner that executes these tests", formalDefinition="URL of documentation that explains how a runner would read these tests, and use them to actually test out a tool." ) 2350 protected UrlType runner; 2351 2352 /** 2353 * A mode that can be passed to a runner running these these tests, that affects test content and influences how the tests are executed or evaulated (or even if they run) 2354 */ 2355 @Child(name = "mode", type = {Base.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 2356 @Description(shortDefinition="A mode that can be passed to runner - affects test content", formalDefinition="A mode that can be passed to a runner running these these tests, that affects test content and influences how the tests are executed or evaulated (or even if they run)" ) 2357 protected List<TestCasesModeComponent> mode; 2358 2359 /** 2360 * A suite of tests that all share a common set up, and can be executed as a group 2361 */ 2362 @Child(name = "suite", type = {Base.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 2363 @Description(shortDefinition="A suite of tests that share a common set up", formalDefinition="A suite of tests that all share a common set up, and can be executed as a group" ) 2364 protected List<TestCasesSuiteComponent> suite; 2365 2366 private static final long serialVersionUID = 1760584672L; 2367 2368 /** 2369 * Constructor 2370 */ 2371 public TestCases() { 2372 super(); 2373 } 2374 2375 /** 2376 * Constructor 2377 */ 2378 public TestCases(String runner) { 2379 super(); 2380 this.setRunner(runner); 2381 } 2382 2383 /** 2384 * @return {@link #url} (An absolute URI that is used to identify test tests.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value 2385 */ 2386 public UriType getUrlElement() { 2387 if (this.url == null) 2388 if (Configuration.errorOnAutoCreate()) 2389 throw new Error("Attempt to auto-create TestCases.url"); 2390 else if (Configuration.doAutoCreate()) 2391 this.url = new UriType(); // bb 2392 return this.url; 2393 } 2394 2395 public boolean hasUrlElement() { 2396 return this.url != null && !this.url.isEmpty(); 2397 } 2398 2399 public boolean hasUrl() { 2400 return this.url != null && !this.url.isEmpty(); 2401 } 2402 2403 /** 2404 * @param value {@link #url} (An absolute URI that is used to identify test tests.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value 2405 */ 2406 public TestCases setUrlElement(UriType value) { 2407 this.url = value; 2408 return this; 2409 } 2410 2411 /** 2412 * @return An absolute URI that is used to identify test tests. 2413 */ 2414 public String getUrl() { 2415 return this.url == null ? null : this.url.getValue(); 2416 } 2417 2418 /** 2419 * @param value An absolute URI that is used to identify test tests. 2420 */ 2421 public TestCases setUrl(String value) { 2422 if (Utilities.noString(value)) 2423 this.url = null; 2424 else { 2425 if (this.url == null) 2426 this.url = new UriType(); 2427 this.url.setValue(value); 2428 } 2429 return this; 2430 } 2431 2432 /** 2433 * @return {@link #version} (The identifier that is used to identify this version of these tests. Version must use SemVer). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value 2434 */ 2435 public StringType getVersionElement() { 2436 if (this.version == null) 2437 if (Configuration.errorOnAutoCreate()) 2438 throw new Error("Attempt to auto-create TestCases.version"); 2439 else if (Configuration.doAutoCreate()) 2440 this.version = new StringType(); // bb 2441 return this.version; 2442 } 2443 2444 public boolean hasVersionElement() { 2445 return this.version != null && !this.version.isEmpty(); 2446 } 2447 2448 public boolean hasVersion() { 2449 return this.version != null && !this.version.isEmpty(); 2450 } 2451 2452 /** 2453 * @param value {@link #version} (The identifier that is used to identify this version of these tests. Version must use SemVer). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value 2454 */ 2455 public TestCases setVersionElement(StringType value) { 2456 this.version = value; 2457 return this; 2458 } 2459 2460 /** 2461 * @return The identifier that is used to identify this version of these tests. Version must use SemVer 2462 */ 2463 public String getVersion() { 2464 return this.version == null ? null : this.version.getValue(); 2465 } 2466 2467 /** 2468 * @param value The identifier that is used to identify this version of these tests. Version must use SemVer 2469 */ 2470 public TestCases setVersion(String value) { 2471 if (Utilities.noString(value)) 2472 this.version = null; 2473 else { 2474 if (this.version == null) 2475 this.version = new StringType(); 2476 this.version.setValue(value); 2477 } 2478 return this; 2479 } 2480 2481 /** 2482 * @return {@link #name} (A natural language name identifying the tests. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 2483 */ 2484 public StringType getNameElement() { 2485 if (this.name == null) 2486 if (Configuration.errorOnAutoCreate()) 2487 throw new Error("Attempt to auto-create TestCases.name"); 2488 else if (Configuration.doAutoCreate()) 2489 this.name = new StringType(); // bb 2490 return this.name; 2491 } 2492 2493 public boolean hasNameElement() { 2494 return this.name != null && !this.name.isEmpty(); 2495 } 2496 2497 public boolean hasName() { 2498 return this.name != null && !this.name.isEmpty(); 2499 } 2500 2501 /** 2502 * @param value {@link #name} (A natural language name identifying the tests. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 2503 */ 2504 public TestCases setNameElement(StringType value) { 2505 this.name = value; 2506 return this; 2507 } 2508 2509 /** 2510 * @return A natural language name identifying the tests. This name should be usable as an identifier for the module by machine processing applications such as code generation. 2511 */ 2512 public String getName() { 2513 return this.name == null ? null : this.name.getValue(); 2514 } 2515 2516 /** 2517 * @param value A natural language name identifying the tests. This name should be usable as an identifier for the module by machine processing applications such as code generation. 2518 */ 2519 public TestCases setName(String value) { 2520 if (Utilities.noString(value)) 2521 this.name = null; 2522 else { 2523 if (this.name == null) 2524 this.name = new StringType(); 2525 this.name.setValue(value); 2526 } 2527 return this; 2528 } 2529 2530 /** 2531 * @return {@link #description} (General description of these teats.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 2532 */ 2533 public MarkdownType getDescriptionElement() { 2534 if (this.description == null) 2535 if (Configuration.errorOnAutoCreate()) 2536 throw new Error("Attempt to auto-create TestCases.description"); 2537 else if (Configuration.doAutoCreate()) 2538 this.description = new MarkdownType(); // bb 2539 return this.description; 2540 } 2541 2542 public boolean hasDescriptionElement() { 2543 return this.description != null && !this.description.isEmpty(); 2544 } 2545 2546 public boolean hasDescription() { 2547 return this.description != null && !this.description.isEmpty(); 2548 } 2549 2550 /** 2551 * @param value {@link #description} (General description of these teats.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 2552 */ 2553 public TestCases setDescriptionElement(MarkdownType value) { 2554 this.description = value; 2555 return this; 2556 } 2557 2558 /** 2559 * @return General description of these teats. 2560 */ 2561 public String getDescription() { 2562 return this.description == null ? null : this.description.getValue(); 2563 } 2564 2565 /** 2566 * @param value General description of these teats. 2567 */ 2568 public TestCases setDescription(String value) { 2569 if (Utilities.noString(value)) 2570 this.description = null; 2571 else { 2572 if (this.description == null) 2573 this.description = new MarkdownType(); 2574 this.description.setValue(value); 2575 } 2576 return this; 2577 } 2578 2579 /** 2580 * @return {@link #runner} (URL of documentation that explains how a runner would read these tests, and use them to actually test out a tool.). This is the underlying object with id, value and extensions. The accessor "getRunner" gives direct access to the value 2581 */ 2582 public UrlType getRunnerElement() { 2583 if (this.runner == null) 2584 if (Configuration.errorOnAutoCreate()) 2585 throw new Error("Attempt to auto-create TestCases.runner"); 2586 else if (Configuration.doAutoCreate()) 2587 this.runner = new UrlType(); // bb 2588 return this.runner; 2589 } 2590 2591 public boolean hasRunnerElement() { 2592 return this.runner != null && !this.runner.isEmpty(); 2593 } 2594 2595 public boolean hasRunner() { 2596 return this.runner != null && !this.runner.isEmpty(); 2597 } 2598 2599 /** 2600 * @param value {@link #runner} (URL of documentation that explains how a runner would read these tests, and use them to actually test out a tool.). This is the underlying object with id, value and extensions. The accessor "getRunner" gives direct access to the value 2601 */ 2602 public TestCases setRunnerElement(UrlType value) { 2603 this.runner = value; 2604 return this; 2605 } 2606 2607 /** 2608 * @return URL of documentation that explains how a runner would read these tests, and use them to actually test out a tool. 2609 */ 2610 public String getRunner() { 2611 return this.runner == null ? null : this.runner.getValue(); 2612 } 2613 2614 /** 2615 * @param value URL of documentation that explains how a runner would read these tests, and use them to actually test out a tool. 2616 */ 2617 public TestCases setRunner(String value) { 2618 if (this.runner == null) 2619 this.runner = new UrlType(); 2620 this.runner.setValue(value); 2621 return this; 2622 } 2623 2624 /** 2625 * @return {@link #mode} (A mode that can be passed to a runner running these these tests, that affects test content and influences how the tests are executed or evaulated (or even if they run)) 2626 */ 2627 public List<TestCasesModeComponent> getMode() { 2628 if (this.mode == null) 2629 this.mode = new ArrayList<TestCasesModeComponent>(); 2630 return this.mode; 2631 } 2632 2633 /** 2634 * @return Returns a reference to <code>this</code> for easy method chaining 2635 */ 2636 public TestCases setMode(List<TestCasesModeComponent> theMode) { 2637 this.mode = theMode; 2638 return this; 2639 } 2640 2641 public boolean hasMode() { 2642 if (this.mode == null) 2643 return false; 2644 for (TestCasesModeComponent item : this.mode) 2645 if (!item.isEmpty()) 2646 return true; 2647 return false; 2648 } 2649 2650 public TestCasesModeComponent addMode() { //3 2651 TestCasesModeComponent t = new TestCasesModeComponent(); 2652 if (this.mode == null) 2653 this.mode = new ArrayList<TestCasesModeComponent>(); 2654 this.mode.add(t); 2655 return t; 2656 } 2657 2658 public TestCases addMode(TestCasesModeComponent t) { //3 2659 if (t == null) 2660 return this; 2661 if (this.mode == null) 2662 this.mode = new ArrayList<TestCasesModeComponent>(); 2663 this.mode.add(t); 2664 return this; 2665 } 2666 2667 /** 2668 * @return The first repetition of repeating field {@link #mode}, creating it if it does not already exist {3} 2669 */ 2670 public TestCasesModeComponent getModeFirstRep() { 2671 if (getMode().isEmpty()) { 2672 addMode(); 2673 } 2674 return getMode().get(0); 2675 } 2676 2677 /** 2678 * @return {@link #suite} (A suite of tests that all share a common set up, and can be executed as a group) 2679 */ 2680 public List<TestCasesSuiteComponent> getSuite() { 2681 if (this.suite == null) 2682 this.suite = new ArrayList<TestCasesSuiteComponent>(); 2683 return this.suite; 2684 } 2685 2686 /** 2687 * @return Returns a reference to <code>this</code> for easy method chaining 2688 */ 2689 public TestCases setSuite(List<TestCasesSuiteComponent> theSuite) { 2690 this.suite = theSuite; 2691 return this; 2692 } 2693 2694 public boolean hasSuite() { 2695 if (this.suite == null) 2696 return false; 2697 for (TestCasesSuiteComponent item : this.suite) 2698 if (!item.isEmpty()) 2699 return true; 2700 return false; 2701 } 2702 2703 public TestCasesSuiteComponent addSuite() { //3 2704 TestCasesSuiteComponent t = new TestCasesSuiteComponent(); 2705 if (this.suite == null) 2706 this.suite = new ArrayList<TestCasesSuiteComponent>(); 2707 this.suite.add(t); 2708 return t; 2709 } 2710 2711 public TestCases addSuite(TestCasesSuiteComponent t) { //3 2712 if (t == null) 2713 return this; 2714 if (this.suite == null) 2715 this.suite = new ArrayList<TestCasesSuiteComponent>(); 2716 this.suite.add(t); 2717 return this; 2718 } 2719 2720 /** 2721 * @return The first repetition of repeating field {@link #suite}, creating it if it does not already exist {3} 2722 */ 2723 public TestCasesSuiteComponent getSuiteFirstRep() { 2724 if (getSuite().isEmpty()) { 2725 addSuite(); 2726 } 2727 return getSuite().get(0); 2728 } 2729 2730 protected void listChildren(List<Property> children) { 2731 super.listChildren(children); 2732 children.add(new Property("url", "uri", "An absolute URI that is used to identify test tests.", 0, 1, url)); 2733 children.add(new Property("version", "string", "The identifier that is used to identify this version of these tests. Version must use SemVer", 0, 1, version)); 2734 children.add(new Property("name", "string", "A natural language name identifying the tests. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name)); 2735 children.add(new Property("description", "markdown", "General description of these teats.", 0, 1, description)); 2736 children.add(new Property("runner", "url", "URL of documentation that explains how a runner would read these tests, and use them to actually test out a tool.", 0, 1, runner)); 2737 children.add(new Property("mode", "Base", "A mode that can be passed to a runner running these these tests, that affects test content and influences how the tests are executed or evaulated (or even if they run)", 0, java.lang.Integer.MAX_VALUE, mode)); 2738 children.add(new Property("suite", "Base", "A suite of tests that all share a common set up, and can be executed as a group", 0, java.lang.Integer.MAX_VALUE, suite)); 2739 } 2740 2741 @Override 2742 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 2743 switch (_hash) { 2744 case 116079: /*url*/ return new Property("url", "uri", "An absolute URI that is used to identify test tests.", 0, 1, url); 2745 case 351608024: /*version*/ return new Property("version", "string", "The identifier that is used to identify this version of these tests. Version must use SemVer", 0, 1, version); 2746 case 3373707: /*name*/ return new Property("name", "string", "A natural language name identifying the tests. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name); 2747 case -1724546052: /*description*/ return new Property("description", "markdown", "General description of these teats.", 0, 1, description); 2748 case -919806160: /*runner*/ return new Property("runner", "url", "URL of documentation that explains how a runner would read these tests, and use them to actually test out a tool.", 0, 1, runner); 2749 case 3357091: /*mode*/ return new Property("mode", "Base", "A mode that can be passed to a runner running these these tests, that affects test content and influences how the tests are executed or evaulated (or even if they run)", 0, java.lang.Integer.MAX_VALUE, mode); 2750 case 109795064: /*suite*/ return new Property("suite", "Base", "A suite of tests that all share a common set up, and can be executed as a group", 0, java.lang.Integer.MAX_VALUE, suite); 2751 default: return super.getNamedProperty(_hash, _name, _checkValid); 2752 } 2753 2754 } 2755 2756 @Override 2757 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 2758 switch (hash) { 2759 case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType 2760 case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType 2761 case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType 2762 case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType 2763 case -919806160: /*runner*/ return this.runner == null ? new Base[0] : new Base[] {this.runner}; // UrlType 2764 case 3357091: /*mode*/ return this.mode == null ? new Base[0] : this.mode.toArray(new Base[this.mode.size()]); // TestCasesModeComponent 2765 case 109795064: /*suite*/ return this.suite == null ? new Base[0] : this.suite.toArray(new Base[this.suite.size()]); // TestCasesSuiteComponent 2766 default: return super.getProperty(hash, name, checkValid); 2767 } 2768 2769 } 2770 2771 @Override 2772 public Base setProperty(int hash, String name, Base value) throws FHIRException { 2773 switch (hash) { 2774 case 116079: // url 2775 this.url = TypeConvertor.castToUri(value); // UriType 2776 return value; 2777 case 351608024: // version 2778 this.version = TypeConvertor.castToString(value); // StringType 2779 return value; 2780 case 3373707: // name 2781 this.name = TypeConvertor.castToString(value); // StringType 2782 return value; 2783 case -1724546052: // description 2784 this.description = TypeConvertor.castToMarkdown(value); // MarkdownType 2785 return value; 2786 case -919806160: // runner 2787 this.runner = TypeConvertor.castToUrl(value); // UrlType 2788 return value; 2789 case 3357091: // mode 2790 this.getMode().add((TestCasesModeComponent) value); // TestCasesModeComponent 2791 return value; 2792 case 109795064: // suite 2793 this.getSuite().add((TestCasesSuiteComponent) value); // TestCasesSuiteComponent 2794 return value; 2795 default: return super.setProperty(hash, name, value); 2796 } 2797 2798 } 2799 2800 @Override 2801 public Base setProperty(String name, Base value) throws FHIRException { 2802 if (name.equals("url")) { 2803 this.url = TypeConvertor.castToUri(value); // UriType 2804 } else if (name.equals("version")) { 2805 this.version = TypeConvertor.castToString(value); // StringType 2806 } else if (name.equals("name")) { 2807 this.name = TypeConvertor.castToString(value); // StringType 2808 } else if (name.equals("description")) { 2809 this.description = TypeConvertor.castToMarkdown(value); // MarkdownType 2810 } else if (name.equals("runner")) { 2811 this.runner = TypeConvertor.castToUrl(value); // UrlType 2812 } else if (name.equals("mode")) { 2813 this.getMode().add((TestCasesModeComponent) value); // TestCasesModeComponent 2814 } else if (name.equals("suite")) { 2815 this.getSuite().add((TestCasesSuiteComponent) value); // TestCasesSuiteComponent 2816 } else 2817 return super.setProperty(name, value); 2818 return value; 2819 } 2820 2821 @Override 2822 public Base makeProperty(int hash, String name) throws FHIRException { 2823 switch (hash) { 2824 case 116079: return getUrlElement(); 2825 case 351608024: return getVersionElement(); 2826 case 3373707: return getNameElement(); 2827 case -1724546052: return getDescriptionElement(); 2828 case -919806160: return getRunnerElement(); 2829 case 3357091: return addMode(); 2830 case 109795064: return addSuite(); 2831 default: return super.makeProperty(hash, name); 2832 } 2833 2834 } 2835 2836 @Override 2837 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 2838 switch (hash) { 2839 case 116079: /*url*/ return new String[] {"uri"}; 2840 case 351608024: /*version*/ return new String[] {"string"}; 2841 case 3373707: /*name*/ return new String[] {"string"}; 2842 case -1724546052: /*description*/ return new String[] {"markdown"}; 2843 case -919806160: /*runner*/ return new String[] {"url"}; 2844 case 3357091: /*mode*/ return new String[] {"Base"}; 2845 case 109795064: /*suite*/ return new String[] {"Base"}; 2846 default: return super.getTypesForProperty(hash, name); 2847 } 2848 2849 } 2850 2851 @Override 2852 public Base addChild(String name) throws FHIRException { 2853 if (name.equals("url")) { 2854 throw new FHIRException("Cannot call addChild on a singleton property TestCases.url"); 2855 } 2856 else if (name.equals("version")) { 2857 throw new FHIRException("Cannot call addChild on a singleton property TestCases.version"); 2858 } 2859 else if (name.equals("name")) { 2860 throw new FHIRException("Cannot call addChild on a singleton property TestCases.name"); 2861 } 2862 else if (name.equals("description")) { 2863 throw new FHIRException("Cannot call addChild on a singleton property TestCases.description"); 2864 } 2865 else if (name.equals("runner")) { 2866 throw new FHIRException("Cannot call addChild on a singleton property TestCases.runner"); 2867 } 2868 else if (name.equals("mode")) { 2869 throw new FHIRException("Cannot call addChild on an abstract type TestCases.mode"); 2870 } 2871 else if (name.equals("suite")) { 2872 throw new FHIRException("Cannot call addChild on an abstract type TestCases.suite"); 2873 } 2874 else 2875 return super.addChild(name); 2876 } 2877 2878 public String fhirType() { 2879 return "TestCases"; 2880 2881 } 2882 2883 public TestCases copy() { 2884 TestCases dst = new TestCases(); 2885 copyValues(dst); 2886 return dst; 2887 } 2888 2889 public void copyValues(TestCases dst) { 2890 super.copyValues(dst); 2891 dst.url = url == null ? null : url.copy(); 2892 dst.version = version == null ? null : version.copy(); 2893 dst.name = name == null ? null : name.copy(); 2894 dst.description = description == null ? null : description.copy(); 2895 dst.runner = runner == null ? null : runner.copy(); 2896 if (mode != null) { 2897 dst.mode = new ArrayList<TestCasesModeComponent>(); 2898 for (TestCasesModeComponent i : mode) 2899 dst.mode.add(i.copy()); 2900 }; 2901 if (suite != null) { 2902 dst.suite = new ArrayList<TestCasesSuiteComponent>(); 2903 for (TestCasesSuiteComponent i : suite) 2904 dst.suite.add(i.copy()); 2905 }; 2906 } 2907 2908 protected TestCases typedCopy() { 2909 return copy(); 2910 } 2911 2912 @Override 2913 public boolean equalsDeep(Base other_) { 2914 if (!super.equalsDeep(other_)) 2915 return false; 2916 if (!(other_ instanceof TestCases)) 2917 return false; 2918 TestCases o = (TestCases) other_; 2919 return compareDeep(url, o.url, true) && compareDeep(version, o.version, true) && compareDeep(name, o.name, true) 2920 && compareDeep(description, o.description, true) && compareDeep(runner, o.runner, true) && compareDeep(mode, o.mode, true) 2921 && compareDeep(suite, o.suite, true); 2922 } 2923 2924 @Override 2925 public boolean equalsShallow(Base other_) { 2926 if (!super.equalsShallow(other_)) 2927 return false; 2928 if (!(other_ instanceof TestCases)) 2929 return false; 2930 TestCases o = (TestCases) other_; 2931 return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) 2932 && compareValues(description, o.description, true) && compareValues(runner, o.runner, true); 2933 } 2934 2935 public boolean isEmpty() { 2936 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(url, version, name, description 2937 , runner, mode, suite); 2938 } 2939 2940 @Override 2941 public ResourceType getResourceType() { 2942 return ResourceType.Custom; 2943 } 2944 2945 public String getCustomResourceName() { 2946 return "TestCases"; 2947 } 2948 2949 2950} 2951