001package org.hl7.fhir.r4.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 Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
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/**
047 * A formally or informally recognized grouping of people or organizations
048 * formed for the purpose of achieving some form of collective action. Includes
049 * companies, institutions, corporations, departments, community groups,
050 * healthcare practice groups, payer/insurer, etc.
051 */
052@ResourceDef(name = "Organization", profile = "http://hl7.org/fhir/StructureDefinition/Organization")
053public class Organization extends DomainResource {
054
055  @Block()
056  public static class OrganizationContactComponent extends BackboneElement implements IBaseBackboneElement {
057    /**
058     * Indicates a purpose for which the contact can be reached.
059     */
060    @Child(name = "purpose", type = {
061        CodeableConcept.class }, order = 1, min = 0, max = 1, modifier = false, summary = false)
062    @Description(shortDefinition = "The type of contact", formalDefinition = "Indicates a purpose for which the contact can be reached.")
063    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/contactentity-type")
064    protected CodeableConcept purpose;
065
066    /**
067     * A name associated with the contact.
068     */
069    @Child(name = "name", type = { HumanName.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
070    @Description(shortDefinition = "A name associated with the contact", formalDefinition = "A name associated with the contact.")
071    protected HumanName name;
072
073    /**
074     * A contact detail (e.g. a telephone number or an email address) by which the
075     * party may be contacted.
076     */
077    @Child(name = "telecom", type = {
078        ContactPoint.class }, order = 3, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
079    @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.")
080    protected List<ContactPoint> telecom;
081
082    /**
083     * Visiting or postal addresses for the contact.
084     */
085    @Child(name = "address", type = { Address.class }, order = 4, min = 0, max = 1, modifier = false, summary = false)
086    @Description(shortDefinition = "Visiting or postal addresses for the contact", formalDefinition = "Visiting or postal addresses for the contact.")
087    protected Address address;
088
089    private static final long serialVersionUID = 1831121305L;
090
091    /**
092     * Constructor
093     */
094    public OrganizationContactComponent() {
095      super();
096    }
097
098    /**
099     * @return {@link #purpose} (Indicates a purpose for which the contact can be
100     *         reached.)
101     */
102    public CodeableConcept getPurpose() {
103      if (this.purpose == null)
104        if (Configuration.errorOnAutoCreate())
105          throw new Error("Attempt to auto-create OrganizationContactComponent.purpose");
106        else if (Configuration.doAutoCreate())
107          this.purpose = new CodeableConcept(); // cc
108      return this.purpose;
109    }
110
111    public boolean hasPurpose() {
112      return this.purpose != null && !this.purpose.isEmpty();
113    }
114
115    /**
116     * @param value {@link #purpose} (Indicates a purpose for which the contact can
117     *              be reached.)
118     */
119    public OrganizationContactComponent setPurpose(CodeableConcept value) {
120      this.purpose = value;
121      return this;
122    }
123
124    /**
125     * @return {@link #name} (A name associated with the contact.)
126     */
127    public HumanName getName() {
128      if (this.name == null)
129        if (Configuration.errorOnAutoCreate())
130          throw new Error("Attempt to auto-create OrganizationContactComponent.name");
131        else if (Configuration.doAutoCreate())
132          this.name = new HumanName(); // cc
133      return this.name;
134    }
135
136    public boolean hasName() {
137      return this.name != null && !this.name.isEmpty();
138    }
139
140    /**
141     * @param value {@link #name} (A name associated with the contact.)
142     */
143    public OrganizationContactComponent setName(HumanName value) {
144      this.name = value;
145      return this;
146    }
147
148    /**
149     * @return {@link #telecom} (A contact detail (e.g. a telephone number or an
150     *         email address) by which the party may be contacted.)
151     */
152    public List<ContactPoint> getTelecom() {
153      if (this.telecom == null)
154        this.telecom = new ArrayList<ContactPoint>();
155      return this.telecom;
156    }
157
158    /**
159     * @return Returns a reference to <code>this</code> for easy method chaining
160     */
161    public OrganizationContactComponent setTelecom(List<ContactPoint> theTelecom) {
162      this.telecom = theTelecom;
163      return this;
164    }
165
166    public boolean hasTelecom() {
167      if (this.telecom == null)
168        return false;
169      for (ContactPoint item : this.telecom)
170        if (!item.isEmpty())
171          return true;
172      return false;
173    }
174
175    public ContactPoint addTelecom() { // 3
176      ContactPoint t = new ContactPoint();
177      if (this.telecom == null)
178        this.telecom = new ArrayList<ContactPoint>();
179      this.telecom.add(t);
180      return t;
181    }
182
183    public OrganizationContactComponent addTelecom(ContactPoint t) { // 3
184      if (t == null)
185        return this;
186      if (this.telecom == null)
187        this.telecom = new ArrayList<ContactPoint>();
188      this.telecom.add(t);
189      return this;
190    }
191
192    /**
193     * @return The first repetition of repeating field {@link #telecom}, creating it
194     *         if it does not already exist
195     */
196    public ContactPoint getTelecomFirstRep() {
197      if (getTelecom().isEmpty()) {
198        addTelecom();
199      }
200      return getTelecom().get(0);
201    }
202
203    /**
204     * @return {@link #address} (Visiting or postal addresses for the contact.)
205     */
206    public Address getAddress() {
207      if (this.address == null)
208        if (Configuration.errorOnAutoCreate())
209          throw new Error("Attempt to auto-create OrganizationContactComponent.address");
210        else if (Configuration.doAutoCreate())
211          this.address = new Address(); // cc
212      return this.address;
213    }
214
215    public boolean hasAddress() {
216      return this.address != null && !this.address.isEmpty();
217    }
218
219    /**
220     * @param value {@link #address} (Visiting or postal addresses for the contact.)
221     */
222    public OrganizationContactComponent setAddress(Address value) {
223      this.address = value;
224      return this;
225    }
226
227    protected void listChildren(List<Property> children) {
228      super.listChildren(children);
229      children.add(new Property("purpose", "CodeableConcept",
230          "Indicates a purpose for which the contact can be reached.", 0, 1, purpose));
231      children.add(new Property("name", "HumanName", "A name associated with the contact.", 0, 1, name));
232      children.add(new Property("telecom", "ContactPoint",
233          "A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.", 0,
234          java.lang.Integer.MAX_VALUE, telecom));
235      children.add(new Property("address", "Address", "Visiting or postal addresses for the contact.", 0, 1, address));
236    }
237
238    @Override
239    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
240      switch (_hash) {
241      case -220463842:
242        /* purpose */ return new Property("purpose", "CodeableConcept",
243            "Indicates a purpose for which the contact can be reached.", 0, 1, purpose);
244      case 3373707:
245        /* name */ return new Property("name", "HumanName", "A name associated with the contact.", 0, 1, name);
246      case -1429363305:
247        /* telecom */ return new Property("telecom", "ContactPoint",
248            "A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.", 0,
249            java.lang.Integer.MAX_VALUE, telecom);
250      case -1147692044:
251        /* address */ return new Property("address", "Address", "Visiting or postal addresses for the contact.", 0, 1,
252            address);
253      default:
254        return super.getNamedProperty(_hash, _name, _checkValid);
255      }
256
257    }
258
259    @Override
260    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
261      switch (hash) {
262      case -220463842:
263        /* purpose */ return this.purpose == null ? new Base[0] : new Base[] { this.purpose }; // CodeableConcept
264      case 3373707:
265        /* name */ return this.name == null ? new Base[0] : new Base[] { this.name }; // HumanName
266      case -1429363305:
267        /* telecom */ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint
268      case -1147692044:
269        /* address */ return this.address == null ? new Base[0] : new Base[] { this.address }; // Address
270      default:
271        return super.getProperty(hash, name, checkValid);
272      }
273
274    }
275
276    @Override
277    public Base setProperty(int hash, String name, Base value) throws FHIRException {
278      switch (hash) {
279      case -220463842: // purpose
280        this.purpose = castToCodeableConcept(value); // CodeableConcept
281        return value;
282      case 3373707: // name
283        this.name = castToHumanName(value); // HumanName
284        return value;
285      case -1429363305: // telecom
286        this.getTelecom().add(castToContactPoint(value)); // ContactPoint
287        return value;
288      case -1147692044: // address
289        this.address = castToAddress(value); // Address
290        return value;
291      default:
292        return super.setProperty(hash, name, value);
293      }
294
295    }
296
297    @Override
298    public Base setProperty(String name, Base value) throws FHIRException {
299      if (name.equals("purpose")) {
300        this.purpose = castToCodeableConcept(value); // CodeableConcept
301      } else if (name.equals("name")) {
302        this.name = castToHumanName(value); // HumanName
303      } else if (name.equals("telecom")) {
304        this.getTelecom().add(castToContactPoint(value));
305      } else if (name.equals("address")) {
306        this.address = castToAddress(value); // Address
307      } else
308        return super.setProperty(name, value);
309      return value;
310    }
311
312  @Override
313  public void removeChild(String name, Base value) throws FHIRException {
314      if (name.equals("purpose")) {
315        this.purpose = null;
316      } else if (name.equals("name")) {
317        this.name = null;
318      } else if (name.equals("telecom")) {
319        this.getTelecom().remove(castToContactPoint(value));
320      } else if (name.equals("address")) {
321        this.address = null;
322      } else
323        super.removeChild(name, value);
324      
325    }
326
327    @Override
328    public Base makeProperty(int hash, String name) throws FHIRException {
329      switch (hash) {
330      case -220463842:
331        return getPurpose();
332      case 3373707:
333        return getName();
334      case -1429363305:
335        return addTelecom();
336      case -1147692044:
337        return getAddress();
338      default:
339        return super.makeProperty(hash, name);
340      }
341
342    }
343
344    @Override
345    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
346      switch (hash) {
347      case -220463842:
348        /* purpose */ return new String[] { "CodeableConcept" };
349      case 3373707:
350        /* name */ return new String[] { "HumanName" };
351      case -1429363305:
352        /* telecom */ return new String[] { "ContactPoint" };
353      case -1147692044:
354        /* address */ return new String[] { "Address" };
355      default:
356        return super.getTypesForProperty(hash, name);
357      }
358
359    }
360
361    @Override
362    public Base addChild(String name) throws FHIRException {
363      if (name.equals("purpose")) {
364        this.purpose = new CodeableConcept();
365        return this.purpose;
366      } else if (name.equals("name")) {
367        this.name = new HumanName();
368        return this.name;
369      } else if (name.equals("telecom")) {
370        return addTelecom();
371      } else if (name.equals("address")) {
372        this.address = new Address();
373        return this.address;
374      } else
375        return super.addChild(name);
376    }
377
378    public OrganizationContactComponent copy() {
379      OrganizationContactComponent dst = new OrganizationContactComponent();
380      copyValues(dst);
381      return dst;
382    }
383
384    public void copyValues(OrganizationContactComponent dst) {
385      super.copyValues(dst);
386      dst.purpose = purpose == null ? null : purpose.copy();
387      dst.name = name == null ? null : name.copy();
388      if (telecom != null) {
389        dst.telecom = new ArrayList<ContactPoint>();
390        for (ContactPoint i : telecom)
391          dst.telecom.add(i.copy());
392      }
393      ;
394      dst.address = address == null ? null : address.copy();
395    }
396
397    @Override
398    public boolean equalsDeep(Base other_) {
399      if (!super.equalsDeep(other_))
400        return false;
401      if (!(other_ instanceof OrganizationContactComponent))
402        return false;
403      OrganizationContactComponent o = (OrganizationContactComponent) other_;
404      return compareDeep(purpose, o.purpose, true) && compareDeep(name, o.name, true)
405          && compareDeep(telecom, o.telecom, true) && compareDeep(address, o.address, true);
406    }
407
408    @Override
409    public boolean equalsShallow(Base other_) {
410      if (!super.equalsShallow(other_))
411        return false;
412      if (!(other_ instanceof OrganizationContactComponent))
413        return false;
414      OrganizationContactComponent o = (OrganizationContactComponent) other_;
415      return true;
416    }
417
418    public boolean isEmpty() {
419      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(purpose, name, telecom, address);
420    }
421
422    public String fhirType() {
423      return "Organization.contact";
424
425    }
426
427  }
428
429  /**
430   * Identifier for the organization that is used to identify the organization
431   * across multiple disparate systems.
432   */
433  @Child(name = "identifier", type = {
434      Identifier.class }, order = 0, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
435  @Description(shortDefinition = "Identifies this organization  across multiple systems", formalDefinition = "Identifier for the organization that is used to identify the organization across multiple disparate systems.")
436  protected List<Identifier> identifier;
437
438  /**
439   * Whether the organization's record is still in active use.
440   */
441  @Child(name = "active", type = { BooleanType.class }, order = 1, min = 0, max = 1, modifier = true, summary = true)
442  @Description(shortDefinition = "Whether the organization's record is still in active use", formalDefinition = "Whether the organization's record is still in active use.")
443  protected BooleanType active;
444
445  /**
446   * The kind(s) of organization that this is.
447   */
448  @Child(name = "type", type = {
449      CodeableConcept.class }, order = 2, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
450  @Description(shortDefinition = "Kind of organization", formalDefinition = "The kind(s) of organization that this is.")
451  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/organization-type")
452  protected List<CodeableConcept> type;
453
454  /**
455   * A name associated with the organization.
456   */
457  @Child(name = "name", type = { StringType.class }, order = 3, min = 0, max = 1, modifier = false, summary = true)
458  @Description(shortDefinition = "Name used for the organization", formalDefinition = "A name associated with the organization.")
459  protected StringType name;
460
461  /**
462   * A list of alternate names that the organization is known as, or was known as
463   * in the past.
464   */
465  @Child(name = "alias", type = {
466      StringType.class }, order = 4, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
467  @Description(shortDefinition = "A list of alternate names that the organization is known as, or was known as in the past", formalDefinition = "A list of alternate names that the organization is known as, or was known as in the past.")
468  protected List<StringType> alias;
469
470  /**
471   * A contact detail for the organization.
472   */
473  @Child(name = "telecom", type = {
474      ContactPoint.class }, order = 5, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
475  @Description(shortDefinition = "A contact detail for the organization", formalDefinition = "A contact detail for the organization.")
476  protected List<ContactPoint> telecom;
477
478  /**
479   * An address for the organization.
480   */
481  @Child(name = "address", type = {
482      Address.class }, order = 6, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
483  @Description(shortDefinition = "An address for the organization", formalDefinition = "An address for the organization.")
484  protected List<Address> address;
485
486  /**
487   * The organization of which this organization forms a part.
488   */
489  @Child(name = "partOf", type = { Organization.class }, order = 7, min = 0, max = 1, modifier = false, summary = true)
490  @Description(shortDefinition = "The organization of which this organization forms a part", formalDefinition = "The organization of which this organization forms a part.")
491  protected Reference partOf;
492
493  /**
494   * The actual object that is the target of the reference (The organization of
495   * which this organization forms a part.)
496   */
497  protected Organization partOfTarget;
498
499  /**
500   * Contact for the organization for a certain purpose.
501   */
502  @Child(name = "contact", type = {}, order = 8, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
503  @Description(shortDefinition = "Contact for the organization for a certain purpose", formalDefinition = "Contact for the organization for a certain purpose.")
504  protected List<OrganizationContactComponent> contact;
505
506  /**
507   * Technical endpoints providing access to services operated for the
508   * organization.
509   */
510  @Child(name = "endpoint", type = {
511      Endpoint.class }, order = 9, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
512  @Description(shortDefinition = "Technical endpoints providing access to services operated for the organization", formalDefinition = "Technical endpoints providing access to services operated for the organization.")
513  protected List<Reference> endpoint;
514  /**
515   * The actual objects that are the target of the reference (Technical endpoints
516   * providing access to services operated for the organization.)
517   */
518  protected List<Endpoint> endpointTarget;
519
520  private static final long serialVersionUID = -2113244111L;
521
522  /**
523   * Constructor
524   */
525  public Organization() {
526    super();
527  }
528
529  /**
530   * @return {@link #identifier} (Identifier for the organization that is used to
531   *         identify the organization across multiple disparate systems.)
532   */
533  public List<Identifier> getIdentifier() {
534    if (this.identifier == null)
535      this.identifier = new ArrayList<Identifier>();
536    return this.identifier;
537  }
538
539  /**
540   * @return Returns a reference to <code>this</code> for easy method chaining
541   */
542  public Organization setIdentifier(List<Identifier> theIdentifier) {
543    this.identifier = theIdentifier;
544    return this;
545  }
546
547  public boolean hasIdentifier() {
548    if (this.identifier == null)
549      return false;
550    for (Identifier item : this.identifier)
551      if (!item.isEmpty())
552        return true;
553    return false;
554  }
555
556  public Identifier addIdentifier() { // 3
557    Identifier t = new Identifier();
558    if (this.identifier == null)
559      this.identifier = new ArrayList<Identifier>();
560    this.identifier.add(t);
561    return t;
562  }
563
564  public Organization addIdentifier(Identifier t) { // 3
565    if (t == null)
566      return this;
567    if (this.identifier == null)
568      this.identifier = new ArrayList<Identifier>();
569    this.identifier.add(t);
570    return this;
571  }
572
573  /**
574   * @return The first repetition of repeating field {@link #identifier}, creating
575   *         it if it does not already exist
576   */
577  public Identifier getIdentifierFirstRep() {
578    if (getIdentifier().isEmpty()) {
579      addIdentifier();
580    }
581    return getIdentifier().get(0);
582  }
583
584  /**
585   * @return {@link #active} (Whether the organization's record is still in active
586   *         use.). This is the underlying object with id, value and extensions.
587   *         The accessor "getActive" gives direct access to the value
588   */
589  public BooleanType getActiveElement() {
590    if (this.active == null)
591      if (Configuration.errorOnAutoCreate())
592        throw new Error("Attempt to auto-create Organization.active");
593      else if (Configuration.doAutoCreate())
594        this.active = new BooleanType(); // bb
595    return this.active;
596  }
597
598  public boolean hasActiveElement() {
599    return this.active != null && !this.active.isEmpty();
600  }
601
602  public boolean hasActive() {
603    return this.active != null && !this.active.isEmpty();
604  }
605
606  /**
607   * @param value {@link #active} (Whether the organization's record is still in
608   *              active use.). This is the underlying object with id, value and
609   *              extensions. The accessor "getActive" gives direct access to the
610   *              value
611   */
612  public Organization setActiveElement(BooleanType value) {
613    this.active = value;
614    return this;
615  }
616
617  /**
618   * @return Whether the organization's record is still in active use.
619   */
620  public boolean getActive() {
621    return this.active == null || this.active.isEmpty() ? false : this.active.getValue();
622  }
623
624  /**
625   * @param value Whether the organization's record is still in active use.
626   */
627  public Organization setActive(boolean value) {
628    if (this.active == null)
629      this.active = new BooleanType();
630    this.active.setValue(value);
631    return this;
632  }
633
634  /**
635   * @return {@link #type} (The kind(s) of organization that this is.)
636   */
637  public List<CodeableConcept> getType() {
638    if (this.type == null)
639      this.type = new ArrayList<CodeableConcept>();
640    return this.type;
641  }
642
643  /**
644   * @return Returns a reference to <code>this</code> for easy method chaining
645   */
646  public Organization setType(List<CodeableConcept> theType) {
647    this.type = theType;
648    return this;
649  }
650
651  public boolean hasType() {
652    if (this.type == null)
653      return false;
654    for (CodeableConcept item : this.type)
655      if (!item.isEmpty())
656        return true;
657    return false;
658  }
659
660  public CodeableConcept addType() { // 3
661    CodeableConcept t = new CodeableConcept();
662    if (this.type == null)
663      this.type = new ArrayList<CodeableConcept>();
664    this.type.add(t);
665    return t;
666  }
667
668  public Organization addType(CodeableConcept t) { // 3
669    if (t == null)
670      return this;
671    if (this.type == null)
672      this.type = new ArrayList<CodeableConcept>();
673    this.type.add(t);
674    return this;
675  }
676
677  /**
678   * @return The first repetition of repeating field {@link #type}, creating it if
679   *         it does not already exist
680   */
681  public CodeableConcept getTypeFirstRep() {
682    if (getType().isEmpty()) {
683      addType();
684    }
685    return getType().get(0);
686  }
687
688  /**
689   * @return {@link #name} (A name associated with the organization.). This is the
690   *         underlying object with id, value and extensions. The accessor
691   *         "getName" gives direct access to the value
692   */
693  public StringType getNameElement() {
694    if (this.name == null)
695      if (Configuration.errorOnAutoCreate())
696        throw new Error("Attempt to auto-create Organization.name");
697      else if (Configuration.doAutoCreate())
698        this.name = new StringType(); // bb
699    return this.name;
700  }
701
702  public boolean hasNameElement() {
703    return this.name != null && !this.name.isEmpty();
704  }
705
706  public boolean hasName() {
707    return this.name != null && !this.name.isEmpty();
708  }
709
710  /**
711   * @param value {@link #name} (A name associated with the organization.). This
712   *              is the underlying object with id, value and extensions. The
713   *              accessor "getName" gives direct access to the value
714   */
715  public Organization setNameElement(StringType value) {
716    this.name = value;
717    return this;
718  }
719
720  /**
721   * @return A name associated with the organization.
722   */
723  public String getName() {
724    return this.name == null ? null : this.name.getValue();
725  }
726
727  /**
728   * @param value A name associated with the organization.
729   */
730  public Organization setName(String value) {
731    if (Utilities.noString(value))
732      this.name = null;
733    else {
734      if (this.name == null)
735        this.name = new StringType();
736      this.name.setValue(value);
737    }
738    return this;
739  }
740
741  /**
742   * @return {@link #alias} (A list of alternate names that the organization is
743   *         known as, or was known as in the past.)
744   */
745  public List<StringType> getAlias() {
746    if (this.alias == null)
747      this.alias = new ArrayList<StringType>();
748    return this.alias;
749  }
750
751  /**
752   * @return Returns a reference to <code>this</code> for easy method chaining
753   */
754  public Organization setAlias(List<StringType> theAlias) {
755    this.alias = theAlias;
756    return this;
757  }
758
759  public boolean hasAlias() {
760    if (this.alias == null)
761      return false;
762    for (StringType item : this.alias)
763      if (!item.isEmpty())
764        return true;
765    return false;
766  }
767
768  /**
769   * @return {@link #alias} (A list of alternate names that the organization is
770   *         known as, or was known as in the past.)
771   */
772  public StringType addAliasElement() {// 2
773    StringType t = new StringType();
774    if (this.alias == null)
775      this.alias = new ArrayList<StringType>();
776    this.alias.add(t);
777    return t;
778  }
779
780  /**
781   * @param value {@link #alias} (A list of alternate names that the organization
782   *              is known as, or was known as in the past.)
783   */
784  public Organization addAlias(String value) { // 1
785    StringType t = new StringType();
786    t.setValue(value);
787    if (this.alias == null)
788      this.alias = new ArrayList<StringType>();
789    this.alias.add(t);
790    return this;
791  }
792
793  /**
794   * @param value {@link #alias} (A list of alternate names that the organization
795   *              is known as, or was known as in the past.)
796   */
797  public boolean hasAlias(String value) {
798    if (this.alias == null)
799      return false;
800    for (StringType v : this.alias)
801      if (v.getValue().equals(value)) // string
802        return true;
803    return false;
804  }
805
806  /**
807   * @return {@link #telecom} (A contact detail for the organization.)
808   */
809  public List<ContactPoint> getTelecom() {
810    if (this.telecom == null)
811      this.telecom = new ArrayList<ContactPoint>();
812    return this.telecom;
813  }
814
815  /**
816   * @return Returns a reference to <code>this</code> for easy method chaining
817   */
818  public Organization setTelecom(List<ContactPoint> theTelecom) {
819    this.telecom = theTelecom;
820    return this;
821  }
822
823  public boolean hasTelecom() {
824    if (this.telecom == null)
825      return false;
826    for (ContactPoint item : this.telecom)
827      if (!item.isEmpty())
828        return true;
829    return false;
830  }
831
832  public ContactPoint addTelecom() { // 3
833    ContactPoint t = new ContactPoint();
834    if (this.telecom == null)
835      this.telecom = new ArrayList<ContactPoint>();
836    this.telecom.add(t);
837    return t;
838  }
839
840  public Organization addTelecom(ContactPoint t) { // 3
841    if (t == null)
842      return this;
843    if (this.telecom == null)
844      this.telecom = new ArrayList<ContactPoint>();
845    this.telecom.add(t);
846    return this;
847  }
848
849  /**
850   * @return The first repetition of repeating field {@link #telecom}, creating it
851   *         if it does not already exist
852   */
853  public ContactPoint getTelecomFirstRep() {
854    if (getTelecom().isEmpty()) {
855      addTelecom();
856    }
857    return getTelecom().get(0);
858  }
859
860  /**
861   * @return {@link #address} (An address for the organization.)
862   */
863  public List<Address> getAddress() {
864    if (this.address == null)
865      this.address = new ArrayList<Address>();
866    return this.address;
867  }
868
869  /**
870   * @return Returns a reference to <code>this</code> for easy method chaining
871   */
872  public Organization setAddress(List<Address> theAddress) {
873    this.address = theAddress;
874    return this;
875  }
876
877  public boolean hasAddress() {
878    if (this.address == null)
879      return false;
880    for (Address item : this.address)
881      if (!item.isEmpty())
882        return true;
883    return false;
884  }
885
886  public Address addAddress() { // 3
887    Address t = new Address();
888    if (this.address == null)
889      this.address = new ArrayList<Address>();
890    this.address.add(t);
891    return t;
892  }
893
894  public Organization addAddress(Address t) { // 3
895    if (t == null)
896      return this;
897    if (this.address == null)
898      this.address = new ArrayList<Address>();
899    this.address.add(t);
900    return this;
901  }
902
903  /**
904   * @return The first repetition of repeating field {@link #address}, creating it
905   *         if it does not already exist
906   */
907  public Address getAddressFirstRep() {
908    if (getAddress().isEmpty()) {
909      addAddress();
910    }
911    return getAddress().get(0);
912  }
913
914  /**
915   * @return {@link #partOf} (The organization of which this organization forms a
916   *         part.)
917   */
918  public Reference getPartOf() {
919    if (this.partOf == null)
920      if (Configuration.errorOnAutoCreate())
921        throw new Error("Attempt to auto-create Organization.partOf");
922      else if (Configuration.doAutoCreate())
923        this.partOf = new Reference(); // cc
924    return this.partOf;
925  }
926
927  public boolean hasPartOf() {
928    return this.partOf != null && !this.partOf.isEmpty();
929  }
930
931  /**
932   * @param value {@link #partOf} (The organization of which this organization
933   *              forms a part.)
934   */
935  public Organization setPartOf(Reference value) {
936    this.partOf = value;
937    return this;
938  }
939
940  /**
941   * @return {@link #partOf} The actual object that is the target of the
942   *         reference. The reference library doesn't populate this, but you can
943   *         use it to hold the resource if you resolve it. (The organization of
944   *         which this organization forms a part.)
945   */
946  public Organization getPartOfTarget() {
947    if (this.partOfTarget == null)
948      if (Configuration.errorOnAutoCreate())
949        throw new Error("Attempt to auto-create Organization.partOf");
950      else if (Configuration.doAutoCreate())
951        this.partOfTarget = new Organization(); // aa
952    return this.partOfTarget;
953  }
954
955  /**
956   * @param value {@link #partOf} The actual object that is the target of the
957   *              reference. The reference library doesn't use these, but you can
958   *              use it to hold the resource if you resolve it. (The organization
959   *              of which this organization forms a part.)
960   */
961  public Organization setPartOfTarget(Organization value) {
962    this.partOfTarget = value;
963    return this;
964  }
965
966  /**
967   * @return {@link #contact} (Contact for the organization for a certain
968   *         purpose.)
969   */
970  public List<OrganizationContactComponent> getContact() {
971    if (this.contact == null)
972      this.contact = new ArrayList<OrganizationContactComponent>();
973    return this.contact;
974  }
975
976  /**
977   * @return Returns a reference to <code>this</code> for easy method chaining
978   */
979  public Organization setContact(List<OrganizationContactComponent> theContact) {
980    this.contact = theContact;
981    return this;
982  }
983
984  public boolean hasContact() {
985    if (this.contact == null)
986      return false;
987    for (OrganizationContactComponent item : this.contact)
988      if (!item.isEmpty())
989        return true;
990    return false;
991  }
992
993  public OrganizationContactComponent addContact() { // 3
994    OrganizationContactComponent t = new OrganizationContactComponent();
995    if (this.contact == null)
996      this.contact = new ArrayList<OrganizationContactComponent>();
997    this.contact.add(t);
998    return t;
999  }
1000
1001  public Organization addContact(OrganizationContactComponent t) { // 3
1002    if (t == null)
1003      return this;
1004    if (this.contact == null)
1005      this.contact = new ArrayList<OrganizationContactComponent>();
1006    this.contact.add(t);
1007    return this;
1008  }
1009
1010  /**
1011   * @return The first repetition of repeating field {@link #contact}, creating it
1012   *         if it does not already exist
1013   */
1014  public OrganizationContactComponent getContactFirstRep() {
1015    if (getContact().isEmpty()) {
1016      addContact();
1017    }
1018    return getContact().get(0);
1019  }
1020
1021  /**
1022   * @return {@link #endpoint} (Technical endpoints providing access to services
1023   *         operated for the organization.)
1024   */
1025  public List<Reference> getEndpoint() {
1026    if (this.endpoint == null)
1027      this.endpoint = new ArrayList<Reference>();
1028    return this.endpoint;
1029  }
1030
1031  /**
1032   * @return Returns a reference to <code>this</code> for easy method chaining
1033   */
1034  public Organization setEndpoint(List<Reference> theEndpoint) {
1035    this.endpoint = theEndpoint;
1036    return this;
1037  }
1038
1039  public boolean hasEndpoint() {
1040    if (this.endpoint == null)
1041      return false;
1042    for (Reference item : this.endpoint)
1043      if (!item.isEmpty())
1044        return true;
1045    return false;
1046  }
1047
1048  public Reference addEndpoint() { // 3
1049    Reference t = new Reference();
1050    if (this.endpoint == null)
1051      this.endpoint = new ArrayList<Reference>();
1052    this.endpoint.add(t);
1053    return t;
1054  }
1055
1056  public Organization addEndpoint(Reference t) { // 3
1057    if (t == null)
1058      return this;
1059    if (this.endpoint == null)
1060      this.endpoint = new ArrayList<Reference>();
1061    this.endpoint.add(t);
1062    return this;
1063  }
1064
1065  /**
1066   * @return The first repetition of repeating field {@link #endpoint}, creating
1067   *         it if it does not already exist
1068   */
1069  public Reference getEndpointFirstRep() {
1070    if (getEndpoint().isEmpty()) {
1071      addEndpoint();
1072    }
1073    return getEndpoint().get(0);
1074  }
1075
1076  /**
1077   * @deprecated Use Reference#setResource(IBaseResource) instead
1078   */
1079  @Deprecated
1080  public List<Endpoint> getEndpointTarget() {
1081    if (this.endpointTarget == null)
1082      this.endpointTarget = new ArrayList<Endpoint>();
1083    return this.endpointTarget;
1084  }
1085
1086  /**
1087   * @deprecated Use Reference#setResource(IBaseResource) instead
1088   */
1089  @Deprecated
1090  public Endpoint addEndpointTarget() {
1091    Endpoint r = new Endpoint();
1092    if (this.endpointTarget == null)
1093      this.endpointTarget = new ArrayList<Endpoint>();
1094    this.endpointTarget.add(r);
1095    return r;
1096  }
1097
1098  protected void listChildren(List<Property> children) {
1099    super.listChildren(children);
1100    children.add(new Property("identifier", "Identifier",
1101        "Identifier for the organization that is used to identify the organization across multiple disparate systems.",
1102        0, java.lang.Integer.MAX_VALUE, identifier));
1103    children.add(
1104        new Property("active", "boolean", "Whether the organization's record is still in active use.", 0, 1, active));
1105    children.add(new Property("type", "CodeableConcept", "The kind(s) of organization that this is.", 0,
1106        java.lang.Integer.MAX_VALUE, type));
1107    children.add(new Property("name", "string", "A name associated with the organization.", 0, 1, name));
1108    children.add(new Property("alias", "string",
1109        "A list of alternate names that the organization is known as, or was known as in the past.", 0,
1110        java.lang.Integer.MAX_VALUE, alias));
1111    children.add(new Property("telecom", "ContactPoint", "A contact detail for the organization.", 0,
1112        java.lang.Integer.MAX_VALUE, telecom));
1113    children.add(new Property("address", "Address", "An address for the organization.", 0, java.lang.Integer.MAX_VALUE,
1114        address));
1115    children.add(new Property("partOf", "Reference(Organization)",
1116        "The organization of which this organization forms a part.", 0, 1, partOf));
1117    children.add(new Property("contact", "", "Contact for the organization for a certain purpose.", 0,
1118        java.lang.Integer.MAX_VALUE, contact));
1119    children.add(new Property("endpoint", "Reference(Endpoint)",
1120        "Technical endpoints providing access to services operated for the organization.", 0,
1121        java.lang.Integer.MAX_VALUE, endpoint));
1122  }
1123
1124  @Override
1125  public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1126    switch (_hash) {
1127    case -1618432855:
1128      /* identifier */ return new Property("identifier", "Identifier",
1129          "Identifier for the organization that is used to identify the organization across multiple disparate systems.",
1130          0, java.lang.Integer.MAX_VALUE, identifier);
1131    case -1422950650:
1132      /* active */ return new Property("active", "boolean", "Whether the organization's record is still in active use.",
1133          0, 1, active);
1134    case 3575610:
1135      /* type */ return new Property("type", "CodeableConcept", "The kind(s) of organization that this is.", 0,
1136          java.lang.Integer.MAX_VALUE, type);
1137    case 3373707:
1138      /* name */ return new Property("name", "string", "A name associated with the organization.", 0, 1, name);
1139    case 92902992:
1140      /* alias */ return new Property("alias", "string",
1141          "A list of alternate names that the organization is known as, or was known as in the past.", 0,
1142          java.lang.Integer.MAX_VALUE, alias);
1143    case -1429363305:
1144      /* telecom */ return new Property("telecom", "ContactPoint", "A contact detail for the organization.", 0,
1145          java.lang.Integer.MAX_VALUE, telecom);
1146    case -1147692044:
1147      /* address */ return new Property("address", "Address", "An address for the organization.", 0,
1148          java.lang.Integer.MAX_VALUE, address);
1149    case -995410646:
1150      /* partOf */ return new Property("partOf", "Reference(Organization)",
1151          "The organization of which this organization forms a part.", 0, 1, partOf);
1152    case 951526432:
1153      /* contact */ return new Property("contact", "", "Contact for the organization for a certain purpose.", 0,
1154          java.lang.Integer.MAX_VALUE, contact);
1155    case 1741102485:
1156      /* endpoint */ return new Property("endpoint", "Reference(Endpoint)",
1157          "Technical endpoints providing access to services operated for the organization.", 0,
1158          java.lang.Integer.MAX_VALUE, endpoint);
1159    default:
1160      return super.getNamedProperty(_hash, _name, _checkValid);
1161    }
1162
1163  }
1164
1165  @Override
1166  public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1167    switch (hash) {
1168    case -1618432855:
1169      /* identifier */ return this.identifier == null ? new Base[0]
1170          : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1171    case -1422950650:
1172      /* active */ return this.active == null ? new Base[0] : new Base[] { this.active }; // BooleanType
1173    case 3575610:
1174      /* type */ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
1175    case 3373707:
1176      /* name */ return this.name == null ? new Base[0] : new Base[] { this.name }; // StringType
1177    case 92902992:
1178      /* alias */ return this.alias == null ? new Base[0] : this.alias.toArray(new Base[this.alias.size()]); // StringType
1179    case -1429363305:
1180      /* telecom */ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint
1181    case -1147692044:
1182      /* address */ return this.address == null ? new Base[0] : this.address.toArray(new Base[this.address.size()]); // Address
1183    case -995410646:
1184      /* partOf */ return this.partOf == null ? new Base[0] : new Base[] { this.partOf }; // Reference
1185    case 951526432:
1186      /* contact */ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // OrganizationContactComponent
1187    case 1741102485:
1188      /* endpoint */ return this.endpoint == null ? new Base[0] : this.endpoint.toArray(new Base[this.endpoint.size()]); // Reference
1189    default:
1190      return super.getProperty(hash, name, checkValid);
1191    }
1192
1193  }
1194
1195  @Override
1196  public Base setProperty(int hash, String name, Base value) throws FHIRException {
1197    switch (hash) {
1198    case -1618432855: // identifier
1199      this.getIdentifier().add(castToIdentifier(value)); // Identifier
1200      return value;
1201    case -1422950650: // active
1202      this.active = castToBoolean(value); // BooleanType
1203      return value;
1204    case 3575610: // type
1205      this.getType().add(castToCodeableConcept(value)); // CodeableConcept
1206      return value;
1207    case 3373707: // name
1208      this.name = castToString(value); // StringType
1209      return value;
1210    case 92902992: // alias
1211      this.getAlias().add(castToString(value)); // StringType
1212      return value;
1213    case -1429363305: // telecom
1214      this.getTelecom().add(castToContactPoint(value)); // ContactPoint
1215      return value;
1216    case -1147692044: // address
1217      this.getAddress().add(castToAddress(value)); // Address
1218      return value;
1219    case -995410646: // partOf
1220      this.partOf = castToReference(value); // Reference
1221      return value;
1222    case 951526432: // contact
1223      this.getContact().add((OrganizationContactComponent) value); // OrganizationContactComponent
1224      return value;
1225    case 1741102485: // endpoint
1226      this.getEndpoint().add(castToReference(value)); // Reference
1227      return value;
1228    default:
1229      return super.setProperty(hash, name, value);
1230    }
1231
1232  }
1233
1234  @Override
1235  public Base setProperty(String name, Base value) throws FHIRException {
1236    if (name.equals("identifier")) {
1237      this.getIdentifier().add(castToIdentifier(value));
1238    } else if (name.equals("active")) {
1239      this.active = castToBoolean(value); // BooleanType
1240    } else if (name.equals("type")) {
1241      this.getType().add(castToCodeableConcept(value));
1242    } else if (name.equals("name")) {
1243      this.name = castToString(value); // StringType
1244    } else if (name.equals("alias")) {
1245      this.getAlias().add(castToString(value));
1246    } else if (name.equals("telecom")) {
1247      this.getTelecom().add(castToContactPoint(value));
1248    } else if (name.equals("address")) {
1249      this.getAddress().add(castToAddress(value));
1250    } else if (name.equals("partOf")) {
1251      this.partOf = castToReference(value); // Reference
1252    } else if (name.equals("contact")) {
1253      this.getContact().add((OrganizationContactComponent) value);
1254    } else if (name.equals("endpoint")) {
1255      this.getEndpoint().add(castToReference(value));
1256    } else
1257      return super.setProperty(name, value);
1258    return value;
1259  }
1260
1261  @Override
1262  public void removeChild(String name, Base value) throws FHIRException {
1263    if (name.equals("identifier")) {
1264      this.getIdentifier().remove(castToIdentifier(value));
1265    } else if (name.equals("active")) {
1266      this.active = null;
1267    } else if (name.equals("type")) {
1268      this.getType().remove(castToCodeableConcept(value));
1269    } else if (name.equals("name")) {
1270      this.name = null;
1271    } else if (name.equals("alias")) {
1272      this.getAlias().remove(castToString(value));
1273    } else if (name.equals("telecom")) {
1274      this.getTelecom().remove(castToContactPoint(value));
1275    } else if (name.equals("address")) {
1276      this.getAddress().remove(castToAddress(value));
1277    } else if (name.equals("partOf")) {
1278      this.partOf = null;
1279    } else if (name.equals("contact")) {
1280      this.getContact().remove((OrganizationContactComponent) value);
1281    } else if (name.equals("endpoint")) {
1282      this.getEndpoint().remove(castToReference(value));
1283    } else
1284      super.removeChild(name, value);
1285    
1286  }
1287
1288  @Override
1289  public Base makeProperty(int hash, String name) throws FHIRException {
1290    switch (hash) {
1291    case -1618432855:
1292      return addIdentifier();
1293    case -1422950650:
1294      return getActiveElement();
1295    case 3575610:
1296      return addType();
1297    case 3373707:
1298      return getNameElement();
1299    case 92902992:
1300      return addAliasElement();
1301    case -1429363305:
1302      return addTelecom();
1303    case -1147692044:
1304      return addAddress();
1305    case -995410646:
1306      return getPartOf();
1307    case 951526432:
1308      return addContact();
1309    case 1741102485:
1310      return addEndpoint();
1311    default:
1312      return super.makeProperty(hash, name);
1313    }
1314
1315  }
1316
1317  @Override
1318  public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1319    switch (hash) {
1320    case -1618432855:
1321      /* identifier */ return new String[] { "Identifier" };
1322    case -1422950650:
1323      /* active */ return new String[] { "boolean" };
1324    case 3575610:
1325      /* type */ return new String[] { "CodeableConcept" };
1326    case 3373707:
1327      /* name */ return new String[] { "string" };
1328    case 92902992:
1329      /* alias */ return new String[] { "string" };
1330    case -1429363305:
1331      /* telecom */ return new String[] { "ContactPoint" };
1332    case -1147692044:
1333      /* address */ return new String[] { "Address" };
1334    case -995410646:
1335      /* partOf */ return new String[] { "Reference" };
1336    case 951526432:
1337      /* contact */ return new String[] {};
1338    case 1741102485:
1339      /* endpoint */ return new String[] { "Reference" };
1340    default:
1341      return super.getTypesForProperty(hash, name);
1342    }
1343
1344  }
1345
1346  @Override
1347  public Base addChild(String name) throws FHIRException {
1348    if (name.equals("identifier")) {
1349      return addIdentifier();
1350    } else if (name.equals("active")) {
1351      throw new FHIRException("Cannot call addChild on a singleton property Organization.active");
1352    } else if (name.equals("type")) {
1353      return addType();
1354    } else if (name.equals("name")) {
1355      throw new FHIRException("Cannot call addChild on a singleton property Organization.name");
1356    } else if (name.equals("alias")) {
1357      throw new FHIRException("Cannot call addChild on a singleton property Organization.alias");
1358    } else if (name.equals("telecom")) {
1359      return addTelecom();
1360    } else if (name.equals("address")) {
1361      return addAddress();
1362    } else if (name.equals("partOf")) {
1363      this.partOf = new Reference();
1364      return this.partOf;
1365    } else if (name.equals("contact")) {
1366      return addContact();
1367    } else if (name.equals("endpoint")) {
1368      return addEndpoint();
1369    } else
1370      return super.addChild(name);
1371  }
1372
1373  public String fhirType() {
1374    return "Organization";
1375
1376  }
1377
1378  public Organization copy() {
1379    Organization dst = new Organization();
1380    copyValues(dst);
1381    return dst;
1382  }
1383
1384  public void copyValues(Organization dst) {
1385    super.copyValues(dst);
1386    if (identifier != null) {
1387      dst.identifier = new ArrayList<Identifier>();
1388      for (Identifier i : identifier)
1389        dst.identifier.add(i.copy());
1390    }
1391    ;
1392    dst.active = active == null ? null : active.copy();
1393    if (type != null) {
1394      dst.type = new ArrayList<CodeableConcept>();
1395      for (CodeableConcept i : type)
1396        dst.type.add(i.copy());
1397    }
1398    ;
1399    dst.name = name == null ? null : name.copy();
1400    if (alias != null) {
1401      dst.alias = new ArrayList<StringType>();
1402      for (StringType i : alias)
1403        dst.alias.add(i.copy());
1404    }
1405    ;
1406    if (telecom != null) {
1407      dst.telecom = new ArrayList<ContactPoint>();
1408      for (ContactPoint i : telecom)
1409        dst.telecom.add(i.copy());
1410    }
1411    ;
1412    if (address != null) {
1413      dst.address = new ArrayList<Address>();
1414      for (Address i : address)
1415        dst.address.add(i.copy());
1416    }
1417    ;
1418    dst.partOf = partOf == null ? null : partOf.copy();
1419    if (contact != null) {
1420      dst.contact = new ArrayList<OrganizationContactComponent>();
1421      for (OrganizationContactComponent i : contact)
1422        dst.contact.add(i.copy());
1423    }
1424    ;
1425    if (endpoint != null) {
1426      dst.endpoint = new ArrayList<Reference>();
1427      for (Reference i : endpoint)
1428        dst.endpoint.add(i.copy());
1429    }
1430    ;
1431  }
1432
1433  protected Organization typedCopy() {
1434    return copy();
1435  }
1436
1437  @Override
1438  public boolean equalsDeep(Base other_) {
1439    if (!super.equalsDeep(other_))
1440      return false;
1441    if (!(other_ instanceof Organization))
1442      return false;
1443    Organization o = (Organization) other_;
1444    return compareDeep(identifier, o.identifier, true) && compareDeep(active, o.active, true)
1445        && compareDeep(type, o.type, true) && compareDeep(name, o.name, true) && compareDeep(alias, o.alias, true)
1446        && compareDeep(telecom, o.telecom, true) && compareDeep(address, o.address, true)
1447        && compareDeep(partOf, o.partOf, true) && compareDeep(contact, o.contact, true)
1448        && compareDeep(endpoint, o.endpoint, true);
1449  }
1450
1451  @Override
1452  public boolean equalsShallow(Base other_) {
1453    if (!super.equalsShallow(other_))
1454      return false;
1455    if (!(other_ instanceof Organization))
1456      return false;
1457    Organization o = (Organization) other_;
1458    return compareValues(active, o.active, true) && compareValues(name, o.name, true)
1459        && compareValues(alias, o.alias, true);
1460  }
1461
1462  public boolean isEmpty() {
1463    return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, active, type, name, alias, telecom,
1464        address, partOf, contact, endpoint);
1465  }
1466
1467  @Override
1468  public ResourceType getResourceType() {
1469    return ResourceType.Organization;
1470  }
1471
1472  /**
1473   * Search parameter: <b>identifier</b>
1474   * <p>
1475   * Description: <b>Any identifier for the organization (not the accreditation
1476   * issuer's identifier)</b><br>
1477   * Type: <b>token</b><br>
1478   * Path: <b>Organization.identifier</b><br>
1479   * </p>
1480   */
1481  @SearchParamDefinition(name = "identifier", path = "Organization.identifier", description = "Any identifier for the organization (not the accreditation issuer's identifier)", type = "token")
1482  public static final String SP_IDENTIFIER = "identifier";
1483  /**
1484   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1485   * <p>
1486   * Description: <b>Any identifier for the organization (not the accreditation
1487   * issuer's identifier)</b><br>
1488   * Type: <b>token</b><br>
1489   * Path: <b>Organization.identifier</b><br>
1490   * </p>
1491   */
1492  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(
1493      SP_IDENTIFIER);
1494
1495  /**
1496   * Search parameter: <b>partof</b>
1497   * <p>
1498   * Description: <b>An organization of which this organization forms a
1499   * part</b><br>
1500   * Type: <b>reference</b><br>
1501   * Path: <b>Organization.partOf</b><br>
1502   * </p>
1503   */
1504  @SearchParamDefinition(name = "partof", path = "Organization.partOf", description = "An organization of which this organization forms a part", type = "reference", target = {
1505      Organization.class })
1506  public static final String SP_PARTOF = "partof";
1507  /**
1508   * <b>Fluent Client</b> search parameter constant for <b>partof</b>
1509   * <p>
1510   * Description: <b>An organization of which this organization forms a
1511   * part</b><br>
1512   * Type: <b>reference</b><br>
1513   * Path: <b>Organization.partOf</b><br>
1514   * </p>
1515   */
1516  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTOF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
1517      SP_PARTOF);
1518
1519  /**
1520   * Constant for fluent queries to be used to add include statements. Specifies
1521   * the path value of "<b>Organization:partof</b>".
1522   */
1523  public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTOF = new ca.uhn.fhir.model.api.Include(
1524      "Organization:partof").toLocked();
1525
1526  /**
1527   * Search parameter: <b>address</b>
1528   * <p>
1529   * Description: <b>A server defined search that may match any of the string
1530   * fields in the Address, including line, city, district, state, country,
1531   * postalCode, and/or text</b><br>
1532   * Type: <b>string</b><br>
1533   * Path: <b>Organization.address</b><br>
1534   * </p>
1535   */
1536  @SearchParamDefinition(name = "address", path = "Organization.address", description = "A server defined search that may match any of the string fields in the Address, including line, city, district, state, country, postalCode, and/or text", type = "string")
1537  public static final String SP_ADDRESS = "address";
1538  /**
1539   * <b>Fluent Client</b> search parameter constant for <b>address</b>
1540   * <p>
1541   * Description: <b>A server defined search that may match any of the string
1542   * fields in the Address, including line, city, district, state, country,
1543   * postalCode, and/or text</b><br>
1544   * Type: <b>string</b><br>
1545   * Path: <b>Organization.address</b><br>
1546   * </p>
1547   */
1548  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.StringClientParam(
1549      SP_ADDRESS);
1550
1551  /**
1552   * Search parameter: <b>address-state</b>
1553   * <p>
1554   * Description: <b>A state specified in an address</b><br>
1555   * Type: <b>string</b><br>
1556   * Path: <b>Organization.address.state</b><br>
1557   * </p>
1558   */
1559  @SearchParamDefinition(name = "address-state", path = "Organization.address.state", description = "A state specified in an address", type = "string")
1560  public static final String SP_ADDRESS_STATE = "address-state";
1561  /**
1562   * <b>Fluent Client</b> search parameter constant for <b>address-state</b>
1563   * <p>
1564   * Description: <b>A state specified in an address</b><br>
1565   * Type: <b>string</b><br>
1566   * Path: <b>Organization.address.state</b><br>
1567   * </p>
1568   */
1569  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_STATE = new ca.uhn.fhir.rest.gclient.StringClientParam(
1570      SP_ADDRESS_STATE);
1571
1572  /**
1573   * Search parameter: <b>active</b>
1574   * <p>
1575   * Description: <b>Is the Organization record active</b><br>
1576   * Type: <b>token</b><br>
1577   * Path: <b>Organization.active</b><br>
1578   * </p>
1579   */
1580  @SearchParamDefinition(name = "active", path = "Organization.active", description = "Is the Organization record active", type = "token")
1581  public static final String SP_ACTIVE = "active";
1582  /**
1583   * <b>Fluent Client</b> search parameter constant for <b>active</b>
1584   * <p>
1585   * Description: <b>Is the Organization record active</b><br>
1586   * Type: <b>token</b><br>
1587   * Path: <b>Organization.active</b><br>
1588   * </p>
1589   */
1590  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTIVE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
1591      SP_ACTIVE);
1592
1593  /**
1594   * Search parameter: <b>type</b>
1595   * <p>
1596   * Description: <b>A code for the type of organization</b><br>
1597   * Type: <b>token</b><br>
1598   * Path: <b>Organization.type</b><br>
1599   * </p>
1600   */
1601  @SearchParamDefinition(name = "type", path = "Organization.type", description = "A code for the type of organization", type = "token")
1602  public static final String SP_TYPE = "type";
1603  /**
1604   * <b>Fluent Client</b> search parameter constant for <b>type</b>
1605   * <p>
1606   * Description: <b>A code for the type of organization</b><br>
1607   * Type: <b>token</b><br>
1608   * Path: <b>Organization.type</b><br>
1609   * </p>
1610   */
1611  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
1612      SP_TYPE);
1613
1614  /**
1615   * Search parameter: <b>address-postalcode</b>
1616   * <p>
1617   * Description: <b>A postal code specified in an address</b><br>
1618   * Type: <b>string</b><br>
1619   * Path: <b>Organization.address.postalCode</b><br>
1620   * </p>
1621   */
1622  @SearchParamDefinition(name = "address-postalcode", path = "Organization.address.postalCode", description = "A postal code specified in an address", type = "string")
1623  public static final String SP_ADDRESS_POSTALCODE = "address-postalcode";
1624  /**
1625   * <b>Fluent Client</b> search parameter constant for <b>address-postalcode</b>
1626   * <p>
1627   * Description: <b>A postal code specified in an address</b><br>
1628   * Type: <b>string</b><br>
1629   * Path: <b>Organization.address.postalCode</b><br>
1630   * </p>
1631   */
1632  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_POSTALCODE = new ca.uhn.fhir.rest.gclient.StringClientParam(
1633      SP_ADDRESS_POSTALCODE);
1634
1635  /**
1636   * Search parameter: <b>address-country</b>
1637   * <p>
1638   * Description: <b>A country specified in an address</b><br>
1639   * Type: <b>string</b><br>
1640   * Path: <b>Organization.address.country</b><br>
1641   * </p>
1642   */
1643  @SearchParamDefinition(name = "address-country", path = "Organization.address.country", description = "A country specified in an address", type = "string")
1644  public static final String SP_ADDRESS_COUNTRY = "address-country";
1645  /**
1646   * <b>Fluent Client</b> search parameter constant for <b>address-country</b>
1647   * <p>
1648   * Description: <b>A country specified in an address</b><br>
1649   * Type: <b>string</b><br>
1650   * Path: <b>Organization.address.country</b><br>
1651   * </p>
1652   */
1653  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(
1654      SP_ADDRESS_COUNTRY);
1655
1656  /**
1657   * Search parameter: <b>endpoint</b>
1658   * <p>
1659   * Description: <b>Technical endpoints providing access to services operated for
1660   * the organization</b><br>
1661   * Type: <b>reference</b><br>
1662   * Path: <b>Organization.endpoint</b><br>
1663   * </p>
1664   */
1665  @SearchParamDefinition(name = "endpoint", path = "Organization.endpoint", description = "Technical endpoints providing access to services operated for the organization", type = "reference", target = {
1666      Endpoint.class })
1667  public static final String SP_ENDPOINT = "endpoint";
1668  /**
1669   * <b>Fluent Client</b> search parameter constant for <b>endpoint</b>
1670   * <p>
1671   * Description: <b>Technical endpoints providing access to services operated for
1672   * the organization</b><br>
1673   * Type: <b>reference</b><br>
1674   * Path: <b>Organization.endpoint</b><br>
1675   * </p>
1676   */
1677  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENDPOINT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
1678      SP_ENDPOINT);
1679
1680  /**
1681   * Constant for fluent queries to be used to add include statements. Specifies
1682   * the path value of "<b>Organization:endpoint</b>".
1683   */
1684  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENDPOINT = new ca.uhn.fhir.model.api.Include(
1685      "Organization:endpoint").toLocked();
1686
1687  /**
1688   * Search parameter: <b>phonetic</b>
1689   * <p>
1690   * Description: <b>A portion of the organization's name using some kind of
1691   * phonetic matching algorithm</b><br>
1692   * Type: <b>string</b><br>
1693   * Path: <b>Organization.name</b><br>
1694   * </p>
1695   */
1696  @SearchParamDefinition(name = "phonetic", path = "Organization.name", description = "A portion of the organization's name using some kind of phonetic matching algorithm", type = "string")
1697  public static final String SP_PHONETIC = "phonetic";
1698  /**
1699   * <b>Fluent Client</b> search parameter constant for <b>phonetic</b>
1700   * <p>
1701   * Description: <b>A portion of the organization's name using some kind of
1702   * phonetic matching algorithm</b><br>
1703   * Type: <b>string</b><br>
1704   * Path: <b>Organization.name</b><br>
1705   * </p>
1706   */
1707  public static final ca.uhn.fhir.rest.gclient.StringClientParam PHONETIC = new ca.uhn.fhir.rest.gclient.StringClientParam(
1708      SP_PHONETIC);
1709
1710  /**
1711   * Search parameter: <b>name</b>
1712   * <p>
1713   * Description: <b>A portion of the organization's name or alias</b><br>
1714   * Type: <b>string</b><br>
1715   * Path: <b>Organization.name, Organization.alias</b><br>
1716   * </p>
1717   */
1718  @SearchParamDefinition(name = "name", path = "Organization.name | Organization.alias", description = "A portion of the organization's name or alias", type = "string")
1719  public static final String SP_NAME = "name";
1720  /**
1721   * <b>Fluent Client</b> search parameter constant for <b>name</b>
1722   * <p>
1723   * Description: <b>A portion of the organization's name or alias</b><br>
1724   * Type: <b>string</b><br>
1725   * Path: <b>Organization.name, Organization.alias</b><br>
1726   * </p>
1727   */
1728  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(
1729      SP_NAME);
1730
1731  /**
1732   * Search parameter: <b>address-use</b>
1733   * <p>
1734   * Description: <b>A use code specified in an address</b><br>
1735   * Type: <b>token</b><br>
1736   * Path: <b>Organization.address.use</b><br>
1737   * </p>
1738   */
1739  @SearchParamDefinition(name = "address-use", path = "Organization.address.use", description = "A use code specified in an address", type = "token")
1740  public static final String SP_ADDRESS_USE = "address-use";
1741  /**
1742   * <b>Fluent Client</b> search parameter constant for <b>address-use</b>
1743   * <p>
1744   * Description: <b>A use code specified in an address</b><br>
1745   * Type: <b>token</b><br>
1746   * Path: <b>Organization.address.use</b><br>
1747   * </p>
1748   */
1749  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
1750      SP_ADDRESS_USE);
1751
1752  /**
1753   * Search parameter: <b>address-city</b>
1754   * <p>
1755   * Description: <b>A city specified in an address</b><br>
1756   * Type: <b>string</b><br>
1757   * Path: <b>Organization.address.city</b><br>
1758   * </p>
1759   */
1760  @SearchParamDefinition(name = "address-city", path = "Organization.address.city", description = "A city specified in an address", type = "string")
1761  public static final String SP_ADDRESS_CITY = "address-city";
1762  /**
1763   * <b>Fluent Client</b> search parameter constant for <b>address-city</b>
1764   * <p>
1765   * Description: <b>A city specified in an address</b><br>
1766   * Type: <b>string</b><br>
1767   * Path: <b>Organization.address.city</b><br>
1768   * </p>
1769   */
1770  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(
1771      SP_ADDRESS_CITY);
1772
1773}