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