001package org.hl7.fhir.r4.model; 002 003 004 005/* 006 Copyright (c) 2011+, HL7, Inc. 007 All rights reserved. 008 009 Redistribution and use in source and binary forms, with or without modification, 010 are permitted provided that the following conditions are met: 011 012 * Redistributions of source code must retain the above copyright notice, this 013 list of conditions and the following disclaimer. 014 * Redistributions in binary form must reproduce the above copyright notice, 015 this list of conditions and the following disclaimer in the documentation 016 and/or other materials provided with the distribution. 017 * Neither the name of HL7 nor the names of its contributors may be used to 018 endorse or promote products derived from this software without specific 019 prior written permission. 020 021 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 022 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 023 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 024 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 025 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 026 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 027 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 028 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 029 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 030 POSSIBILITY OF SUCH DAMAGE. 031 032*/ 033 034 035// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1 036 037import java.util.*; 038 039import org.hl7.fhir.utilities.Utilities; 040import org.hl7.fhir.r4.model.Enumerations.*; 041import ca.uhn.fhir.model.api.annotation.ResourceDef; 042import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; 043import ca.uhn.fhir.model.api.annotation.Child; 044import ca.uhn.fhir.model.api.annotation.ChildOrder; 045import ca.uhn.fhir.model.api.annotation.Description; 046import ca.uhn.fhir.model.api.annotation.Block; 047import org.hl7.fhir.instance.model.api.*; 048import org.hl7.fhir.exceptions.FHIRException; 049/** 050 * This resource provides enrollment and plan details from the processing of an EnrollmentRequest resource. 051 */ 052@ResourceDef(name="EnrollmentResponse", profile="http://hl7.org/fhir/StructureDefinition/EnrollmentResponse") 053public class EnrollmentResponse extends DomainResource { 054 055 public enum EnrollmentResponseStatus { 056 /** 057 * The instance is currently in-force. 058 */ 059 ACTIVE, 060 /** 061 * The instance is withdrawn, rescinded or reversed. 062 */ 063 CANCELLED, 064 /** 065 * A new instance the contents of which is not complete. 066 */ 067 DRAFT, 068 /** 069 * The instance was entered in error. 070 */ 071 ENTEREDINERROR, 072 /** 073 * added to help the parsers with the generic types 074 */ 075 NULL; 076 public static EnrollmentResponseStatus fromCode(String codeString) throws FHIRException { 077 if (codeString == null || "".equals(codeString)) 078 return null; 079 if ("active".equals(codeString)) 080 return ACTIVE; 081 if ("cancelled".equals(codeString)) 082 return CANCELLED; 083 if ("draft".equals(codeString)) 084 return DRAFT; 085 if ("entered-in-error".equals(codeString)) 086 return ENTEREDINERROR; 087 if (Configuration.isAcceptInvalidEnums()) 088 return null; 089 else 090 throw new FHIRException("Unknown EnrollmentResponseStatus code '"+codeString+"'"); 091 } 092 public String toCode() { 093 switch (this) { 094 case ACTIVE: return "active"; 095 case CANCELLED: return "cancelled"; 096 case DRAFT: return "draft"; 097 case ENTEREDINERROR: return "entered-in-error"; 098 default: return "?"; 099 } 100 } 101 public String getSystem() { 102 switch (this) { 103 case ACTIVE: return "http://hl7.org/fhir/fm-status"; 104 case CANCELLED: return "http://hl7.org/fhir/fm-status"; 105 case DRAFT: return "http://hl7.org/fhir/fm-status"; 106 case ENTEREDINERROR: return "http://hl7.org/fhir/fm-status"; 107 default: return "?"; 108 } 109 } 110 public String getDefinition() { 111 switch (this) { 112 case ACTIVE: return "The instance is currently in-force."; 113 case CANCELLED: return "The instance is withdrawn, rescinded or reversed."; 114 case DRAFT: return "A new instance the contents of which is not complete."; 115 case ENTEREDINERROR: return "The instance was entered in error."; 116 default: return "?"; 117 } 118 } 119 public String getDisplay() { 120 switch (this) { 121 case ACTIVE: return "Active"; 122 case CANCELLED: return "Cancelled"; 123 case DRAFT: return "Draft"; 124 case ENTEREDINERROR: return "Entered in Error"; 125 default: return "?"; 126 } 127 } 128 } 129 130 public static class EnrollmentResponseStatusEnumFactory implements EnumFactory<EnrollmentResponseStatus> { 131 public EnrollmentResponseStatus fromCode(String codeString) throws IllegalArgumentException { 132 if (codeString == null || "".equals(codeString)) 133 if (codeString == null || "".equals(codeString)) 134 return null; 135 if ("active".equals(codeString)) 136 return EnrollmentResponseStatus.ACTIVE; 137 if ("cancelled".equals(codeString)) 138 return EnrollmentResponseStatus.CANCELLED; 139 if ("draft".equals(codeString)) 140 return EnrollmentResponseStatus.DRAFT; 141 if ("entered-in-error".equals(codeString)) 142 return EnrollmentResponseStatus.ENTEREDINERROR; 143 throw new IllegalArgumentException("Unknown EnrollmentResponseStatus code '"+codeString+"'"); 144 } 145 public Enumeration<EnrollmentResponseStatus> fromType(Base code) throws FHIRException { 146 if (code == null) 147 return null; 148 if (code.isEmpty()) 149 return new Enumeration<EnrollmentResponseStatus>(this); 150 String codeString = ((PrimitiveType) code).asStringValue(); 151 if (codeString == null || "".equals(codeString)) 152 return null; 153 if ("active".equals(codeString)) 154 return new Enumeration<EnrollmentResponseStatus>(this, EnrollmentResponseStatus.ACTIVE); 155 if ("cancelled".equals(codeString)) 156 return new Enumeration<EnrollmentResponseStatus>(this, EnrollmentResponseStatus.CANCELLED); 157 if ("draft".equals(codeString)) 158 return new Enumeration<EnrollmentResponseStatus>(this, EnrollmentResponseStatus.DRAFT); 159 if ("entered-in-error".equals(codeString)) 160 return new Enumeration<EnrollmentResponseStatus>(this, EnrollmentResponseStatus.ENTEREDINERROR); 161 throw new FHIRException("Unknown EnrollmentResponseStatus code '"+codeString+"'"); 162 } 163 public String toCode(EnrollmentResponseStatus code) { 164 if (code == EnrollmentResponseStatus.ACTIVE) 165 return "active"; 166 if (code == EnrollmentResponseStatus.CANCELLED) 167 return "cancelled"; 168 if (code == EnrollmentResponseStatus.DRAFT) 169 return "draft"; 170 if (code == EnrollmentResponseStatus.ENTEREDINERROR) 171 return "entered-in-error"; 172 return "?"; 173 } 174 public String toSystem(EnrollmentResponseStatus code) { 175 return code.getSystem(); 176 } 177 } 178 179 /** 180 * The Response business identifier. 181 */ 182 @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 183 @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." ) 184 protected List<Identifier> identifier; 185 186 /** 187 * The status of the resource instance. 188 */ 189 @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) 190 @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." ) 191 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status") 192 protected Enumeration<EnrollmentResponseStatus> status; 193 194 /** 195 * Original request resource reference. 196 */ 197 @Child(name = "request", type = {EnrollmentRequest.class}, order=2, min=0, max=1, modifier=false, summary=false) 198 @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." ) 199 protected Reference request; 200 201 /** 202 * The actual object that is the target of the reference (Original request resource reference.) 203 */ 204 protected EnrollmentRequest requestTarget; 205 206 /** 207 * Processing status: error, complete. 208 */ 209 @Child(name = "outcome", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false) 210 @Description(shortDefinition="queued | complete | error | partial", formalDefinition="Processing status: error, complete." ) 211 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/remittance-outcome") 212 protected Enumeration<RemittanceOutcome> outcome; 213 214 /** 215 * A description of the status of the adjudication. 216 */ 217 @Child(name = "disposition", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) 218 @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) 219 protected StringType disposition; 220 221 /** 222 * The date when the enclosed suite of services were performed or completed. 223 */ 224 @Child(name = "created", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=false) 225 @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) 226 protected DateTimeType created; 227 228 /** 229 * The Insurer who produced this adjudicated response. 230 */ 231 @Child(name = "organization", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=false) 232 @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) 233 protected Reference organization; 234 235 /** 236 * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) 237 */ 238 protected Organization organizationTarget; 239 240 /** 241 * The practitioner who is responsible for the services rendered to the patient. 242 */ 243 @Child(name = "requestProvider", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=7, min=0, max=1, modifier=false, summary=false) 244 @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) 245 protected Reference requestProvider; 246 247 /** 248 * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) 249 */ 250 protected Resource requestProviderTarget; 251 252 private static final long serialVersionUID = -1759921458L; 253 254 /** 255 * Constructor 256 */ 257 public EnrollmentResponse() { 258 super(); 259 } 260 261 /** 262 * @return {@link #identifier} (The Response business identifier.) 263 */ 264 public List<Identifier> getIdentifier() { 265 if (this.identifier == null) 266 this.identifier = new ArrayList<Identifier>(); 267 return this.identifier; 268 } 269 270 /** 271 * @return Returns a reference to <code>this</code> for easy method chaining 272 */ 273 public EnrollmentResponse setIdentifier(List<Identifier> theIdentifier) { 274 this.identifier = theIdentifier; 275 return this; 276 } 277 278 public boolean hasIdentifier() { 279 if (this.identifier == null) 280 return false; 281 for (Identifier item : this.identifier) 282 if (!item.isEmpty()) 283 return true; 284 return false; 285 } 286 287 public Identifier addIdentifier() { //3 288 Identifier t = new Identifier(); 289 if (this.identifier == null) 290 this.identifier = new ArrayList<Identifier>(); 291 this.identifier.add(t); 292 return t; 293 } 294 295 public EnrollmentResponse addIdentifier(Identifier t) { //3 296 if (t == null) 297 return this; 298 if (this.identifier == null) 299 this.identifier = new ArrayList<Identifier>(); 300 this.identifier.add(t); 301 return this; 302 } 303 304 /** 305 * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist 306 */ 307 public Identifier getIdentifierFirstRep() { 308 if (getIdentifier().isEmpty()) { 309 addIdentifier(); 310 } 311 return getIdentifier().get(0); 312 } 313 314 /** 315 * @return {@link #status} (The status of the resource instance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 316 */ 317 public Enumeration<EnrollmentResponseStatus> getStatusElement() { 318 if (this.status == null) 319 if (Configuration.errorOnAutoCreate()) 320 throw new Error("Attempt to auto-create EnrollmentResponse.status"); 321 else if (Configuration.doAutoCreate()) 322 this.status = new Enumeration<EnrollmentResponseStatus>(new EnrollmentResponseStatusEnumFactory()); // bb 323 return this.status; 324 } 325 326 public boolean hasStatusElement() { 327 return this.status != null && !this.status.isEmpty(); 328 } 329 330 public boolean hasStatus() { 331 return this.status != null && !this.status.isEmpty(); 332 } 333 334 /** 335 * @param value {@link #status} (The status of the resource instance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 336 */ 337 public EnrollmentResponse setStatusElement(Enumeration<EnrollmentResponseStatus> value) { 338 this.status = value; 339 return this; 340 } 341 342 /** 343 * @return The status of the resource instance. 344 */ 345 public EnrollmentResponseStatus getStatus() { 346 return this.status == null ? null : this.status.getValue(); 347 } 348 349 /** 350 * @param value The status of the resource instance. 351 */ 352 public EnrollmentResponse setStatus(EnrollmentResponseStatus value) { 353 if (value == null) 354 this.status = null; 355 else { 356 if (this.status == null) 357 this.status = new Enumeration<EnrollmentResponseStatus>(new EnrollmentResponseStatusEnumFactory()); 358 this.status.setValue(value); 359 } 360 return this; 361 } 362 363 /** 364 * @return {@link #request} (Original request resource reference.) 365 */ 366 public Reference getRequest() { 367 if (this.request == null) 368 if (Configuration.errorOnAutoCreate()) 369 throw new Error("Attempt to auto-create EnrollmentResponse.request"); 370 else if (Configuration.doAutoCreate()) 371 this.request = new Reference(); // cc 372 return this.request; 373 } 374 375 public boolean hasRequest() { 376 return this.request != null && !this.request.isEmpty(); 377 } 378 379 /** 380 * @param value {@link #request} (Original request resource reference.) 381 */ 382 public EnrollmentResponse setRequest(Reference value) { 383 this.request = value; 384 return this; 385 } 386 387 /** 388 * @return {@link #request} 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. (Original request resource reference.) 389 */ 390 public EnrollmentRequest getRequestTarget() { 391 if (this.requestTarget == null) 392 if (Configuration.errorOnAutoCreate()) 393 throw new Error("Attempt to auto-create EnrollmentResponse.request"); 394 else if (Configuration.doAutoCreate()) 395 this.requestTarget = new EnrollmentRequest(); // aa 396 return this.requestTarget; 397 } 398 399 /** 400 * @param value {@link #request} 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. (Original request resource reference.) 401 */ 402 public EnrollmentResponse setRequestTarget(EnrollmentRequest value) { 403 this.requestTarget = value; 404 return this; 405 } 406 407 /** 408 * @return {@link #outcome} (Processing status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value 409 */ 410 public Enumeration<RemittanceOutcome> getOutcomeElement() { 411 if (this.outcome == null) 412 if (Configuration.errorOnAutoCreate()) 413 throw new Error("Attempt to auto-create EnrollmentResponse.outcome"); 414 else if (Configuration.doAutoCreate()) 415 this.outcome = new Enumeration<RemittanceOutcome>(new RemittanceOutcomeEnumFactory()); // bb 416 return this.outcome; 417 } 418 419 public boolean hasOutcomeElement() { 420 return this.outcome != null && !this.outcome.isEmpty(); 421 } 422 423 public boolean hasOutcome() { 424 return this.outcome != null && !this.outcome.isEmpty(); 425 } 426 427 /** 428 * @param value {@link #outcome} (Processing status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value 429 */ 430 public EnrollmentResponse setOutcomeElement(Enumeration<RemittanceOutcome> value) { 431 this.outcome = value; 432 return this; 433 } 434 435 /** 436 * @return Processing status: error, complete. 437 */ 438 public RemittanceOutcome getOutcome() { 439 return this.outcome == null ? null : this.outcome.getValue(); 440 } 441 442 /** 443 * @param value Processing status: error, complete. 444 */ 445 public EnrollmentResponse setOutcome(RemittanceOutcome value) { 446 if (value == null) 447 this.outcome = null; 448 else { 449 if (this.outcome == null) 450 this.outcome = new Enumeration<RemittanceOutcome>(new RemittanceOutcomeEnumFactory()); 451 this.outcome.setValue(value); 452 } 453 return this; 454 } 455 456 /** 457 * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value 458 */ 459 public StringType getDispositionElement() { 460 if (this.disposition == null) 461 if (Configuration.errorOnAutoCreate()) 462 throw new Error("Attempt to auto-create EnrollmentResponse.disposition"); 463 else if (Configuration.doAutoCreate()) 464 this.disposition = new StringType(); // bb 465 return this.disposition; 466 } 467 468 public boolean hasDispositionElement() { 469 return this.disposition != null && !this.disposition.isEmpty(); 470 } 471 472 public boolean hasDisposition() { 473 return this.disposition != null && !this.disposition.isEmpty(); 474 } 475 476 /** 477 * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value 478 */ 479 public EnrollmentResponse setDispositionElement(StringType value) { 480 this.disposition = value; 481 return this; 482 } 483 484 /** 485 * @return A description of the status of the adjudication. 486 */ 487 public String getDisposition() { 488 return this.disposition == null ? null : this.disposition.getValue(); 489 } 490 491 /** 492 * @param value A description of the status of the adjudication. 493 */ 494 public EnrollmentResponse setDisposition(String value) { 495 if (Utilities.noString(value)) 496 this.disposition = null; 497 else { 498 if (this.disposition == null) 499 this.disposition = new StringType(); 500 this.disposition.setValue(value); 501 } 502 return this; 503 } 504 505 /** 506 * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value 507 */ 508 public DateTimeType getCreatedElement() { 509 if (this.created == null) 510 if (Configuration.errorOnAutoCreate()) 511 throw new Error("Attempt to auto-create EnrollmentResponse.created"); 512 else if (Configuration.doAutoCreate()) 513 this.created = new DateTimeType(); // bb 514 return this.created; 515 } 516 517 public boolean hasCreatedElement() { 518 return this.created != null && !this.created.isEmpty(); 519 } 520 521 public boolean hasCreated() { 522 return this.created != null && !this.created.isEmpty(); 523 } 524 525 /** 526 * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value 527 */ 528 public EnrollmentResponse setCreatedElement(DateTimeType value) { 529 this.created = value; 530 return this; 531 } 532 533 /** 534 * @return The date when the enclosed suite of services were performed or completed. 535 */ 536 public Date getCreated() { 537 return this.created == null ? null : this.created.getValue(); 538 } 539 540 /** 541 * @param value The date when the enclosed suite of services were performed or completed. 542 */ 543 public EnrollmentResponse setCreated(Date value) { 544 if (value == null) 545 this.created = null; 546 else { 547 if (this.created == null) 548 this.created = new DateTimeType(); 549 this.created.setValue(value); 550 } 551 return this; 552 } 553 554 /** 555 * @return {@link #organization} (The Insurer who produced this adjudicated response.) 556 */ 557 public Reference getOrganization() { 558 if (this.organization == null) 559 if (Configuration.errorOnAutoCreate()) 560 throw new Error("Attempt to auto-create EnrollmentResponse.organization"); 561 else if (Configuration.doAutoCreate()) 562 this.organization = new Reference(); // cc 563 return this.organization; 564 } 565 566 public boolean hasOrganization() { 567 return this.organization != null && !this.organization.isEmpty(); 568 } 569 570 /** 571 * @param value {@link #organization} (The Insurer who produced this adjudicated response.) 572 */ 573 public EnrollmentResponse setOrganization(Reference value) { 574 this.organization = value; 575 return this; 576 } 577 578 /** 579 * @return {@link #organization} 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 Insurer who produced this adjudicated response.) 580 */ 581 public Organization getOrganizationTarget() { 582 if (this.organizationTarget == null) 583 if (Configuration.errorOnAutoCreate()) 584 throw new Error("Attempt to auto-create EnrollmentResponse.organization"); 585 else if (Configuration.doAutoCreate()) 586 this.organizationTarget = new Organization(); // aa 587 return this.organizationTarget; 588 } 589 590 /** 591 * @param value {@link #organization} 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 Insurer who produced this adjudicated response.) 592 */ 593 public EnrollmentResponse setOrganizationTarget(Organization value) { 594 this.organizationTarget = value; 595 return this; 596 } 597 598 /** 599 * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) 600 */ 601 public Reference getRequestProvider() { 602 if (this.requestProvider == null) 603 if (Configuration.errorOnAutoCreate()) 604 throw new Error("Attempt to auto-create EnrollmentResponse.requestProvider"); 605 else if (Configuration.doAutoCreate()) 606 this.requestProvider = new Reference(); // cc 607 return this.requestProvider; 608 } 609 610 public boolean hasRequestProvider() { 611 return this.requestProvider != null && !this.requestProvider.isEmpty(); 612 } 613 614 /** 615 * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) 616 */ 617 public EnrollmentResponse setRequestProvider(Reference value) { 618 this.requestProvider = value; 619 return this; 620 } 621 622 /** 623 * @return {@link #requestProvider} 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 practitioner who is responsible for the services rendered to the patient.) 624 */ 625 public Resource getRequestProviderTarget() { 626 return this.requestProviderTarget; 627 } 628 629 /** 630 * @param value {@link #requestProvider} 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 practitioner who is responsible for the services rendered to the patient.) 631 */ 632 public EnrollmentResponse setRequestProviderTarget(Resource value) { 633 this.requestProviderTarget = value; 634 return this; 635 } 636 637 protected void listChildren(List<Property> children) { 638 super.listChildren(children); 639 children.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); 640 children.add(new Property("status", "code", "The status of the resource instance.", 0, 1, status)); 641 children.add(new Property("request", "Reference(EnrollmentRequest)", "Original request resource reference.", 0, 1, request)); 642 children.add(new Property("outcome", "code", "Processing status: error, complete.", 0, 1, outcome)); 643 children.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, 1, disposition)); 644 children.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, 1, created)); 645 children.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, 1, organization)); 646 children.add(new Property("requestProvider", "Reference(Practitioner|PractitionerRole|Organization)", "The practitioner who is responsible for the services rendered to the patient.", 0, 1, requestProvider)); 647 } 648 649 @Override 650 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 651 switch (_hash) { 652 case -1618432855: /*identifier*/ return new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier); 653 case -892481550: /*status*/ return new Property("status", "code", "The status of the resource instance.", 0, 1, status); 654 case 1095692943: /*request*/ return new Property("request", "Reference(EnrollmentRequest)", "Original request resource reference.", 0, 1, request); 655 case -1106507950: /*outcome*/ return new Property("outcome", "code", "Processing status: error, complete.", 0, 1, outcome); 656 case 583380919: /*disposition*/ return new Property("disposition", "string", "A description of the status of the adjudication.", 0, 1, disposition); 657 case 1028554472: /*created*/ return new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, 1, created); 658 case 1178922291: /*organization*/ return new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, 1, organization); 659 case 1601527200: /*requestProvider*/ return new Property("requestProvider", "Reference(Practitioner|PractitionerRole|Organization)", "The practitioner who is responsible for the services rendered to the patient.", 0, 1, requestProvider); 660 default: return super.getNamedProperty(_hash, _name, _checkValid); 661 } 662 663 } 664 665 @Override 666 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 667 switch (hash) { 668 case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier 669 case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<EnrollmentResponseStatus> 670 case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference 671 case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration<RemittanceOutcome> 672 case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType 673 case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType 674 case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference 675 case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Reference 676 default: return super.getProperty(hash, name, checkValid); 677 } 678 679 } 680 681 @Override 682 public Base setProperty(int hash, String name, Base value) throws FHIRException { 683 switch (hash) { 684 case -1618432855: // identifier 685 this.getIdentifier().add(castToIdentifier(value)); // Identifier 686 return value; 687 case -892481550: // status 688 value = new EnrollmentResponseStatusEnumFactory().fromType(castToCode(value)); 689 this.status = (Enumeration) value; // Enumeration<EnrollmentResponseStatus> 690 return value; 691 case 1095692943: // request 692 this.request = castToReference(value); // Reference 693 return value; 694 case -1106507950: // outcome 695 value = new RemittanceOutcomeEnumFactory().fromType(castToCode(value)); 696 this.outcome = (Enumeration) value; // Enumeration<RemittanceOutcome> 697 return value; 698 case 583380919: // disposition 699 this.disposition = castToString(value); // StringType 700 return value; 701 case 1028554472: // created 702 this.created = castToDateTime(value); // DateTimeType 703 return value; 704 case 1178922291: // organization 705 this.organization = castToReference(value); // Reference 706 return value; 707 case 1601527200: // requestProvider 708 this.requestProvider = castToReference(value); // Reference 709 return value; 710 default: return super.setProperty(hash, name, value); 711 } 712 713 } 714 715 @Override 716 public Base setProperty(String name, Base value) throws FHIRException { 717 if (name.equals("identifier")) { 718 this.getIdentifier().add(castToIdentifier(value)); 719 } else if (name.equals("status")) { 720 value = new EnrollmentResponseStatusEnumFactory().fromType(castToCode(value)); 721 this.status = (Enumeration) value; // Enumeration<EnrollmentResponseStatus> 722 } else if (name.equals("request")) { 723 this.request = castToReference(value); // Reference 724 } else if (name.equals("outcome")) { 725 value = new RemittanceOutcomeEnumFactory().fromType(castToCode(value)); 726 this.outcome = (Enumeration) value; // Enumeration<RemittanceOutcome> 727 } else if (name.equals("disposition")) { 728 this.disposition = castToString(value); // StringType 729 } else if (name.equals("created")) { 730 this.created = castToDateTime(value); // DateTimeType 731 } else if (name.equals("organization")) { 732 this.organization = castToReference(value); // Reference 733 } else if (name.equals("requestProvider")) { 734 this.requestProvider = castToReference(value); // Reference 735 } else 736 return super.setProperty(name, value); 737 return value; 738 } 739 740 @Override 741 public Base makeProperty(int hash, String name) throws FHIRException { 742 switch (hash) { 743 case -1618432855: return addIdentifier(); 744 case -892481550: return getStatusElement(); 745 case 1095692943: return getRequest(); 746 case -1106507950: return getOutcomeElement(); 747 case 583380919: return getDispositionElement(); 748 case 1028554472: return getCreatedElement(); 749 case 1178922291: return getOrganization(); 750 case 1601527200: return getRequestProvider(); 751 default: return super.makeProperty(hash, name); 752 } 753 754 } 755 756 @Override 757 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 758 switch (hash) { 759 case -1618432855: /*identifier*/ return new String[] {"Identifier"}; 760 case -892481550: /*status*/ return new String[] {"code"}; 761 case 1095692943: /*request*/ return new String[] {"Reference"}; 762 case -1106507950: /*outcome*/ return new String[] {"code"}; 763 case 583380919: /*disposition*/ return new String[] {"string"}; 764 case 1028554472: /*created*/ return new String[] {"dateTime"}; 765 case 1178922291: /*organization*/ return new String[] {"Reference"}; 766 case 1601527200: /*requestProvider*/ return new String[] {"Reference"}; 767 default: return super.getTypesForProperty(hash, name); 768 } 769 770 } 771 772 @Override 773 public Base addChild(String name) throws FHIRException { 774 if (name.equals("identifier")) { 775 return addIdentifier(); 776 } 777 else if (name.equals("status")) { 778 throw new FHIRException("Cannot call addChild on a primitive type EnrollmentResponse.status"); 779 } 780 else if (name.equals("request")) { 781 this.request = new Reference(); 782 return this.request; 783 } 784 else if (name.equals("outcome")) { 785 throw new FHIRException("Cannot call addChild on a primitive type EnrollmentResponse.outcome"); 786 } 787 else if (name.equals("disposition")) { 788 throw new FHIRException("Cannot call addChild on a primitive type EnrollmentResponse.disposition"); 789 } 790 else if (name.equals("created")) { 791 throw new FHIRException("Cannot call addChild on a primitive type EnrollmentResponse.created"); 792 } 793 else if (name.equals("organization")) { 794 this.organization = new Reference(); 795 return this.organization; 796 } 797 else if (name.equals("requestProvider")) { 798 this.requestProvider = new Reference(); 799 return this.requestProvider; 800 } 801 else 802 return super.addChild(name); 803 } 804 805 public String fhirType() { 806 return "EnrollmentResponse"; 807 808 } 809 810 public EnrollmentResponse copy() { 811 EnrollmentResponse dst = new EnrollmentResponse(); 812 copyValues(dst); 813 return dst; 814 } 815 816 public void copyValues(EnrollmentResponse dst) { 817 super.copyValues(dst); 818 if (identifier != null) { 819 dst.identifier = new ArrayList<Identifier>(); 820 for (Identifier i : identifier) 821 dst.identifier.add(i.copy()); 822 }; 823 dst.status = status == null ? null : status.copy(); 824 dst.request = request == null ? null : request.copy(); 825 dst.outcome = outcome == null ? null : outcome.copy(); 826 dst.disposition = disposition == null ? null : disposition.copy(); 827 dst.created = created == null ? null : created.copy(); 828 dst.organization = organization == null ? null : organization.copy(); 829 dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); 830 } 831 832 protected EnrollmentResponse typedCopy() { 833 return copy(); 834 } 835 836 @Override 837 public boolean equalsDeep(Base other_) { 838 if (!super.equalsDeep(other_)) 839 return false; 840 if (!(other_ instanceof EnrollmentResponse)) 841 return false; 842 EnrollmentResponse o = (EnrollmentResponse) other_; 843 return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(request, o.request, true) 844 && compareDeep(outcome, o.outcome, true) && compareDeep(disposition, o.disposition, true) && compareDeep(created, o.created, true) 845 && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) 846 ; 847 } 848 849 @Override 850 public boolean equalsShallow(Base other_) { 851 if (!super.equalsShallow(other_)) 852 return false; 853 if (!(other_ instanceof EnrollmentResponse)) 854 return false; 855 EnrollmentResponse o = (EnrollmentResponse) other_; 856 return compareValues(status, o.status, true) && compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) 857 && compareValues(created, o.created, true); 858 } 859 860 public boolean isEmpty() { 861 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, request 862 , outcome, disposition, created, organization, requestProvider); 863 } 864 865 @Override 866 public ResourceType getResourceType() { 867 return ResourceType.EnrollmentResponse; 868 } 869 870 /** 871 * Search parameter: <b>identifier</b> 872 * <p> 873 * Description: <b>The business identifier of the EnrollmentResponse</b><br> 874 * Type: <b>token</b><br> 875 * Path: <b>EnrollmentResponse.identifier</b><br> 876 * </p> 877 */ 878 @SearchParamDefinition(name="identifier", path="EnrollmentResponse.identifier", description="The business identifier of the EnrollmentResponse", type="token" ) 879 public static final String SP_IDENTIFIER = "identifier"; 880 /** 881 * <b>Fluent Client</b> search parameter constant for <b>identifier</b> 882 * <p> 883 * Description: <b>The business identifier of the EnrollmentResponse</b><br> 884 * Type: <b>token</b><br> 885 * Path: <b>EnrollmentResponse.identifier</b><br> 886 * </p> 887 */ 888 public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); 889 890 /** 891 * Search parameter: <b>request</b> 892 * <p> 893 * Description: <b>The reference to the claim</b><br> 894 * Type: <b>reference</b><br> 895 * Path: <b>EnrollmentResponse.request</b><br> 896 * </p> 897 */ 898 @SearchParamDefinition(name="request", path="EnrollmentResponse.request", description="The reference to the claim", type="reference", target={EnrollmentRequest.class } ) 899 public static final String SP_REQUEST = "request"; 900 /** 901 * <b>Fluent Client</b> search parameter constant for <b>request</b> 902 * <p> 903 * Description: <b>The reference to the claim</b><br> 904 * Type: <b>reference</b><br> 905 * Path: <b>EnrollmentResponse.request</b><br> 906 * </p> 907 */ 908 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST); 909 910/** 911 * Constant for fluent queries to be used to add include statements. Specifies 912 * the path value of "<b>EnrollmentResponse:request</b>". 913 */ 914 public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST = new ca.uhn.fhir.model.api.Include("EnrollmentResponse:request").toLocked(); 915 916 /** 917 * Search parameter: <b>status</b> 918 * <p> 919 * Description: <b>The status of the enrollment response</b><br> 920 * Type: <b>token</b><br> 921 * Path: <b>EnrollmentResponse.status</b><br> 922 * </p> 923 */ 924 @SearchParamDefinition(name="status", path="EnrollmentResponse.status", description="The status of the enrollment response", type="token" ) 925 public static final String SP_STATUS = "status"; 926 /** 927 * <b>Fluent Client</b> search parameter constant for <b>status</b> 928 * <p> 929 * Description: <b>The status of the enrollment response</b><br> 930 * Type: <b>token</b><br> 931 * Path: <b>EnrollmentResponse.status</b><br> 932 * </p> 933 */ 934 public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); 935 936 937}