001package org.hl7.fhir.r4.model; 002 003 004 005/* 006 Copyright (c) 2011+, HL7, Inc. 007 All rights reserved. 008 009 Redistribution and use in source and binary forms, with or without modification, 010 are permitted provided that the following conditions are met: 011 012 * Redistributions of source code must retain the above copyright notice, this 013 list of conditions and the following disclaimer. 014 * Redistributions in binary form must reproduce the above copyright notice, 015 this list of conditions and the following disclaimer in the documentation 016 and/or other materials provided with the distribution. 017 * Neither the name of HL7 nor the names of its contributors may be used to 018 endorse or promote products derived from this software without specific 019 prior written permission. 020 021 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 022 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 023 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 024 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 025 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 026 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 027 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 028 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 029 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 030 POSSIBILITY OF SUCH DAMAGE. 031 032*/ 033 034 035// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1 036 037import java.util.*; 038 039import java.math.*; 040import org.hl7.fhir.utilities.Utilities; 041import ca.uhn.fhir.model.api.annotation.ResourceDef; 042import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; 043import ca.uhn.fhir.model.api.annotation.Child; 044import ca.uhn.fhir.model.api.annotation.ChildOrder; 045import ca.uhn.fhir.model.api.annotation.Description; 046import ca.uhn.fhir.model.api.annotation.Block; 047import org.hl7.fhir.instance.model.api.*; 048import org.hl7.fhir.exceptions.FHIRException; 049/** 050 * A summary of information based on the results of executing a TestScript. 051 */ 052@ResourceDef(name="TestReport", profile="http://hl7.org/fhir/StructureDefinition/TestReport") 053public class TestReport extends DomainResource { 054 055 public enum TestReportStatus { 056 /** 057 * All test operations have completed. 058 */ 059 COMPLETED, 060 /** 061 * A test operations is currently executing. 062 */ 063 INPROGRESS, 064 /** 065 * A test operation is waiting for an external client request. 066 */ 067 WAITING, 068 /** 069 * The test script execution was manually stopped. 070 */ 071 STOPPED, 072 /** 073 * This test report was entered or created in error. 074 */ 075 ENTEREDINERROR, 076 /** 077 * added to help the parsers with the generic types 078 */ 079 NULL; 080 public static TestReportStatus fromCode(String codeString) throws FHIRException { 081 if (codeString == null || "".equals(codeString)) 082 return null; 083 if ("completed".equals(codeString)) 084 return COMPLETED; 085 if ("in-progress".equals(codeString)) 086 return INPROGRESS; 087 if ("waiting".equals(codeString)) 088 return WAITING; 089 if ("stopped".equals(codeString)) 090 return STOPPED; 091 if ("entered-in-error".equals(codeString)) 092 return ENTEREDINERROR; 093 if (Configuration.isAcceptInvalidEnums()) 094 return null; 095 else 096 throw new FHIRException("Unknown TestReportStatus code '"+codeString+"'"); 097 } 098 public String toCode() { 099 switch (this) { 100 case COMPLETED: return "completed"; 101 case INPROGRESS: return "in-progress"; 102 case WAITING: return "waiting"; 103 case STOPPED: return "stopped"; 104 case ENTEREDINERROR: return "entered-in-error"; 105 case NULL: return null; 106 default: return "?"; 107 } 108 } 109 public String getSystem() { 110 switch (this) { 111 case COMPLETED: return "http://hl7.org/fhir/report-status-codes"; 112 case INPROGRESS: return "http://hl7.org/fhir/report-status-codes"; 113 case WAITING: return "http://hl7.org/fhir/report-status-codes"; 114 case STOPPED: return "http://hl7.org/fhir/report-status-codes"; 115 case ENTEREDINERROR: return "http://hl7.org/fhir/report-status-codes"; 116 case NULL: return null; 117 default: return "?"; 118 } 119 } 120 public String getDefinition() { 121 switch (this) { 122 case COMPLETED: return "All test operations have completed."; 123 case INPROGRESS: return "A test operations is currently executing."; 124 case WAITING: return "A test operation is waiting for an external client request."; 125 case STOPPED: return "The test script execution was manually stopped."; 126 case ENTEREDINERROR: return "This test report was entered or created in error."; 127 case NULL: return null; 128 default: return "?"; 129 } 130 } 131 public String getDisplay() { 132 switch (this) { 133 case COMPLETED: return "Completed"; 134 case INPROGRESS: return "In Progress"; 135 case WAITING: return "Waiting"; 136 case STOPPED: return "Stopped"; 137 case ENTEREDINERROR: return "Entered In Error"; 138 case NULL: return null; 139 default: return "?"; 140 } 141 } 142 } 143 144 public static class TestReportStatusEnumFactory implements EnumFactory<TestReportStatus> { 145 public TestReportStatus fromCode(String codeString) throws IllegalArgumentException { 146 if (codeString == null || "".equals(codeString)) 147 if (codeString == null || "".equals(codeString)) 148 return null; 149 if ("completed".equals(codeString)) 150 return TestReportStatus.COMPLETED; 151 if ("in-progress".equals(codeString)) 152 return TestReportStatus.INPROGRESS; 153 if ("waiting".equals(codeString)) 154 return TestReportStatus.WAITING; 155 if ("stopped".equals(codeString)) 156 return TestReportStatus.STOPPED; 157 if ("entered-in-error".equals(codeString)) 158 return TestReportStatus.ENTEREDINERROR; 159 throw new IllegalArgumentException("Unknown TestReportStatus code '"+codeString+"'"); 160 } 161 public Enumeration<TestReportStatus> fromType(Base code) throws FHIRException { 162 if (code == null) 163 return null; 164 if (code.isEmpty()) 165 return new Enumeration<TestReportStatus>(this); 166 String codeString = ((PrimitiveType) code).asStringValue(); 167 if (codeString == null || "".equals(codeString)) 168 return null; 169 if ("completed".equals(codeString)) 170 return new Enumeration<TestReportStatus>(this, TestReportStatus.COMPLETED); 171 if ("in-progress".equals(codeString)) 172 return new Enumeration<TestReportStatus>(this, TestReportStatus.INPROGRESS); 173 if ("waiting".equals(codeString)) 174 return new Enumeration<TestReportStatus>(this, TestReportStatus.WAITING); 175 if ("stopped".equals(codeString)) 176 return new Enumeration<TestReportStatus>(this, TestReportStatus.STOPPED); 177 if ("entered-in-error".equals(codeString)) 178 return new Enumeration<TestReportStatus>(this, TestReportStatus.ENTEREDINERROR); 179 throw new FHIRException("Unknown TestReportStatus code '"+codeString+"'"); 180 } 181 public String toCode(TestReportStatus code) { 182 if (code == TestReportStatus.COMPLETED) 183 return "completed"; 184 if (code == TestReportStatus.INPROGRESS) 185 return "in-progress"; 186 if (code == TestReportStatus.WAITING) 187 return "waiting"; 188 if (code == TestReportStatus.STOPPED) 189 return "stopped"; 190 if (code == TestReportStatus.ENTEREDINERROR) 191 return "entered-in-error"; 192 return "?"; 193 } 194 public String toSystem(TestReportStatus code) { 195 return code.getSystem(); 196 } 197 } 198 199 public enum TestReportResult { 200 /** 201 * All test operations successfully passed all asserts. 202 */ 203 PASS, 204 /** 205 * One or more test operations failed one or more asserts. 206 */ 207 FAIL, 208 /** 209 * One or more test operations is pending execution completion. 210 */ 211 PENDING, 212 /** 213 * added to help the parsers with the generic types 214 */ 215 NULL; 216 public static TestReportResult fromCode(String codeString) throws FHIRException { 217 if (codeString == null || "".equals(codeString)) 218 return null; 219 if ("pass".equals(codeString)) 220 return PASS; 221 if ("fail".equals(codeString)) 222 return FAIL; 223 if ("pending".equals(codeString)) 224 return PENDING; 225 if (Configuration.isAcceptInvalidEnums()) 226 return null; 227 else 228 throw new FHIRException("Unknown TestReportResult code '"+codeString+"'"); 229 } 230 public String toCode() { 231 switch (this) { 232 case PASS: return "pass"; 233 case FAIL: return "fail"; 234 case PENDING: return "pending"; 235 case NULL: return null; 236 default: return "?"; 237 } 238 } 239 public String getSystem() { 240 switch (this) { 241 case PASS: return "http://hl7.org/fhir/report-result-codes"; 242 case FAIL: return "http://hl7.org/fhir/report-result-codes"; 243 case PENDING: return "http://hl7.org/fhir/report-result-codes"; 244 case NULL: return null; 245 default: return "?"; 246 } 247 } 248 public String getDefinition() { 249 switch (this) { 250 case PASS: return "All test operations successfully passed all asserts."; 251 case FAIL: return "One or more test operations failed one or more asserts."; 252 case PENDING: return "One or more test operations is pending execution completion."; 253 case NULL: return null; 254 default: return "?"; 255 } 256 } 257 public String getDisplay() { 258 switch (this) { 259 case PASS: return "Pass"; 260 case FAIL: return "Fail"; 261 case PENDING: return "Pending"; 262 case NULL: return null; 263 default: return "?"; 264 } 265 } 266 } 267 268 public static class TestReportResultEnumFactory implements EnumFactory<TestReportResult> { 269 public TestReportResult fromCode(String codeString) throws IllegalArgumentException { 270 if (codeString == null || "".equals(codeString)) 271 if (codeString == null || "".equals(codeString)) 272 return null; 273 if ("pass".equals(codeString)) 274 return TestReportResult.PASS; 275 if ("fail".equals(codeString)) 276 return TestReportResult.FAIL; 277 if ("pending".equals(codeString)) 278 return TestReportResult.PENDING; 279 throw new IllegalArgumentException("Unknown TestReportResult code '"+codeString+"'"); 280 } 281 public Enumeration<TestReportResult> fromType(Base code) throws FHIRException { 282 if (code == null) 283 return null; 284 if (code.isEmpty()) 285 return new Enumeration<TestReportResult>(this); 286 String codeString = ((PrimitiveType) code).asStringValue(); 287 if (codeString == null || "".equals(codeString)) 288 return null; 289 if ("pass".equals(codeString)) 290 return new Enumeration<TestReportResult>(this, TestReportResult.PASS); 291 if ("fail".equals(codeString)) 292 return new Enumeration<TestReportResult>(this, TestReportResult.FAIL); 293 if ("pending".equals(codeString)) 294 return new Enumeration<TestReportResult>(this, TestReportResult.PENDING); 295 throw new FHIRException("Unknown TestReportResult code '"+codeString+"'"); 296 } 297 public String toCode(TestReportResult code) { 298 if (code == TestReportResult.PASS) 299 return "pass"; 300 if (code == TestReportResult.FAIL) 301 return "fail"; 302 if (code == TestReportResult.PENDING) 303 return "pending"; 304 return "?"; 305 } 306 public String toSystem(TestReportResult code) { 307 return code.getSystem(); 308 } 309 } 310 311 public enum TestReportParticipantType { 312 /** 313 * The test execution engine. 314 */ 315 TESTENGINE, 316 /** 317 * A FHIR Client. 318 */ 319 CLIENT, 320 /** 321 * A FHIR Server. 322 */ 323 SERVER, 324 /** 325 * added to help the parsers with the generic types 326 */ 327 NULL; 328 public static TestReportParticipantType fromCode(String codeString) throws FHIRException { 329 if (codeString == null || "".equals(codeString)) 330 return null; 331 if ("test-engine".equals(codeString)) 332 return TESTENGINE; 333 if ("client".equals(codeString)) 334 return CLIENT; 335 if ("server".equals(codeString)) 336 return SERVER; 337 if (Configuration.isAcceptInvalidEnums()) 338 return null; 339 else 340 throw new FHIRException("Unknown TestReportParticipantType code '"+codeString+"'"); 341 } 342 public String toCode() { 343 switch (this) { 344 case TESTENGINE: return "test-engine"; 345 case CLIENT: return "client"; 346 case SERVER: return "server"; 347 case NULL: return null; 348 default: return "?"; 349 } 350 } 351 public String getSystem() { 352 switch (this) { 353 case TESTENGINE: return "http://hl7.org/fhir/report-participant-type"; 354 case CLIENT: return "http://hl7.org/fhir/report-participant-type"; 355 case SERVER: return "http://hl7.org/fhir/report-participant-type"; 356 case NULL: return null; 357 default: return "?"; 358 } 359 } 360 public String getDefinition() { 361 switch (this) { 362 case TESTENGINE: return "The test execution engine."; 363 case CLIENT: return "A FHIR Client."; 364 case SERVER: return "A FHIR Server."; 365 case NULL: return null; 366 default: return "?"; 367 } 368 } 369 public String getDisplay() { 370 switch (this) { 371 case TESTENGINE: return "Test Engine"; 372 case CLIENT: return "Client"; 373 case SERVER: return "Server"; 374 case NULL: return null; 375 default: return "?"; 376 } 377 } 378 } 379 380 public static class TestReportParticipantTypeEnumFactory implements EnumFactory<TestReportParticipantType> { 381 public TestReportParticipantType fromCode(String codeString) throws IllegalArgumentException { 382 if (codeString == null || "".equals(codeString)) 383 if (codeString == null || "".equals(codeString)) 384 return null; 385 if ("test-engine".equals(codeString)) 386 return TestReportParticipantType.TESTENGINE; 387 if ("client".equals(codeString)) 388 return TestReportParticipantType.CLIENT; 389 if ("server".equals(codeString)) 390 return TestReportParticipantType.SERVER; 391 throw new IllegalArgumentException("Unknown TestReportParticipantType code '"+codeString+"'"); 392 } 393 public Enumeration<TestReportParticipantType> fromType(Base code) throws FHIRException { 394 if (code == null) 395 return null; 396 if (code.isEmpty()) 397 return new Enumeration<TestReportParticipantType>(this); 398 String codeString = ((PrimitiveType) code).asStringValue(); 399 if (codeString == null || "".equals(codeString)) 400 return null; 401 if ("test-engine".equals(codeString)) 402 return new Enumeration<TestReportParticipantType>(this, TestReportParticipantType.TESTENGINE); 403 if ("client".equals(codeString)) 404 return new Enumeration<TestReportParticipantType>(this, TestReportParticipantType.CLIENT); 405 if ("server".equals(codeString)) 406 return new Enumeration<TestReportParticipantType>(this, TestReportParticipantType.SERVER); 407 throw new FHIRException("Unknown TestReportParticipantType code '"+codeString+"'"); 408 } 409 public String toCode(TestReportParticipantType code) { 410 if (code == TestReportParticipantType.TESTENGINE) 411 return "test-engine"; 412 if (code == TestReportParticipantType.CLIENT) 413 return "client"; 414 if (code == TestReportParticipantType.SERVER) 415 return "server"; 416 return "?"; 417 } 418 public String toSystem(TestReportParticipantType code) { 419 return code.getSystem(); 420 } 421 } 422 423 public enum TestReportActionResult { 424 /** 425 * The action was successful. 426 */ 427 PASS, 428 /** 429 * The action was skipped. 430 */ 431 SKIP, 432 /** 433 * The action failed. 434 */ 435 FAIL, 436 /** 437 * The action passed but with warnings. 438 */ 439 WARNING, 440 /** 441 * The action encountered a fatal error and the engine was unable to process. 442 */ 443 ERROR, 444 /** 445 * added to help the parsers with the generic types 446 */ 447 NULL; 448 public static TestReportActionResult fromCode(String codeString) throws FHIRException { 449 if (codeString == null || "".equals(codeString)) 450 return null; 451 if ("pass".equals(codeString)) 452 return PASS; 453 if ("skip".equals(codeString)) 454 return SKIP; 455 if ("fail".equals(codeString)) 456 return FAIL; 457 if ("warning".equals(codeString)) 458 return WARNING; 459 if ("error".equals(codeString)) 460 return ERROR; 461 if (Configuration.isAcceptInvalidEnums()) 462 return null; 463 else 464 throw new FHIRException("Unknown TestReportActionResult code '"+codeString+"'"); 465 } 466 public String toCode() { 467 switch (this) { 468 case PASS: return "pass"; 469 case SKIP: return "skip"; 470 case FAIL: return "fail"; 471 case WARNING: return "warning"; 472 case ERROR: return "error"; 473 case NULL: return null; 474 default: return "?"; 475 } 476 } 477 public String getSystem() { 478 switch (this) { 479 case PASS: return "http://hl7.org/fhir/report-action-result-codes"; 480 case SKIP: return "http://hl7.org/fhir/report-action-result-codes"; 481 case FAIL: return "http://hl7.org/fhir/report-action-result-codes"; 482 case WARNING: return "http://hl7.org/fhir/report-action-result-codes"; 483 case ERROR: return "http://hl7.org/fhir/report-action-result-codes"; 484 case NULL: return null; 485 default: return "?"; 486 } 487 } 488 public String getDefinition() { 489 switch (this) { 490 case PASS: return "The action was successful."; 491 case SKIP: return "The action was skipped."; 492 case FAIL: return "The action failed."; 493 case WARNING: return "The action passed but with warnings."; 494 case ERROR: return "The action encountered a fatal error and the engine was unable to process."; 495 case NULL: return null; 496 default: return "?"; 497 } 498 } 499 public String getDisplay() { 500 switch (this) { 501 case PASS: return "Pass"; 502 case SKIP: return "Skip"; 503 case FAIL: return "Fail"; 504 case WARNING: return "Warning"; 505 case ERROR: return "Error"; 506 case NULL: return null; 507 default: return "?"; 508 } 509 } 510 } 511 512 public static class TestReportActionResultEnumFactory implements EnumFactory<TestReportActionResult> { 513 public TestReportActionResult fromCode(String codeString) throws IllegalArgumentException { 514 if (codeString == null || "".equals(codeString)) 515 if (codeString == null || "".equals(codeString)) 516 return null; 517 if ("pass".equals(codeString)) 518 return TestReportActionResult.PASS; 519 if ("skip".equals(codeString)) 520 return TestReportActionResult.SKIP; 521 if ("fail".equals(codeString)) 522 return TestReportActionResult.FAIL; 523 if ("warning".equals(codeString)) 524 return TestReportActionResult.WARNING; 525 if ("error".equals(codeString)) 526 return TestReportActionResult.ERROR; 527 throw new IllegalArgumentException("Unknown TestReportActionResult code '"+codeString+"'"); 528 } 529 public Enumeration<TestReportActionResult> fromType(Base code) throws FHIRException { 530 if (code == null) 531 return null; 532 if (code.isEmpty()) 533 return new Enumeration<TestReportActionResult>(this); 534 String codeString = ((PrimitiveType) code).asStringValue(); 535 if (codeString == null || "".equals(codeString)) 536 return null; 537 if ("pass".equals(codeString)) 538 return new Enumeration<TestReportActionResult>(this, TestReportActionResult.PASS); 539 if ("skip".equals(codeString)) 540 return new Enumeration<TestReportActionResult>(this, TestReportActionResult.SKIP); 541 if ("fail".equals(codeString)) 542 return new Enumeration<TestReportActionResult>(this, TestReportActionResult.FAIL); 543 if ("warning".equals(codeString)) 544 return new Enumeration<TestReportActionResult>(this, TestReportActionResult.WARNING); 545 if ("error".equals(codeString)) 546 return new Enumeration<TestReportActionResult>(this, TestReportActionResult.ERROR); 547 throw new FHIRException("Unknown TestReportActionResult code '"+codeString+"'"); 548 } 549 public String toCode(TestReportActionResult code) { 550 if (code == TestReportActionResult.PASS) 551 return "pass"; 552 if (code == TestReportActionResult.SKIP) 553 return "skip"; 554 if (code == TestReportActionResult.FAIL) 555 return "fail"; 556 if (code == TestReportActionResult.WARNING) 557 return "warning"; 558 if (code == TestReportActionResult.ERROR) 559 return "error"; 560 return "?"; 561 } 562 public String toSystem(TestReportActionResult code) { 563 return code.getSystem(); 564 } 565 } 566 567 @Block() 568 public static class TestReportParticipantComponent extends BackboneElement implements IBaseBackboneElement { 569 /** 570 * The type of participant. 571 */ 572 @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) 573 @Description(shortDefinition="test-engine | client | server", formalDefinition="The type of participant." ) 574 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/report-participant-type") 575 protected Enumeration<TestReportParticipantType> type; 576 577 /** 578 * The uri of the participant. An absolute URL is preferred. 579 */ 580 @Child(name = "uri", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=false) 581 @Description(shortDefinition="The uri of the participant. An absolute URL is preferred", formalDefinition="The uri of the participant. An absolute URL is preferred." ) 582 protected UriType uri; 583 584 /** 585 * The display name of the participant. 586 */ 587 @Child(name = "display", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) 588 @Description(shortDefinition="The display name of the participant", formalDefinition="The display name of the participant." ) 589 protected StringType display; 590 591 private static final long serialVersionUID = 577488357L; 592 593 /** 594 * Constructor 595 */ 596 public TestReportParticipantComponent() { 597 super(); 598 } 599 600 /** 601 * Constructor 602 */ 603 public TestReportParticipantComponent(Enumeration<TestReportParticipantType> type, UriType uri) { 604 super(); 605 this.type = type; 606 this.uri = uri; 607 } 608 609 /** 610 * @return {@link #type} (The type of participant.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value 611 */ 612 public Enumeration<TestReportParticipantType> getTypeElement() { 613 if (this.type == null) 614 if (Configuration.errorOnAutoCreate()) 615 throw new Error("Attempt to auto-create TestReportParticipantComponent.type"); 616 else if (Configuration.doAutoCreate()) 617 this.type = new Enumeration<TestReportParticipantType>(new TestReportParticipantTypeEnumFactory()); // bb 618 return this.type; 619 } 620 621 public boolean hasTypeElement() { 622 return this.type != null && !this.type.isEmpty(); 623 } 624 625 public boolean hasType() { 626 return this.type != null && !this.type.isEmpty(); 627 } 628 629 /** 630 * @param value {@link #type} (The type of participant.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value 631 */ 632 public TestReportParticipantComponent setTypeElement(Enumeration<TestReportParticipantType> value) { 633 this.type = value; 634 return this; 635 } 636 637 /** 638 * @return The type of participant. 639 */ 640 public TestReportParticipantType getType() { 641 return this.type == null ? null : this.type.getValue(); 642 } 643 644 /** 645 * @param value The type of participant. 646 */ 647 public TestReportParticipantComponent setType(TestReportParticipantType value) { 648 if (this.type == null) 649 this.type = new Enumeration<TestReportParticipantType>(new TestReportParticipantTypeEnumFactory()); 650 this.type.setValue(value); 651 return this; 652 } 653 654 /** 655 * @return {@link #uri} (The uri of the participant. An absolute URL is preferred.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value 656 */ 657 public UriType getUriElement() { 658 if (this.uri == null) 659 if (Configuration.errorOnAutoCreate()) 660 throw new Error("Attempt to auto-create TestReportParticipantComponent.uri"); 661 else if (Configuration.doAutoCreate()) 662 this.uri = new UriType(); // bb 663 return this.uri; 664 } 665 666 public boolean hasUriElement() { 667 return this.uri != null && !this.uri.isEmpty(); 668 } 669 670 public boolean hasUri() { 671 return this.uri != null && !this.uri.isEmpty(); 672 } 673 674 /** 675 * @param value {@link #uri} (The uri of the participant. An absolute URL is preferred.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value 676 */ 677 public TestReportParticipantComponent setUriElement(UriType value) { 678 this.uri = value; 679 return this; 680 } 681 682 /** 683 * @return The uri of the participant. An absolute URL is preferred. 684 */ 685 public String getUri() { 686 return this.uri == null ? null : this.uri.getValue(); 687 } 688 689 /** 690 * @param value The uri of the participant. An absolute URL is preferred. 691 */ 692 public TestReportParticipantComponent setUri(String value) { 693 if (this.uri == null) 694 this.uri = new UriType(); 695 this.uri.setValue(value); 696 return this; 697 } 698 699 /** 700 * @return {@link #display} (The display name of the participant.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value 701 */ 702 public StringType getDisplayElement() { 703 if (this.display == null) 704 if (Configuration.errorOnAutoCreate()) 705 throw new Error("Attempt to auto-create TestReportParticipantComponent.display"); 706 else if (Configuration.doAutoCreate()) 707 this.display = new StringType(); // bb 708 return this.display; 709 } 710 711 public boolean hasDisplayElement() { 712 return this.display != null && !this.display.isEmpty(); 713 } 714 715 public boolean hasDisplay() { 716 return this.display != null && !this.display.isEmpty(); 717 } 718 719 /** 720 * @param value {@link #display} (The display name of the participant.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value 721 */ 722 public TestReportParticipantComponent setDisplayElement(StringType value) { 723 this.display = value; 724 return this; 725 } 726 727 /** 728 * @return The display name of the participant. 729 */ 730 public String getDisplay() { 731 return this.display == null ? null : this.display.getValue(); 732 } 733 734 /** 735 * @param value The display name of the participant. 736 */ 737 public TestReportParticipantComponent setDisplay(String value) { 738 if (Utilities.noString(value)) 739 this.display = null; 740 else { 741 if (this.display == null) 742 this.display = new StringType(); 743 this.display.setValue(value); 744 } 745 return this; 746 } 747 748 protected void listChildren(List<Property> children) { 749 super.listChildren(children); 750 children.add(new Property("type", "code", "The type of participant.", 0, 1, type)); 751 children.add(new Property("uri", "uri", "The uri of the participant. An absolute URL is preferred.", 0, 1, uri)); 752 children.add(new Property("display", "string", "The display name of the participant.", 0, 1, display)); 753 } 754 755 @Override 756 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 757 switch (_hash) { 758 case 3575610: /*type*/ return new Property("type", "code", "The type of participant.", 0, 1, type); 759 case 116076: /*uri*/ return new Property("uri", "uri", "The uri of the participant. An absolute URL is preferred.", 0, 1, uri); 760 case 1671764162: /*display*/ return new Property("display", "string", "The display name of the participant.", 0, 1, display); 761 default: return super.getNamedProperty(_hash, _name, _checkValid); 762 } 763 764 } 765 766 @Override 767 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 768 switch (hash) { 769 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<TestReportParticipantType> 770 case 116076: /*uri*/ return this.uri == null ? new Base[0] : new Base[] {this.uri}; // UriType 771 case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType 772 default: return super.getProperty(hash, name, checkValid); 773 } 774 775 } 776 777 @Override 778 public Base setProperty(int hash, String name, Base value) throws FHIRException { 779 switch (hash) { 780 case 3575610: // type 781 value = new TestReportParticipantTypeEnumFactory().fromType(castToCode(value)); 782 this.type = (Enumeration) value; // Enumeration<TestReportParticipantType> 783 return value; 784 case 116076: // uri 785 this.uri = castToUri(value); // UriType 786 return value; 787 case 1671764162: // display 788 this.display = castToString(value); // StringType 789 return value; 790 default: return super.setProperty(hash, name, value); 791 } 792 793 } 794 795 @Override 796 public Base setProperty(String name, Base value) throws FHIRException { 797 if (name.equals("type")) { 798 value = new TestReportParticipantTypeEnumFactory().fromType(castToCode(value)); 799 this.type = (Enumeration) value; // Enumeration<TestReportParticipantType> 800 } else if (name.equals("uri")) { 801 this.uri = castToUri(value); // UriType 802 } else if (name.equals("display")) { 803 this.display = castToString(value); // StringType 804 } else 805 return super.setProperty(name, value); 806 return value; 807 } 808 809 @Override 810 public Base makeProperty(int hash, String name) throws FHIRException { 811 switch (hash) { 812 case 3575610: return getTypeElement(); 813 case 116076: return getUriElement(); 814 case 1671764162: return getDisplayElement(); 815 default: return super.makeProperty(hash, name); 816 } 817 818 } 819 820 @Override 821 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 822 switch (hash) { 823 case 3575610: /*type*/ return new String[] {"code"}; 824 case 116076: /*uri*/ return new String[] {"uri"}; 825 case 1671764162: /*display*/ return new String[] {"string"}; 826 default: return super.getTypesForProperty(hash, name); 827 } 828 829 } 830 831 @Override 832 public Base addChild(String name) throws FHIRException { 833 if (name.equals("type")) { 834 throw new FHIRException("Cannot call addChild on a primitive type TestReport.type"); 835 } 836 else if (name.equals("uri")) { 837 throw new FHIRException("Cannot call addChild on a primitive type TestReport.uri"); 838 } 839 else if (name.equals("display")) { 840 throw new FHIRException("Cannot call addChild on a primitive type TestReport.display"); 841 } 842 else 843 return super.addChild(name); 844 } 845 846 public TestReportParticipantComponent copy() { 847 TestReportParticipantComponent dst = new TestReportParticipantComponent(); 848 copyValues(dst); 849 return dst; 850 } 851 852 public void copyValues(TestReportParticipantComponent dst) { 853 super.copyValues(dst); 854 dst.type = type == null ? null : type.copy(); 855 dst.uri = uri == null ? null : uri.copy(); 856 dst.display = display == null ? null : display.copy(); 857 } 858 859 @Override 860 public boolean equalsDeep(Base other_) { 861 if (!super.equalsDeep(other_)) 862 return false; 863 if (!(other_ instanceof TestReportParticipantComponent)) 864 return false; 865 TestReportParticipantComponent o = (TestReportParticipantComponent) other_; 866 return compareDeep(type, o.type, true) && compareDeep(uri, o.uri, true) && compareDeep(display, o.display, true) 867 ; 868 } 869 870 @Override 871 public boolean equalsShallow(Base other_) { 872 if (!super.equalsShallow(other_)) 873 return false; 874 if (!(other_ instanceof TestReportParticipantComponent)) 875 return false; 876 TestReportParticipantComponent o = (TestReportParticipantComponent) other_; 877 return compareValues(type, o.type, true) && compareValues(uri, o.uri, true) && compareValues(display, o.display, true) 878 ; 879 } 880 881 public boolean isEmpty() { 882 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, uri, display); 883 } 884 885 public String fhirType() { 886 return "TestReport.participant"; 887 888 } 889 890 } 891 892 @Block() 893 public static class TestReportSetupComponent extends BackboneElement implements IBaseBackboneElement { 894 /** 895 * Action would contain either an operation or an assertion. 896 */ 897 @Child(name = "action", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 898 @Description(shortDefinition="A setup operation or assert that was executed", formalDefinition="Action would contain either an operation or an assertion." ) 899 protected List<SetupActionComponent> action; 900 901 private static final long serialVersionUID = -123374486L; 902 903 /** 904 * Constructor 905 */ 906 public TestReportSetupComponent() { 907 super(); 908 } 909 910 /** 911 * @return {@link #action} (Action would contain either an operation or an assertion.) 912 */ 913 public List<SetupActionComponent> getAction() { 914 if (this.action == null) 915 this.action = new ArrayList<SetupActionComponent>(); 916 return this.action; 917 } 918 919 /** 920 * @return Returns a reference to <code>this</code> for easy method chaining 921 */ 922 public TestReportSetupComponent setAction(List<SetupActionComponent> theAction) { 923 this.action = theAction; 924 return this; 925 } 926 927 public boolean hasAction() { 928 if (this.action == null) 929 return false; 930 for (SetupActionComponent item : this.action) 931 if (!item.isEmpty()) 932 return true; 933 return false; 934 } 935 936 public SetupActionComponent addAction() { //3 937 SetupActionComponent t = new SetupActionComponent(); 938 if (this.action == null) 939 this.action = new ArrayList<SetupActionComponent>(); 940 this.action.add(t); 941 return t; 942 } 943 944 public TestReportSetupComponent addAction(SetupActionComponent t) { //3 945 if (t == null) 946 return this; 947 if (this.action == null) 948 this.action = new ArrayList<SetupActionComponent>(); 949 this.action.add(t); 950 return this; 951 } 952 953 /** 954 * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist 955 */ 956 public SetupActionComponent getActionFirstRep() { 957 if (getAction().isEmpty()) { 958 addAction(); 959 } 960 return getAction().get(0); 961 } 962 963 protected void listChildren(List<Property> children) { 964 super.listChildren(children); 965 children.add(new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action)); 966 } 967 968 @Override 969 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 970 switch (_hash) { 971 case -1422950858: /*action*/ return new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action); 972 default: return super.getNamedProperty(_hash, _name, _checkValid); 973 } 974 975 } 976 977 @Override 978 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 979 switch (hash) { 980 case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // SetupActionComponent 981 default: return super.getProperty(hash, name, checkValid); 982 } 983 984 } 985 986 @Override 987 public Base setProperty(int hash, String name, Base value) throws FHIRException { 988 switch (hash) { 989 case -1422950858: // action 990 this.getAction().add((SetupActionComponent) value); // SetupActionComponent 991 return value; 992 default: return super.setProperty(hash, name, value); 993 } 994 995 } 996 997 @Override 998 public Base setProperty(String name, Base value) throws FHIRException { 999 if (name.equals("action")) { 1000 this.getAction().add((SetupActionComponent) value); 1001 } else 1002 return super.setProperty(name, value); 1003 return value; 1004 } 1005 1006 @Override 1007 public Base makeProperty(int hash, String name) throws FHIRException { 1008 switch (hash) { 1009 case -1422950858: return addAction(); 1010 default: return super.makeProperty(hash, name); 1011 } 1012 1013 } 1014 1015 @Override 1016 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1017 switch (hash) { 1018 case -1422950858: /*action*/ return new String[] {}; 1019 default: return super.getTypesForProperty(hash, name); 1020 } 1021 1022 } 1023 1024 @Override 1025 public Base addChild(String name) throws FHIRException { 1026 if (name.equals("action")) { 1027 return addAction(); 1028 } 1029 else 1030 return super.addChild(name); 1031 } 1032 1033 public TestReportSetupComponent copy() { 1034 TestReportSetupComponent dst = new TestReportSetupComponent(); 1035 copyValues(dst); 1036 return dst; 1037 } 1038 1039 public void copyValues(TestReportSetupComponent dst) { 1040 super.copyValues(dst); 1041 if (action != null) { 1042 dst.action = new ArrayList<SetupActionComponent>(); 1043 for (SetupActionComponent i : action) 1044 dst.action.add(i.copy()); 1045 }; 1046 } 1047 1048 @Override 1049 public boolean equalsDeep(Base other_) { 1050 if (!super.equalsDeep(other_)) 1051 return false; 1052 if (!(other_ instanceof TestReportSetupComponent)) 1053 return false; 1054 TestReportSetupComponent o = (TestReportSetupComponent) other_; 1055 return compareDeep(action, o.action, true); 1056 } 1057 1058 @Override 1059 public boolean equalsShallow(Base other_) { 1060 if (!super.equalsShallow(other_)) 1061 return false; 1062 if (!(other_ instanceof TestReportSetupComponent)) 1063 return false; 1064 TestReportSetupComponent o = (TestReportSetupComponent) other_; 1065 return true; 1066 } 1067 1068 public boolean isEmpty() { 1069 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(action); 1070 } 1071 1072 public String fhirType() { 1073 return "TestReport.setup"; 1074 1075 } 1076 1077 } 1078 1079 @Block() 1080 public static class SetupActionComponent extends BackboneElement implements IBaseBackboneElement { 1081 /** 1082 * The operation performed. 1083 */ 1084 @Child(name = "operation", type = {}, order=1, min=0, max=1, modifier=false, summary=false) 1085 @Description(shortDefinition="The operation to perform", formalDefinition="The operation performed." ) 1086 protected SetupActionOperationComponent operation; 1087 1088 /** 1089 * The results of the assertion performed on the previous operations. 1090 */ 1091 @Child(name = "assert", type = {}, order=2, min=0, max=1, modifier=false, summary=false) 1092 @Description(shortDefinition="The assertion to perform", formalDefinition="The results of the assertion performed on the previous operations." ) 1093 protected SetupActionAssertComponent assert_; 1094 1095 private static final long serialVersionUID = -252088305L; 1096 1097 /** 1098 * Constructor 1099 */ 1100 public SetupActionComponent() { 1101 super(); 1102 } 1103 1104 /** 1105 * @return {@link #operation} (The operation performed.) 1106 */ 1107 public SetupActionOperationComponent getOperation() { 1108 if (this.operation == null) 1109 if (Configuration.errorOnAutoCreate()) 1110 throw new Error("Attempt to auto-create SetupActionComponent.operation"); 1111 else if (Configuration.doAutoCreate()) 1112 this.operation = new SetupActionOperationComponent(); // cc 1113 return this.operation; 1114 } 1115 1116 public boolean hasOperation() { 1117 return this.operation != null && !this.operation.isEmpty(); 1118 } 1119 1120 /** 1121 * @param value {@link #operation} (The operation performed.) 1122 */ 1123 public SetupActionComponent setOperation(SetupActionOperationComponent value) { 1124 this.operation = value; 1125 return this; 1126 } 1127 1128 /** 1129 * @return {@link #assert_} (The results of the assertion performed on the previous operations.) 1130 */ 1131 public SetupActionAssertComponent getAssert() { 1132 if (this.assert_ == null) 1133 if (Configuration.errorOnAutoCreate()) 1134 throw new Error("Attempt to auto-create SetupActionComponent.assert_"); 1135 else if (Configuration.doAutoCreate()) 1136 this.assert_ = new SetupActionAssertComponent(); // cc 1137 return this.assert_; 1138 } 1139 1140 public boolean hasAssert() { 1141 return this.assert_ != null && !this.assert_.isEmpty(); 1142 } 1143 1144 /** 1145 * @param value {@link #assert_} (The results of the assertion performed on the previous operations.) 1146 */ 1147 public SetupActionComponent setAssert(SetupActionAssertComponent value) { 1148 this.assert_ = value; 1149 return this; 1150 } 1151 1152 protected void listChildren(List<Property> children) { 1153 super.listChildren(children); 1154 children.add(new Property("operation", "", "The operation performed.", 0, 1, operation)); 1155 children.add(new Property("assert", "", "The results of the assertion performed on the previous operations.", 0, 1, assert_)); 1156 } 1157 1158 @Override 1159 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1160 switch (_hash) { 1161 case 1662702951: /*operation*/ return new Property("operation", "", "The operation performed.", 0, 1, operation); 1162 case -1408208058: /*assert*/ return new Property("assert", "", "The results of the assertion performed on the previous operations.", 0, 1, assert_); 1163 default: return super.getNamedProperty(_hash, _name, _checkValid); 1164 } 1165 1166 } 1167 1168 @Override 1169 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1170 switch (hash) { 1171 case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : new Base[] {this.operation}; // SetupActionOperationComponent 1172 case -1408208058: /*assert*/ return this.assert_ == null ? new Base[0] : new Base[] {this.assert_}; // SetupActionAssertComponent 1173 default: return super.getProperty(hash, name, checkValid); 1174 } 1175 1176 } 1177 1178 @Override 1179 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1180 switch (hash) { 1181 case 1662702951: // operation 1182 this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent 1183 return value; 1184 case -1408208058: // assert 1185 this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent 1186 return value; 1187 default: return super.setProperty(hash, name, value); 1188 } 1189 1190 } 1191 1192 @Override 1193 public Base setProperty(String name, Base value) throws FHIRException { 1194 if (name.equals("operation")) { 1195 this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent 1196 } else if (name.equals("assert")) { 1197 this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent 1198 } else 1199 return super.setProperty(name, value); 1200 return value; 1201 } 1202 1203 @Override 1204 public Base makeProperty(int hash, String name) throws FHIRException { 1205 switch (hash) { 1206 case 1662702951: return getOperation(); 1207 case -1408208058: return getAssert(); 1208 default: return super.makeProperty(hash, name); 1209 } 1210 1211 } 1212 1213 @Override 1214 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1215 switch (hash) { 1216 case 1662702951: /*operation*/ return new String[] {}; 1217 case -1408208058: /*assert*/ return new String[] {}; 1218 default: return super.getTypesForProperty(hash, name); 1219 } 1220 1221 } 1222 1223 @Override 1224 public Base addChild(String name) throws FHIRException { 1225 if (name.equals("operation")) { 1226 this.operation = new SetupActionOperationComponent(); 1227 return this.operation; 1228 } 1229 else if (name.equals("assert")) { 1230 this.assert_ = new SetupActionAssertComponent(); 1231 return this.assert_; 1232 } 1233 else 1234 return super.addChild(name); 1235 } 1236 1237 public SetupActionComponent copy() { 1238 SetupActionComponent dst = new SetupActionComponent(); 1239 copyValues(dst); 1240 return dst; 1241 } 1242 1243 public void copyValues(SetupActionComponent dst) { 1244 super.copyValues(dst); 1245 dst.operation = operation == null ? null : operation.copy(); 1246 dst.assert_ = assert_ == null ? null : assert_.copy(); 1247 } 1248 1249 @Override 1250 public boolean equalsDeep(Base other_) { 1251 if (!super.equalsDeep(other_)) 1252 return false; 1253 if (!(other_ instanceof SetupActionComponent)) 1254 return false; 1255 SetupActionComponent o = (SetupActionComponent) other_; 1256 return compareDeep(operation, o.operation, true) && compareDeep(assert_, o.assert_, true); 1257 } 1258 1259 @Override 1260 public boolean equalsShallow(Base other_) { 1261 if (!super.equalsShallow(other_)) 1262 return false; 1263 if (!(other_ instanceof SetupActionComponent)) 1264 return false; 1265 SetupActionComponent o = (SetupActionComponent) other_; 1266 return true; 1267 } 1268 1269 public boolean isEmpty() { 1270 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(operation, assert_); 1271 } 1272 1273 public String fhirType() { 1274 return "TestReport.setup.action"; 1275 1276 } 1277 1278 } 1279 1280 @Block() 1281 public static class SetupActionOperationComponent extends BackboneElement implements IBaseBackboneElement { 1282 /** 1283 * The result of this operation. 1284 */ 1285 @Child(name = "result", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) 1286 @Description(shortDefinition="pass | skip | fail | warning | error", formalDefinition="The result of this operation." ) 1287 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/report-action-result-codes") 1288 protected Enumeration<TestReportActionResult> result; 1289 1290 /** 1291 * An explanatory message associated with the result. 1292 */ 1293 @Child(name = "message", type = {MarkdownType.class}, order=2, min=0, max=1, modifier=false, summary=false) 1294 @Description(shortDefinition="A message associated with the result", formalDefinition="An explanatory message associated with the result." ) 1295 protected MarkdownType message; 1296 1297 /** 1298 * A link to further details on the result. 1299 */ 1300 @Child(name = "detail", type = {UriType.class}, order=3, min=0, max=1, modifier=false, summary=false) 1301 @Description(shortDefinition="A link to further details on the result", formalDefinition="A link to further details on the result." ) 1302 protected UriType detail; 1303 1304 private static final long serialVersionUID = 269088798L; 1305 1306 /** 1307 * Constructor 1308 */ 1309 public SetupActionOperationComponent() { 1310 super(); 1311 } 1312 1313 /** 1314 * Constructor 1315 */ 1316 public SetupActionOperationComponent(Enumeration<TestReportActionResult> result) { 1317 super(); 1318 this.result = result; 1319 } 1320 1321 /** 1322 * @return {@link #result} (The result of this operation.). This is the underlying object with id, value and extensions. The accessor "getResult" gives direct access to the value 1323 */ 1324 public Enumeration<TestReportActionResult> getResultElement() { 1325 if (this.result == null) 1326 if (Configuration.errorOnAutoCreate()) 1327 throw new Error("Attempt to auto-create SetupActionOperationComponent.result"); 1328 else if (Configuration.doAutoCreate()) 1329 this.result = new Enumeration<TestReportActionResult>(new TestReportActionResultEnumFactory()); // bb 1330 return this.result; 1331 } 1332 1333 public boolean hasResultElement() { 1334 return this.result != null && !this.result.isEmpty(); 1335 } 1336 1337 public boolean hasResult() { 1338 return this.result != null && !this.result.isEmpty(); 1339 } 1340 1341 /** 1342 * @param value {@link #result} (The result of this operation.). This is the underlying object with id, value and extensions. The accessor "getResult" gives direct access to the value 1343 */ 1344 public SetupActionOperationComponent setResultElement(Enumeration<TestReportActionResult> value) { 1345 this.result = value; 1346 return this; 1347 } 1348 1349 /** 1350 * @return The result of this operation. 1351 */ 1352 public TestReportActionResult getResult() { 1353 return this.result == null ? null : this.result.getValue(); 1354 } 1355 1356 /** 1357 * @param value The result of this operation. 1358 */ 1359 public SetupActionOperationComponent setResult(TestReportActionResult value) { 1360 if (this.result == null) 1361 this.result = new Enumeration<TestReportActionResult>(new TestReportActionResultEnumFactory()); 1362 this.result.setValue(value); 1363 return this; 1364 } 1365 1366 /** 1367 * @return {@link #message} (An explanatory message associated with the result.). This is the underlying object with id, value and extensions. The accessor "getMessage" gives direct access to the value 1368 */ 1369 public MarkdownType getMessageElement() { 1370 if (this.message == null) 1371 if (Configuration.errorOnAutoCreate()) 1372 throw new Error("Attempt to auto-create SetupActionOperationComponent.message"); 1373 else if (Configuration.doAutoCreate()) 1374 this.message = new MarkdownType(); // bb 1375 return this.message; 1376 } 1377 1378 public boolean hasMessageElement() { 1379 return this.message != null && !this.message.isEmpty(); 1380 } 1381 1382 public boolean hasMessage() { 1383 return this.message != null && !this.message.isEmpty(); 1384 } 1385 1386 /** 1387 * @param value {@link #message} (An explanatory message associated with the result.). This is the underlying object with id, value and extensions. The accessor "getMessage" gives direct access to the value 1388 */ 1389 public SetupActionOperationComponent setMessageElement(MarkdownType value) { 1390 this.message = value; 1391 return this; 1392 } 1393 1394 /** 1395 * @return An explanatory message associated with the result. 1396 */ 1397 public String getMessage() { 1398 return this.message == null ? null : this.message.getValue(); 1399 } 1400 1401 /** 1402 * @param value An explanatory message associated with the result. 1403 */ 1404 public SetupActionOperationComponent setMessage(String value) { 1405 if (value == null) 1406 this.message = null; 1407 else { 1408 if (this.message == null) 1409 this.message = new MarkdownType(); 1410 this.message.setValue(value); 1411 } 1412 return this; 1413 } 1414 1415 /** 1416 * @return {@link #detail} (A link to further details on the result.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value 1417 */ 1418 public UriType getDetailElement() { 1419 if (this.detail == null) 1420 if (Configuration.errorOnAutoCreate()) 1421 throw new Error("Attempt to auto-create SetupActionOperationComponent.detail"); 1422 else if (Configuration.doAutoCreate()) 1423 this.detail = new UriType(); // bb 1424 return this.detail; 1425 } 1426 1427 public boolean hasDetailElement() { 1428 return this.detail != null && !this.detail.isEmpty(); 1429 } 1430 1431 public boolean hasDetail() { 1432 return this.detail != null && !this.detail.isEmpty(); 1433 } 1434 1435 /** 1436 * @param value {@link #detail} (A link to further details on the result.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value 1437 */ 1438 public SetupActionOperationComponent setDetailElement(UriType value) { 1439 this.detail = value; 1440 return this; 1441 } 1442 1443 /** 1444 * @return A link to further details on the result. 1445 */ 1446 public String getDetail() { 1447 return this.detail == null ? null : this.detail.getValue(); 1448 } 1449 1450 /** 1451 * @param value A link to further details on the result. 1452 */ 1453 public SetupActionOperationComponent setDetail(String value) { 1454 if (Utilities.noString(value)) 1455 this.detail = null; 1456 else { 1457 if (this.detail == null) 1458 this.detail = new UriType(); 1459 this.detail.setValue(value); 1460 } 1461 return this; 1462 } 1463 1464 protected void listChildren(List<Property> children) { 1465 super.listChildren(children); 1466 children.add(new Property("result", "code", "The result of this operation.", 0, 1, result)); 1467 children.add(new Property("message", "markdown", "An explanatory message associated with the result.", 0, 1, message)); 1468 children.add(new Property("detail", "uri", "A link to further details on the result.", 0, 1, detail)); 1469 } 1470 1471 @Override 1472 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1473 switch (_hash) { 1474 case -934426595: /*result*/ return new Property("result", "code", "The result of this operation.", 0, 1, result); 1475 case 954925063: /*message*/ return new Property("message", "markdown", "An explanatory message associated with the result.", 0, 1, message); 1476 case -1335224239: /*detail*/ return new Property("detail", "uri", "A link to further details on the result.", 0, 1, detail); 1477 default: return super.getNamedProperty(_hash, _name, _checkValid); 1478 } 1479 1480 } 1481 1482 @Override 1483 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1484 switch (hash) { 1485 case -934426595: /*result*/ return this.result == null ? new Base[0] : new Base[] {this.result}; // Enumeration<TestReportActionResult> 1486 case 954925063: /*message*/ return this.message == null ? new Base[0] : new Base[] {this.message}; // MarkdownType 1487 case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : new Base[] {this.detail}; // UriType 1488 default: return super.getProperty(hash, name, checkValid); 1489 } 1490 1491 } 1492 1493 @Override 1494 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1495 switch (hash) { 1496 case -934426595: // result 1497 value = new TestReportActionResultEnumFactory().fromType(castToCode(value)); 1498 this.result = (Enumeration) value; // Enumeration<TestReportActionResult> 1499 return value; 1500 case 954925063: // message 1501 this.message = castToMarkdown(value); // MarkdownType 1502 return value; 1503 case -1335224239: // detail 1504 this.detail = castToUri(value); // UriType 1505 return value; 1506 default: return super.setProperty(hash, name, value); 1507 } 1508 1509 } 1510 1511 @Override 1512 public Base setProperty(String name, Base value) throws FHIRException { 1513 if (name.equals("result")) { 1514 value = new TestReportActionResultEnumFactory().fromType(castToCode(value)); 1515 this.result = (Enumeration) value; // Enumeration<TestReportActionResult> 1516 } else if (name.equals("message")) { 1517 this.message = castToMarkdown(value); // MarkdownType 1518 } else if (name.equals("detail")) { 1519 this.detail = castToUri(value); // UriType 1520 } else 1521 return super.setProperty(name, value); 1522 return value; 1523 } 1524 1525 @Override 1526 public Base makeProperty(int hash, String name) throws FHIRException { 1527 switch (hash) { 1528 case -934426595: return getResultElement(); 1529 case 954925063: return getMessageElement(); 1530 case -1335224239: return getDetailElement(); 1531 default: return super.makeProperty(hash, name); 1532 } 1533 1534 } 1535 1536 @Override 1537 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1538 switch (hash) { 1539 case -934426595: /*result*/ return new String[] {"code"}; 1540 case 954925063: /*message*/ return new String[] {"markdown"}; 1541 case -1335224239: /*detail*/ return new String[] {"uri"}; 1542 default: return super.getTypesForProperty(hash, name); 1543 } 1544 1545 } 1546 1547 @Override 1548 public Base addChild(String name) throws FHIRException { 1549 if (name.equals("result")) { 1550 throw new FHIRException("Cannot call addChild on a primitive type TestReport.result"); 1551 } 1552 else if (name.equals("message")) { 1553 throw new FHIRException("Cannot call addChild on a primitive type TestReport.message"); 1554 } 1555 else if (name.equals("detail")) { 1556 throw new FHIRException("Cannot call addChild on a primitive type TestReport.detail"); 1557 } 1558 else 1559 return super.addChild(name); 1560 } 1561 1562 public SetupActionOperationComponent copy() { 1563 SetupActionOperationComponent dst = new SetupActionOperationComponent(); 1564 copyValues(dst); 1565 return dst; 1566 } 1567 1568 public void copyValues(SetupActionOperationComponent dst) { 1569 super.copyValues(dst); 1570 dst.result = result == null ? null : result.copy(); 1571 dst.message = message == null ? null : message.copy(); 1572 dst.detail = detail == null ? null : detail.copy(); 1573 } 1574 1575 @Override 1576 public boolean equalsDeep(Base other_) { 1577 if (!super.equalsDeep(other_)) 1578 return false; 1579 if (!(other_ instanceof SetupActionOperationComponent)) 1580 return false; 1581 SetupActionOperationComponent o = (SetupActionOperationComponent) other_; 1582 return compareDeep(result, o.result, true) && compareDeep(message, o.message, true) && compareDeep(detail, o.detail, true) 1583 ; 1584 } 1585 1586 @Override 1587 public boolean equalsShallow(Base other_) { 1588 if (!super.equalsShallow(other_)) 1589 return false; 1590 if (!(other_ instanceof SetupActionOperationComponent)) 1591 return false; 1592 SetupActionOperationComponent o = (SetupActionOperationComponent) other_; 1593 return compareValues(result, o.result, true) && compareValues(message, o.message, true) && compareValues(detail, o.detail, true) 1594 ; 1595 } 1596 1597 public boolean isEmpty() { 1598 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(result, message, detail 1599 ); 1600 } 1601 1602 public String fhirType() { 1603 return "TestReport.setup.action.operation"; 1604 1605 } 1606 1607 } 1608 1609 @Block() 1610 public static class SetupActionAssertComponent extends BackboneElement implements IBaseBackboneElement { 1611 /** 1612 * The result of this assertion. 1613 */ 1614 @Child(name = "result", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) 1615 @Description(shortDefinition="pass | skip | fail | warning | error", formalDefinition="The result of this assertion." ) 1616 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/report-action-result-codes") 1617 protected Enumeration<TestReportActionResult> result; 1618 1619 /** 1620 * An explanatory message associated with the result. 1621 */ 1622 @Child(name = "message", type = {MarkdownType.class}, order=2, min=0, max=1, modifier=false, summary=false) 1623 @Description(shortDefinition="A message associated with the result", formalDefinition="An explanatory message associated with the result." ) 1624 protected MarkdownType message; 1625 1626 /** 1627 * A link to further details on the result. 1628 */ 1629 @Child(name = "detail", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) 1630 @Description(shortDefinition="A link to further details on the result", formalDefinition="A link to further details on the result." ) 1631 protected StringType detail; 1632 1633 private static final long serialVersionUID = 467968193L; 1634 1635 /** 1636 * Constructor 1637 */ 1638 public SetupActionAssertComponent() { 1639 super(); 1640 } 1641 1642 /** 1643 * Constructor 1644 */ 1645 public SetupActionAssertComponent(Enumeration<TestReportActionResult> result) { 1646 super(); 1647 this.result = result; 1648 } 1649 1650 /** 1651 * @return {@link #result} (The result of this assertion.). This is the underlying object with id, value and extensions. The accessor "getResult" gives direct access to the value 1652 */ 1653 public Enumeration<TestReportActionResult> getResultElement() { 1654 if (this.result == null) 1655 if (Configuration.errorOnAutoCreate()) 1656 throw new Error("Attempt to auto-create SetupActionAssertComponent.result"); 1657 else if (Configuration.doAutoCreate()) 1658 this.result = new Enumeration<TestReportActionResult>(new TestReportActionResultEnumFactory()); // bb 1659 return this.result; 1660 } 1661 1662 public boolean hasResultElement() { 1663 return this.result != null && !this.result.isEmpty(); 1664 } 1665 1666 public boolean hasResult() { 1667 return this.result != null && !this.result.isEmpty(); 1668 } 1669 1670 /** 1671 * @param value {@link #result} (The result of this assertion.). This is the underlying object with id, value and extensions. The accessor "getResult" gives direct access to the value 1672 */ 1673 public SetupActionAssertComponent setResultElement(Enumeration<TestReportActionResult> value) { 1674 this.result = value; 1675 return this; 1676 } 1677 1678 /** 1679 * @return The result of this assertion. 1680 */ 1681 public TestReportActionResult getResult() { 1682 return this.result == null ? null : this.result.getValue(); 1683 } 1684 1685 /** 1686 * @param value The result of this assertion. 1687 */ 1688 public SetupActionAssertComponent setResult(TestReportActionResult value) { 1689 if (this.result == null) 1690 this.result = new Enumeration<TestReportActionResult>(new TestReportActionResultEnumFactory()); 1691 this.result.setValue(value); 1692 return this; 1693 } 1694 1695 /** 1696 * @return {@link #message} (An explanatory message associated with the result.). This is the underlying object with id, value and extensions. The accessor "getMessage" gives direct access to the value 1697 */ 1698 public MarkdownType getMessageElement() { 1699 if (this.message == null) 1700 if (Configuration.errorOnAutoCreate()) 1701 throw new Error("Attempt to auto-create SetupActionAssertComponent.message"); 1702 else if (Configuration.doAutoCreate()) 1703 this.message = new MarkdownType(); // bb 1704 return this.message; 1705 } 1706 1707 public boolean hasMessageElement() { 1708 return this.message != null && !this.message.isEmpty(); 1709 } 1710 1711 public boolean hasMessage() { 1712 return this.message != null && !this.message.isEmpty(); 1713 } 1714 1715 /** 1716 * @param value {@link #message} (An explanatory message associated with the result.). This is the underlying object with id, value and extensions. The accessor "getMessage" gives direct access to the value 1717 */ 1718 public SetupActionAssertComponent setMessageElement(MarkdownType value) { 1719 this.message = value; 1720 return this; 1721 } 1722 1723 /** 1724 * @return An explanatory message associated with the result. 1725 */ 1726 public String getMessage() { 1727 return this.message == null ? null : this.message.getValue(); 1728 } 1729 1730 /** 1731 * @param value An explanatory message associated with the result. 1732 */ 1733 public SetupActionAssertComponent setMessage(String value) { 1734 if (value == null) 1735 this.message = null; 1736 else { 1737 if (this.message == null) 1738 this.message = new MarkdownType(); 1739 this.message.setValue(value); 1740 } 1741 return this; 1742 } 1743 1744 /** 1745 * @return {@link #detail} (A link to further details on the result.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value 1746 */ 1747 public StringType getDetailElement() { 1748 if (this.detail == null) 1749 if (Configuration.errorOnAutoCreate()) 1750 throw new Error("Attempt to auto-create SetupActionAssertComponent.detail"); 1751 else if (Configuration.doAutoCreate()) 1752 this.detail = new StringType(); // bb 1753 return this.detail; 1754 } 1755 1756 public boolean hasDetailElement() { 1757 return this.detail != null && !this.detail.isEmpty(); 1758 } 1759 1760 public boolean hasDetail() { 1761 return this.detail != null && !this.detail.isEmpty(); 1762 } 1763 1764 /** 1765 * @param value {@link #detail} (A link to further details on the result.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value 1766 */ 1767 public SetupActionAssertComponent setDetailElement(StringType value) { 1768 this.detail = value; 1769 return this; 1770 } 1771 1772 /** 1773 * @return A link to further details on the result. 1774 */ 1775 public String getDetail() { 1776 return this.detail == null ? null : this.detail.getValue(); 1777 } 1778 1779 /** 1780 * @param value A link to further details on the result. 1781 */ 1782 public SetupActionAssertComponent setDetail(String value) { 1783 if (Utilities.noString(value)) 1784 this.detail = null; 1785 else { 1786 if (this.detail == null) 1787 this.detail = new StringType(); 1788 this.detail.setValue(value); 1789 } 1790 return this; 1791 } 1792 1793 protected void listChildren(List<Property> children) { 1794 super.listChildren(children); 1795 children.add(new Property("result", "code", "The result of this assertion.", 0, 1, result)); 1796 children.add(new Property("message", "markdown", "An explanatory message associated with the result.", 0, 1, message)); 1797 children.add(new Property("detail", "string", "A link to further details on the result.", 0, 1, detail)); 1798 } 1799 1800 @Override 1801 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1802 switch (_hash) { 1803 case -934426595: /*result*/ return new Property("result", "code", "The result of this assertion.", 0, 1, result); 1804 case 954925063: /*message*/ return new Property("message", "markdown", "An explanatory message associated with the result.", 0, 1, message); 1805 case -1335224239: /*detail*/ return new Property("detail", "string", "A link to further details on the result.", 0, 1, detail); 1806 default: return super.getNamedProperty(_hash, _name, _checkValid); 1807 } 1808 1809 } 1810 1811 @Override 1812 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1813 switch (hash) { 1814 case -934426595: /*result*/ return this.result == null ? new Base[0] : new Base[] {this.result}; // Enumeration<TestReportActionResult> 1815 case 954925063: /*message*/ return this.message == null ? new Base[0] : new Base[] {this.message}; // MarkdownType 1816 case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : new Base[] {this.detail}; // StringType 1817 default: return super.getProperty(hash, name, checkValid); 1818 } 1819 1820 } 1821 1822 @Override 1823 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1824 switch (hash) { 1825 case -934426595: // result 1826 value = new TestReportActionResultEnumFactory().fromType(castToCode(value)); 1827 this.result = (Enumeration) value; // Enumeration<TestReportActionResult> 1828 return value; 1829 case 954925063: // message 1830 this.message = castToMarkdown(value); // MarkdownType 1831 return value; 1832 case -1335224239: // detail 1833 this.detail = castToString(value); // StringType 1834 return value; 1835 default: return super.setProperty(hash, name, value); 1836 } 1837 1838 } 1839 1840 @Override 1841 public Base setProperty(String name, Base value) throws FHIRException { 1842 if (name.equals("result")) { 1843 value = new TestReportActionResultEnumFactory().fromType(castToCode(value)); 1844 this.result = (Enumeration) value; // Enumeration<TestReportActionResult> 1845 } else if (name.equals("message")) { 1846 this.message = castToMarkdown(value); // MarkdownType 1847 } else if (name.equals("detail")) { 1848 this.detail = castToString(value); // StringType 1849 } else 1850 return super.setProperty(name, value); 1851 return value; 1852 } 1853 1854 @Override 1855 public Base makeProperty(int hash, String name) throws FHIRException { 1856 switch (hash) { 1857 case -934426595: return getResultElement(); 1858 case 954925063: return getMessageElement(); 1859 case -1335224239: return getDetailElement(); 1860 default: return super.makeProperty(hash, name); 1861 } 1862 1863 } 1864 1865 @Override 1866 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1867 switch (hash) { 1868 case -934426595: /*result*/ return new String[] {"code"}; 1869 case 954925063: /*message*/ return new String[] {"markdown"}; 1870 case -1335224239: /*detail*/ return new String[] {"string"}; 1871 default: return super.getTypesForProperty(hash, name); 1872 } 1873 1874 } 1875 1876 @Override 1877 public Base addChild(String name) throws FHIRException { 1878 if (name.equals("result")) { 1879 throw new FHIRException("Cannot call addChild on a primitive type TestReport.result"); 1880 } 1881 else if (name.equals("message")) { 1882 throw new FHIRException("Cannot call addChild on a primitive type TestReport.message"); 1883 } 1884 else if (name.equals("detail")) { 1885 throw new FHIRException("Cannot call addChild on a primitive type TestReport.detail"); 1886 } 1887 else 1888 return super.addChild(name); 1889 } 1890 1891 public SetupActionAssertComponent copy() { 1892 SetupActionAssertComponent dst = new SetupActionAssertComponent(); 1893 copyValues(dst); 1894 return dst; 1895 } 1896 1897 public void copyValues(SetupActionAssertComponent dst) { 1898 super.copyValues(dst); 1899 dst.result = result == null ? null : result.copy(); 1900 dst.message = message == null ? null : message.copy(); 1901 dst.detail = detail == null ? null : detail.copy(); 1902 } 1903 1904 @Override 1905 public boolean equalsDeep(Base other_) { 1906 if (!super.equalsDeep(other_)) 1907 return false; 1908 if (!(other_ instanceof SetupActionAssertComponent)) 1909 return false; 1910 SetupActionAssertComponent o = (SetupActionAssertComponent) other_; 1911 return compareDeep(result, o.result, true) && compareDeep(message, o.message, true) && compareDeep(detail, o.detail, true) 1912 ; 1913 } 1914 1915 @Override 1916 public boolean equalsShallow(Base other_) { 1917 if (!super.equalsShallow(other_)) 1918 return false; 1919 if (!(other_ instanceof SetupActionAssertComponent)) 1920 return false; 1921 SetupActionAssertComponent o = (SetupActionAssertComponent) other_; 1922 return compareValues(result, o.result, true) && compareValues(message, o.message, true) && compareValues(detail, o.detail, true) 1923 ; 1924 } 1925 1926 public boolean isEmpty() { 1927 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(result, message, detail 1928 ); 1929 } 1930 1931 public String fhirType() { 1932 return "TestReport.setup.action.assert"; 1933 1934 } 1935 1936 } 1937 1938 @Block() 1939 public static class TestReportTestComponent extends BackboneElement implements IBaseBackboneElement { 1940 /** 1941 * The name of this test used for tracking/logging purposes by test engines. 1942 */ 1943 @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) 1944 @Description(shortDefinition="Tracking/logging name of this test", formalDefinition="The name of this test used for tracking/logging purposes by test engines." ) 1945 protected StringType name; 1946 1947 /** 1948 * A short description of the test used by test engines for tracking and reporting purposes. 1949 */ 1950 @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) 1951 @Description(shortDefinition="Tracking/reporting short description of the test", formalDefinition="A short description of the test used by test engines for tracking and reporting purposes." ) 1952 protected StringType description; 1953 1954 /** 1955 * Action would contain either an operation or an assertion. 1956 */ 1957 @Child(name = "action", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 1958 @Description(shortDefinition="A test operation or assert that was performed", formalDefinition="Action would contain either an operation or an assertion." ) 1959 protected List<TestActionComponent> action; 1960 1961 private static final long serialVersionUID = -865006110L; 1962 1963 /** 1964 * Constructor 1965 */ 1966 public TestReportTestComponent() { 1967 super(); 1968 } 1969 1970 /** 1971 * @return {@link #name} (The name of this test used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 1972 */ 1973 public StringType getNameElement() { 1974 if (this.name == null) 1975 if (Configuration.errorOnAutoCreate()) 1976 throw new Error("Attempt to auto-create TestReportTestComponent.name"); 1977 else if (Configuration.doAutoCreate()) 1978 this.name = new StringType(); // bb 1979 return this.name; 1980 } 1981 1982 public boolean hasNameElement() { 1983 return this.name != null && !this.name.isEmpty(); 1984 } 1985 1986 public boolean hasName() { 1987 return this.name != null && !this.name.isEmpty(); 1988 } 1989 1990 /** 1991 * @param value {@link #name} (The name of this test used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 1992 */ 1993 public TestReportTestComponent setNameElement(StringType value) { 1994 this.name = value; 1995 return this; 1996 } 1997 1998 /** 1999 * @return The name of this test used for tracking/logging purposes by test engines. 2000 */ 2001 public String getName() { 2002 return this.name == null ? null : this.name.getValue(); 2003 } 2004 2005 /** 2006 * @param value The name of this test used for tracking/logging purposes by test engines. 2007 */ 2008 public TestReportTestComponent setName(String value) { 2009 if (Utilities.noString(value)) 2010 this.name = null; 2011 else { 2012 if (this.name == null) 2013 this.name = new StringType(); 2014 this.name.setValue(value); 2015 } 2016 return this; 2017 } 2018 2019 /** 2020 * @return {@link #description} (A short description of the test used by test engines for tracking and reporting purposes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 2021 */ 2022 public StringType getDescriptionElement() { 2023 if (this.description == null) 2024 if (Configuration.errorOnAutoCreate()) 2025 throw new Error("Attempt to auto-create TestReportTestComponent.description"); 2026 else if (Configuration.doAutoCreate()) 2027 this.description = new StringType(); // bb 2028 return this.description; 2029 } 2030 2031 public boolean hasDescriptionElement() { 2032 return this.description != null && !this.description.isEmpty(); 2033 } 2034 2035 public boolean hasDescription() { 2036 return this.description != null && !this.description.isEmpty(); 2037 } 2038 2039 /** 2040 * @param value {@link #description} (A short description of the test used by test engines for tracking and reporting purposes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 2041 */ 2042 public TestReportTestComponent setDescriptionElement(StringType value) { 2043 this.description = value; 2044 return this; 2045 } 2046 2047 /** 2048 * @return A short description of the test used by test engines for tracking and reporting purposes. 2049 */ 2050 public String getDescription() { 2051 return this.description == null ? null : this.description.getValue(); 2052 } 2053 2054 /** 2055 * @param value A short description of the test used by test engines for tracking and reporting purposes. 2056 */ 2057 public TestReportTestComponent setDescription(String value) { 2058 if (Utilities.noString(value)) 2059 this.description = null; 2060 else { 2061 if (this.description == null) 2062 this.description = new StringType(); 2063 this.description.setValue(value); 2064 } 2065 return this; 2066 } 2067 2068 /** 2069 * @return {@link #action} (Action would contain either an operation or an assertion.) 2070 */ 2071 public List<TestActionComponent> getAction() { 2072 if (this.action == null) 2073 this.action = new ArrayList<TestActionComponent>(); 2074 return this.action; 2075 } 2076 2077 /** 2078 * @return Returns a reference to <code>this</code> for easy method chaining 2079 */ 2080 public TestReportTestComponent setAction(List<TestActionComponent> theAction) { 2081 this.action = theAction; 2082 return this; 2083 } 2084 2085 public boolean hasAction() { 2086 if (this.action == null) 2087 return false; 2088 for (TestActionComponent item : this.action) 2089 if (!item.isEmpty()) 2090 return true; 2091 return false; 2092 } 2093 2094 public TestActionComponent addAction() { //3 2095 TestActionComponent t = new TestActionComponent(); 2096 if (this.action == null) 2097 this.action = new ArrayList<TestActionComponent>(); 2098 this.action.add(t); 2099 return t; 2100 } 2101 2102 public TestReportTestComponent addAction(TestActionComponent t) { //3 2103 if (t == null) 2104 return this; 2105 if (this.action == null) 2106 this.action = new ArrayList<TestActionComponent>(); 2107 this.action.add(t); 2108 return this; 2109 } 2110 2111 /** 2112 * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist 2113 */ 2114 public TestActionComponent getActionFirstRep() { 2115 if (getAction().isEmpty()) { 2116 addAction(); 2117 } 2118 return getAction().get(0); 2119 } 2120 2121 protected void listChildren(List<Property> children) { 2122 super.listChildren(children); 2123 children.add(new Property("name", "string", "The name of this test used for tracking/logging purposes by test engines.", 0, 1, name)); 2124 children.add(new Property("description", "string", "A short description of the test used by test engines for tracking and reporting purposes.", 0, 1, description)); 2125 children.add(new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action)); 2126 } 2127 2128 @Override 2129 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 2130 switch (_hash) { 2131 case 3373707: /*name*/ return new Property("name", "string", "The name of this test used for tracking/logging purposes by test engines.", 0, 1, name); 2132 case -1724546052: /*description*/ return new Property("description", "string", "A short description of the test used by test engines for tracking and reporting purposes.", 0, 1, description); 2133 case -1422950858: /*action*/ return new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action); 2134 default: return super.getNamedProperty(_hash, _name, _checkValid); 2135 } 2136 2137 } 2138 2139 @Override 2140 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 2141 switch (hash) { 2142 case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType 2143 case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType 2144 case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // TestActionComponent 2145 default: return super.getProperty(hash, name, checkValid); 2146 } 2147 2148 } 2149 2150 @Override 2151 public Base setProperty(int hash, String name, Base value) throws FHIRException { 2152 switch (hash) { 2153 case 3373707: // name 2154 this.name = castToString(value); // StringType 2155 return value; 2156 case -1724546052: // description 2157 this.description = castToString(value); // StringType 2158 return value; 2159 case -1422950858: // action 2160 this.getAction().add((TestActionComponent) value); // TestActionComponent 2161 return value; 2162 default: return super.setProperty(hash, name, value); 2163 } 2164 2165 } 2166 2167 @Override 2168 public Base setProperty(String name, Base value) throws FHIRException { 2169 if (name.equals("name")) { 2170 this.name = castToString(value); // StringType 2171 } else if (name.equals("description")) { 2172 this.description = castToString(value); // StringType 2173 } else if (name.equals("action")) { 2174 this.getAction().add((TestActionComponent) value); 2175 } else 2176 return super.setProperty(name, value); 2177 return value; 2178 } 2179 2180 @Override 2181 public Base makeProperty(int hash, String name) throws FHIRException { 2182 switch (hash) { 2183 case 3373707: return getNameElement(); 2184 case -1724546052: return getDescriptionElement(); 2185 case -1422950858: return addAction(); 2186 default: return super.makeProperty(hash, name); 2187 } 2188 2189 } 2190 2191 @Override 2192 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 2193 switch (hash) { 2194 case 3373707: /*name*/ return new String[] {"string"}; 2195 case -1724546052: /*description*/ return new String[] {"string"}; 2196 case -1422950858: /*action*/ return new String[] {}; 2197 default: return super.getTypesForProperty(hash, name); 2198 } 2199 2200 } 2201 2202 @Override 2203 public Base addChild(String name) throws FHIRException { 2204 if (name.equals("name")) { 2205 throw new FHIRException("Cannot call addChild on a primitive type TestReport.name"); 2206 } 2207 else if (name.equals("description")) { 2208 throw new FHIRException("Cannot call addChild on a primitive type TestReport.description"); 2209 } 2210 else if (name.equals("action")) { 2211 return addAction(); 2212 } 2213 else 2214 return super.addChild(name); 2215 } 2216 2217 public TestReportTestComponent copy() { 2218 TestReportTestComponent dst = new TestReportTestComponent(); 2219 copyValues(dst); 2220 return dst; 2221 } 2222 2223 public void copyValues(TestReportTestComponent dst) { 2224 super.copyValues(dst); 2225 dst.name = name == null ? null : name.copy(); 2226 dst.description = description == null ? null : description.copy(); 2227 if (action != null) { 2228 dst.action = new ArrayList<TestActionComponent>(); 2229 for (TestActionComponent i : action) 2230 dst.action.add(i.copy()); 2231 }; 2232 } 2233 2234 @Override 2235 public boolean equalsDeep(Base other_) { 2236 if (!super.equalsDeep(other_)) 2237 return false; 2238 if (!(other_ instanceof TestReportTestComponent)) 2239 return false; 2240 TestReportTestComponent o = (TestReportTestComponent) other_; 2241 return compareDeep(name, o.name, true) && compareDeep(description, o.description, true) && compareDeep(action, o.action, true) 2242 ; 2243 } 2244 2245 @Override 2246 public boolean equalsShallow(Base other_) { 2247 if (!super.equalsShallow(other_)) 2248 return false; 2249 if (!(other_ instanceof TestReportTestComponent)) 2250 return false; 2251 TestReportTestComponent o = (TestReportTestComponent) other_; 2252 return compareValues(name, o.name, true) && compareValues(description, o.description, true); 2253 } 2254 2255 public boolean isEmpty() { 2256 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, description, action 2257 ); 2258 } 2259 2260 public String fhirType() { 2261 return "TestReport.test"; 2262 2263 } 2264 2265 } 2266 2267 @Block() 2268 public static class TestActionComponent extends BackboneElement implements IBaseBackboneElement { 2269 /** 2270 * An operation would involve a REST request to a server. 2271 */ 2272 @Child(name = "operation", type = {SetupActionOperationComponent.class}, order=1, min=0, max=1, modifier=false, summary=false) 2273 @Description(shortDefinition="The operation performed", formalDefinition="An operation would involve a REST request to a server." ) 2274 protected SetupActionOperationComponent operation; 2275 2276 /** 2277 * The results of the assertion performed on the previous operations. 2278 */ 2279 @Child(name = "assert", type = {SetupActionAssertComponent.class}, order=2, min=0, max=1, modifier=false, summary=false) 2280 @Description(shortDefinition="The assertion performed", formalDefinition="The results of the assertion performed on the previous operations." ) 2281 protected SetupActionAssertComponent assert_; 2282 2283 private static final long serialVersionUID = -252088305L; 2284 2285 /** 2286 * Constructor 2287 */ 2288 public TestActionComponent() { 2289 super(); 2290 } 2291 2292 /** 2293 * @return {@link #operation} (An operation would involve a REST request to a server.) 2294 */ 2295 public SetupActionOperationComponent getOperation() { 2296 if (this.operation == null) 2297 if (Configuration.errorOnAutoCreate()) 2298 throw new Error("Attempt to auto-create TestActionComponent.operation"); 2299 else if (Configuration.doAutoCreate()) 2300 this.operation = new SetupActionOperationComponent(); // cc 2301 return this.operation; 2302 } 2303 2304 public boolean hasOperation() { 2305 return this.operation != null && !this.operation.isEmpty(); 2306 } 2307 2308 /** 2309 * @param value {@link #operation} (An operation would involve a REST request to a server.) 2310 */ 2311 public TestActionComponent setOperation(SetupActionOperationComponent value) { 2312 this.operation = value; 2313 return this; 2314 } 2315 2316 /** 2317 * @return {@link #assert_} (The results of the assertion performed on the previous operations.) 2318 */ 2319 public SetupActionAssertComponent getAssert() { 2320 if (this.assert_ == null) 2321 if (Configuration.errorOnAutoCreate()) 2322 throw new Error("Attempt to auto-create TestActionComponent.assert_"); 2323 else if (Configuration.doAutoCreate()) 2324 this.assert_ = new SetupActionAssertComponent(); // cc 2325 return this.assert_; 2326 } 2327 2328 public boolean hasAssert() { 2329 return this.assert_ != null && !this.assert_.isEmpty(); 2330 } 2331 2332 /** 2333 * @param value {@link #assert_} (The results of the assertion performed on the previous operations.) 2334 */ 2335 public TestActionComponent setAssert(SetupActionAssertComponent value) { 2336 this.assert_ = value; 2337 return this; 2338 } 2339 2340 protected void listChildren(List<Property> children) { 2341 super.listChildren(children); 2342 children.add(new Property("operation", "@TestReport.setup.action.operation", "An operation would involve a REST request to a server.", 0, 1, operation)); 2343 children.add(new Property("assert", "@TestReport.setup.action.assert", "The results of the assertion performed on the previous operations.", 0, 1, assert_)); 2344 } 2345 2346 @Override 2347 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 2348 switch (_hash) { 2349 case 1662702951: /*operation*/ return new Property("operation", "@TestReport.setup.action.operation", "An operation would involve a REST request to a server.", 0, 1, operation); 2350 case -1408208058: /*assert*/ return new Property("assert", "@TestReport.setup.action.assert", "The results of the assertion performed on the previous operations.", 0, 1, assert_); 2351 default: return super.getNamedProperty(_hash, _name, _checkValid); 2352 } 2353 2354 } 2355 2356 @Override 2357 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 2358 switch (hash) { 2359 case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : new Base[] {this.operation}; // SetupActionOperationComponent 2360 case -1408208058: /*assert*/ return this.assert_ == null ? new Base[0] : new Base[] {this.assert_}; // SetupActionAssertComponent 2361 default: return super.getProperty(hash, name, checkValid); 2362 } 2363 2364 } 2365 2366 @Override 2367 public Base setProperty(int hash, String name, Base value) throws FHIRException { 2368 switch (hash) { 2369 case 1662702951: // operation 2370 this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent 2371 return value; 2372 case -1408208058: // assert 2373 this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent 2374 return value; 2375 default: return super.setProperty(hash, name, value); 2376 } 2377 2378 } 2379 2380 @Override 2381 public Base setProperty(String name, Base value) throws FHIRException { 2382 if (name.equals("operation")) { 2383 this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent 2384 } else if (name.equals("assert")) { 2385 this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent 2386 } else 2387 return super.setProperty(name, value); 2388 return value; 2389 } 2390 2391 @Override 2392 public Base makeProperty(int hash, String name) throws FHIRException { 2393 switch (hash) { 2394 case 1662702951: return getOperation(); 2395 case -1408208058: return getAssert(); 2396 default: return super.makeProperty(hash, name); 2397 } 2398 2399 } 2400 2401 @Override 2402 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 2403 switch (hash) { 2404 case 1662702951: /*operation*/ return new String[] {"@TestReport.setup.action.operation"}; 2405 case -1408208058: /*assert*/ return new String[] {"@TestReport.setup.action.assert"}; 2406 default: return super.getTypesForProperty(hash, name); 2407 } 2408 2409 } 2410 2411 @Override 2412 public Base addChild(String name) throws FHIRException { 2413 if (name.equals("operation")) { 2414 this.operation = new SetupActionOperationComponent(); 2415 return this.operation; 2416 } 2417 else if (name.equals("assert")) { 2418 this.assert_ = new SetupActionAssertComponent(); 2419 return this.assert_; 2420 } 2421 else 2422 return super.addChild(name); 2423 } 2424 2425 public TestActionComponent copy() { 2426 TestActionComponent dst = new TestActionComponent(); 2427 copyValues(dst); 2428 return dst; 2429 } 2430 2431 public void copyValues(TestActionComponent dst) { 2432 super.copyValues(dst); 2433 dst.operation = operation == null ? null : operation.copy(); 2434 dst.assert_ = assert_ == null ? null : assert_.copy(); 2435 } 2436 2437 @Override 2438 public boolean equalsDeep(Base other_) { 2439 if (!super.equalsDeep(other_)) 2440 return false; 2441 if (!(other_ instanceof TestActionComponent)) 2442 return false; 2443 TestActionComponent o = (TestActionComponent) other_; 2444 return compareDeep(operation, o.operation, true) && compareDeep(assert_, o.assert_, true); 2445 } 2446 2447 @Override 2448 public boolean equalsShallow(Base other_) { 2449 if (!super.equalsShallow(other_)) 2450 return false; 2451 if (!(other_ instanceof TestActionComponent)) 2452 return false; 2453 TestActionComponent o = (TestActionComponent) other_; 2454 return true; 2455 } 2456 2457 public boolean isEmpty() { 2458 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(operation, assert_); 2459 } 2460 2461 public String fhirType() { 2462 return "TestReport.test.action"; 2463 2464 } 2465 2466 } 2467 2468 @Block() 2469 public static class TestReportTeardownComponent extends BackboneElement implements IBaseBackboneElement { 2470 /** 2471 * The teardown action will only contain an operation. 2472 */ 2473 @Child(name = "action", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 2474 @Description(shortDefinition="One or more teardown operations performed", formalDefinition="The teardown action will only contain an operation." ) 2475 protected List<TeardownActionComponent> action; 2476 2477 private static final long serialVersionUID = 1168638089L; 2478 2479 /** 2480 * Constructor 2481 */ 2482 public TestReportTeardownComponent() { 2483 super(); 2484 } 2485 2486 /** 2487 * @return {@link #action} (The teardown action will only contain an operation.) 2488 */ 2489 public List<TeardownActionComponent> getAction() { 2490 if (this.action == null) 2491 this.action = new ArrayList<TeardownActionComponent>(); 2492 return this.action; 2493 } 2494 2495 /** 2496 * @return Returns a reference to <code>this</code> for easy method chaining 2497 */ 2498 public TestReportTeardownComponent setAction(List<TeardownActionComponent> theAction) { 2499 this.action = theAction; 2500 return this; 2501 } 2502 2503 public boolean hasAction() { 2504 if (this.action == null) 2505 return false; 2506 for (TeardownActionComponent item : this.action) 2507 if (!item.isEmpty()) 2508 return true; 2509 return false; 2510 } 2511 2512 public TeardownActionComponent addAction() { //3 2513 TeardownActionComponent t = new TeardownActionComponent(); 2514 if (this.action == null) 2515 this.action = new ArrayList<TeardownActionComponent>(); 2516 this.action.add(t); 2517 return t; 2518 } 2519 2520 public TestReportTeardownComponent addAction(TeardownActionComponent t) { //3 2521 if (t == null) 2522 return this; 2523 if (this.action == null) 2524 this.action = new ArrayList<TeardownActionComponent>(); 2525 this.action.add(t); 2526 return this; 2527 } 2528 2529 /** 2530 * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist 2531 */ 2532 public TeardownActionComponent getActionFirstRep() { 2533 if (getAction().isEmpty()) { 2534 addAction(); 2535 } 2536 return getAction().get(0); 2537 } 2538 2539 protected void listChildren(List<Property> children) { 2540 super.listChildren(children); 2541 children.add(new Property("action", "", "The teardown action will only contain an operation.", 0, java.lang.Integer.MAX_VALUE, action)); 2542 } 2543 2544 @Override 2545 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 2546 switch (_hash) { 2547 case -1422950858: /*action*/ return new Property("action", "", "The teardown action will only contain an operation.", 0, java.lang.Integer.MAX_VALUE, action); 2548 default: return super.getNamedProperty(_hash, _name, _checkValid); 2549 } 2550 2551 } 2552 2553 @Override 2554 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 2555 switch (hash) { 2556 case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // TeardownActionComponent 2557 default: return super.getProperty(hash, name, checkValid); 2558 } 2559 2560 } 2561 2562 @Override 2563 public Base setProperty(int hash, String name, Base value) throws FHIRException { 2564 switch (hash) { 2565 case -1422950858: // action 2566 this.getAction().add((TeardownActionComponent) value); // TeardownActionComponent 2567 return value; 2568 default: return super.setProperty(hash, name, value); 2569 } 2570 2571 } 2572 2573 @Override 2574 public Base setProperty(String name, Base value) throws FHIRException { 2575 if (name.equals("action")) { 2576 this.getAction().add((TeardownActionComponent) value); 2577 } else 2578 return super.setProperty(name, value); 2579 return value; 2580 } 2581 2582 @Override 2583 public Base makeProperty(int hash, String name) throws FHIRException { 2584 switch (hash) { 2585 case -1422950858: return addAction(); 2586 default: return super.makeProperty(hash, name); 2587 } 2588 2589 } 2590 2591 @Override 2592 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 2593 switch (hash) { 2594 case -1422950858: /*action*/ return new String[] {}; 2595 default: return super.getTypesForProperty(hash, name); 2596 } 2597 2598 } 2599 2600 @Override 2601 public Base addChild(String name) throws FHIRException { 2602 if (name.equals("action")) { 2603 return addAction(); 2604 } 2605 else 2606 return super.addChild(name); 2607 } 2608 2609 public TestReportTeardownComponent copy() { 2610 TestReportTeardownComponent dst = new TestReportTeardownComponent(); 2611 copyValues(dst); 2612 return dst; 2613 } 2614 2615 public void copyValues(TestReportTeardownComponent dst) { 2616 super.copyValues(dst); 2617 if (action != null) { 2618 dst.action = new ArrayList<TeardownActionComponent>(); 2619 for (TeardownActionComponent i : action) 2620 dst.action.add(i.copy()); 2621 }; 2622 } 2623 2624 @Override 2625 public boolean equalsDeep(Base other_) { 2626 if (!super.equalsDeep(other_)) 2627 return false; 2628 if (!(other_ instanceof TestReportTeardownComponent)) 2629 return false; 2630 TestReportTeardownComponent o = (TestReportTeardownComponent) other_; 2631 return compareDeep(action, o.action, true); 2632 } 2633 2634 @Override 2635 public boolean equalsShallow(Base other_) { 2636 if (!super.equalsShallow(other_)) 2637 return false; 2638 if (!(other_ instanceof TestReportTeardownComponent)) 2639 return false; 2640 TestReportTeardownComponent o = (TestReportTeardownComponent) other_; 2641 return true; 2642 } 2643 2644 public boolean isEmpty() { 2645 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(action); 2646 } 2647 2648 public String fhirType() { 2649 return "TestReport.teardown"; 2650 2651 } 2652 2653 } 2654 2655 @Block() 2656 public static class TeardownActionComponent extends BackboneElement implements IBaseBackboneElement { 2657 /** 2658 * An operation would involve a REST request to a server. 2659 */ 2660 @Child(name = "operation", type = {SetupActionOperationComponent.class}, order=1, min=1, max=1, modifier=false, summary=false) 2661 @Description(shortDefinition="The teardown operation performed", formalDefinition="An operation would involve a REST request to a server." ) 2662 protected SetupActionOperationComponent operation; 2663 2664 private static final long serialVersionUID = -1099598054L; 2665 2666 /** 2667 * Constructor 2668 */ 2669 public TeardownActionComponent() { 2670 super(); 2671 } 2672 2673 /** 2674 * Constructor 2675 */ 2676 public TeardownActionComponent(SetupActionOperationComponent operation) { 2677 super(); 2678 this.operation = operation; 2679 } 2680 2681 /** 2682 * @return {@link #operation} (An operation would involve a REST request to a server.) 2683 */ 2684 public SetupActionOperationComponent getOperation() { 2685 if (this.operation == null) 2686 if (Configuration.errorOnAutoCreate()) 2687 throw new Error("Attempt to auto-create TeardownActionComponent.operation"); 2688 else if (Configuration.doAutoCreate()) 2689 this.operation = new SetupActionOperationComponent(); // cc 2690 return this.operation; 2691 } 2692 2693 public boolean hasOperation() { 2694 return this.operation != null && !this.operation.isEmpty(); 2695 } 2696 2697 /** 2698 * @param value {@link #operation} (An operation would involve a REST request to a server.) 2699 */ 2700 public TeardownActionComponent setOperation(SetupActionOperationComponent value) { 2701 this.operation = value; 2702 return this; 2703 } 2704 2705 protected void listChildren(List<Property> children) { 2706 super.listChildren(children); 2707 children.add(new Property("operation", "@TestReport.setup.action.operation", "An operation would involve a REST request to a server.", 0, 1, operation)); 2708 } 2709 2710 @Override 2711 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 2712 switch (_hash) { 2713 case 1662702951: /*operation*/ return new Property("operation", "@TestReport.setup.action.operation", "An operation would involve a REST request to a server.", 0, 1, operation); 2714 default: return super.getNamedProperty(_hash, _name, _checkValid); 2715 } 2716 2717 } 2718 2719 @Override 2720 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 2721 switch (hash) { 2722 case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : new Base[] {this.operation}; // SetupActionOperationComponent 2723 default: return super.getProperty(hash, name, checkValid); 2724 } 2725 2726 } 2727 2728 @Override 2729 public Base setProperty(int hash, String name, Base value) throws FHIRException { 2730 switch (hash) { 2731 case 1662702951: // operation 2732 this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent 2733 return value; 2734 default: return super.setProperty(hash, name, value); 2735 } 2736 2737 } 2738 2739 @Override 2740 public Base setProperty(String name, Base value) throws FHIRException { 2741 if (name.equals("operation")) { 2742 this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent 2743 } else 2744 return super.setProperty(name, value); 2745 return value; 2746 } 2747 2748 @Override 2749 public Base makeProperty(int hash, String name) throws FHIRException { 2750 switch (hash) { 2751 case 1662702951: return getOperation(); 2752 default: return super.makeProperty(hash, name); 2753 } 2754 2755 } 2756 2757 @Override 2758 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 2759 switch (hash) { 2760 case 1662702951: /*operation*/ return new String[] {"@TestReport.setup.action.operation"}; 2761 default: return super.getTypesForProperty(hash, name); 2762 } 2763 2764 } 2765 2766 @Override 2767 public Base addChild(String name) throws FHIRException { 2768 if (name.equals("operation")) { 2769 this.operation = new SetupActionOperationComponent(); 2770 return this.operation; 2771 } 2772 else 2773 return super.addChild(name); 2774 } 2775 2776 public TeardownActionComponent copy() { 2777 TeardownActionComponent dst = new TeardownActionComponent(); 2778 copyValues(dst); 2779 return dst; 2780 } 2781 2782 public void copyValues(TeardownActionComponent dst) { 2783 super.copyValues(dst); 2784 dst.operation = operation == null ? null : operation.copy(); 2785 } 2786 2787 @Override 2788 public boolean equalsDeep(Base other_) { 2789 if (!super.equalsDeep(other_)) 2790 return false; 2791 if (!(other_ instanceof TeardownActionComponent)) 2792 return false; 2793 TeardownActionComponent o = (TeardownActionComponent) other_; 2794 return compareDeep(operation, o.operation, true); 2795 } 2796 2797 @Override 2798 public boolean equalsShallow(Base other_) { 2799 if (!super.equalsShallow(other_)) 2800 return false; 2801 if (!(other_ instanceof TeardownActionComponent)) 2802 return false; 2803 TeardownActionComponent o = (TeardownActionComponent) other_; 2804 return true; 2805 } 2806 2807 public boolean isEmpty() { 2808 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(operation); 2809 } 2810 2811 public String fhirType() { 2812 return "TestReport.teardown.action"; 2813 2814 } 2815 2816 } 2817 2818 /** 2819 * Identifier for the TestScript assigned for external purposes outside the context of FHIR. 2820 */ 2821 @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true) 2822 @Description(shortDefinition="External identifier", formalDefinition="Identifier for the TestScript assigned for external purposes outside the context of FHIR." ) 2823 protected Identifier identifier; 2824 2825 /** 2826 * A free text natural language name identifying the executed TestScript. 2827 */ 2828 @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) 2829 @Description(shortDefinition="Informal name of the executed TestScript", formalDefinition="A free text natural language name identifying the executed TestScript." ) 2830 protected StringType name; 2831 2832 /** 2833 * The current state of this test report. 2834 */ 2835 @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) 2836 @Description(shortDefinition="completed | in-progress | waiting | stopped | entered-in-error", formalDefinition="The current state of this test report." ) 2837 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/report-status-codes") 2838 protected Enumeration<TestReportStatus> status; 2839 2840 /** 2841 * Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`. 2842 */ 2843 @Child(name = "testScript", type = {TestScript.class}, order=3, min=1, max=1, modifier=false, summary=true) 2844 @Description(shortDefinition="Reference to the version-specific TestScript that was executed to produce this TestReport", formalDefinition="Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`." ) 2845 protected Reference testScript; 2846 2847 /** 2848 * The actual object that is the target of the reference (Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.) 2849 */ 2850 protected TestScript testScriptTarget; 2851 2852 /** 2853 * The overall result from the execution of the TestScript. 2854 */ 2855 @Child(name = "result", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=true) 2856 @Description(shortDefinition="pass | fail | pending", formalDefinition="The overall result from the execution of the TestScript." ) 2857 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/report-result-codes") 2858 protected Enumeration<TestReportResult> result; 2859 2860 /** 2861 * The final score (percentage of tests passed) resulting from the execution of the TestScript. 2862 */ 2863 @Child(name = "score", type = {DecimalType.class}, order=5, min=0, max=1, modifier=false, summary=true) 2864 @Description(shortDefinition="The final score (percentage of tests passed) resulting from the execution of the TestScript", formalDefinition="The final score (percentage of tests passed) resulting from the execution of the TestScript." ) 2865 protected DecimalType score; 2866 2867 /** 2868 * Name of the tester producing this report (Organization or individual). 2869 */ 2870 @Child(name = "tester", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) 2871 @Description(shortDefinition="Name of the tester producing this report (Organization or individual)", formalDefinition="Name of the tester producing this report (Organization or individual)." ) 2872 protected StringType tester; 2873 2874 /** 2875 * When the TestScript was executed and this TestReport was generated. 2876 */ 2877 @Child(name = "issued", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true) 2878 @Description(shortDefinition="When the TestScript was executed and this TestReport was generated", formalDefinition="When the TestScript was executed and this TestReport was generated." ) 2879 protected DateTimeType issued; 2880 2881 /** 2882 * A participant in the test execution, either the execution engine, a client, or a server. 2883 */ 2884 @Child(name = "participant", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 2885 @Description(shortDefinition="A participant in the test execution, either the execution engine, a client, or a server", formalDefinition="A participant in the test execution, either the execution engine, a client, or a server." ) 2886 protected List<TestReportParticipantComponent> participant; 2887 2888 /** 2889 * The results of the series of required setup operations before the tests were executed. 2890 */ 2891 @Child(name = "setup", type = {}, order=9, min=0, max=1, modifier=false, summary=false) 2892 @Description(shortDefinition="The results of the series of required setup operations before the tests were executed", formalDefinition="The results of the series of required setup operations before the tests were executed." ) 2893 protected TestReportSetupComponent setup; 2894 2895 /** 2896 * A test executed from the test script. 2897 */ 2898 @Child(name = "test", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 2899 @Description(shortDefinition="A test executed from the test script", formalDefinition="A test executed from the test script." ) 2900 protected List<TestReportTestComponent> test; 2901 2902 /** 2903 * The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise). 2904 */ 2905 @Child(name = "teardown", type = {}, order=11, min=0, max=1, modifier=false, summary=false) 2906 @Description(shortDefinition="The results of running the series of required clean up steps", formalDefinition="The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise)." ) 2907 protected TestReportTeardownComponent teardown; 2908 2909 private static final long serialVersionUID = 79474516L; 2910 2911 /** 2912 * Constructor 2913 */ 2914 public TestReport() { 2915 super(); 2916 } 2917 2918 /** 2919 * Constructor 2920 */ 2921 public TestReport(Enumeration<TestReportStatus> status, Reference testScript, Enumeration<TestReportResult> result) { 2922 super(); 2923 this.status = status; 2924 this.testScript = testScript; 2925 this.result = result; 2926 } 2927 2928 /** 2929 * @return {@link #identifier} (Identifier for the TestScript assigned for external purposes outside the context of FHIR.) 2930 */ 2931 public Identifier getIdentifier() { 2932 if (this.identifier == null) 2933 if (Configuration.errorOnAutoCreate()) 2934 throw new Error("Attempt to auto-create TestReport.identifier"); 2935 else if (Configuration.doAutoCreate()) 2936 this.identifier = new Identifier(); // cc 2937 return this.identifier; 2938 } 2939 2940 public boolean hasIdentifier() { 2941 return this.identifier != null && !this.identifier.isEmpty(); 2942 } 2943 2944 /** 2945 * @param value {@link #identifier} (Identifier for the TestScript assigned for external purposes outside the context of FHIR.) 2946 */ 2947 public TestReport setIdentifier(Identifier value) { 2948 this.identifier = value; 2949 return this; 2950 } 2951 2952 /** 2953 * @return {@link #name} (A free text natural language name identifying the executed TestScript.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 2954 */ 2955 public StringType getNameElement() { 2956 if (this.name == null) 2957 if (Configuration.errorOnAutoCreate()) 2958 throw new Error("Attempt to auto-create TestReport.name"); 2959 else if (Configuration.doAutoCreate()) 2960 this.name = new StringType(); // bb 2961 return this.name; 2962 } 2963 2964 public boolean hasNameElement() { 2965 return this.name != null && !this.name.isEmpty(); 2966 } 2967 2968 public boolean hasName() { 2969 return this.name != null && !this.name.isEmpty(); 2970 } 2971 2972 /** 2973 * @param value {@link #name} (A free text natural language name identifying the executed TestScript.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 2974 */ 2975 public TestReport setNameElement(StringType value) { 2976 this.name = value; 2977 return this; 2978 } 2979 2980 /** 2981 * @return A free text natural language name identifying the executed TestScript. 2982 */ 2983 public String getName() { 2984 return this.name == null ? null : this.name.getValue(); 2985 } 2986 2987 /** 2988 * @param value A free text natural language name identifying the executed TestScript. 2989 */ 2990 public TestReport setName(String value) { 2991 if (Utilities.noString(value)) 2992 this.name = null; 2993 else { 2994 if (this.name == null) 2995 this.name = new StringType(); 2996 this.name.setValue(value); 2997 } 2998 return this; 2999 } 3000 3001 /** 3002 * @return {@link #status} (The current state of this test report.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 3003 */ 3004 public Enumeration<TestReportStatus> getStatusElement() { 3005 if (this.status == null) 3006 if (Configuration.errorOnAutoCreate()) 3007 throw new Error("Attempt to auto-create TestReport.status"); 3008 else if (Configuration.doAutoCreate()) 3009 this.status = new Enumeration<TestReportStatus>(new TestReportStatusEnumFactory()); // bb 3010 return this.status; 3011 } 3012 3013 public boolean hasStatusElement() { 3014 return this.status != null && !this.status.isEmpty(); 3015 } 3016 3017 public boolean hasStatus() { 3018 return this.status != null && !this.status.isEmpty(); 3019 } 3020 3021 /** 3022 * @param value {@link #status} (The current state of this test report.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 3023 */ 3024 public TestReport setStatusElement(Enumeration<TestReportStatus> value) { 3025 this.status = value; 3026 return this; 3027 } 3028 3029 /** 3030 * @return The current state of this test report. 3031 */ 3032 public TestReportStatus getStatus() { 3033 return this.status == null ? null : this.status.getValue(); 3034 } 3035 3036 /** 3037 * @param value The current state of this test report. 3038 */ 3039 public TestReport setStatus(TestReportStatus value) { 3040 if (this.status == null) 3041 this.status = new Enumeration<TestReportStatus>(new TestReportStatusEnumFactory()); 3042 this.status.setValue(value); 3043 return this; 3044 } 3045 3046 /** 3047 * @return {@link #testScript} (Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.) 3048 */ 3049 public Reference getTestScript() { 3050 if (this.testScript == null) 3051 if (Configuration.errorOnAutoCreate()) 3052 throw new Error("Attempt to auto-create TestReport.testScript"); 3053 else if (Configuration.doAutoCreate()) 3054 this.testScript = new Reference(); // cc 3055 return this.testScript; 3056 } 3057 3058 public boolean hasTestScript() { 3059 return this.testScript != null && !this.testScript.isEmpty(); 3060 } 3061 3062 /** 3063 * @param value {@link #testScript} (Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.) 3064 */ 3065 public TestReport setTestScript(Reference value) { 3066 this.testScript = value; 3067 return this; 3068 } 3069 3070 /** 3071 * @return {@link #testScript} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.) 3072 */ 3073 public TestScript getTestScriptTarget() { 3074 if (this.testScriptTarget == null) 3075 if (Configuration.errorOnAutoCreate()) 3076 throw new Error("Attempt to auto-create TestReport.testScript"); 3077 else if (Configuration.doAutoCreate()) 3078 this.testScriptTarget = new TestScript(); // aa 3079 return this.testScriptTarget; 3080 } 3081 3082 /** 3083 * @param value {@link #testScript} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.) 3084 */ 3085 public TestReport setTestScriptTarget(TestScript value) { 3086 this.testScriptTarget = value; 3087 return this; 3088 } 3089 3090 /** 3091 * @return {@link #result} (The overall result from the execution of the TestScript.). This is the underlying object with id, value and extensions. The accessor "getResult" gives direct access to the value 3092 */ 3093 public Enumeration<TestReportResult> getResultElement() { 3094 if (this.result == null) 3095 if (Configuration.errorOnAutoCreate()) 3096 throw new Error("Attempt to auto-create TestReport.result"); 3097 else if (Configuration.doAutoCreate()) 3098 this.result = new Enumeration<TestReportResult>(new TestReportResultEnumFactory()); // bb 3099 return this.result; 3100 } 3101 3102 public boolean hasResultElement() { 3103 return this.result != null && !this.result.isEmpty(); 3104 } 3105 3106 public boolean hasResult() { 3107 return this.result != null && !this.result.isEmpty(); 3108 } 3109 3110 /** 3111 * @param value {@link #result} (The overall result from the execution of the TestScript.). This is the underlying object with id, value and extensions. The accessor "getResult" gives direct access to the value 3112 */ 3113 public TestReport setResultElement(Enumeration<TestReportResult> value) { 3114 this.result = value; 3115 return this; 3116 } 3117 3118 /** 3119 * @return The overall result from the execution of the TestScript. 3120 */ 3121 public TestReportResult getResult() { 3122 return this.result == null ? null : this.result.getValue(); 3123 } 3124 3125 /** 3126 * @param value The overall result from the execution of the TestScript. 3127 */ 3128 public TestReport setResult(TestReportResult value) { 3129 if (this.result == null) 3130 this.result = new Enumeration<TestReportResult>(new TestReportResultEnumFactory()); 3131 this.result.setValue(value); 3132 return this; 3133 } 3134 3135 /** 3136 * @return {@link #score} (The final score (percentage of tests passed) resulting from the execution of the TestScript.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value 3137 */ 3138 public DecimalType getScoreElement() { 3139 if (this.score == null) 3140 if (Configuration.errorOnAutoCreate()) 3141 throw new Error("Attempt to auto-create TestReport.score"); 3142 else if (Configuration.doAutoCreate()) 3143 this.score = new DecimalType(); // bb 3144 return this.score; 3145 } 3146 3147 public boolean hasScoreElement() { 3148 return this.score != null && !this.score.isEmpty(); 3149 } 3150 3151 public boolean hasScore() { 3152 return this.score != null && !this.score.isEmpty(); 3153 } 3154 3155 /** 3156 * @param value {@link #score} (The final score (percentage of tests passed) resulting from the execution of the TestScript.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value 3157 */ 3158 public TestReport setScoreElement(DecimalType value) { 3159 this.score = value; 3160 return this; 3161 } 3162 3163 /** 3164 * @return The final score (percentage of tests passed) resulting from the execution of the TestScript. 3165 */ 3166 public BigDecimal getScore() { 3167 return this.score == null ? null : this.score.getValue(); 3168 } 3169 3170 /** 3171 * @param value The final score (percentage of tests passed) resulting from the execution of the TestScript. 3172 */ 3173 public TestReport setScore(BigDecimal value) { 3174 if (value == null) 3175 this.score = null; 3176 else { 3177 if (this.score == null) 3178 this.score = new DecimalType(); 3179 this.score.setValue(value); 3180 } 3181 return this; 3182 } 3183 3184 /** 3185 * @param value The final score (percentage of tests passed) resulting from the execution of the TestScript. 3186 */ 3187 public TestReport setScore(long value) { 3188 this.score = new DecimalType(); 3189 this.score.setValue(value); 3190 return this; 3191 } 3192 3193 /** 3194 * @param value The final score (percentage of tests passed) resulting from the execution of the TestScript. 3195 */ 3196 public TestReport setScore(double value) { 3197 this.score = new DecimalType(); 3198 this.score.setValue(value); 3199 return this; 3200 } 3201 3202 /** 3203 * @return {@link #tester} (Name of the tester producing this report (Organization or individual).). This is the underlying object with id, value and extensions. The accessor "getTester" gives direct access to the value 3204 */ 3205 public StringType getTesterElement() { 3206 if (this.tester == null) 3207 if (Configuration.errorOnAutoCreate()) 3208 throw new Error("Attempt to auto-create TestReport.tester"); 3209 else if (Configuration.doAutoCreate()) 3210 this.tester = new StringType(); // bb 3211 return this.tester; 3212 } 3213 3214 public boolean hasTesterElement() { 3215 return this.tester != null && !this.tester.isEmpty(); 3216 } 3217 3218 public boolean hasTester() { 3219 return this.tester != null && !this.tester.isEmpty(); 3220 } 3221 3222 /** 3223 * @param value {@link #tester} (Name of the tester producing this report (Organization or individual).). This is the underlying object with id, value and extensions. The accessor "getTester" gives direct access to the value 3224 */ 3225 public TestReport setTesterElement(StringType value) { 3226 this.tester = value; 3227 return this; 3228 } 3229 3230 /** 3231 * @return Name of the tester producing this report (Organization or individual). 3232 */ 3233 public String getTester() { 3234 return this.tester == null ? null : this.tester.getValue(); 3235 } 3236 3237 /** 3238 * @param value Name of the tester producing this report (Organization or individual). 3239 */ 3240 public TestReport setTester(String value) { 3241 if (Utilities.noString(value)) 3242 this.tester = null; 3243 else { 3244 if (this.tester == null) 3245 this.tester = new StringType(); 3246 this.tester.setValue(value); 3247 } 3248 return this; 3249 } 3250 3251 /** 3252 * @return {@link #issued} (When the TestScript was executed and this TestReport was generated.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value 3253 */ 3254 public DateTimeType getIssuedElement() { 3255 if (this.issued == null) 3256 if (Configuration.errorOnAutoCreate()) 3257 throw new Error("Attempt to auto-create TestReport.issued"); 3258 else if (Configuration.doAutoCreate()) 3259 this.issued = new DateTimeType(); // bb 3260 return this.issued; 3261 } 3262 3263 public boolean hasIssuedElement() { 3264 return this.issued != null && !this.issued.isEmpty(); 3265 } 3266 3267 public boolean hasIssued() { 3268 return this.issued != null && !this.issued.isEmpty(); 3269 } 3270 3271 /** 3272 * @param value {@link #issued} (When the TestScript was executed and this TestReport was generated.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value 3273 */ 3274 public TestReport setIssuedElement(DateTimeType value) { 3275 this.issued = value; 3276 return this; 3277 } 3278 3279 /** 3280 * @return When the TestScript was executed and this TestReport was generated. 3281 */ 3282 public Date getIssued() { 3283 return this.issued == null ? null : this.issued.getValue(); 3284 } 3285 3286 /** 3287 * @param value When the TestScript was executed and this TestReport was generated. 3288 */ 3289 public TestReport setIssued(Date value) { 3290 if (value == null) 3291 this.issued = null; 3292 else { 3293 if (this.issued == null) 3294 this.issued = new DateTimeType(); 3295 this.issued.setValue(value); 3296 } 3297 return this; 3298 } 3299 3300 /** 3301 * @return {@link #participant} (A participant in the test execution, either the execution engine, a client, or a server.) 3302 */ 3303 public List<TestReportParticipantComponent> getParticipant() { 3304 if (this.participant == null) 3305 this.participant = new ArrayList<TestReportParticipantComponent>(); 3306 return this.participant; 3307 } 3308 3309 /** 3310 * @return Returns a reference to <code>this</code> for easy method chaining 3311 */ 3312 public TestReport setParticipant(List<TestReportParticipantComponent> theParticipant) { 3313 this.participant = theParticipant; 3314 return this; 3315 } 3316 3317 public boolean hasParticipant() { 3318 if (this.participant == null) 3319 return false; 3320 for (TestReportParticipantComponent item : this.participant) 3321 if (!item.isEmpty()) 3322 return true; 3323 return false; 3324 } 3325 3326 public TestReportParticipantComponent addParticipant() { //3 3327 TestReportParticipantComponent t = new TestReportParticipantComponent(); 3328 if (this.participant == null) 3329 this.participant = new ArrayList<TestReportParticipantComponent>(); 3330 this.participant.add(t); 3331 return t; 3332 } 3333 3334 public TestReport addParticipant(TestReportParticipantComponent t) { //3 3335 if (t == null) 3336 return this; 3337 if (this.participant == null) 3338 this.participant = new ArrayList<TestReportParticipantComponent>(); 3339 this.participant.add(t); 3340 return this; 3341 } 3342 3343 /** 3344 * @return The first repetition of repeating field {@link #participant}, creating it if it does not already exist 3345 */ 3346 public TestReportParticipantComponent getParticipantFirstRep() { 3347 if (getParticipant().isEmpty()) { 3348 addParticipant(); 3349 } 3350 return getParticipant().get(0); 3351 } 3352 3353 /** 3354 * @return {@link #setup} (The results of the series of required setup operations before the tests were executed.) 3355 */ 3356 public TestReportSetupComponent getSetup() { 3357 if (this.setup == null) 3358 if (Configuration.errorOnAutoCreate()) 3359 throw new Error("Attempt to auto-create TestReport.setup"); 3360 else if (Configuration.doAutoCreate()) 3361 this.setup = new TestReportSetupComponent(); // cc 3362 return this.setup; 3363 } 3364 3365 public boolean hasSetup() { 3366 return this.setup != null && !this.setup.isEmpty(); 3367 } 3368 3369 /** 3370 * @param value {@link #setup} (The results of the series of required setup operations before the tests were executed.) 3371 */ 3372 public TestReport setSetup(TestReportSetupComponent value) { 3373 this.setup = value; 3374 return this; 3375 } 3376 3377 /** 3378 * @return {@link #test} (A test executed from the test script.) 3379 */ 3380 public List<TestReportTestComponent> getTest() { 3381 if (this.test == null) 3382 this.test = new ArrayList<TestReportTestComponent>(); 3383 return this.test; 3384 } 3385 3386 /** 3387 * @return Returns a reference to <code>this</code> for easy method chaining 3388 */ 3389 public TestReport setTest(List<TestReportTestComponent> theTest) { 3390 this.test = theTest; 3391 return this; 3392 } 3393 3394 public boolean hasTest() { 3395 if (this.test == null) 3396 return false; 3397 for (TestReportTestComponent item : this.test) 3398 if (!item.isEmpty()) 3399 return true; 3400 return false; 3401 } 3402 3403 public TestReportTestComponent addTest() { //3 3404 TestReportTestComponent t = new TestReportTestComponent(); 3405 if (this.test == null) 3406 this.test = new ArrayList<TestReportTestComponent>(); 3407 this.test.add(t); 3408 return t; 3409 } 3410 3411 public TestReport addTest(TestReportTestComponent t) { //3 3412 if (t == null) 3413 return this; 3414 if (this.test == null) 3415 this.test = new ArrayList<TestReportTestComponent>(); 3416 this.test.add(t); 3417 return this; 3418 } 3419 3420 /** 3421 * @return The first repetition of repeating field {@link #test}, creating it if it does not already exist 3422 */ 3423 public TestReportTestComponent getTestFirstRep() { 3424 if (getTest().isEmpty()) { 3425 addTest(); 3426 } 3427 return getTest().get(0); 3428 } 3429 3430 /** 3431 * @return {@link #teardown} (The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise).) 3432 */ 3433 public TestReportTeardownComponent getTeardown() { 3434 if (this.teardown == null) 3435 if (Configuration.errorOnAutoCreate()) 3436 throw new Error("Attempt to auto-create TestReport.teardown"); 3437 else if (Configuration.doAutoCreate()) 3438 this.teardown = new TestReportTeardownComponent(); // cc 3439 return this.teardown; 3440 } 3441 3442 public boolean hasTeardown() { 3443 return this.teardown != null && !this.teardown.isEmpty(); 3444 } 3445 3446 /** 3447 * @param value {@link #teardown} (The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise).) 3448 */ 3449 public TestReport setTeardown(TestReportTeardownComponent value) { 3450 this.teardown = value; 3451 return this; 3452 } 3453 3454 protected void listChildren(List<Property> children) { 3455 super.listChildren(children); 3456 children.add(new Property("identifier", "Identifier", "Identifier for the TestScript assigned for external purposes outside the context of FHIR.", 0, 1, identifier)); 3457 children.add(new Property("name", "string", "A free text natural language name identifying the executed TestScript.", 0, 1, name)); 3458 children.add(new Property("status", "code", "The current state of this test report.", 0, 1, status)); 3459 children.add(new Property("testScript", "Reference(TestScript)", "Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.", 0, 1, testScript)); 3460 children.add(new Property("result", "code", "The overall result from the execution of the TestScript.", 0, 1, result)); 3461 children.add(new Property("score", "decimal", "The final score (percentage of tests passed) resulting from the execution of the TestScript.", 0, 1, score)); 3462 children.add(new Property("tester", "string", "Name of the tester producing this report (Organization or individual).", 0, 1, tester)); 3463 children.add(new Property("issued", "dateTime", "When the TestScript was executed and this TestReport was generated.", 0, 1, issued)); 3464 children.add(new Property("participant", "", "A participant in the test execution, either the execution engine, a client, or a server.", 0, java.lang.Integer.MAX_VALUE, participant)); 3465 children.add(new Property("setup", "", "The results of the series of required setup operations before the tests were executed.", 0, 1, setup)); 3466 children.add(new Property("test", "", "A test executed from the test script.", 0, java.lang.Integer.MAX_VALUE, test)); 3467 children.add(new Property("teardown", "", "The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise).", 0, 1, teardown)); 3468 } 3469 3470 @Override 3471 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 3472 switch (_hash) { 3473 case -1618432855: /*identifier*/ return new Property("identifier", "Identifier", "Identifier for the TestScript assigned for external purposes outside the context of FHIR.", 0, 1, identifier); 3474 case 3373707: /*name*/ return new Property("name", "string", "A free text natural language name identifying the executed TestScript.", 0, 1, name); 3475 case -892481550: /*status*/ return new Property("status", "code", "The current state of this test report.", 0, 1, status); 3476 case 1712049149: /*testScript*/ return new Property("testScript", "Reference(TestScript)", "Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.", 0, 1, testScript); 3477 case -934426595: /*result*/ return new Property("result", "code", "The overall result from the execution of the TestScript.", 0, 1, result); 3478 case 109264530: /*score*/ return new Property("score", "decimal", "The final score (percentage of tests passed) resulting from the execution of the TestScript.", 0, 1, score); 3479 case -877169473: /*tester*/ return new Property("tester", "string", "Name of the tester producing this report (Organization or individual).", 0, 1, tester); 3480 case -1179159893: /*issued*/ return new Property("issued", "dateTime", "When the TestScript was executed and this TestReport was generated.", 0, 1, issued); 3481 case 767422259: /*participant*/ return new Property("participant", "", "A participant in the test execution, either the execution engine, a client, or a server.", 0, java.lang.Integer.MAX_VALUE, participant); 3482 case 109329021: /*setup*/ return new Property("setup", "", "The results of the series of required setup operations before the tests were executed.", 0, 1, setup); 3483 case 3556498: /*test*/ return new Property("test", "", "A test executed from the test script.", 0, java.lang.Integer.MAX_VALUE, test); 3484 case -1663474172: /*teardown*/ return new Property("teardown", "", "The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise).", 0, 1, teardown); 3485 default: return super.getNamedProperty(_hash, _name, _checkValid); 3486 } 3487 3488 } 3489 3490 @Override 3491 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 3492 switch (hash) { 3493 case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier 3494 case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType 3495 case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<TestReportStatus> 3496 case 1712049149: /*testScript*/ return this.testScript == null ? new Base[0] : new Base[] {this.testScript}; // Reference 3497 case -934426595: /*result*/ return this.result == null ? new Base[0] : new Base[] {this.result}; // Enumeration<TestReportResult> 3498 case 109264530: /*score*/ return this.score == null ? new Base[0] : new Base[] {this.score}; // DecimalType 3499 case -877169473: /*tester*/ return this.tester == null ? new Base[0] : new Base[] {this.tester}; // StringType 3500 case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // DateTimeType 3501 case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // TestReportParticipantComponent 3502 case 109329021: /*setup*/ return this.setup == null ? new Base[0] : new Base[] {this.setup}; // TestReportSetupComponent 3503 case 3556498: /*test*/ return this.test == null ? new Base[0] : this.test.toArray(new Base[this.test.size()]); // TestReportTestComponent 3504 case -1663474172: /*teardown*/ return this.teardown == null ? new Base[0] : new Base[] {this.teardown}; // TestReportTeardownComponent 3505 default: return super.getProperty(hash, name, checkValid); 3506 } 3507 3508 } 3509 3510 @Override 3511 public Base setProperty(int hash, String name, Base value) throws FHIRException { 3512 switch (hash) { 3513 case -1618432855: // identifier 3514 this.identifier = castToIdentifier(value); // Identifier 3515 return value; 3516 case 3373707: // name 3517 this.name = castToString(value); // StringType 3518 return value; 3519 case -892481550: // status 3520 value = new TestReportStatusEnumFactory().fromType(castToCode(value)); 3521 this.status = (Enumeration) value; // Enumeration<TestReportStatus> 3522 return value; 3523 case 1712049149: // testScript 3524 this.testScript = castToReference(value); // Reference 3525 return value; 3526 case -934426595: // result 3527 value = new TestReportResultEnumFactory().fromType(castToCode(value)); 3528 this.result = (Enumeration) value; // Enumeration<TestReportResult> 3529 return value; 3530 case 109264530: // score 3531 this.score = castToDecimal(value); // DecimalType 3532 return value; 3533 case -877169473: // tester 3534 this.tester = castToString(value); // StringType 3535 return value; 3536 case -1179159893: // issued 3537 this.issued = castToDateTime(value); // DateTimeType 3538 return value; 3539 case 767422259: // participant 3540 this.getParticipant().add((TestReportParticipantComponent) value); // TestReportParticipantComponent 3541 return value; 3542 case 109329021: // setup 3543 this.setup = (TestReportSetupComponent) value; // TestReportSetupComponent 3544 return value; 3545 case 3556498: // test 3546 this.getTest().add((TestReportTestComponent) value); // TestReportTestComponent 3547 return value; 3548 case -1663474172: // teardown 3549 this.teardown = (TestReportTeardownComponent) value; // TestReportTeardownComponent 3550 return value; 3551 default: return super.setProperty(hash, name, value); 3552 } 3553 3554 } 3555 3556 @Override 3557 public Base setProperty(String name, Base value) throws FHIRException { 3558 if (name.equals("identifier")) { 3559 this.identifier = castToIdentifier(value); // Identifier 3560 } else if (name.equals("name")) { 3561 this.name = castToString(value); // StringType 3562 } else if (name.equals("status")) { 3563 value = new TestReportStatusEnumFactory().fromType(castToCode(value)); 3564 this.status = (Enumeration) value; // Enumeration<TestReportStatus> 3565 } else if (name.equals("testScript")) { 3566 this.testScript = castToReference(value); // Reference 3567 } else if (name.equals("result")) { 3568 value = new TestReportResultEnumFactory().fromType(castToCode(value)); 3569 this.result = (Enumeration) value; // Enumeration<TestReportResult> 3570 } else if (name.equals("score")) { 3571 this.score = castToDecimal(value); // DecimalType 3572 } else if (name.equals("tester")) { 3573 this.tester = castToString(value); // StringType 3574 } else if (name.equals("issued")) { 3575 this.issued = castToDateTime(value); // DateTimeType 3576 } else if (name.equals("participant")) { 3577 this.getParticipant().add((TestReportParticipantComponent) value); 3578 } else if (name.equals("setup")) { 3579 this.setup = (TestReportSetupComponent) value; // TestReportSetupComponent 3580 } else if (name.equals("test")) { 3581 this.getTest().add((TestReportTestComponent) value); 3582 } else if (name.equals("teardown")) { 3583 this.teardown = (TestReportTeardownComponent) value; // TestReportTeardownComponent 3584 } else 3585 return super.setProperty(name, value); 3586 return value; 3587 } 3588 3589 @Override 3590 public Base makeProperty(int hash, String name) throws FHIRException { 3591 switch (hash) { 3592 case -1618432855: return getIdentifier(); 3593 case 3373707: return getNameElement(); 3594 case -892481550: return getStatusElement(); 3595 case 1712049149: return getTestScript(); 3596 case -934426595: return getResultElement(); 3597 case 109264530: return getScoreElement(); 3598 case -877169473: return getTesterElement(); 3599 case -1179159893: return getIssuedElement(); 3600 case 767422259: return addParticipant(); 3601 case 109329021: return getSetup(); 3602 case 3556498: return addTest(); 3603 case -1663474172: return getTeardown(); 3604 default: return super.makeProperty(hash, name); 3605 } 3606 3607 } 3608 3609 @Override 3610 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 3611 switch (hash) { 3612 case -1618432855: /*identifier*/ return new String[] {"Identifier"}; 3613 case 3373707: /*name*/ return new String[] {"string"}; 3614 case -892481550: /*status*/ return new String[] {"code"}; 3615 case 1712049149: /*testScript*/ return new String[] {"Reference"}; 3616 case -934426595: /*result*/ return new String[] {"code"}; 3617 case 109264530: /*score*/ return new String[] {"decimal"}; 3618 case -877169473: /*tester*/ return new String[] {"string"}; 3619 case -1179159893: /*issued*/ return new String[] {"dateTime"}; 3620 case 767422259: /*participant*/ return new String[] {}; 3621 case 109329021: /*setup*/ return new String[] {}; 3622 case 3556498: /*test*/ return new String[] {}; 3623 case -1663474172: /*teardown*/ return new String[] {}; 3624 default: return super.getTypesForProperty(hash, name); 3625 } 3626 3627 } 3628 3629 @Override 3630 public Base addChild(String name) throws FHIRException { 3631 if (name.equals("identifier")) { 3632 this.identifier = new Identifier(); 3633 return this.identifier; 3634 } 3635 else if (name.equals("name")) { 3636 throw new FHIRException("Cannot call addChild on a primitive type TestReport.name"); 3637 } 3638 else if (name.equals("status")) { 3639 throw new FHIRException("Cannot call addChild on a primitive type TestReport.status"); 3640 } 3641 else if (name.equals("testScript")) { 3642 this.testScript = new Reference(); 3643 return this.testScript; 3644 } 3645 else if (name.equals("result")) { 3646 throw new FHIRException("Cannot call addChild on a primitive type TestReport.result"); 3647 } 3648 else if (name.equals("score")) { 3649 throw new FHIRException("Cannot call addChild on a primitive type TestReport.score"); 3650 } 3651 else if (name.equals("tester")) { 3652 throw new FHIRException("Cannot call addChild on a primitive type TestReport.tester"); 3653 } 3654 else if (name.equals("issued")) { 3655 throw new FHIRException("Cannot call addChild on a primitive type TestReport.issued"); 3656 } 3657 else if (name.equals("participant")) { 3658 return addParticipant(); 3659 } 3660 else if (name.equals("setup")) { 3661 this.setup = new TestReportSetupComponent(); 3662 return this.setup; 3663 } 3664 else if (name.equals("test")) { 3665 return addTest(); 3666 } 3667 else if (name.equals("teardown")) { 3668 this.teardown = new TestReportTeardownComponent(); 3669 return this.teardown; 3670 } 3671 else 3672 return super.addChild(name); 3673 } 3674 3675 public String fhirType() { 3676 return "TestReport"; 3677 3678 } 3679 3680 public TestReport copy() { 3681 TestReport dst = new TestReport(); 3682 copyValues(dst); 3683 return dst; 3684 } 3685 3686 public void copyValues(TestReport dst) { 3687 super.copyValues(dst); 3688 dst.identifier = identifier == null ? null : identifier.copy(); 3689 dst.name = name == null ? null : name.copy(); 3690 dst.status = status == null ? null : status.copy(); 3691 dst.testScript = testScript == null ? null : testScript.copy(); 3692 dst.result = result == null ? null : result.copy(); 3693 dst.score = score == null ? null : score.copy(); 3694 dst.tester = tester == null ? null : tester.copy(); 3695 dst.issued = issued == null ? null : issued.copy(); 3696 if (participant != null) { 3697 dst.participant = new ArrayList<TestReportParticipantComponent>(); 3698 for (TestReportParticipantComponent i : participant) 3699 dst.participant.add(i.copy()); 3700 }; 3701 dst.setup = setup == null ? null : setup.copy(); 3702 if (test != null) { 3703 dst.test = new ArrayList<TestReportTestComponent>(); 3704 for (TestReportTestComponent i : test) 3705 dst.test.add(i.copy()); 3706 }; 3707 dst.teardown = teardown == null ? null : teardown.copy(); 3708 } 3709 3710 protected TestReport typedCopy() { 3711 return copy(); 3712 } 3713 3714 @Override 3715 public boolean equalsDeep(Base other_) { 3716 if (!super.equalsDeep(other_)) 3717 return false; 3718 if (!(other_ instanceof TestReport)) 3719 return false; 3720 TestReport o = (TestReport) other_; 3721 return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(status, o.status, true) 3722 && compareDeep(testScript, o.testScript, true) && compareDeep(result, o.result, true) && compareDeep(score, o.score, true) 3723 && compareDeep(tester, o.tester, true) && compareDeep(issued, o.issued, true) && compareDeep(participant, o.participant, true) 3724 && compareDeep(setup, o.setup, true) && compareDeep(test, o.test, true) && compareDeep(teardown, o.teardown, true) 3725 ; 3726 } 3727 3728 @Override 3729 public boolean equalsShallow(Base other_) { 3730 if (!super.equalsShallow(other_)) 3731 return false; 3732 if (!(other_ instanceof TestReport)) 3733 return false; 3734 TestReport o = (TestReport) other_; 3735 return compareValues(name, o.name, true) && compareValues(status, o.status, true) && compareValues(result, o.result, true) 3736 && compareValues(score, o.score, true) && compareValues(tester, o.tester, true) && compareValues(issued, o.issued, true) 3737 ; 3738 } 3739 3740 public boolean isEmpty() { 3741 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, name, status 3742 , testScript, result, score, tester, issued, participant, setup, test, teardown 3743 ); 3744 } 3745 3746 @Override 3747 public ResourceType getResourceType() { 3748 return ResourceType.TestReport; 3749 } 3750 3751 /** 3752 * Search parameter: <b>result</b> 3753 * <p> 3754 * Description: <b>The result disposition of the test execution</b><br> 3755 * Type: <b>token</b><br> 3756 * Path: <b>TestReport.result</b><br> 3757 * </p> 3758 */ 3759 @SearchParamDefinition(name="result", path="TestReport.result", description="The result disposition of the test execution", type="token" ) 3760 public static final String SP_RESULT = "result"; 3761 /** 3762 * <b>Fluent Client</b> search parameter constant for <b>result</b> 3763 * <p> 3764 * Description: <b>The result disposition of the test execution</b><br> 3765 * Type: <b>token</b><br> 3766 * Path: <b>TestReport.result</b><br> 3767 * </p> 3768 */ 3769 public static final ca.uhn.fhir.rest.gclient.TokenClientParam RESULT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RESULT); 3770 3771 /** 3772 * Search parameter: <b>identifier</b> 3773 * <p> 3774 * Description: <b>An external identifier for the test report</b><br> 3775 * Type: <b>token</b><br> 3776 * Path: <b>TestReport.identifier</b><br> 3777 * </p> 3778 */ 3779 @SearchParamDefinition(name="identifier", path="TestReport.identifier", description="An external identifier for the test report", type="token" ) 3780 public static final String SP_IDENTIFIER = "identifier"; 3781 /** 3782 * <b>Fluent Client</b> search parameter constant for <b>identifier</b> 3783 * <p> 3784 * Description: <b>An external identifier for the test report</b><br> 3785 * Type: <b>token</b><br> 3786 * Path: <b>TestReport.identifier</b><br> 3787 * </p> 3788 */ 3789 public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); 3790 3791 /** 3792 * Search parameter: <b>tester</b> 3793 * <p> 3794 * Description: <b>The name of the testing organization</b><br> 3795 * Type: <b>string</b><br> 3796 * Path: <b>TestReport.tester</b><br> 3797 * </p> 3798 */ 3799 @SearchParamDefinition(name="tester", path="TestReport.tester", description="The name of the testing organization", type="string" ) 3800 public static final String SP_TESTER = "tester"; 3801 /** 3802 * <b>Fluent Client</b> search parameter constant for <b>tester</b> 3803 * <p> 3804 * Description: <b>The name of the testing organization</b><br> 3805 * Type: <b>string</b><br> 3806 * Path: <b>TestReport.tester</b><br> 3807 * </p> 3808 */ 3809 public static final ca.uhn.fhir.rest.gclient.StringClientParam TESTER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TESTER); 3810 3811 /** 3812 * Search parameter: <b>testscript</b> 3813 * <p> 3814 * Description: <b>The test script executed to produce this report</b><br> 3815 * Type: <b>reference</b><br> 3816 * Path: <b>TestReport.testScript</b><br> 3817 * </p> 3818 */ 3819 @SearchParamDefinition(name="testscript", path="TestReport.testScript", description="The test script executed to produce this report", type="reference", target={TestScript.class } ) 3820 public static final String SP_TESTSCRIPT = "testscript"; 3821 /** 3822 * <b>Fluent Client</b> search parameter constant for <b>testscript</b> 3823 * <p> 3824 * Description: <b>The test script executed to produce this report</b><br> 3825 * Type: <b>reference</b><br> 3826 * Path: <b>TestReport.testScript</b><br> 3827 * </p> 3828 */ 3829 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TESTSCRIPT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TESTSCRIPT); 3830 3831/** 3832 * Constant for fluent queries to be used to add include statements. Specifies 3833 * the path value of "<b>TestReport:testscript</b>". 3834 */ 3835 public static final ca.uhn.fhir.model.api.Include INCLUDE_TESTSCRIPT = new ca.uhn.fhir.model.api.Include("TestReport:testscript").toLocked(); 3836 3837 /** 3838 * Search parameter: <b>issued</b> 3839 * <p> 3840 * Description: <b>The test report generation date</b><br> 3841 * Type: <b>date</b><br> 3842 * Path: <b>TestReport.issued</b><br> 3843 * </p> 3844 */ 3845 @SearchParamDefinition(name="issued", path="TestReport.issued", description="The test report generation date", type="date" ) 3846 public static final String SP_ISSUED = "issued"; 3847 /** 3848 * <b>Fluent Client</b> search parameter constant for <b>issued</b> 3849 * <p> 3850 * Description: <b>The test report generation date</b><br> 3851 * Type: <b>date</b><br> 3852 * Path: <b>TestReport.issued</b><br> 3853 * </p> 3854 */ 3855 public static final ca.uhn.fhir.rest.gclient.DateClientParam ISSUED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ISSUED); 3856 3857 /** 3858 * Search parameter: <b>participant</b> 3859 * <p> 3860 * Description: <b>The reference to a participant in the test execution</b><br> 3861 * Type: <b>uri</b><br> 3862 * Path: <b>TestReport.participant.uri</b><br> 3863 * </p> 3864 */ 3865 @SearchParamDefinition(name="participant", path="TestReport.participant.uri", description="The reference to a participant in the test execution", type="uri" ) 3866 public static final String SP_PARTICIPANT = "participant"; 3867 /** 3868 * <b>Fluent Client</b> search parameter constant for <b>participant</b> 3869 * <p> 3870 * Description: <b>The reference to a participant in the test execution</b><br> 3871 * Type: <b>uri</b><br> 3872 * Path: <b>TestReport.participant.uri</b><br> 3873 * </p> 3874 */ 3875 public static final ca.uhn.fhir.rest.gclient.UriClientParam PARTICIPANT = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_PARTICIPANT); 3876 3877 3878}