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