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