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