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; 044import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; 045/** 046 * A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc. 047 */ 048@ResourceDef(name="Organization", profile="http://hl7.org/fhir/Profile/Organization") 049public class Organization extends DomainResource { 050 051 @Block() 052 public static class OrganizationContactComponent extends BackboneElement implements IBaseBackboneElement { 053 /** 054 * Indicates a purpose for which the contact can be reached. 055 */ 056 @Child(name = "purpose", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) 057 @Description(shortDefinition="The type of contact", formalDefinition="Indicates a purpose for which the contact can be reached." ) 058 protected CodeableConcept purpose; 059 060 /** 061 * A name associated with the contact. 062 */ 063 @Child(name = "name", type = {HumanName.class}, order=2, min=0, max=1, modifier=false, summary=false) 064 @Description(shortDefinition="A name associated with the contact", formalDefinition="A name associated with the contact." ) 065 protected HumanName name; 066 067 /** 068 * A contact detail (e.g. a telephone number or an email address) by which the party may be contacted. 069 */ 070 @Child(name = "telecom", type = {ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 071 @Description(shortDefinition="Contact details (telephone, email, etc.) for a contact", formalDefinition="A contact detail (e.g. a telephone number or an email address) by which the party may be contacted." ) 072 protected List<ContactPoint> telecom; 073 074 /** 075 * Visiting or postal addresses for the contact. 076 */ 077 @Child(name = "address", type = {Address.class}, order=4, min=0, max=1, modifier=false, summary=false) 078 @Description(shortDefinition="Visiting or postal addresses for the contact", formalDefinition="Visiting or postal addresses for the contact." ) 079 protected Address address; 080 081 private static final long serialVersionUID = 1831121305L; 082 083 /** 084 * Constructor 085 */ 086 public OrganizationContactComponent() { 087 super(); 088 } 089 090 /** 091 * @return {@link #purpose} (Indicates a purpose for which the contact can be reached.) 092 */ 093 public CodeableConcept getPurpose() { 094 if (this.purpose == null) 095 if (Configuration.errorOnAutoCreate()) 096 throw new Error("Attempt to auto-create OrganizationContactComponent.purpose"); 097 else if (Configuration.doAutoCreate()) 098 this.purpose = new CodeableConcept(); // cc 099 return this.purpose; 100 } 101 102 public boolean hasPurpose() { 103 return this.purpose != null && !this.purpose.isEmpty(); 104 } 105 106 /** 107 * @param value {@link #purpose} (Indicates a purpose for which the contact can be reached.) 108 */ 109 public OrganizationContactComponent setPurpose(CodeableConcept value) { 110 this.purpose = value; 111 return this; 112 } 113 114 /** 115 * @return {@link #name} (A name associated with the contact.) 116 */ 117 public HumanName getName() { 118 if (this.name == null) 119 if (Configuration.errorOnAutoCreate()) 120 throw new Error("Attempt to auto-create OrganizationContactComponent.name"); 121 else if (Configuration.doAutoCreate()) 122 this.name = new HumanName(); // cc 123 return this.name; 124 } 125 126 public boolean hasName() { 127 return this.name != null && !this.name.isEmpty(); 128 } 129 130 /** 131 * @param value {@link #name} (A name associated with the contact.) 132 */ 133 public OrganizationContactComponent setName(HumanName value) { 134 this.name = value; 135 return this; 136 } 137 138 /** 139 * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.) 140 */ 141 public List<ContactPoint> getTelecom() { 142 if (this.telecom == null) 143 this.telecom = new ArrayList<ContactPoint>(); 144 return this.telecom; 145 } 146 147 public boolean hasTelecom() { 148 if (this.telecom == null) 149 return false; 150 for (ContactPoint item : this.telecom) 151 if (!item.isEmpty()) 152 return true; 153 return false; 154 } 155 156 /** 157 * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.) 158 */ 159 // syntactic sugar 160 public ContactPoint addTelecom() { //3 161 ContactPoint t = new ContactPoint(); 162 if (this.telecom == null) 163 this.telecom = new ArrayList<ContactPoint>(); 164 this.telecom.add(t); 165 return t; 166 } 167 168 // syntactic sugar 169 public OrganizationContactComponent addTelecom(ContactPoint t) { //3 170 if (t == null) 171 return this; 172 if (this.telecom == null) 173 this.telecom = new ArrayList<ContactPoint>(); 174 this.telecom.add(t); 175 return this; 176 } 177 178 /** 179 * @return {@link #address} (Visiting or postal addresses for the contact.) 180 */ 181 public Address getAddress() { 182 if (this.address == null) 183 if (Configuration.errorOnAutoCreate()) 184 throw new Error("Attempt to auto-create OrganizationContactComponent.address"); 185 else if (Configuration.doAutoCreate()) 186 this.address = new Address(); // cc 187 return this.address; 188 } 189 190 public boolean hasAddress() { 191 return this.address != null && !this.address.isEmpty(); 192 } 193 194 /** 195 * @param value {@link #address} (Visiting or postal addresses for the contact.) 196 */ 197 public OrganizationContactComponent setAddress(Address value) { 198 this.address = value; 199 return this; 200 } 201 202 protected void listChildren(List<Property> childrenList) { 203 super.listChildren(childrenList); 204 childrenList.add(new Property("purpose", "CodeableConcept", "Indicates a purpose for which the contact can be reached.", 0, java.lang.Integer.MAX_VALUE, purpose)); 205 childrenList.add(new Property("name", "HumanName", "A name associated with the contact.", 0, java.lang.Integer.MAX_VALUE, name)); 206 childrenList.add(new Property("telecom", "ContactPoint", "A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom)); 207 childrenList.add(new Property("address", "Address", "Visiting or postal addresses for the contact.", 0, java.lang.Integer.MAX_VALUE, address)); 208 } 209 210 @Override 211 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 212 switch (hash) { 213 case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // CodeableConcept 214 case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // HumanName 215 case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint 216 case -1147692044: /*address*/ return this.address == null ? new Base[0] : new Base[] {this.address}; // Address 217 default: return super.getProperty(hash, name, checkValid); 218 } 219 220 } 221 222 @Override 223 public void setProperty(int hash, String name, Base value) throws FHIRException { 224 switch (hash) { 225 case -220463842: // purpose 226 this.purpose = castToCodeableConcept(value); // CodeableConcept 227 break; 228 case 3373707: // name 229 this.name = castToHumanName(value); // HumanName 230 break; 231 case -1429363305: // telecom 232 this.getTelecom().add(castToContactPoint(value)); // ContactPoint 233 break; 234 case -1147692044: // address 235 this.address = castToAddress(value); // Address 236 break; 237 default: super.setProperty(hash, name, value); 238 } 239 240 } 241 242 @Override 243 public void setProperty(String name, Base value) throws FHIRException { 244 if (name.equals("purpose")) 245 this.purpose = castToCodeableConcept(value); // CodeableConcept 246 else if (name.equals("name")) 247 this.name = castToHumanName(value); // HumanName 248 else if (name.equals("telecom")) 249 this.getTelecom().add(castToContactPoint(value)); 250 else if (name.equals("address")) 251 this.address = castToAddress(value); // Address 252 else 253 super.setProperty(name, value); 254 } 255 256 @Override 257 public Base makeProperty(int hash, String name) throws FHIRException { 258 switch (hash) { 259 case -220463842: return getPurpose(); // CodeableConcept 260 case 3373707: return getName(); // HumanName 261 case -1429363305: return addTelecom(); // ContactPoint 262 case -1147692044: return getAddress(); // Address 263 default: return super.makeProperty(hash, name); 264 } 265 266 } 267 268 @Override 269 public Base addChild(String name) throws FHIRException { 270 if (name.equals("purpose")) { 271 this.purpose = new CodeableConcept(); 272 return this.purpose; 273 } 274 else if (name.equals("name")) { 275 this.name = new HumanName(); 276 return this.name; 277 } 278 else if (name.equals("telecom")) { 279 return addTelecom(); 280 } 281 else if (name.equals("address")) { 282 this.address = new Address(); 283 return this.address; 284 } 285 else 286 return super.addChild(name); 287 } 288 289 public OrganizationContactComponent copy() { 290 OrganizationContactComponent dst = new OrganizationContactComponent(); 291 copyValues(dst); 292 dst.purpose = purpose == null ? null : purpose.copy(); 293 dst.name = name == null ? null : name.copy(); 294 if (telecom != null) { 295 dst.telecom = new ArrayList<ContactPoint>(); 296 for (ContactPoint i : telecom) 297 dst.telecom.add(i.copy()); 298 }; 299 dst.address = address == null ? null : address.copy(); 300 return dst; 301 } 302 303 @Override 304 public boolean equalsDeep(Base other) { 305 if (!super.equalsDeep(other)) 306 return false; 307 if (!(other instanceof OrganizationContactComponent)) 308 return false; 309 OrganizationContactComponent o = (OrganizationContactComponent) other; 310 return compareDeep(purpose, o.purpose, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) 311 && compareDeep(address, o.address, true); 312 } 313 314 @Override 315 public boolean equalsShallow(Base other) { 316 if (!super.equalsShallow(other)) 317 return false; 318 if (!(other instanceof OrganizationContactComponent)) 319 return false; 320 OrganizationContactComponent o = (OrganizationContactComponent) other; 321 return true; 322 } 323 324 public boolean isEmpty() { 325 return super.isEmpty() && (purpose == null || purpose.isEmpty()) && (name == null || name.isEmpty()) 326 && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()); 327 } 328 329 public String fhirType() { 330 return "Organization.contact"; 331 332 } 333 334 } 335 336 /** 337 * Identifier for the organization that is used to identify the organization across multiple disparate systems. 338 */ 339 @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 340 @Description(shortDefinition="Identifies this organization across multiple systems", formalDefinition="Identifier for the organization that is used to identify the organization across multiple disparate systems." ) 341 protected List<Identifier> identifier; 342 343 /** 344 * Whether the organization's record is still in active use. 345 */ 346 @Child(name = "active", type = {BooleanType.class}, order=1, min=0, max=1, modifier=true, summary=true) 347 @Description(shortDefinition="Whether the organization's record is still in active use", formalDefinition="Whether the organization's record is still in active use." ) 348 protected BooleanType active; 349 350 /** 351 * The kind of organization that this is. 352 */ 353 @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) 354 @Description(shortDefinition="Kind of organization", formalDefinition="The kind of organization that this is." ) 355 protected CodeableConcept type; 356 357 /** 358 * A name associated with the organization. 359 */ 360 @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) 361 @Description(shortDefinition="Name used for the organization", formalDefinition="A name associated with the organization." ) 362 protected StringType name; 363 364 /** 365 * A contact detail for the organization. 366 */ 367 @Child(name = "telecom", type = {ContactPoint.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 368 @Description(shortDefinition="A contact detail for the organization", formalDefinition="A contact detail for the organization." ) 369 protected List<ContactPoint> telecom; 370 371 /** 372 * An address for the organization. 373 */ 374 @Child(name = "address", type = {Address.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 375 @Description(shortDefinition="An address for the organization", formalDefinition="An address for the organization." ) 376 protected List<Address> address; 377 378 /** 379 * The organization of which this organization forms a part. 380 */ 381 @Child(name = "partOf", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true) 382 @Description(shortDefinition="The organization of which this organization forms a part", formalDefinition="The organization of which this organization forms a part." ) 383 protected Reference partOf; 384 385 /** 386 * The actual object that is the target of the reference (The organization of which this organization forms a part.) 387 */ 388 protected Organization partOfTarget; 389 390 /** 391 * Contact for the organization for a certain purpose. 392 */ 393 @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 394 @Description(shortDefinition="Contact for the organization for a certain purpose", formalDefinition="Contact for the organization for a certain purpose." ) 395 protected List<OrganizationContactComponent> contact; 396 397 private static final long serialVersionUID = -749567123L; 398 399 /** 400 * Constructor 401 */ 402 public Organization() { 403 super(); 404 } 405 406 /** 407 * @return {@link #identifier} (Identifier for the organization that is used to identify the organization across multiple disparate systems.) 408 */ 409 public List<Identifier> getIdentifier() { 410 if (this.identifier == null) 411 this.identifier = new ArrayList<Identifier>(); 412 return this.identifier; 413 } 414 415 public boolean hasIdentifier() { 416 if (this.identifier == null) 417 return false; 418 for (Identifier item : this.identifier) 419 if (!item.isEmpty()) 420 return true; 421 return false; 422 } 423 424 /** 425 * @return {@link #identifier} (Identifier for the organization that is used to identify the organization across multiple disparate systems.) 426 */ 427 // syntactic sugar 428 public Identifier addIdentifier() { //3 429 Identifier t = new Identifier(); 430 if (this.identifier == null) 431 this.identifier = new ArrayList<Identifier>(); 432 this.identifier.add(t); 433 return t; 434 } 435 436 // syntactic sugar 437 public Organization addIdentifier(Identifier t) { //3 438 if (t == null) 439 return this; 440 if (this.identifier == null) 441 this.identifier = new ArrayList<Identifier>(); 442 this.identifier.add(t); 443 return this; 444 } 445 446 /** 447 * @return {@link #active} (Whether the organization's record is still in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value 448 */ 449 public BooleanType getActiveElement() { 450 if (this.active == null) 451 if (Configuration.errorOnAutoCreate()) 452 throw new Error("Attempt to auto-create Organization.active"); 453 else if (Configuration.doAutoCreate()) 454 this.active = new BooleanType(); // bb 455 return this.active; 456 } 457 458 public boolean hasActiveElement() { 459 return this.active != null && !this.active.isEmpty(); 460 } 461 462 public boolean hasActive() { 463 return this.active != null && !this.active.isEmpty(); 464 } 465 466 /** 467 * @param value {@link #active} (Whether the organization's record is still in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value 468 */ 469 public Organization setActiveElement(BooleanType value) { 470 this.active = value; 471 return this; 472 } 473 474 /** 475 * @return Whether the organization's record is still in active use. 476 */ 477 public boolean getActive() { 478 return this.active == null || this.active.isEmpty() ? false : this.active.getValue(); 479 } 480 481 /** 482 * @param value Whether the organization's record is still in active use. 483 */ 484 public Organization setActive(boolean value) { 485 if (this.active == null) 486 this.active = new BooleanType(); 487 this.active.setValue(value); 488 return this; 489 } 490 491 /** 492 * @return {@link #type} (The kind of organization that this is.) 493 */ 494 public CodeableConcept getType() { 495 if (this.type == null) 496 if (Configuration.errorOnAutoCreate()) 497 throw new Error("Attempt to auto-create Organization.type"); 498 else if (Configuration.doAutoCreate()) 499 this.type = new CodeableConcept(); // cc 500 return this.type; 501 } 502 503 public boolean hasType() { 504 return this.type != null && !this.type.isEmpty(); 505 } 506 507 /** 508 * @param value {@link #type} (The kind of organization that this is.) 509 */ 510 public Organization setType(CodeableConcept value) { 511 this.type = value; 512 return this; 513 } 514 515 /** 516 * @return {@link #name} (A name associated with the organization.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 517 */ 518 public StringType getNameElement() { 519 if (this.name == null) 520 if (Configuration.errorOnAutoCreate()) 521 throw new Error("Attempt to auto-create Organization.name"); 522 else if (Configuration.doAutoCreate()) 523 this.name = new StringType(); // bb 524 return this.name; 525 } 526 527 public boolean hasNameElement() { 528 return this.name != null && !this.name.isEmpty(); 529 } 530 531 public boolean hasName() { 532 return this.name != null && !this.name.isEmpty(); 533 } 534 535 /** 536 * @param value {@link #name} (A name associated with the organization.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 537 */ 538 public Organization setNameElement(StringType value) { 539 this.name = value; 540 return this; 541 } 542 543 /** 544 * @return A name associated with the organization. 545 */ 546 public String getName() { 547 return this.name == null ? null : this.name.getValue(); 548 } 549 550 /** 551 * @param value A name associated with the organization. 552 */ 553 public Organization setName(String value) { 554 if (Utilities.noString(value)) 555 this.name = null; 556 else { 557 if (this.name == null) 558 this.name = new StringType(); 559 this.name.setValue(value); 560 } 561 return this; 562 } 563 564 /** 565 * @return {@link #telecom} (A contact detail for the organization.) 566 */ 567 public List<ContactPoint> getTelecom() { 568 if (this.telecom == null) 569 this.telecom = new ArrayList<ContactPoint>(); 570 return this.telecom; 571 } 572 573 public boolean hasTelecom() { 574 if (this.telecom == null) 575 return false; 576 for (ContactPoint item : this.telecom) 577 if (!item.isEmpty()) 578 return true; 579 return false; 580 } 581 582 /** 583 * @return {@link #telecom} (A contact detail for the organization.) 584 */ 585 // syntactic sugar 586 public ContactPoint addTelecom() { //3 587 ContactPoint t = new ContactPoint(); 588 if (this.telecom == null) 589 this.telecom = new ArrayList<ContactPoint>(); 590 this.telecom.add(t); 591 return t; 592 } 593 594 // syntactic sugar 595 public Organization addTelecom(ContactPoint t) { //3 596 if (t == null) 597 return this; 598 if (this.telecom == null) 599 this.telecom = new ArrayList<ContactPoint>(); 600 this.telecom.add(t); 601 return this; 602 } 603 604 /** 605 * @return {@link #address} (An address for the organization.) 606 */ 607 public List<Address> getAddress() { 608 if (this.address == null) 609 this.address = new ArrayList<Address>(); 610 return this.address; 611 } 612 613 public boolean hasAddress() { 614 if (this.address == null) 615 return false; 616 for (Address item : this.address) 617 if (!item.isEmpty()) 618 return true; 619 return false; 620 } 621 622 /** 623 * @return {@link #address} (An address for the organization.) 624 */ 625 // syntactic sugar 626 public Address addAddress() { //3 627 Address t = new Address(); 628 if (this.address == null) 629 this.address = new ArrayList<Address>(); 630 this.address.add(t); 631 return t; 632 } 633 634 // syntactic sugar 635 public Organization addAddress(Address t) { //3 636 if (t == null) 637 return this; 638 if (this.address == null) 639 this.address = new ArrayList<Address>(); 640 this.address.add(t); 641 return this; 642 } 643 644 /** 645 * @return {@link #partOf} (The organization of which this organization forms a part.) 646 */ 647 public Reference getPartOf() { 648 if (this.partOf == null) 649 if (Configuration.errorOnAutoCreate()) 650 throw new Error("Attempt to auto-create Organization.partOf"); 651 else if (Configuration.doAutoCreate()) 652 this.partOf = new Reference(); // cc 653 return this.partOf; 654 } 655 656 public boolean hasPartOf() { 657 return this.partOf != null && !this.partOf.isEmpty(); 658 } 659 660 /** 661 * @param value {@link #partOf} (The organization of which this organization forms a part.) 662 */ 663 public Organization setPartOf(Reference value) { 664 this.partOf = value; 665 return this; 666 } 667 668 /** 669 * @return {@link #partOf} 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 organization of which this organization forms a part.) 670 */ 671 public Organization getPartOfTarget() { 672 if (this.partOfTarget == null) 673 if (Configuration.errorOnAutoCreate()) 674 throw new Error("Attempt to auto-create Organization.partOf"); 675 else if (Configuration.doAutoCreate()) 676 this.partOfTarget = new Organization(); // aa 677 return this.partOfTarget; 678 } 679 680 /** 681 * @param value {@link #partOf} 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 organization of which this organization forms a part.) 682 */ 683 public Organization setPartOfTarget(Organization value) { 684 this.partOfTarget = value; 685 return this; 686 } 687 688 /** 689 * @return {@link #contact} (Contact for the organization for a certain purpose.) 690 */ 691 public List<OrganizationContactComponent> getContact() { 692 if (this.contact == null) 693 this.contact = new ArrayList<OrganizationContactComponent>(); 694 return this.contact; 695 } 696 697 public boolean hasContact() { 698 if (this.contact == null) 699 return false; 700 for (OrganizationContactComponent item : this.contact) 701 if (!item.isEmpty()) 702 return true; 703 return false; 704 } 705 706 /** 707 * @return {@link #contact} (Contact for the organization for a certain purpose.) 708 */ 709 // syntactic sugar 710 public OrganizationContactComponent addContact() { //3 711 OrganizationContactComponent t = new OrganizationContactComponent(); 712 if (this.contact == null) 713 this.contact = new ArrayList<OrganizationContactComponent>(); 714 this.contact.add(t); 715 return t; 716 } 717 718 // syntactic sugar 719 public Organization addContact(OrganizationContactComponent t) { //3 720 if (t == null) 721 return this; 722 if (this.contact == null) 723 this.contact = new ArrayList<OrganizationContactComponent>(); 724 this.contact.add(t); 725 return this; 726 } 727 728 protected void listChildren(List<Property> childrenList) { 729 super.listChildren(childrenList); 730 childrenList.add(new Property("identifier", "Identifier", "Identifier for the organization that is used to identify the organization across multiple disparate systems.", 0, java.lang.Integer.MAX_VALUE, identifier)); 731 childrenList.add(new Property("active", "boolean", "Whether the organization's record is still in active use.", 0, java.lang.Integer.MAX_VALUE, active)); 732 childrenList.add(new Property("type", "CodeableConcept", "The kind of organization that this is.", 0, java.lang.Integer.MAX_VALUE, type)); 733 childrenList.add(new Property("name", "string", "A name associated with the organization.", 0, java.lang.Integer.MAX_VALUE, name)); 734 childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the organization.", 0, java.lang.Integer.MAX_VALUE, telecom)); 735 childrenList.add(new Property("address", "Address", "An address for the organization.", 0, java.lang.Integer.MAX_VALUE, address)); 736 childrenList.add(new Property("partOf", "Reference(Organization)", "The organization of which this organization forms a part.", 0, java.lang.Integer.MAX_VALUE, partOf)); 737 childrenList.add(new Property("contact", "", "Contact for the organization for a certain purpose.", 0, java.lang.Integer.MAX_VALUE, contact)); 738 } 739 740 @Override 741 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 742 switch (hash) { 743 case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier 744 case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType 745 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept 746 case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType 747 case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint 748 case -1147692044: /*address*/ return this.address == null ? new Base[0] : this.address.toArray(new Base[this.address.size()]); // Address 749 case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : new Base[] {this.partOf}; // Reference 750 case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // OrganizationContactComponent 751 default: return super.getProperty(hash, name, checkValid); 752 } 753 754 } 755 756 @Override 757 public void setProperty(int hash, String name, Base value) throws FHIRException { 758 switch (hash) { 759 case -1618432855: // identifier 760 this.getIdentifier().add(castToIdentifier(value)); // Identifier 761 break; 762 case -1422950650: // active 763 this.active = castToBoolean(value); // BooleanType 764 break; 765 case 3575610: // type 766 this.type = castToCodeableConcept(value); // CodeableConcept 767 break; 768 case 3373707: // name 769 this.name = castToString(value); // StringType 770 break; 771 case -1429363305: // telecom 772 this.getTelecom().add(castToContactPoint(value)); // ContactPoint 773 break; 774 case -1147692044: // address 775 this.getAddress().add(castToAddress(value)); // Address 776 break; 777 case -995410646: // partOf 778 this.partOf = castToReference(value); // Reference 779 break; 780 case 951526432: // contact 781 this.getContact().add((OrganizationContactComponent) value); // OrganizationContactComponent 782 break; 783 default: super.setProperty(hash, name, value); 784 } 785 786 } 787 788 @Override 789 public void setProperty(String name, Base value) throws FHIRException { 790 if (name.equals("identifier")) 791 this.getIdentifier().add(castToIdentifier(value)); 792 else if (name.equals("active")) 793 this.active = castToBoolean(value); // BooleanType 794 else if (name.equals("type")) 795 this.type = castToCodeableConcept(value); // CodeableConcept 796 else if (name.equals("name")) 797 this.name = castToString(value); // StringType 798 else if (name.equals("telecom")) 799 this.getTelecom().add(castToContactPoint(value)); 800 else if (name.equals("address")) 801 this.getAddress().add(castToAddress(value)); 802 else if (name.equals("partOf")) 803 this.partOf = castToReference(value); // Reference 804 else if (name.equals("contact")) 805 this.getContact().add((OrganizationContactComponent) value); 806 else 807 super.setProperty(name, value); 808 } 809 810 @Override 811 public Base makeProperty(int hash, String name) throws FHIRException { 812 switch (hash) { 813 case -1618432855: return addIdentifier(); // Identifier 814 case -1422950650: throw new FHIRException("Cannot make property active as it is not a complex type"); // BooleanType 815 case 3575610: return getType(); // CodeableConcept 816 case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType 817 case -1429363305: return addTelecom(); // ContactPoint 818 case -1147692044: return addAddress(); // Address 819 case -995410646: return getPartOf(); // Reference 820 case 951526432: return addContact(); // OrganizationContactComponent 821 default: return super.makeProperty(hash, name); 822 } 823 824 } 825 826 @Override 827 public Base addChild(String name) throws FHIRException { 828 if (name.equals("identifier")) { 829 return addIdentifier(); 830 } 831 else if (name.equals("active")) { 832 throw new FHIRException("Cannot call addChild on a primitive type Organization.active"); 833 } 834 else if (name.equals("type")) { 835 this.type = new CodeableConcept(); 836 return this.type; 837 } 838 else if (name.equals("name")) { 839 throw new FHIRException("Cannot call addChild on a primitive type Organization.name"); 840 } 841 else if (name.equals("telecom")) { 842 return addTelecom(); 843 } 844 else if (name.equals("address")) { 845 return addAddress(); 846 } 847 else if (name.equals("partOf")) { 848 this.partOf = new Reference(); 849 return this.partOf; 850 } 851 else if (name.equals("contact")) { 852 return addContact(); 853 } 854 else 855 return super.addChild(name); 856 } 857 858 public String fhirType() { 859 return "Organization"; 860 861 } 862 863 public Organization copy() { 864 Organization dst = new Organization(); 865 copyValues(dst); 866 if (identifier != null) { 867 dst.identifier = new ArrayList<Identifier>(); 868 for (Identifier i : identifier) 869 dst.identifier.add(i.copy()); 870 }; 871 dst.active = active == null ? null : active.copy(); 872 dst.type = type == null ? null : type.copy(); 873 dst.name = name == null ? null : name.copy(); 874 if (telecom != null) { 875 dst.telecom = new ArrayList<ContactPoint>(); 876 for (ContactPoint i : telecom) 877 dst.telecom.add(i.copy()); 878 }; 879 if (address != null) { 880 dst.address = new ArrayList<Address>(); 881 for (Address i : address) 882 dst.address.add(i.copy()); 883 }; 884 dst.partOf = partOf == null ? null : partOf.copy(); 885 if (contact != null) { 886 dst.contact = new ArrayList<OrganizationContactComponent>(); 887 for (OrganizationContactComponent i : contact) 888 dst.contact.add(i.copy()); 889 }; 890 return dst; 891 } 892 893 protected Organization typedCopy() { 894 return copy(); 895 } 896 897 @Override 898 public boolean equalsDeep(Base other) { 899 if (!super.equalsDeep(other)) 900 return false; 901 if (!(other instanceof Organization)) 902 return false; 903 Organization o = (Organization) other; 904 return compareDeep(identifier, o.identifier, true) && compareDeep(active, o.active, true) && compareDeep(type, o.type, true) 905 && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) && compareDeep(address, o.address, true) 906 && compareDeep(partOf, o.partOf, true) && compareDeep(contact, o.contact, true); 907 } 908 909 @Override 910 public boolean equalsShallow(Base other) { 911 if (!super.equalsShallow(other)) 912 return false; 913 if (!(other instanceof Organization)) 914 return false; 915 Organization o = (Organization) other; 916 return compareValues(active, o.active, true) && compareValues(name, o.name, true); 917 } 918 919 public boolean isEmpty() { 920 return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (active == null || active.isEmpty()) 921 && (type == null || type.isEmpty()) && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) 922 && (address == null || address.isEmpty()) && (partOf == null || partOf.isEmpty()) && (contact == null || contact.isEmpty()) 923 ; 924 } 925 926 @Override 927 public ResourceType getResourceType() { 928 return ResourceType.Organization; 929 } 930 931 /** 932 * Search parameter: <b>address-state</b> 933 * <p> 934 * Description: <b>A state specified in an address</b><br> 935 * Type: <b>string</b><br> 936 * Path: <b>Organization.address.state</b><br> 937 * </p> 938 */ 939 @SearchParamDefinition(name="address-state", path="Organization.address.state", description="A state specified in an address", type="string" ) 940 public static final String SP_ADDRESS_STATE = "address-state"; 941 /** 942 * <b>Fluent Client</b> search parameter constant for <b>address-state</b> 943 * <p> 944 * Description: <b>A state specified in an address</b><br> 945 * Type: <b>string</b><br> 946 * Path: <b>Organization.address.state</b><br> 947 * </p> 948 */ 949 public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_STATE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_STATE); 950 951 /** 952 * Search parameter: <b>address-city</b> 953 * <p> 954 * Description: <b>A city specified in an address</b><br> 955 * Type: <b>string</b><br> 956 * Path: <b>Organization.address.city</b><br> 957 * </p> 958 */ 959 @SearchParamDefinition(name="address-city", path="Organization.address.city", description="A city specified in an address", type="string" ) 960 public static final String SP_ADDRESS_CITY = "address-city"; 961 /** 962 * <b>Fluent Client</b> search parameter constant for <b>address-city</b> 963 * <p> 964 * Description: <b>A city specified in an address</b><br> 965 * Type: <b>string</b><br> 966 * Path: <b>Organization.address.city</b><br> 967 * </p> 968 */ 969 public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_CITY); 970 971 /** 972 * Search parameter: <b>phonetic</b> 973 * <p> 974 * Description: <b>A portion of the organization's name using some kind of phonetic matching algorithm</b><br> 975 * Type: <b>string</b><br> 976 * Path: <b>Organization.name</b><br> 977 * </p> 978 */ 979 @SearchParamDefinition(name="phonetic", path="Organization.name", description="A portion of the organization's name using some kind of phonetic matching algorithm", type="string" ) 980 public static final String SP_PHONETIC = "phonetic"; 981 /** 982 * <b>Fluent Client</b> search parameter constant for <b>phonetic</b> 983 * <p> 984 * Description: <b>A portion of the organization's name using some kind of phonetic matching algorithm</b><br> 985 * Type: <b>string</b><br> 986 * Path: <b>Organization.name</b><br> 987 * </p> 988 */ 989 public static final ca.uhn.fhir.rest.gclient.StringClientParam PHONETIC = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PHONETIC); 990 991 /** 992 * Search parameter: <b>partof</b> 993 * <p> 994 * Description: <b>Search all organizations that are part of the given organization</b><br> 995 * Type: <b>reference</b><br> 996 * Path: <b>Organization.partOf</b><br> 997 * </p> 998 */ 999 @SearchParamDefinition(name="partof", path="Organization.partOf", description="Search all organizations that are part of the given organization", type="reference" ) 1000 public static final String SP_PARTOF = "partof"; 1001 /** 1002 * <b>Fluent Client</b> search parameter constant for <b>partof</b> 1003 * <p> 1004 * Description: <b>Search all organizations that are part of the given organization</b><br> 1005 * Type: <b>reference</b><br> 1006 * Path: <b>Organization.partOf</b><br> 1007 * </p> 1008 */ 1009 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTOF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARTOF); 1010 1011/** 1012 * Constant for fluent queries to be used to add include statements. Specifies 1013 * the path value of "<b>Organization:partof</b>". 1014 */ 1015 public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTOF = new ca.uhn.fhir.model.api.Include("Organization:partof").toLocked(); 1016 1017 /** 1018 * Search parameter: <b>address</b> 1019 * <p> 1020 * Description: <b>A (part of the) address of the Organization</b><br> 1021 * Type: <b>string</b><br> 1022 * Path: <b>Organization.address</b><br> 1023 * </p> 1024 */ 1025 @SearchParamDefinition(name="address", path="Organization.address", description="A (part of the) address of the Organization", type="string" ) 1026 public static final String SP_ADDRESS = "address"; 1027 /** 1028 * <b>Fluent Client</b> search parameter constant for <b>address</b> 1029 * <p> 1030 * Description: <b>A (part of the) address of the Organization</b><br> 1031 * Type: <b>string</b><br> 1032 * Path: <b>Organization.address</b><br> 1033 * </p> 1034 */ 1035 public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS); 1036 1037 /** 1038 * Search parameter: <b>address-use</b> 1039 * <p> 1040 * Description: <b>A use code specified in an address</b><br> 1041 * Type: <b>token</b><br> 1042 * Path: <b>Organization.address.use</b><br> 1043 * </p> 1044 */ 1045 @SearchParamDefinition(name="address-use", path="Organization.address.use", description="A use code specified in an address", type="token" ) 1046 public static final String SP_ADDRESS_USE = "address-use"; 1047 /** 1048 * <b>Fluent Client</b> search parameter constant for <b>address-use</b> 1049 * <p> 1050 * Description: <b>A use code specified in an address</b><br> 1051 * Type: <b>token</b><br> 1052 * Path: <b>Organization.address.use</b><br> 1053 * </p> 1054 */ 1055 public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS_USE); 1056 1057 /** 1058 * Search parameter: <b>name</b> 1059 * <p> 1060 * Description: <b>A portion of the organization's name</b><br> 1061 * Type: <b>string</b><br> 1062 * Path: <b>Organization.name</b><br> 1063 * </p> 1064 */ 1065 @SearchParamDefinition(name="name", path="Organization.name", description="A portion of the organization's name", type="string" ) 1066 public static final String SP_NAME = "name"; 1067 /** 1068 * <b>Fluent Client</b> search parameter constant for <b>name</b> 1069 * <p> 1070 * Description: <b>A portion of the organization's name</b><br> 1071 * Type: <b>string</b><br> 1072 * Path: <b>Organization.name</b><br> 1073 * </p> 1074 */ 1075 public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); 1076 1077 /** 1078 * Search parameter: <b>address-country</b> 1079 * <p> 1080 * Description: <b>A country specified in an address</b><br> 1081 * Type: <b>string</b><br> 1082 * Path: <b>Organization.address.country</b><br> 1083 * </p> 1084 */ 1085 @SearchParamDefinition(name="address-country", path="Organization.address.country", description="A country specified in an address", type="string" ) 1086 public static final String SP_ADDRESS_COUNTRY = "address-country"; 1087 /** 1088 * <b>Fluent Client</b> search parameter constant for <b>address-country</b> 1089 * <p> 1090 * Description: <b>A country specified in an address</b><br> 1091 * Type: <b>string</b><br> 1092 * Path: <b>Organization.address.country</b><br> 1093 * </p> 1094 */ 1095 public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY); 1096 1097 /** 1098 * Search parameter: <b>active</b> 1099 * <p> 1100 * Description: <b>Whether the organization's record is active</b><br> 1101 * Type: <b>token</b><br> 1102 * Path: <b>Organization.active</b><br> 1103 * </p> 1104 */ 1105 @SearchParamDefinition(name="active", path="Organization.active", description="Whether the organization's record is active", type="token" ) 1106 public static final String SP_ACTIVE = "active"; 1107 /** 1108 * <b>Fluent Client</b> search parameter constant for <b>active</b> 1109 * <p> 1110 * Description: <b>Whether the organization's record is active</b><br> 1111 * Type: <b>token</b><br> 1112 * Path: <b>Organization.active</b><br> 1113 * </p> 1114 */ 1115 public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTIVE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTIVE); 1116 1117 /** 1118 * Search parameter: <b>type</b> 1119 * <p> 1120 * Description: <b>A code for the type of organization</b><br> 1121 * Type: <b>token</b><br> 1122 * Path: <b>Organization.type</b><br> 1123 * </p> 1124 */ 1125 @SearchParamDefinition(name="type", path="Organization.type", description="A code for the type of organization", type="token" ) 1126 public static final String SP_TYPE = "type"; 1127 /** 1128 * <b>Fluent Client</b> search parameter constant for <b>type</b> 1129 * <p> 1130 * Description: <b>A code for the type of organization</b><br> 1131 * Type: <b>token</b><br> 1132 * Path: <b>Organization.type</b><br> 1133 * </p> 1134 */ 1135 public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); 1136 1137 /** 1138 * Search parameter: <b>identifier</b> 1139 * <p> 1140 * Description: <b>Any identifier for the organization (not the accreditation issuer's identifier)</b><br> 1141 * Type: <b>token</b><br> 1142 * Path: <b>Organization.identifier</b><br> 1143 * </p> 1144 */ 1145 @SearchParamDefinition(name="identifier", path="Organization.identifier", description="Any identifier for the organization (not the accreditation issuer's identifier)", type="token" ) 1146 public static final String SP_IDENTIFIER = "identifier"; 1147 /** 1148 * <b>Fluent Client</b> search parameter constant for <b>identifier</b> 1149 * <p> 1150 * Description: <b>Any identifier for the organization (not the accreditation issuer's identifier)</b><br> 1151 * Type: <b>token</b><br> 1152 * Path: <b>Organization.identifier</b><br> 1153 * </p> 1154 */ 1155 public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); 1156 1157 /** 1158 * Search parameter: <b>address-postalcode</b> 1159 * <p> 1160 * Description: <b>A postal code specified in an address</b><br> 1161 * Type: <b>string</b><br> 1162 * Path: <b>Organization.address.postalCode</b><br> 1163 * </p> 1164 */ 1165 @SearchParamDefinition(name="address-postalcode", path="Organization.address.postalCode", description="A postal code specified in an address", type="string" ) 1166 public static final String SP_ADDRESS_POSTALCODE = "address-postalcode"; 1167 /** 1168 * <b>Fluent Client</b> search parameter constant for <b>address-postalcode</b> 1169 * <p> 1170 * Description: <b>A postal code specified in an address</b><br> 1171 * Type: <b>string</b><br> 1172 * Path: <b>Organization.address.postalCode</b><br> 1173 * </p> 1174 */ 1175 public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_POSTALCODE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_POSTALCODE); 1176 1177 1178} 1179