001package org.hl7.fhir.dstu2016may.model; 002 003 004 005 006/* 007 Copyright (c) 2011+, HL7, Inc. 008 All rights reserved. 009 010 Redistribution and use in source and binary forms, with or without modification, 011 are permitted provided that the following conditions are met: 012 013 * Redistributions of source code must retain the above copyright notice, this 014 list of conditions and the following disclaimer. 015 * Redistributions in binary form must reproduce the above copyright notice, 016 this list of conditions and the following disclaimer in the documentation 017 and/or other materials provided with the distribution. 018 * Neither the name of HL7 nor the names of its contributors may be used to 019 endorse or promote products derived from this software without specific 020 prior written permission. 021 022 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 023 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 024 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 025 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 026 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 027 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 028 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 029 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 030 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 031 POSSIBILITY OF SUCH DAMAGE. 032 033*/ 034 035// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 036import java.util.ArrayList; 037import java.util.List; 038 039import org.hl7.fhir.exceptions.FHIRException; 040import org.hl7.fhir.instance.model.api.IBaseBackboneElement; 041import org.hl7.fhir.utilities.Utilities; 042 043import ca.uhn.fhir.model.api.annotation.Block; 044import ca.uhn.fhir.model.api.annotation.Child; 045import ca.uhn.fhir.model.api.annotation.Description; 046import ca.uhn.fhir.model.api.annotation.ResourceDef; 047/** 048 * A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken. 049 */ 050@ResourceDef(name="GuidanceResponse", profile="http://hl7.org/fhir/Profile/GuidanceResponse") 051public class GuidanceResponse extends DomainResource { 052 053 public enum GuidanceResponseStatus { 054 /** 055 * The request was processed successfully 056 */ 057 SUCCESS, 058 /** 059 * The request was processed successfully, but more data may result in a more complete evaluation 060 */ 061 DATAREQUESTED, 062 /** 063 * The request was processed, but more data is required to complete the evaluation 064 */ 065 DATAREQUIRED, 066 /** 067 * The request is currently being processed 068 */ 069 INPROGRESS, 070 /** 071 * The request was not processed successfully 072 */ 073 FAILURE, 074 /** 075 * added to help the parsers 076 */ 077 NULL; 078 public static GuidanceResponseStatus fromCode(String codeString) throws FHIRException { 079 if (codeString == null || "".equals(codeString)) 080 return null; 081 if ("success".equals(codeString)) 082 return SUCCESS; 083 if ("data-requested".equals(codeString)) 084 return DATAREQUESTED; 085 if ("data-required".equals(codeString)) 086 return DATAREQUIRED; 087 if ("in-progress".equals(codeString)) 088 return INPROGRESS; 089 if ("failure".equals(codeString)) 090 return FAILURE; 091 throw new FHIRException("Unknown GuidanceResponseStatus code '"+codeString+"'"); 092 } 093 public String toCode() { 094 switch (this) { 095 case SUCCESS: return "success"; 096 case DATAREQUESTED: return "data-requested"; 097 case DATAREQUIRED: return "data-required"; 098 case INPROGRESS: return "in-progress"; 099 case FAILURE: return "failure"; 100 case NULL: return null; 101 default: return "?"; 102 } 103 } 104 public String getSystem() { 105 switch (this) { 106 case SUCCESS: return "http://hl7.org/fhir/guidance-response-status"; 107 case DATAREQUESTED: return "http://hl7.org/fhir/guidance-response-status"; 108 case DATAREQUIRED: return "http://hl7.org/fhir/guidance-response-status"; 109 case INPROGRESS: return "http://hl7.org/fhir/guidance-response-status"; 110 case FAILURE: return "http://hl7.org/fhir/guidance-response-status"; 111 case NULL: return null; 112 default: return "?"; 113 } 114 } 115 public String getDefinition() { 116 switch (this) { 117 case SUCCESS: return "The request was processed successfully"; 118 case DATAREQUESTED: return "The request was processed successfully, but more data may result in a more complete evaluation"; 119 case DATAREQUIRED: return "The request was processed, but more data is required to complete the evaluation"; 120 case INPROGRESS: return "The request is currently being processed"; 121 case FAILURE: return "The request was not processed successfully"; 122 case NULL: return null; 123 default: return "?"; 124 } 125 } 126 public String getDisplay() { 127 switch (this) { 128 case SUCCESS: return "Success"; 129 case DATAREQUESTED: return "Data Requested"; 130 case DATAREQUIRED: return "Data Required"; 131 case INPROGRESS: return "In Progress"; 132 case FAILURE: return "Failure"; 133 case NULL: return null; 134 default: return "?"; 135 } 136 } 137 } 138 139 public static class GuidanceResponseStatusEnumFactory implements EnumFactory<GuidanceResponseStatus> { 140 public GuidanceResponseStatus fromCode(String codeString) throws IllegalArgumentException { 141 if (codeString == null || "".equals(codeString)) 142 if (codeString == null || "".equals(codeString)) 143 return null; 144 if ("success".equals(codeString)) 145 return GuidanceResponseStatus.SUCCESS; 146 if ("data-requested".equals(codeString)) 147 return GuidanceResponseStatus.DATAREQUESTED; 148 if ("data-required".equals(codeString)) 149 return GuidanceResponseStatus.DATAREQUIRED; 150 if ("in-progress".equals(codeString)) 151 return GuidanceResponseStatus.INPROGRESS; 152 if ("failure".equals(codeString)) 153 return GuidanceResponseStatus.FAILURE; 154 throw new IllegalArgumentException("Unknown GuidanceResponseStatus code '"+codeString+"'"); 155 } 156 public Enumeration<GuidanceResponseStatus> fromType(Base code) throws FHIRException { 157 if (code == null || code.isEmpty()) 158 return null; 159 String codeString = ((PrimitiveType) code).asStringValue(); 160 if (codeString == null || "".equals(codeString)) 161 return null; 162 if ("success".equals(codeString)) 163 return new Enumeration<GuidanceResponseStatus>(this, GuidanceResponseStatus.SUCCESS); 164 if ("data-requested".equals(codeString)) 165 return new Enumeration<GuidanceResponseStatus>(this, GuidanceResponseStatus.DATAREQUESTED); 166 if ("data-required".equals(codeString)) 167 return new Enumeration<GuidanceResponseStatus>(this, GuidanceResponseStatus.DATAREQUIRED); 168 if ("in-progress".equals(codeString)) 169 return new Enumeration<GuidanceResponseStatus>(this, GuidanceResponseStatus.INPROGRESS); 170 if ("failure".equals(codeString)) 171 return new Enumeration<GuidanceResponseStatus>(this, GuidanceResponseStatus.FAILURE); 172 throw new FHIRException("Unknown GuidanceResponseStatus code '"+codeString+"'"); 173 } 174 public String toCode(GuidanceResponseStatus code) { 175 if (code == GuidanceResponseStatus.SUCCESS) 176 return "success"; 177 if (code == GuidanceResponseStatus.DATAREQUESTED) 178 return "data-requested"; 179 if (code == GuidanceResponseStatus.DATAREQUIRED) 180 return "data-required"; 181 if (code == GuidanceResponseStatus.INPROGRESS) 182 return "in-progress"; 183 if (code == GuidanceResponseStatus.FAILURE) 184 return "failure"; 185 return "?"; 186 } 187 public String toSystem(GuidanceResponseStatus code) { 188 return code.getSystem(); 189 } 190 } 191 192 @Block() 193 public static class GuidanceResponseActionComponent extends BackboneElement implements IBaseBackboneElement { 194 /** 195 * A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique. 196 */ 197 @Child(name = "actionIdentifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=false) 198 @Description(shortDefinition="Unique identifier", formalDefinition="A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique." ) 199 protected Identifier actionIdentifier; 200 201 /** 202 * A user-visible label for the action. 203 */ 204 @Child(name = "label", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) 205 @Description(shortDefinition="User-visible label for the action (e.g. 1. or A.)", formalDefinition="A user-visible label for the action." ) 206 protected StringType label; 207 208 /** 209 * The title of the action displayed to a user. 210 */ 211 @Child(name = "title", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) 212 @Description(shortDefinition="User-visible title", formalDefinition="The title of the action displayed to a user." ) 213 protected StringType title; 214 215 /** 216 * A short description of the action used to provide a summary to display to the user. 217 */ 218 @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) 219 @Description(shortDefinition="Short description of the action", formalDefinition="A short description of the action used to provide a summary to display to the user." ) 220 protected StringType description; 221 222 /** 223 * A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically. 224 */ 225 @Child(name = "textEquivalent", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) 226 @Description(shortDefinition="Static text equivalent of the action, used if the dynamic aspects cannot be interpreted by the receiving system", formalDefinition="A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically." ) 227 protected StringType textEquivalent; 228 229 /** 230 * The concept represented by this action or its sub-actions. 231 */ 232 @Child(name = "concept", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 233 @Description(shortDefinition="The meaning of the action or its sub-actions", formalDefinition="The concept represented by this action or its sub-actions." ) 234 protected List<CodeableConcept> concept; 235 236 /** 237 * The evidence grade and the sources of evidence for this action. 238 */ 239 @Child(name = "supportingEvidence", type = {Attachment.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 240 @Description(shortDefinition="Evidence that supports taking the action", formalDefinition="The evidence grade and the sources of evidence for this action." ) 241 protected List<Attachment> supportingEvidence; 242 243 /** 244 * A relationship to another action such as "before" or "30-60 minutes after start of". 245 */ 246 @Child(name = "relatedAction", type = {}, order=8, min=0, max=1, modifier=false, summary=false) 247 @Description(shortDefinition="Relationship to another action", formalDefinition="A relationship to another action such as \"before\" or \"30-60 minutes after start of\"." ) 248 protected GuidanceResponseActionRelatedActionComponent relatedAction; 249 250 /** 251 * Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources. 252 */ 253 @Child(name = "documentation", type = {Attachment.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 254 @Description(shortDefinition="Supporting documentation for the intended performer of the action", formalDefinition="Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources." ) 255 protected List<Attachment> documentation; 256 257 /** 258 * The participant in the action. 259 */ 260 @Child(name = "participant", type = {Patient.class, Person.class, Practitioner.class, RelatedPerson.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 261 @Description(shortDefinition="Participant", formalDefinition="The participant in the action." ) 262 protected List<Reference> participant; 263 /** 264 * The actual objects that are the target of the reference (The participant in the action.) 265 */ 266 protected List<Resource> participantTarget; 267 268 269 /** 270 * The type of action to perform (create, update, remove). 271 */ 272 @Child(name = "type", type = {CodeType.class}, order=11, min=0, max=1, modifier=false, summary=false) 273 @Description(shortDefinition="create | update | remove | fire-event", formalDefinition="The type of action to perform (create, update, remove)." ) 274 protected CodeType type; 275 276 /** 277 * A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment. 278 */ 279 @Child(name = "behavior", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 280 @Description(shortDefinition="Defines behaviors such as selection and grouping", formalDefinition="A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment." ) 281 protected List<GuidanceResponseActionBehaviorComponent> behavior; 282 283 /** 284 * The resource that is the target of the action (e.g. CommunicationRequest). 285 */ 286 @Child(name = "resource", type = {}, order=13, min=0, max=1, modifier=false, summary=false) 287 @Description(shortDefinition="The target of the action", formalDefinition="The resource that is the target of the action (e.g. CommunicationRequest)." ) 288 protected Reference resource; 289 290 /** 291 * The actual object that is the target of the reference (The resource that is the target of the action (e.g. CommunicationRequest).) 292 */ 293 protected Resource resourceTarget; 294 295 /** 296 * Sub actions. 297 */ 298 @Child(name = "action", type = {GuidanceResponseActionComponent.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 299 @Description(shortDefinition="Sub action", formalDefinition="Sub actions." ) 300 protected List<GuidanceResponseActionComponent> action; 301 302 private static final long serialVersionUID = -1602697381L; 303 304 /** 305 * Constructor 306 */ 307 public GuidanceResponseActionComponent() { 308 super(); 309 } 310 311 /** 312 * @return {@link #actionIdentifier} (A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique.) 313 */ 314 public Identifier getActionIdentifier() { 315 if (this.actionIdentifier == null) 316 if (Configuration.errorOnAutoCreate()) 317 throw new Error("Attempt to auto-create GuidanceResponseActionComponent.actionIdentifier"); 318 else if (Configuration.doAutoCreate()) 319 this.actionIdentifier = new Identifier(); // cc 320 return this.actionIdentifier; 321 } 322 323 public boolean hasActionIdentifier() { 324 return this.actionIdentifier != null && !this.actionIdentifier.isEmpty(); 325 } 326 327 /** 328 * @param value {@link #actionIdentifier} (A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique.) 329 */ 330 public GuidanceResponseActionComponent setActionIdentifier(Identifier value) { 331 this.actionIdentifier = value; 332 return this; 333 } 334 335 /** 336 * @return {@link #label} (A user-visible label for the action.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value 337 */ 338 public StringType getLabelElement() { 339 if (this.label == null) 340 if (Configuration.errorOnAutoCreate()) 341 throw new Error("Attempt to auto-create GuidanceResponseActionComponent.label"); 342 else if (Configuration.doAutoCreate()) 343 this.label = new StringType(); // bb 344 return this.label; 345 } 346 347 public boolean hasLabelElement() { 348 return this.label != null && !this.label.isEmpty(); 349 } 350 351 public boolean hasLabel() { 352 return this.label != null && !this.label.isEmpty(); 353 } 354 355 /** 356 * @param value {@link #label} (A user-visible label for the action.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value 357 */ 358 public GuidanceResponseActionComponent setLabelElement(StringType value) { 359 this.label = value; 360 return this; 361 } 362 363 /** 364 * @return A user-visible label for the action. 365 */ 366 public String getLabel() { 367 return this.label == null ? null : this.label.getValue(); 368 } 369 370 /** 371 * @param value A user-visible label for the action. 372 */ 373 public GuidanceResponseActionComponent setLabel(String value) { 374 if (Utilities.noString(value)) 375 this.label = null; 376 else { 377 if (this.label == null) 378 this.label = new StringType(); 379 this.label.setValue(value); 380 } 381 return this; 382 } 383 384 /** 385 * @return {@link #title} (The title of the action displayed to a user.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value 386 */ 387 public StringType getTitleElement() { 388 if (this.title == null) 389 if (Configuration.errorOnAutoCreate()) 390 throw new Error("Attempt to auto-create GuidanceResponseActionComponent.title"); 391 else if (Configuration.doAutoCreate()) 392 this.title = new StringType(); // bb 393 return this.title; 394 } 395 396 public boolean hasTitleElement() { 397 return this.title != null && !this.title.isEmpty(); 398 } 399 400 public boolean hasTitle() { 401 return this.title != null && !this.title.isEmpty(); 402 } 403 404 /** 405 * @param value {@link #title} (The title of the action displayed to a user.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value 406 */ 407 public GuidanceResponseActionComponent setTitleElement(StringType value) { 408 this.title = value; 409 return this; 410 } 411 412 /** 413 * @return The title of the action displayed to a user. 414 */ 415 public String getTitle() { 416 return this.title == null ? null : this.title.getValue(); 417 } 418 419 /** 420 * @param value The title of the action displayed to a user. 421 */ 422 public GuidanceResponseActionComponent setTitle(String value) { 423 if (Utilities.noString(value)) 424 this.title = null; 425 else { 426 if (this.title == null) 427 this.title = new StringType(); 428 this.title.setValue(value); 429 } 430 return this; 431 } 432 433 /** 434 * @return {@link #description} (A short description of the action used to provide a summary to display to the user.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 435 */ 436 public StringType getDescriptionElement() { 437 if (this.description == null) 438 if (Configuration.errorOnAutoCreate()) 439 throw new Error("Attempt to auto-create GuidanceResponseActionComponent.description"); 440 else if (Configuration.doAutoCreate()) 441 this.description = new StringType(); // bb 442 return this.description; 443 } 444 445 public boolean hasDescriptionElement() { 446 return this.description != null && !this.description.isEmpty(); 447 } 448 449 public boolean hasDescription() { 450 return this.description != null && !this.description.isEmpty(); 451 } 452 453 /** 454 * @param value {@link #description} (A short description of the action used to provide a summary to display to the user.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 455 */ 456 public GuidanceResponseActionComponent setDescriptionElement(StringType value) { 457 this.description = value; 458 return this; 459 } 460 461 /** 462 * @return A short description of the action used to provide a summary to display to the user. 463 */ 464 public String getDescription() { 465 return this.description == null ? null : this.description.getValue(); 466 } 467 468 /** 469 * @param value A short description of the action used to provide a summary to display to the user. 470 */ 471 public GuidanceResponseActionComponent setDescription(String value) { 472 if (Utilities.noString(value)) 473 this.description = null; 474 else { 475 if (this.description == null) 476 this.description = new StringType(); 477 this.description.setValue(value); 478 } 479 return this; 480 } 481 482 /** 483 * @return {@link #textEquivalent} (A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically.). This is the underlying object with id, value and extensions. The accessor "getTextEquivalent" gives direct access to the value 484 */ 485 public StringType getTextEquivalentElement() { 486 if (this.textEquivalent == null) 487 if (Configuration.errorOnAutoCreate()) 488 throw new Error("Attempt to auto-create GuidanceResponseActionComponent.textEquivalent"); 489 else if (Configuration.doAutoCreate()) 490 this.textEquivalent = new StringType(); // bb 491 return this.textEquivalent; 492 } 493 494 public boolean hasTextEquivalentElement() { 495 return this.textEquivalent != null && !this.textEquivalent.isEmpty(); 496 } 497 498 public boolean hasTextEquivalent() { 499 return this.textEquivalent != null && !this.textEquivalent.isEmpty(); 500 } 501 502 /** 503 * @param value {@link #textEquivalent} (A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically.). This is the underlying object with id, value and extensions. The accessor "getTextEquivalent" gives direct access to the value 504 */ 505 public GuidanceResponseActionComponent setTextEquivalentElement(StringType value) { 506 this.textEquivalent = value; 507 return this; 508 } 509 510 /** 511 * @return A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically. 512 */ 513 public String getTextEquivalent() { 514 return this.textEquivalent == null ? null : this.textEquivalent.getValue(); 515 } 516 517 /** 518 * @param value A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically. 519 */ 520 public GuidanceResponseActionComponent setTextEquivalent(String value) { 521 if (Utilities.noString(value)) 522 this.textEquivalent = null; 523 else { 524 if (this.textEquivalent == null) 525 this.textEquivalent = new StringType(); 526 this.textEquivalent.setValue(value); 527 } 528 return this; 529 } 530 531 /** 532 * @return {@link #concept} (The concept represented by this action or its sub-actions.) 533 */ 534 public List<CodeableConcept> getConcept() { 535 if (this.concept == null) 536 this.concept = new ArrayList<CodeableConcept>(); 537 return this.concept; 538 } 539 540 public boolean hasConcept() { 541 if (this.concept == null) 542 return false; 543 for (CodeableConcept item : this.concept) 544 if (!item.isEmpty()) 545 return true; 546 return false; 547 } 548 549 /** 550 * @return {@link #concept} (The concept represented by this action or its sub-actions.) 551 */ 552 // syntactic sugar 553 public CodeableConcept addConcept() { //3 554 CodeableConcept t = new CodeableConcept(); 555 if (this.concept == null) 556 this.concept = new ArrayList<CodeableConcept>(); 557 this.concept.add(t); 558 return t; 559 } 560 561 // syntactic sugar 562 public GuidanceResponseActionComponent addConcept(CodeableConcept t) { //3 563 if (t == null) 564 return this; 565 if (this.concept == null) 566 this.concept = new ArrayList<CodeableConcept>(); 567 this.concept.add(t); 568 return this; 569 } 570 571 /** 572 * @return {@link #supportingEvidence} (The evidence grade and the sources of evidence for this action.) 573 */ 574 public List<Attachment> getSupportingEvidence() { 575 if (this.supportingEvidence == null) 576 this.supportingEvidence = new ArrayList<Attachment>(); 577 return this.supportingEvidence; 578 } 579 580 public boolean hasSupportingEvidence() { 581 if (this.supportingEvidence == null) 582 return false; 583 for (Attachment item : this.supportingEvidence) 584 if (!item.isEmpty()) 585 return true; 586 return false; 587 } 588 589 /** 590 * @return {@link #supportingEvidence} (The evidence grade and the sources of evidence for this action.) 591 */ 592 // syntactic sugar 593 public Attachment addSupportingEvidence() { //3 594 Attachment t = new Attachment(); 595 if (this.supportingEvidence == null) 596 this.supportingEvidence = new ArrayList<Attachment>(); 597 this.supportingEvidence.add(t); 598 return t; 599 } 600 601 // syntactic sugar 602 public GuidanceResponseActionComponent addSupportingEvidence(Attachment t) { //3 603 if (t == null) 604 return this; 605 if (this.supportingEvidence == null) 606 this.supportingEvidence = new ArrayList<Attachment>(); 607 this.supportingEvidence.add(t); 608 return this; 609 } 610 611 /** 612 * @return {@link #relatedAction} (A relationship to another action such as "before" or "30-60 minutes after start of".) 613 */ 614 public GuidanceResponseActionRelatedActionComponent getRelatedAction() { 615 if (this.relatedAction == null) 616 if (Configuration.errorOnAutoCreate()) 617 throw new Error("Attempt to auto-create GuidanceResponseActionComponent.relatedAction"); 618 else if (Configuration.doAutoCreate()) 619 this.relatedAction = new GuidanceResponseActionRelatedActionComponent(); // cc 620 return this.relatedAction; 621 } 622 623 public boolean hasRelatedAction() { 624 return this.relatedAction != null && !this.relatedAction.isEmpty(); 625 } 626 627 /** 628 * @param value {@link #relatedAction} (A relationship to another action such as "before" or "30-60 minutes after start of".) 629 */ 630 public GuidanceResponseActionComponent setRelatedAction(GuidanceResponseActionRelatedActionComponent value) { 631 this.relatedAction = value; 632 return this; 633 } 634 635 /** 636 * @return {@link #documentation} (Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.) 637 */ 638 public List<Attachment> getDocumentation() { 639 if (this.documentation == null) 640 this.documentation = new ArrayList<Attachment>(); 641 return this.documentation; 642 } 643 644 public boolean hasDocumentation() { 645 if (this.documentation == null) 646 return false; 647 for (Attachment item : this.documentation) 648 if (!item.isEmpty()) 649 return true; 650 return false; 651 } 652 653 /** 654 * @return {@link #documentation} (Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.) 655 */ 656 // syntactic sugar 657 public Attachment addDocumentation() { //3 658 Attachment t = new Attachment(); 659 if (this.documentation == null) 660 this.documentation = new ArrayList<Attachment>(); 661 this.documentation.add(t); 662 return t; 663 } 664 665 // syntactic sugar 666 public GuidanceResponseActionComponent addDocumentation(Attachment t) { //3 667 if (t == null) 668 return this; 669 if (this.documentation == null) 670 this.documentation = new ArrayList<Attachment>(); 671 this.documentation.add(t); 672 return this; 673 } 674 675 /** 676 * @return {@link #participant} (The participant in the action.) 677 */ 678 public List<Reference> getParticipant() { 679 if (this.participant == null) 680 this.participant = new ArrayList<Reference>(); 681 return this.participant; 682 } 683 684 public boolean hasParticipant() { 685 if (this.participant == null) 686 return false; 687 for (Reference item : this.participant) 688 if (!item.isEmpty()) 689 return true; 690 return false; 691 } 692 693 /** 694 * @return {@link #participant} (The participant in the action.) 695 */ 696 // syntactic sugar 697 public Reference addParticipant() { //3 698 Reference t = new Reference(); 699 if (this.participant == null) 700 this.participant = new ArrayList<Reference>(); 701 this.participant.add(t); 702 return t; 703 } 704 705 // syntactic sugar 706 public GuidanceResponseActionComponent addParticipant(Reference t) { //3 707 if (t == null) 708 return this; 709 if (this.participant == null) 710 this.participant = new ArrayList<Reference>(); 711 this.participant.add(t); 712 return this; 713 } 714 715 /** 716 * @return {@link #participant} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The participant in the action.) 717 */ 718 public List<Resource> getParticipantTarget() { 719 if (this.participantTarget == null) 720 this.participantTarget = new ArrayList<Resource>(); 721 return this.participantTarget; 722 } 723 724 /** 725 * @return {@link #type} (The type of action to perform (create, update, remove).). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value 726 */ 727 public CodeType getTypeElement() { 728 if (this.type == null) 729 if (Configuration.errorOnAutoCreate()) 730 throw new Error("Attempt to auto-create GuidanceResponseActionComponent.type"); 731 else if (Configuration.doAutoCreate()) 732 this.type = new CodeType(); // bb 733 return this.type; 734 } 735 736 public boolean hasTypeElement() { 737 return this.type != null && !this.type.isEmpty(); 738 } 739 740 public boolean hasType() { 741 return this.type != null && !this.type.isEmpty(); 742 } 743 744 /** 745 * @param value {@link #type} (The type of action to perform (create, update, remove).). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value 746 */ 747 public GuidanceResponseActionComponent setTypeElement(CodeType value) { 748 this.type = value; 749 return this; 750 } 751 752 /** 753 * @return The type of action to perform (create, update, remove). 754 */ 755 public String getType() { 756 return this.type == null ? null : this.type.getValue(); 757 } 758 759 /** 760 * @param value The type of action to perform (create, update, remove). 761 */ 762 public GuidanceResponseActionComponent setType(String value) { 763 if (Utilities.noString(value)) 764 this.type = null; 765 else { 766 if (this.type == null) 767 this.type = new CodeType(); 768 this.type.setValue(value); 769 } 770 return this; 771 } 772 773 /** 774 * @return {@link #behavior} (A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment.) 775 */ 776 public List<GuidanceResponseActionBehaviorComponent> getBehavior() { 777 if (this.behavior == null) 778 this.behavior = new ArrayList<GuidanceResponseActionBehaviorComponent>(); 779 return this.behavior; 780 } 781 782 public boolean hasBehavior() { 783 if (this.behavior == null) 784 return false; 785 for (GuidanceResponseActionBehaviorComponent item : this.behavior) 786 if (!item.isEmpty()) 787 return true; 788 return false; 789 } 790 791 /** 792 * @return {@link #behavior} (A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment.) 793 */ 794 // syntactic sugar 795 public GuidanceResponseActionBehaviorComponent addBehavior() { //3 796 GuidanceResponseActionBehaviorComponent t = new GuidanceResponseActionBehaviorComponent(); 797 if (this.behavior == null) 798 this.behavior = new ArrayList<GuidanceResponseActionBehaviorComponent>(); 799 this.behavior.add(t); 800 return t; 801 } 802 803 // syntactic sugar 804 public GuidanceResponseActionComponent addBehavior(GuidanceResponseActionBehaviorComponent t) { //3 805 if (t == null) 806 return this; 807 if (this.behavior == null) 808 this.behavior = new ArrayList<GuidanceResponseActionBehaviorComponent>(); 809 this.behavior.add(t); 810 return this; 811 } 812 813 /** 814 * @return {@link #resource} (The resource that is the target of the action (e.g. CommunicationRequest).) 815 */ 816 public Reference getResource() { 817 if (this.resource == null) 818 if (Configuration.errorOnAutoCreate()) 819 throw new Error("Attempt to auto-create GuidanceResponseActionComponent.resource"); 820 else if (Configuration.doAutoCreate()) 821 this.resource = new Reference(); // cc 822 return this.resource; 823 } 824 825 public boolean hasResource() { 826 return this.resource != null && !this.resource.isEmpty(); 827 } 828 829 /** 830 * @param value {@link #resource} (The resource that is the target of the action (e.g. CommunicationRequest).) 831 */ 832 public GuidanceResponseActionComponent setResource(Reference value) { 833 this.resource = value; 834 return this; 835 } 836 837 /** 838 * @return {@link #resource} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The resource that is the target of the action (e.g. CommunicationRequest).) 839 */ 840 public Resource getResourceTarget() { 841 return this.resourceTarget; 842 } 843 844 /** 845 * @param value {@link #resource} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The resource that is the target of the action (e.g. CommunicationRequest).) 846 */ 847 public GuidanceResponseActionComponent setResourceTarget(Resource value) { 848 this.resourceTarget = value; 849 return this; 850 } 851 852 /** 853 * @return {@link #action} (Sub actions.) 854 */ 855 public List<GuidanceResponseActionComponent> getAction() { 856 if (this.action == null) 857 this.action = new ArrayList<GuidanceResponseActionComponent>(); 858 return this.action; 859 } 860 861 public boolean hasAction() { 862 if (this.action == null) 863 return false; 864 for (GuidanceResponseActionComponent item : this.action) 865 if (!item.isEmpty()) 866 return true; 867 return false; 868 } 869 870 /** 871 * @return {@link #action} (Sub actions.) 872 */ 873 // syntactic sugar 874 public GuidanceResponseActionComponent addAction() { //3 875 GuidanceResponseActionComponent t = new GuidanceResponseActionComponent(); 876 if (this.action == null) 877 this.action = new ArrayList<GuidanceResponseActionComponent>(); 878 this.action.add(t); 879 return t; 880 } 881 882 // syntactic sugar 883 public GuidanceResponseActionComponent addAction(GuidanceResponseActionComponent t) { //3 884 if (t == null) 885 return this; 886 if (this.action == null) 887 this.action = new ArrayList<GuidanceResponseActionComponent>(); 888 this.action.add(t); 889 return this; 890 } 891 892 protected void listChildren(List<Property> childrenList) { 893 super.listChildren(childrenList); 894 childrenList.add(new Property("actionIdentifier", "Identifier", "A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique.", 0, java.lang.Integer.MAX_VALUE, actionIdentifier)); 895 childrenList.add(new Property("label", "string", "A user-visible label for the action.", 0, java.lang.Integer.MAX_VALUE, label)); 896 childrenList.add(new Property("title", "string", "The title of the action displayed to a user.", 0, java.lang.Integer.MAX_VALUE, title)); 897 childrenList.add(new Property("description", "string", "A short description of the action used to provide a summary to display to the user.", 0, java.lang.Integer.MAX_VALUE, description)); 898 childrenList.add(new Property("textEquivalent", "string", "A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically.", 0, java.lang.Integer.MAX_VALUE, textEquivalent)); 899 childrenList.add(new Property("concept", "CodeableConcept", "The concept represented by this action or its sub-actions.", 0, java.lang.Integer.MAX_VALUE, concept)); 900 childrenList.add(new Property("supportingEvidence", "Attachment", "The evidence grade and the sources of evidence for this action.", 0, java.lang.Integer.MAX_VALUE, supportingEvidence)); 901 childrenList.add(new Property("relatedAction", "", "A relationship to another action such as \"before\" or \"30-60 minutes after start of\".", 0, java.lang.Integer.MAX_VALUE, relatedAction)); 902 childrenList.add(new Property("documentation", "Attachment", "Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.", 0, java.lang.Integer.MAX_VALUE, documentation)); 903 childrenList.add(new Property("participant", "Reference(Patient|Person|Practitioner|RelatedPerson)", "The participant in the action.", 0, java.lang.Integer.MAX_VALUE, participant)); 904 childrenList.add(new Property("type", "code", "The type of action to perform (create, update, remove).", 0, java.lang.Integer.MAX_VALUE, type)); 905 childrenList.add(new Property("behavior", "", "A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment.", 0, java.lang.Integer.MAX_VALUE, behavior)); 906 childrenList.add(new Property("resource", "Reference(Any)", "The resource that is the target of the action (e.g. CommunicationRequest).", 0, java.lang.Integer.MAX_VALUE, resource)); 907 childrenList.add(new Property("action", "@GuidanceResponse.action", "Sub actions.", 0, java.lang.Integer.MAX_VALUE, action)); 908 } 909 910 @Override 911 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 912 switch (hash) { 913 case -889046145: /*actionIdentifier*/ return this.actionIdentifier == null ? new Base[0] : new Base[] {this.actionIdentifier}; // Identifier 914 case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType 915 case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType 916 case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType 917 case -900391049: /*textEquivalent*/ return this.textEquivalent == null ? new Base[0] : new Base[] {this.textEquivalent}; // StringType 918 case 951024232: /*concept*/ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // CodeableConcept 919 case -1735429846: /*supportingEvidence*/ return this.supportingEvidence == null ? new Base[0] : this.supportingEvidence.toArray(new Base[this.supportingEvidence.size()]); // Attachment 920 case -384107967: /*relatedAction*/ return this.relatedAction == null ? new Base[0] : new Base[] {this.relatedAction}; // GuidanceResponseActionRelatedActionComponent 921 case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : this.documentation.toArray(new Base[this.documentation.size()]); // Attachment 922 case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // Reference 923 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType 924 case 1510912594: /*behavior*/ return this.behavior == null ? new Base[0] : this.behavior.toArray(new Base[this.behavior.size()]); // GuidanceResponseActionBehaviorComponent 925 case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference 926 case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // GuidanceResponseActionComponent 927 default: return super.getProperty(hash, name, checkValid); 928 } 929 930 } 931 932 @Override 933 public void setProperty(int hash, String name, Base value) throws FHIRException { 934 switch (hash) { 935 case -889046145: // actionIdentifier 936 this.actionIdentifier = castToIdentifier(value); // Identifier 937 break; 938 case 102727412: // label 939 this.label = castToString(value); // StringType 940 break; 941 case 110371416: // title 942 this.title = castToString(value); // StringType 943 break; 944 case -1724546052: // description 945 this.description = castToString(value); // StringType 946 break; 947 case -900391049: // textEquivalent 948 this.textEquivalent = castToString(value); // StringType 949 break; 950 case 951024232: // concept 951 this.getConcept().add(castToCodeableConcept(value)); // CodeableConcept 952 break; 953 case -1735429846: // supportingEvidence 954 this.getSupportingEvidence().add(castToAttachment(value)); // Attachment 955 break; 956 case -384107967: // relatedAction 957 this.relatedAction = (GuidanceResponseActionRelatedActionComponent) value; // GuidanceResponseActionRelatedActionComponent 958 break; 959 case 1587405498: // documentation 960 this.getDocumentation().add(castToAttachment(value)); // Attachment 961 break; 962 case 767422259: // participant 963 this.getParticipant().add(castToReference(value)); // Reference 964 break; 965 case 3575610: // type 966 this.type = castToCode(value); // CodeType 967 break; 968 case 1510912594: // behavior 969 this.getBehavior().add((GuidanceResponseActionBehaviorComponent) value); // GuidanceResponseActionBehaviorComponent 970 break; 971 case -341064690: // resource 972 this.resource = castToReference(value); // Reference 973 break; 974 case -1422950858: // action 975 this.getAction().add((GuidanceResponseActionComponent) value); // GuidanceResponseActionComponent 976 break; 977 default: super.setProperty(hash, name, value); 978 } 979 980 } 981 982 @Override 983 public void setProperty(String name, Base value) throws FHIRException { 984 if (name.equals("actionIdentifier")) 985 this.actionIdentifier = castToIdentifier(value); // Identifier 986 else if (name.equals("label")) 987 this.label = castToString(value); // StringType 988 else if (name.equals("title")) 989 this.title = castToString(value); // StringType 990 else if (name.equals("description")) 991 this.description = castToString(value); // StringType 992 else if (name.equals("textEquivalent")) 993 this.textEquivalent = castToString(value); // StringType 994 else if (name.equals("concept")) 995 this.getConcept().add(castToCodeableConcept(value)); 996 else if (name.equals("supportingEvidence")) 997 this.getSupportingEvidence().add(castToAttachment(value)); 998 else if (name.equals("relatedAction")) 999 this.relatedAction = (GuidanceResponseActionRelatedActionComponent) value; // GuidanceResponseActionRelatedActionComponent 1000 else if (name.equals("documentation")) 1001 this.getDocumentation().add(castToAttachment(value)); 1002 else if (name.equals("participant")) 1003 this.getParticipant().add(castToReference(value)); 1004 else if (name.equals("type")) 1005 this.type = castToCode(value); // CodeType 1006 else if (name.equals("behavior")) 1007 this.getBehavior().add((GuidanceResponseActionBehaviorComponent) value); 1008 else if (name.equals("resource")) 1009 this.resource = castToReference(value); // Reference 1010 else if (name.equals("action")) 1011 this.getAction().add((GuidanceResponseActionComponent) value); 1012 else 1013 super.setProperty(name, value); 1014 } 1015 1016 @Override 1017 public Base makeProperty(int hash, String name) throws FHIRException { 1018 switch (hash) { 1019 case -889046145: return getActionIdentifier(); // Identifier 1020 case 102727412: throw new FHIRException("Cannot make property label as it is not a complex type"); // StringType 1021 case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType 1022 case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType 1023 case -900391049: throw new FHIRException("Cannot make property textEquivalent as it is not a complex type"); // StringType 1024 case 951024232: return addConcept(); // CodeableConcept 1025 case -1735429846: return addSupportingEvidence(); // Attachment 1026 case -384107967: return getRelatedAction(); // GuidanceResponseActionRelatedActionComponent 1027 case 1587405498: return addDocumentation(); // Attachment 1028 case 767422259: return addParticipant(); // Reference 1029 case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType 1030 case 1510912594: return addBehavior(); // GuidanceResponseActionBehaviorComponent 1031 case -341064690: return getResource(); // Reference 1032 case -1422950858: return addAction(); // GuidanceResponseActionComponent 1033 default: return super.makeProperty(hash, name); 1034 } 1035 1036 } 1037 1038 @Override 1039 public Base addChild(String name) throws FHIRException { 1040 if (name.equals("actionIdentifier")) { 1041 this.actionIdentifier = new Identifier(); 1042 return this.actionIdentifier; 1043 } 1044 else if (name.equals("label")) { 1045 throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.label"); 1046 } 1047 else if (name.equals("title")) { 1048 throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.title"); 1049 } 1050 else if (name.equals("description")) { 1051 throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.description"); 1052 } 1053 else if (name.equals("textEquivalent")) { 1054 throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.textEquivalent"); 1055 } 1056 else if (name.equals("concept")) { 1057 return addConcept(); 1058 } 1059 else if (name.equals("supportingEvidence")) { 1060 return addSupportingEvidence(); 1061 } 1062 else if (name.equals("relatedAction")) { 1063 this.relatedAction = new GuidanceResponseActionRelatedActionComponent(); 1064 return this.relatedAction; 1065 } 1066 else if (name.equals("documentation")) { 1067 return addDocumentation(); 1068 } 1069 else if (name.equals("participant")) { 1070 return addParticipant(); 1071 } 1072 else if (name.equals("type")) { 1073 throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.type"); 1074 } 1075 else if (name.equals("behavior")) { 1076 return addBehavior(); 1077 } 1078 else if (name.equals("resource")) { 1079 this.resource = new Reference(); 1080 return this.resource; 1081 } 1082 else if (name.equals("action")) { 1083 return addAction(); 1084 } 1085 else 1086 return super.addChild(name); 1087 } 1088 1089 public GuidanceResponseActionComponent copy() { 1090 GuidanceResponseActionComponent dst = new GuidanceResponseActionComponent(); 1091 copyValues(dst); 1092 dst.actionIdentifier = actionIdentifier == null ? null : actionIdentifier.copy(); 1093 dst.label = label == null ? null : label.copy(); 1094 dst.title = title == null ? null : title.copy(); 1095 dst.description = description == null ? null : description.copy(); 1096 dst.textEquivalent = textEquivalent == null ? null : textEquivalent.copy(); 1097 if (concept != null) { 1098 dst.concept = new ArrayList<CodeableConcept>(); 1099 for (CodeableConcept i : concept) 1100 dst.concept.add(i.copy()); 1101 }; 1102 if (supportingEvidence != null) { 1103 dst.supportingEvidence = new ArrayList<Attachment>(); 1104 for (Attachment i : supportingEvidence) 1105 dst.supportingEvidence.add(i.copy()); 1106 }; 1107 dst.relatedAction = relatedAction == null ? null : relatedAction.copy(); 1108 if (documentation != null) { 1109 dst.documentation = new ArrayList<Attachment>(); 1110 for (Attachment i : documentation) 1111 dst.documentation.add(i.copy()); 1112 }; 1113 if (participant != null) { 1114 dst.participant = new ArrayList<Reference>(); 1115 for (Reference i : participant) 1116 dst.participant.add(i.copy()); 1117 }; 1118 dst.type = type == null ? null : type.copy(); 1119 if (behavior != null) { 1120 dst.behavior = new ArrayList<GuidanceResponseActionBehaviorComponent>(); 1121 for (GuidanceResponseActionBehaviorComponent i : behavior) 1122 dst.behavior.add(i.copy()); 1123 }; 1124 dst.resource = resource == null ? null : resource.copy(); 1125 if (action != null) { 1126 dst.action = new ArrayList<GuidanceResponseActionComponent>(); 1127 for (GuidanceResponseActionComponent i : action) 1128 dst.action.add(i.copy()); 1129 }; 1130 return dst; 1131 } 1132 1133 @Override 1134 public boolean equalsDeep(Base other) { 1135 if (!super.equalsDeep(other)) 1136 return false; 1137 if (!(other instanceof GuidanceResponseActionComponent)) 1138 return false; 1139 GuidanceResponseActionComponent o = (GuidanceResponseActionComponent) other; 1140 return compareDeep(actionIdentifier, o.actionIdentifier, true) && compareDeep(label, o.label, true) 1141 && compareDeep(title, o.title, true) && compareDeep(description, o.description, true) && compareDeep(textEquivalent, o.textEquivalent, true) 1142 && compareDeep(concept, o.concept, true) && compareDeep(supportingEvidence, o.supportingEvidence, true) 1143 && compareDeep(relatedAction, o.relatedAction, true) && compareDeep(documentation, o.documentation, true) 1144 && compareDeep(participant, o.participant, true) && compareDeep(type, o.type, true) && compareDeep(behavior, o.behavior, true) 1145 && compareDeep(resource, o.resource, true) && compareDeep(action, o.action, true); 1146 } 1147 1148 @Override 1149 public boolean equalsShallow(Base other) { 1150 if (!super.equalsShallow(other)) 1151 return false; 1152 if (!(other instanceof GuidanceResponseActionComponent)) 1153 return false; 1154 GuidanceResponseActionComponent o = (GuidanceResponseActionComponent) other; 1155 return compareValues(label, o.label, true) && compareValues(title, o.title, true) && compareValues(description, o.description, true) 1156 && compareValues(textEquivalent, o.textEquivalent, true) && compareValues(type, o.type, true); 1157 } 1158 1159 public boolean isEmpty() { 1160 return super.isEmpty() && (actionIdentifier == null || actionIdentifier.isEmpty()) && (label == null || label.isEmpty()) 1161 && (title == null || title.isEmpty()) && (description == null || description.isEmpty()) && (textEquivalent == null || textEquivalent.isEmpty()) 1162 && (concept == null || concept.isEmpty()) && (supportingEvidence == null || supportingEvidence.isEmpty()) 1163 && (relatedAction == null || relatedAction.isEmpty()) && (documentation == null || documentation.isEmpty()) 1164 && (participant == null || participant.isEmpty()) && (type == null || type.isEmpty()) && (behavior == null || behavior.isEmpty()) 1165 && (resource == null || resource.isEmpty()) && (action == null || action.isEmpty()); 1166 } 1167 1168 public String fhirType() { 1169 return "GuidanceResponse.action"; 1170 1171 } 1172 1173 } 1174 1175 @Block() 1176 public static class GuidanceResponseActionRelatedActionComponent extends BackboneElement implements IBaseBackboneElement { 1177 /** 1178 * The unique identifier of the related action. 1179 */ 1180 @Child(name = "actionIdentifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=false) 1181 @Description(shortDefinition="Identifier of the related action", formalDefinition="The unique identifier of the related action." ) 1182 protected Identifier actionIdentifier; 1183 1184 /** 1185 * The relationship of this action to the related action. 1186 */ 1187 @Child(name = "relationship", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false) 1188 @Description(shortDefinition="before | after", formalDefinition="The relationship of this action to the related action." ) 1189 protected CodeType relationship; 1190 1191 /** 1192 * A duration or range of durations to apply to the relationship. For example, 30-60 minutes before. 1193 */ 1194 @Child(name = "offset", type = {Duration.class, Range.class}, order=3, min=0, max=1, modifier=false, summary=false) 1195 @Description(shortDefinition="Time offset for the relationship", formalDefinition="A duration or range of durations to apply to the relationship. For example, 30-60 minutes before." ) 1196 protected Type offset; 1197 1198 /** 1199 * An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action. 1200 */ 1201 @Child(name = "anchor", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=false) 1202 @Description(shortDefinition="start | end", formalDefinition="An optional indicator for how the relationship is anchored to the related action. For example \"before the start\" or \"before the end\" of the related action." ) 1203 protected CodeType anchor; 1204 1205 private static final long serialVersionUID = -1200619014L; 1206 1207 /** 1208 * Constructor 1209 */ 1210 public GuidanceResponseActionRelatedActionComponent() { 1211 super(); 1212 } 1213 1214 /** 1215 * Constructor 1216 */ 1217 public GuidanceResponseActionRelatedActionComponent(Identifier actionIdentifier, CodeType relationship) { 1218 super(); 1219 this.actionIdentifier = actionIdentifier; 1220 this.relationship = relationship; 1221 } 1222 1223 /** 1224 * @return {@link #actionIdentifier} (The unique identifier of the related action.) 1225 */ 1226 public Identifier getActionIdentifier() { 1227 if (this.actionIdentifier == null) 1228 if (Configuration.errorOnAutoCreate()) 1229 throw new Error("Attempt to auto-create GuidanceResponseActionRelatedActionComponent.actionIdentifier"); 1230 else if (Configuration.doAutoCreate()) 1231 this.actionIdentifier = new Identifier(); // cc 1232 return this.actionIdentifier; 1233 } 1234 1235 public boolean hasActionIdentifier() { 1236 return this.actionIdentifier != null && !this.actionIdentifier.isEmpty(); 1237 } 1238 1239 /** 1240 * @param value {@link #actionIdentifier} (The unique identifier of the related action.) 1241 */ 1242 public GuidanceResponseActionRelatedActionComponent setActionIdentifier(Identifier value) { 1243 this.actionIdentifier = value; 1244 return this; 1245 } 1246 1247 /** 1248 * @return {@link #relationship} (The relationship of this action to the related action.). This is the underlying object with id, value and extensions. The accessor "getRelationship" gives direct access to the value 1249 */ 1250 public CodeType getRelationshipElement() { 1251 if (this.relationship == null) 1252 if (Configuration.errorOnAutoCreate()) 1253 throw new Error("Attempt to auto-create GuidanceResponseActionRelatedActionComponent.relationship"); 1254 else if (Configuration.doAutoCreate()) 1255 this.relationship = new CodeType(); // bb 1256 return this.relationship; 1257 } 1258 1259 public boolean hasRelationshipElement() { 1260 return this.relationship != null && !this.relationship.isEmpty(); 1261 } 1262 1263 public boolean hasRelationship() { 1264 return this.relationship != null && !this.relationship.isEmpty(); 1265 } 1266 1267 /** 1268 * @param value {@link #relationship} (The relationship of this action to the related action.). This is the underlying object with id, value and extensions. The accessor "getRelationship" gives direct access to the value 1269 */ 1270 public GuidanceResponseActionRelatedActionComponent setRelationshipElement(CodeType value) { 1271 this.relationship = value; 1272 return this; 1273 } 1274 1275 /** 1276 * @return The relationship of this action to the related action. 1277 */ 1278 public String getRelationship() { 1279 return this.relationship == null ? null : this.relationship.getValue(); 1280 } 1281 1282 /** 1283 * @param value The relationship of this action to the related action. 1284 */ 1285 public GuidanceResponseActionRelatedActionComponent setRelationship(String value) { 1286 if (this.relationship == null) 1287 this.relationship = new CodeType(); 1288 this.relationship.setValue(value); 1289 return this; 1290 } 1291 1292 /** 1293 * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) 1294 */ 1295 public Type getOffset() { 1296 return this.offset; 1297 } 1298 1299 /** 1300 * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) 1301 */ 1302 public Duration getOffsetDuration() throws FHIRException { 1303 if (!(this.offset instanceof Duration)) 1304 throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.offset.getClass().getName()+" was encountered"); 1305 return (Duration) this.offset; 1306 } 1307 1308 public boolean hasOffsetDuration() { 1309 return this.offset instanceof Duration; 1310 } 1311 1312 /** 1313 * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) 1314 */ 1315 public Range getOffsetRange() throws FHIRException { 1316 if (!(this.offset instanceof Range)) 1317 throw new FHIRException("Type mismatch: the type Range was expected, but "+this.offset.getClass().getName()+" was encountered"); 1318 return (Range) this.offset; 1319 } 1320 1321 public boolean hasOffsetRange() { 1322 return this.offset instanceof Range; 1323 } 1324 1325 public boolean hasOffset() { 1326 return this.offset != null && !this.offset.isEmpty(); 1327 } 1328 1329 /** 1330 * @param value {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) 1331 */ 1332 public GuidanceResponseActionRelatedActionComponent setOffset(Type value) { 1333 this.offset = value; 1334 return this; 1335 } 1336 1337 /** 1338 * @return {@link #anchor} (An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action.). This is the underlying object with id, value and extensions. The accessor "getAnchor" gives direct access to the value 1339 */ 1340 public CodeType getAnchorElement() { 1341 if (this.anchor == null) 1342 if (Configuration.errorOnAutoCreate()) 1343 throw new Error("Attempt to auto-create GuidanceResponseActionRelatedActionComponent.anchor"); 1344 else if (Configuration.doAutoCreate()) 1345 this.anchor = new CodeType(); // bb 1346 return this.anchor; 1347 } 1348 1349 public boolean hasAnchorElement() { 1350 return this.anchor != null && !this.anchor.isEmpty(); 1351 } 1352 1353 public boolean hasAnchor() { 1354 return this.anchor != null && !this.anchor.isEmpty(); 1355 } 1356 1357 /** 1358 * @param value {@link #anchor} (An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action.). This is the underlying object with id, value and extensions. The accessor "getAnchor" gives direct access to the value 1359 */ 1360 public GuidanceResponseActionRelatedActionComponent setAnchorElement(CodeType value) { 1361 this.anchor = value; 1362 return this; 1363 } 1364 1365 /** 1366 * @return An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action. 1367 */ 1368 public String getAnchor() { 1369 return this.anchor == null ? null : this.anchor.getValue(); 1370 } 1371 1372 /** 1373 * @param value An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action. 1374 */ 1375 public GuidanceResponseActionRelatedActionComponent setAnchor(String value) { 1376 if (Utilities.noString(value)) 1377 this.anchor = null; 1378 else { 1379 if (this.anchor == null) 1380 this.anchor = new CodeType(); 1381 this.anchor.setValue(value); 1382 } 1383 return this; 1384 } 1385 1386 protected void listChildren(List<Property> childrenList) { 1387 super.listChildren(childrenList); 1388 childrenList.add(new Property("actionIdentifier", "Identifier", "The unique identifier of the related action.", 0, java.lang.Integer.MAX_VALUE, actionIdentifier)); 1389 childrenList.add(new Property("relationship", "code", "The relationship of this action to the related action.", 0, java.lang.Integer.MAX_VALUE, relationship)); 1390 childrenList.add(new Property("offset[x]", "Duration|Range", "A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.", 0, java.lang.Integer.MAX_VALUE, offset)); 1391 childrenList.add(new Property("anchor", "code", "An optional indicator for how the relationship is anchored to the related action. For example \"before the start\" or \"before the end\" of the related action.", 0, java.lang.Integer.MAX_VALUE, anchor)); 1392 } 1393 1394 @Override 1395 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1396 switch (hash) { 1397 case -889046145: /*actionIdentifier*/ return this.actionIdentifier == null ? new Base[0] : new Base[] {this.actionIdentifier}; // Identifier 1398 case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // CodeType 1399 case -1019779949: /*offset*/ return this.offset == null ? new Base[0] : new Base[] {this.offset}; // Type 1400 case -1413299531: /*anchor*/ return this.anchor == null ? new Base[0] : new Base[] {this.anchor}; // CodeType 1401 default: return super.getProperty(hash, name, checkValid); 1402 } 1403 1404 } 1405 1406 @Override 1407 public void setProperty(int hash, String name, Base value) throws FHIRException { 1408 switch (hash) { 1409 case -889046145: // actionIdentifier 1410 this.actionIdentifier = castToIdentifier(value); // Identifier 1411 break; 1412 case -261851592: // relationship 1413 this.relationship = castToCode(value); // CodeType 1414 break; 1415 case -1019779949: // offset 1416 this.offset = (Type) value; // Type 1417 break; 1418 case -1413299531: // anchor 1419 this.anchor = castToCode(value); // CodeType 1420 break; 1421 default: super.setProperty(hash, name, value); 1422 } 1423 1424 } 1425 1426 @Override 1427 public void setProperty(String name, Base value) throws FHIRException { 1428 if (name.equals("actionIdentifier")) 1429 this.actionIdentifier = castToIdentifier(value); // Identifier 1430 else if (name.equals("relationship")) 1431 this.relationship = castToCode(value); // CodeType 1432 else if (name.equals("offset[x]")) 1433 this.offset = (Type) value; // Type 1434 else if (name.equals("anchor")) 1435 this.anchor = castToCode(value); // CodeType 1436 else 1437 super.setProperty(name, value); 1438 } 1439 1440 @Override 1441 public Base makeProperty(int hash, String name) throws FHIRException { 1442 switch (hash) { 1443 case -889046145: return getActionIdentifier(); // Identifier 1444 case -261851592: throw new FHIRException("Cannot make property relationship as it is not a complex type"); // CodeType 1445 case -1960684787: return getOffset(); // Type 1446 case -1413299531: throw new FHIRException("Cannot make property anchor as it is not a complex type"); // CodeType 1447 default: return super.makeProperty(hash, name); 1448 } 1449 1450 } 1451 1452 @Override 1453 public Base addChild(String name) throws FHIRException { 1454 if (name.equals("actionIdentifier")) { 1455 this.actionIdentifier = new Identifier(); 1456 return this.actionIdentifier; 1457 } 1458 else if (name.equals("relationship")) { 1459 throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.relationship"); 1460 } 1461 else if (name.equals("offsetDuration")) { 1462 this.offset = new Duration(); 1463 return this.offset; 1464 } 1465 else if (name.equals("offsetRange")) { 1466 this.offset = new Range(); 1467 return this.offset; 1468 } 1469 else if (name.equals("anchor")) { 1470 throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.anchor"); 1471 } 1472 else 1473 return super.addChild(name); 1474 } 1475 1476 public GuidanceResponseActionRelatedActionComponent copy() { 1477 GuidanceResponseActionRelatedActionComponent dst = new GuidanceResponseActionRelatedActionComponent(); 1478 copyValues(dst); 1479 dst.actionIdentifier = actionIdentifier == null ? null : actionIdentifier.copy(); 1480 dst.relationship = relationship == null ? null : relationship.copy(); 1481 dst.offset = offset == null ? null : offset.copy(); 1482 dst.anchor = anchor == null ? null : anchor.copy(); 1483 return dst; 1484 } 1485 1486 @Override 1487 public boolean equalsDeep(Base other) { 1488 if (!super.equalsDeep(other)) 1489 return false; 1490 if (!(other instanceof GuidanceResponseActionRelatedActionComponent)) 1491 return false; 1492 GuidanceResponseActionRelatedActionComponent o = (GuidanceResponseActionRelatedActionComponent) other; 1493 return compareDeep(actionIdentifier, o.actionIdentifier, true) && compareDeep(relationship, o.relationship, true) 1494 && compareDeep(offset, o.offset, true) && compareDeep(anchor, o.anchor, true); 1495 } 1496 1497 @Override 1498 public boolean equalsShallow(Base other) { 1499 if (!super.equalsShallow(other)) 1500 return false; 1501 if (!(other instanceof GuidanceResponseActionRelatedActionComponent)) 1502 return false; 1503 GuidanceResponseActionRelatedActionComponent o = (GuidanceResponseActionRelatedActionComponent) other; 1504 return compareValues(relationship, o.relationship, true) && compareValues(anchor, o.anchor, true); 1505 } 1506 1507 public boolean isEmpty() { 1508 return super.isEmpty() && (actionIdentifier == null || actionIdentifier.isEmpty()) && (relationship == null || relationship.isEmpty()) 1509 && (offset == null || offset.isEmpty()) && (anchor == null || anchor.isEmpty()); 1510 } 1511 1512 public String fhirType() { 1513 return "GuidanceResponse.action.relatedAction"; 1514 1515 } 1516 1517 } 1518 1519 @Block() 1520 public static class GuidanceResponseActionBehaviorComponent extends BackboneElement implements IBaseBackboneElement { 1521 /** 1522 * The type of the behavior to be described, such as grouping, visual, or selection behaviors. 1523 */ 1524 @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) 1525 @Description(shortDefinition="The type of behavior (grouping, precheck, selection, cardinality, etc)", formalDefinition="The type of the behavior to be described, such as grouping, visual, or selection behaviors." ) 1526 protected Coding type; 1527 1528 /** 1529 * The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset. 1530 */ 1531 @Child(name = "value", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=false) 1532 @Description(shortDefinition="Specific behavior (e.g. required, at-most-one, single, etc)", formalDefinition="The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset." ) 1533 protected Coding value; 1534 1535 private static final long serialVersionUID = -1054119695L; 1536 1537 /** 1538 * Constructor 1539 */ 1540 public GuidanceResponseActionBehaviorComponent() { 1541 super(); 1542 } 1543 1544 /** 1545 * Constructor 1546 */ 1547 public GuidanceResponseActionBehaviorComponent(Coding type, Coding value) { 1548 super(); 1549 this.type = type; 1550 this.value = value; 1551 } 1552 1553 /** 1554 * @return {@link #type} (The type of the behavior to be described, such as grouping, visual, or selection behaviors.) 1555 */ 1556 public Coding getType() { 1557 if (this.type == null) 1558 if (Configuration.errorOnAutoCreate()) 1559 throw new Error("Attempt to auto-create GuidanceResponseActionBehaviorComponent.type"); 1560 else if (Configuration.doAutoCreate()) 1561 this.type = new Coding(); // cc 1562 return this.type; 1563 } 1564 1565 public boolean hasType() { 1566 return this.type != null && !this.type.isEmpty(); 1567 } 1568 1569 /** 1570 * @param value {@link #type} (The type of the behavior to be described, such as grouping, visual, or selection behaviors.) 1571 */ 1572 public GuidanceResponseActionBehaviorComponent setType(Coding value) { 1573 this.type = value; 1574 return this; 1575 } 1576 1577 /** 1578 * @return {@link #value} (The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset.) 1579 */ 1580 public Coding getValue() { 1581 if (this.value == null) 1582 if (Configuration.errorOnAutoCreate()) 1583 throw new Error("Attempt to auto-create GuidanceResponseActionBehaviorComponent.value"); 1584 else if (Configuration.doAutoCreate()) 1585 this.value = new Coding(); // cc 1586 return this.value; 1587 } 1588 1589 public boolean hasValue() { 1590 return this.value != null && !this.value.isEmpty(); 1591 } 1592 1593 /** 1594 * @param value {@link #value} (The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset.) 1595 */ 1596 public GuidanceResponseActionBehaviorComponent setValue(Coding value) { 1597 this.value = value; 1598 return this; 1599 } 1600 1601 protected void listChildren(List<Property> childrenList) { 1602 super.listChildren(childrenList); 1603 childrenList.add(new Property("type", "Coding", "The type of the behavior to be described, such as grouping, visual, or selection behaviors.", 0, java.lang.Integer.MAX_VALUE, type)); 1604 childrenList.add(new Property("value", "Coding", "The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset.", 0, java.lang.Integer.MAX_VALUE, value)); 1605 } 1606 1607 @Override 1608 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1609 switch (hash) { 1610 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding 1611 case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Coding 1612 default: return super.getProperty(hash, name, checkValid); 1613 } 1614 1615 } 1616 1617 @Override 1618 public void setProperty(int hash, String name, Base value) throws FHIRException { 1619 switch (hash) { 1620 case 3575610: // type 1621 this.type = castToCoding(value); // Coding 1622 break; 1623 case 111972721: // value 1624 this.value = castToCoding(value); // Coding 1625 break; 1626 default: super.setProperty(hash, name, value); 1627 } 1628 1629 } 1630 1631 @Override 1632 public void setProperty(String name, Base value) throws FHIRException { 1633 if (name.equals("type")) 1634 this.type = castToCoding(value); // Coding 1635 else if (name.equals("value")) 1636 this.value = castToCoding(value); // Coding 1637 else 1638 super.setProperty(name, value); 1639 } 1640 1641 @Override 1642 public Base makeProperty(int hash, String name) throws FHIRException { 1643 switch (hash) { 1644 case 3575610: return getType(); // Coding 1645 case 111972721: return getValue(); // Coding 1646 default: return super.makeProperty(hash, name); 1647 } 1648 1649 } 1650 1651 @Override 1652 public Base addChild(String name) throws FHIRException { 1653 if (name.equals("type")) { 1654 this.type = new Coding(); 1655 return this.type; 1656 } 1657 else if (name.equals("value")) { 1658 this.value = new Coding(); 1659 return this.value; 1660 } 1661 else 1662 return super.addChild(name); 1663 } 1664 1665 public GuidanceResponseActionBehaviorComponent copy() { 1666 GuidanceResponseActionBehaviorComponent dst = new GuidanceResponseActionBehaviorComponent(); 1667 copyValues(dst); 1668 dst.type = type == null ? null : type.copy(); 1669 dst.value = value == null ? null : value.copy(); 1670 return dst; 1671 } 1672 1673 @Override 1674 public boolean equalsDeep(Base other) { 1675 if (!super.equalsDeep(other)) 1676 return false; 1677 if (!(other instanceof GuidanceResponseActionBehaviorComponent)) 1678 return false; 1679 GuidanceResponseActionBehaviorComponent o = (GuidanceResponseActionBehaviorComponent) other; 1680 return compareDeep(type, o.type, true) && compareDeep(value, o.value, true); 1681 } 1682 1683 @Override 1684 public boolean equalsShallow(Base other) { 1685 if (!super.equalsShallow(other)) 1686 return false; 1687 if (!(other instanceof GuidanceResponseActionBehaviorComponent)) 1688 return false; 1689 GuidanceResponseActionBehaviorComponent o = (GuidanceResponseActionBehaviorComponent) other; 1690 return true; 1691 } 1692 1693 public boolean isEmpty() { 1694 return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty()) 1695 ; 1696 } 1697 1698 public String fhirType() { 1699 return "GuidanceResponse.action.behavior"; 1700 1701 } 1702 1703 } 1704 1705 /** 1706 * The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario. 1707 */ 1708 @Child(name = "requestId", type = {StringType.class}, order=0, min=0, max=1, modifier=false, summary=false) 1709 @Description(shortDefinition="The id of the request associated with this response, if any", formalDefinition="The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario." ) 1710 protected StringType requestId; 1711 1712 /** 1713 * A reference to the knowledge module that was invoked. 1714 */ 1715 @Child(name = "module", type = {DecisionSupportServiceModule.class, DecisionSupportRule.class}, order=1, min=1, max=1, modifier=true, summary=true) 1716 @Description(shortDefinition="A reference to a knowledge module", formalDefinition="A reference to the knowledge module that was invoked." ) 1717 protected Reference module; 1718 1719 /** 1720 * The actual object that is the target of the reference (A reference to the knowledge module that was invoked.) 1721 */ 1722 protected Resource moduleTarget; 1723 1724 /** 1725 * The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information. 1726 */ 1727 @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) 1728 @Description(shortDefinition="success | data-requested | data-required | in-progress | failure", formalDefinition="The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information." ) 1729 protected Enumeration<GuidanceResponseStatus> status; 1730 1731 /** 1732 * Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element. 1733 */ 1734 @Child(name = "evaluationMessage", type = {OperationOutcome.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 1735 @Description(shortDefinition="Messages resulting from the evaluation of the artifact or artifacts", formalDefinition="Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element." ) 1736 protected List<Reference> evaluationMessage; 1737 /** 1738 * The actual objects that are the target of the reference (Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.) 1739 */ 1740 protected List<OperationOutcome> evaluationMessageTarget; 1741 1742 1743 /** 1744 * The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element. 1745 */ 1746 @Child(name = "outputParameters", type = {Parameters.class}, order=4, min=0, max=1, modifier=false, summary=false) 1747 @Description(shortDefinition="The output parameters of the evaluation, if any", formalDefinition="The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element." ) 1748 protected Reference outputParameters; 1749 1750 /** 1751 * The actual object that is the target of the reference (The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.) 1752 */ 1753 protected Parameters outputParametersTarget; 1754 1755 /** 1756 * The actions, if any, produced by the evaluation of the artifact. 1757 */ 1758 @Child(name = "action", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 1759 @Description(shortDefinition="Proposed actions, if any", formalDefinition="The actions, if any, produced by the evaluation of the artifact." ) 1760 protected List<GuidanceResponseActionComponent> action; 1761 1762 /** 1763 * If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data. 1764 */ 1765 @Child(name = "dataRequirement", type = {DataRequirement.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 1766 @Description(shortDefinition="Additional required data", formalDefinition="If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data." ) 1767 protected List<DataRequirement> dataRequirement; 1768 1769 private static final long serialVersionUID = -918912174L; 1770 1771 /** 1772 * Constructor 1773 */ 1774 public GuidanceResponse() { 1775 super(); 1776 } 1777 1778 /** 1779 * Constructor 1780 */ 1781 public GuidanceResponse(Reference module, Enumeration<GuidanceResponseStatus> status) { 1782 super(); 1783 this.module = module; 1784 this.status = status; 1785 } 1786 1787 /** 1788 * @return {@link #requestId} (The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario.). This is the underlying object with id, value and extensions. The accessor "getRequestId" gives direct access to the value 1789 */ 1790 public StringType getRequestIdElement() { 1791 if (this.requestId == null) 1792 if (Configuration.errorOnAutoCreate()) 1793 throw new Error("Attempt to auto-create GuidanceResponse.requestId"); 1794 else if (Configuration.doAutoCreate()) 1795 this.requestId = new StringType(); // bb 1796 return this.requestId; 1797 } 1798 1799 public boolean hasRequestIdElement() { 1800 return this.requestId != null && !this.requestId.isEmpty(); 1801 } 1802 1803 public boolean hasRequestId() { 1804 return this.requestId != null && !this.requestId.isEmpty(); 1805 } 1806 1807 /** 1808 * @param value {@link #requestId} (The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario.). This is the underlying object with id, value and extensions. The accessor "getRequestId" gives direct access to the value 1809 */ 1810 public GuidanceResponse setRequestIdElement(StringType value) { 1811 this.requestId = value; 1812 return this; 1813 } 1814 1815 /** 1816 * @return The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario. 1817 */ 1818 public String getRequestId() { 1819 return this.requestId == null ? null : this.requestId.getValue(); 1820 } 1821 1822 /** 1823 * @param value The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario. 1824 */ 1825 public GuidanceResponse setRequestId(String value) { 1826 if (Utilities.noString(value)) 1827 this.requestId = null; 1828 else { 1829 if (this.requestId == null) 1830 this.requestId = new StringType(); 1831 this.requestId.setValue(value); 1832 } 1833 return this; 1834 } 1835 1836 /** 1837 * @return {@link #module} (A reference to the knowledge module that was invoked.) 1838 */ 1839 public Reference getModule() { 1840 if (this.module == null) 1841 if (Configuration.errorOnAutoCreate()) 1842 throw new Error("Attempt to auto-create GuidanceResponse.module"); 1843 else if (Configuration.doAutoCreate()) 1844 this.module = new Reference(); // cc 1845 return this.module; 1846 } 1847 1848 public boolean hasModule() { 1849 return this.module != null && !this.module.isEmpty(); 1850 } 1851 1852 /** 1853 * @param value {@link #module} (A reference to the knowledge module that was invoked.) 1854 */ 1855 public GuidanceResponse setModule(Reference value) { 1856 this.module = value; 1857 return this; 1858 } 1859 1860 /** 1861 * @return {@link #module} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the knowledge module that was invoked.) 1862 */ 1863 public Resource getModuleTarget() { 1864 return this.moduleTarget; 1865 } 1866 1867 /** 1868 * @param value {@link #module} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the knowledge module that was invoked.) 1869 */ 1870 public GuidanceResponse setModuleTarget(Resource value) { 1871 this.moduleTarget = value; 1872 return this; 1873 } 1874 1875 /** 1876 * @return {@link #status} (The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 1877 */ 1878 public Enumeration<GuidanceResponseStatus> getStatusElement() { 1879 if (this.status == null) 1880 if (Configuration.errorOnAutoCreate()) 1881 throw new Error("Attempt to auto-create GuidanceResponse.status"); 1882 else if (Configuration.doAutoCreate()) 1883 this.status = new Enumeration<GuidanceResponseStatus>(new GuidanceResponseStatusEnumFactory()); // bb 1884 return this.status; 1885 } 1886 1887 public boolean hasStatusElement() { 1888 return this.status != null && !this.status.isEmpty(); 1889 } 1890 1891 public boolean hasStatus() { 1892 return this.status != null && !this.status.isEmpty(); 1893 } 1894 1895 /** 1896 * @param value {@link #status} (The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 1897 */ 1898 public GuidanceResponse setStatusElement(Enumeration<GuidanceResponseStatus> value) { 1899 this.status = value; 1900 return this; 1901 } 1902 1903 /** 1904 * @return The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information. 1905 */ 1906 public GuidanceResponseStatus getStatus() { 1907 return this.status == null ? null : this.status.getValue(); 1908 } 1909 1910 /** 1911 * @param value The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information. 1912 */ 1913 public GuidanceResponse setStatus(GuidanceResponseStatus value) { 1914 if (this.status == null) 1915 this.status = new Enumeration<GuidanceResponseStatus>(new GuidanceResponseStatusEnumFactory()); 1916 this.status.setValue(value); 1917 return this; 1918 } 1919 1920 /** 1921 * @return {@link #evaluationMessage} (Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.) 1922 */ 1923 public List<Reference> getEvaluationMessage() { 1924 if (this.evaluationMessage == null) 1925 this.evaluationMessage = new ArrayList<Reference>(); 1926 return this.evaluationMessage; 1927 } 1928 1929 public boolean hasEvaluationMessage() { 1930 if (this.evaluationMessage == null) 1931 return false; 1932 for (Reference item : this.evaluationMessage) 1933 if (!item.isEmpty()) 1934 return true; 1935 return false; 1936 } 1937 1938 /** 1939 * @return {@link #evaluationMessage} (Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.) 1940 */ 1941 // syntactic sugar 1942 public Reference addEvaluationMessage() { //3 1943 Reference t = new Reference(); 1944 if (this.evaluationMessage == null) 1945 this.evaluationMessage = new ArrayList<Reference>(); 1946 this.evaluationMessage.add(t); 1947 return t; 1948 } 1949 1950 // syntactic sugar 1951 public GuidanceResponse addEvaluationMessage(Reference t) { //3 1952 if (t == null) 1953 return this; 1954 if (this.evaluationMessage == null) 1955 this.evaluationMessage = new ArrayList<Reference>(); 1956 this.evaluationMessage.add(t); 1957 return this; 1958 } 1959 1960 /** 1961 * @return {@link #evaluationMessage} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.) 1962 */ 1963 public List<OperationOutcome> getEvaluationMessageTarget() { 1964 if (this.evaluationMessageTarget == null) 1965 this.evaluationMessageTarget = new ArrayList<OperationOutcome>(); 1966 return this.evaluationMessageTarget; 1967 } 1968 1969 // syntactic sugar 1970 /** 1971 * @return {@link #evaluationMessage} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.) 1972 */ 1973 public OperationOutcome addEvaluationMessageTarget() { 1974 OperationOutcome r = new OperationOutcome(); 1975 if (this.evaluationMessageTarget == null) 1976 this.evaluationMessageTarget = new ArrayList<OperationOutcome>(); 1977 this.evaluationMessageTarget.add(r); 1978 return r; 1979 } 1980 1981 /** 1982 * @return {@link #outputParameters} (The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.) 1983 */ 1984 public Reference getOutputParameters() { 1985 if (this.outputParameters == null) 1986 if (Configuration.errorOnAutoCreate()) 1987 throw new Error("Attempt to auto-create GuidanceResponse.outputParameters"); 1988 else if (Configuration.doAutoCreate()) 1989 this.outputParameters = new Reference(); // cc 1990 return this.outputParameters; 1991 } 1992 1993 public boolean hasOutputParameters() { 1994 return this.outputParameters != null && !this.outputParameters.isEmpty(); 1995 } 1996 1997 /** 1998 * @param value {@link #outputParameters} (The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.) 1999 */ 2000 public GuidanceResponse setOutputParameters(Reference value) { 2001 this.outputParameters = value; 2002 return this; 2003 } 2004 2005 /** 2006 * @return {@link #outputParameters} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.) 2007 */ 2008 public Parameters getOutputParametersTarget() { 2009 if (this.outputParametersTarget == null) 2010 if (Configuration.errorOnAutoCreate()) 2011 throw new Error("Attempt to auto-create GuidanceResponse.outputParameters"); 2012 else if (Configuration.doAutoCreate()) 2013 this.outputParametersTarget = new Parameters(); // aa 2014 return this.outputParametersTarget; 2015 } 2016 2017 /** 2018 * @param value {@link #outputParameters} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.) 2019 */ 2020 public GuidanceResponse setOutputParametersTarget(Parameters value) { 2021 this.outputParametersTarget = value; 2022 return this; 2023 } 2024 2025 /** 2026 * @return {@link #action} (The actions, if any, produced by the evaluation of the artifact.) 2027 */ 2028 public List<GuidanceResponseActionComponent> getAction() { 2029 if (this.action == null) 2030 this.action = new ArrayList<GuidanceResponseActionComponent>(); 2031 return this.action; 2032 } 2033 2034 public boolean hasAction() { 2035 if (this.action == null) 2036 return false; 2037 for (GuidanceResponseActionComponent item : this.action) 2038 if (!item.isEmpty()) 2039 return true; 2040 return false; 2041 } 2042 2043 /** 2044 * @return {@link #action} (The actions, if any, produced by the evaluation of the artifact.) 2045 */ 2046 // syntactic sugar 2047 public GuidanceResponseActionComponent addAction() { //3 2048 GuidanceResponseActionComponent t = new GuidanceResponseActionComponent(); 2049 if (this.action == null) 2050 this.action = new ArrayList<GuidanceResponseActionComponent>(); 2051 this.action.add(t); 2052 return t; 2053 } 2054 2055 // syntactic sugar 2056 public GuidanceResponse addAction(GuidanceResponseActionComponent t) { //3 2057 if (t == null) 2058 return this; 2059 if (this.action == null) 2060 this.action = new ArrayList<GuidanceResponseActionComponent>(); 2061 this.action.add(t); 2062 return this; 2063 } 2064 2065 /** 2066 * @return {@link #dataRequirement} (If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data.) 2067 */ 2068 public List<DataRequirement> getDataRequirement() { 2069 if (this.dataRequirement == null) 2070 this.dataRequirement = new ArrayList<DataRequirement>(); 2071 return this.dataRequirement; 2072 } 2073 2074 public boolean hasDataRequirement() { 2075 if (this.dataRequirement == null) 2076 return false; 2077 for (DataRequirement item : this.dataRequirement) 2078 if (!item.isEmpty()) 2079 return true; 2080 return false; 2081 } 2082 2083 /** 2084 * @return {@link #dataRequirement} (If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data.) 2085 */ 2086 // syntactic sugar 2087 public DataRequirement addDataRequirement() { //3 2088 DataRequirement t = new DataRequirement(); 2089 if (this.dataRequirement == null) 2090 this.dataRequirement = new ArrayList<DataRequirement>(); 2091 this.dataRequirement.add(t); 2092 return t; 2093 } 2094 2095 // syntactic sugar 2096 public GuidanceResponse addDataRequirement(DataRequirement t) { //3 2097 if (t == null) 2098 return this; 2099 if (this.dataRequirement == null) 2100 this.dataRequirement = new ArrayList<DataRequirement>(); 2101 this.dataRequirement.add(t); 2102 return this; 2103 } 2104 2105 protected void listChildren(List<Property> childrenList) { 2106 super.listChildren(childrenList); 2107 childrenList.add(new Property("requestId", "string", "The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario.", 0, java.lang.Integer.MAX_VALUE, requestId)); 2108 childrenList.add(new Property("module", "Reference(DecisionSupportServiceModule|DecisionSupportRule)", "A reference to the knowledge module that was invoked.", 0, java.lang.Integer.MAX_VALUE, module)); 2109 childrenList.add(new Property("status", "code", "The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information.", 0, java.lang.Integer.MAX_VALUE, status)); 2110 childrenList.add(new Property("evaluationMessage", "Reference(OperationOutcome)", "Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.", 0, java.lang.Integer.MAX_VALUE, evaluationMessage)); 2111 childrenList.add(new Property("outputParameters", "Reference(Parameters)", "The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.", 0, java.lang.Integer.MAX_VALUE, outputParameters)); 2112 childrenList.add(new Property("action", "", "The actions, if any, produced by the evaluation of the artifact.", 0, java.lang.Integer.MAX_VALUE, action)); 2113 childrenList.add(new Property("dataRequirement", "DataRequirement", "If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data.", 0, java.lang.Integer.MAX_VALUE, dataRequirement)); 2114 } 2115 2116 @Override 2117 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 2118 switch (hash) { 2119 case 693933066: /*requestId*/ return this.requestId == null ? new Base[0] : new Base[] {this.requestId}; // StringType 2120 case -1068784020: /*module*/ return this.module == null ? new Base[0] : new Base[] {this.module}; // Reference 2121 case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<GuidanceResponseStatus> 2122 case 1081619755: /*evaluationMessage*/ return this.evaluationMessage == null ? new Base[0] : this.evaluationMessage.toArray(new Base[this.evaluationMessage.size()]); // Reference 2123 case 525609419: /*outputParameters*/ return this.outputParameters == null ? new Base[0] : new Base[] {this.outputParameters}; // Reference 2124 case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // GuidanceResponseActionComponent 2125 case 629147193: /*dataRequirement*/ return this.dataRequirement == null ? new Base[0] : this.dataRequirement.toArray(new Base[this.dataRequirement.size()]); // DataRequirement 2126 default: return super.getProperty(hash, name, checkValid); 2127 } 2128 2129 } 2130 2131 @Override 2132 public void setProperty(int hash, String name, Base value) throws FHIRException { 2133 switch (hash) { 2134 case 693933066: // requestId 2135 this.requestId = castToString(value); // StringType 2136 break; 2137 case -1068784020: // module 2138 this.module = castToReference(value); // Reference 2139 break; 2140 case -892481550: // status 2141 this.status = new GuidanceResponseStatusEnumFactory().fromType(value); // Enumeration<GuidanceResponseStatus> 2142 break; 2143 case 1081619755: // evaluationMessage 2144 this.getEvaluationMessage().add(castToReference(value)); // Reference 2145 break; 2146 case 525609419: // outputParameters 2147 this.outputParameters = castToReference(value); // Reference 2148 break; 2149 case -1422950858: // action 2150 this.getAction().add((GuidanceResponseActionComponent) value); // GuidanceResponseActionComponent 2151 break; 2152 case 629147193: // dataRequirement 2153 this.getDataRequirement().add(castToDataRequirement(value)); // DataRequirement 2154 break; 2155 default: super.setProperty(hash, name, value); 2156 } 2157 2158 } 2159 2160 @Override 2161 public void setProperty(String name, Base value) throws FHIRException { 2162 if (name.equals("requestId")) 2163 this.requestId = castToString(value); // StringType 2164 else if (name.equals("module")) 2165 this.module = castToReference(value); // Reference 2166 else if (name.equals("status")) 2167 this.status = new GuidanceResponseStatusEnumFactory().fromType(value); // Enumeration<GuidanceResponseStatus> 2168 else if (name.equals("evaluationMessage")) 2169 this.getEvaluationMessage().add(castToReference(value)); 2170 else if (name.equals("outputParameters")) 2171 this.outputParameters = castToReference(value); // Reference 2172 else if (name.equals("action")) 2173 this.getAction().add((GuidanceResponseActionComponent) value); 2174 else if (name.equals("dataRequirement")) 2175 this.getDataRequirement().add(castToDataRequirement(value)); 2176 else 2177 super.setProperty(name, value); 2178 } 2179 2180 @Override 2181 public Base makeProperty(int hash, String name) throws FHIRException { 2182 switch (hash) { 2183 case 693933066: throw new FHIRException("Cannot make property requestId as it is not a complex type"); // StringType 2184 case -1068784020: return getModule(); // Reference 2185 case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration<GuidanceResponseStatus> 2186 case 1081619755: return addEvaluationMessage(); // Reference 2187 case 525609419: return getOutputParameters(); // Reference 2188 case -1422950858: return addAction(); // GuidanceResponseActionComponent 2189 case 629147193: return addDataRequirement(); // DataRequirement 2190 default: return super.makeProperty(hash, name); 2191 } 2192 2193 } 2194 2195 @Override 2196 public Base addChild(String name) throws FHIRException { 2197 if (name.equals("requestId")) { 2198 throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.requestId"); 2199 } 2200 else if (name.equals("module")) { 2201 this.module = new Reference(); 2202 return this.module; 2203 } 2204 else if (name.equals("status")) { 2205 throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.status"); 2206 } 2207 else if (name.equals("evaluationMessage")) { 2208 return addEvaluationMessage(); 2209 } 2210 else if (name.equals("outputParameters")) { 2211 this.outputParameters = new Reference(); 2212 return this.outputParameters; 2213 } 2214 else if (name.equals("action")) { 2215 return addAction(); 2216 } 2217 else if (name.equals("dataRequirement")) { 2218 return addDataRequirement(); 2219 } 2220 else 2221 return super.addChild(name); 2222 } 2223 2224 public String fhirType() { 2225 return "GuidanceResponse"; 2226 2227 } 2228 2229 public GuidanceResponse copy() { 2230 GuidanceResponse dst = new GuidanceResponse(); 2231 copyValues(dst); 2232 dst.requestId = requestId == null ? null : requestId.copy(); 2233 dst.module = module == null ? null : module.copy(); 2234 dst.status = status == null ? null : status.copy(); 2235 if (evaluationMessage != null) { 2236 dst.evaluationMessage = new ArrayList<Reference>(); 2237 for (Reference i : evaluationMessage) 2238 dst.evaluationMessage.add(i.copy()); 2239 }; 2240 dst.outputParameters = outputParameters == null ? null : outputParameters.copy(); 2241 if (action != null) { 2242 dst.action = new ArrayList<GuidanceResponseActionComponent>(); 2243 for (GuidanceResponseActionComponent i : action) 2244 dst.action.add(i.copy()); 2245 }; 2246 if (dataRequirement != null) { 2247 dst.dataRequirement = new ArrayList<DataRequirement>(); 2248 for (DataRequirement i : dataRequirement) 2249 dst.dataRequirement.add(i.copy()); 2250 }; 2251 return dst; 2252 } 2253 2254 protected GuidanceResponse typedCopy() { 2255 return copy(); 2256 } 2257 2258 @Override 2259 public boolean equalsDeep(Base other) { 2260 if (!super.equalsDeep(other)) 2261 return false; 2262 if (!(other instanceof GuidanceResponse)) 2263 return false; 2264 GuidanceResponse o = (GuidanceResponse) other; 2265 return compareDeep(requestId, o.requestId, true) && compareDeep(module, o.module, true) && compareDeep(status, o.status, true) 2266 && compareDeep(evaluationMessage, o.evaluationMessage, true) && compareDeep(outputParameters, o.outputParameters, true) 2267 && compareDeep(action, o.action, true) && compareDeep(dataRequirement, o.dataRequirement, true) 2268 ; 2269 } 2270 2271 @Override 2272 public boolean equalsShallow(Base other) { 2273 if (!super.equalsShallow(other)) 2274 return false; 2275 if (!(other instanceof GuidanceResponse)) 2276 return false; 2277 GuidanceResponse o = (GuidanceResponse) other; 2278 return compareValues(requestId, o.requestId, true) && compareValues(status, o.status, true); 2279 } 2280 2281 public boolean isEmpty() { 2282 return super.isEmpty() && (requestId == null || requestId.isEmpty()) && (module == null || module.isEmpty()) 2283 && (status == null || status.isEmpty()) && (evaluationMessage == null || evaluationMessage.isEmpty()) 2284 && (outputParameters == null || outputParameters.isEmpty()) && (action == null || action.isEmpty()) 2285 && (dataRequirement == null || dataRequirement.isEmpty()); 2286 } 2287 2288 @Override 2289 public ResourceType getResourceType() { 2290 return ResourceType.GuidanceResponse; 2291 } 2292 2293 2294}