001package org.hl7.fhir.instance.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 Wed, Jul 13, 2016 05:32+1000 for FHIR v1.0.2
033import java.util.*;
034
035import org.hl7.fhir.exceptions.FHIRException;
036import org.hl7.fhir.instance.model.Enumerations.AdministrativeGender;
037import org.hl7.fhir.instance.model.Enumerations.AdministrativeGenderEnumFactory;
038import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
039
040import ca.uhn.fhir.model.api.annotation.*;
041/**
042 * A person who is directly or indirectly involved in the provisioning of healthcare.
043 */
044@ResourceDef(name="Practitioner", profile="http://hl7.org/fhir/Profile/Practitioner")
045public class Practitioner extends DomainResource {
046
047    @Block()
048    public static class PractitionerPractitionerRoleComponent extends BackboneElement implements IBaseBackboneElement {
049        /**
050         * The organization where the Practitioner performs the roles associated.
051         */
052        @Child(name = "managingOrganization", type = {Organization.class}, order=1, min=0, max=1, modifier=false, summary=false)
053        @Description(shortDefinition="Organization where the roles are performed", formalDefinition="The organization where the Practitioner performs the roles associated." )
054        protected Reference managingOrganization;
055
056        /**
057         * The actual object that is the target of the reference (The organization where the Practitioner performs the roles associated.)
058         */
059        protected Organization managingOrganizationTarget;
060
061        /**
062         * Roles which this practitioner is authorized to perform for the organization.
063         */
064        @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
065        @Description(shortDefinition="Roles which this practitioner may perform", formalDefinition="Roles which this practitioner is authorized to perform for the organization." )
066        protected CodeableConcept role;
067
068        /**
069         * Specific specialty of the practitioner.
070         */
071        @Child(name = "specialty", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
072        @Description(shortDefinition="Specific specialty of the practitioner", formalDefinition="Specific specialty of the practitioner." )
073        protected List<CodeableConcept> specialty;
074
075        /**
076         * The period during which the person is authorized to act as a practitioner in these role(s) for the organization.
077         */
078        @Child(name = "period", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=true)
079        @Description(shortDefinition="The period during which the practitioner is authorized to perform in these role(s)", formalDefinition="The period during which the person is authorized to act as a practitioner in these role(s) for the organization." )
080        protected Period period;
081
082        /**
083         * The location(s) at which this practitioner provides care.
084         */
085        @Child(name = "location", type = {Location.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
086        @Description(shortDefinition="The location(s) at which this practitioner provides care", formalDefinition="The location(s) at which this practitioner provides care." )
087        protected List<Reference> location;
088        /**
089         * The actual objects that are the target of the reference (The location(s) at which this practitioner provides care.)
090         */
091        protected List<Location> locationTarget;
092
093
094        /**
095         * The list of healthcare services that this worker provides for this role's Organization/Location(s).
096         */
097        @Child(name = "healthcareService", type = {HealthcareService.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
098        @Description(shortDefinition="The list of healthcare services that this worker provides for this role's Organization/Location(s)", formalDefinition="The list of healthcare services that this worker provides for this role's Organization/Location(s)." )
099        protected List<Reference> healthcareService;
100        /**
101         * The actual objects that are the target of the reference (The list of healthcare services that this worker provides for this role's Organization/Location(s).)
102         */
103        protected List<HealthcareService> healthcareServiceTarget;
104
105
106        private static final long serialVersionUID = -2146177018L;
107
108    /*
109     * Constructor
110     */
111      public PractitionerPractitionerRoleComponent() {
112        super();
113      }
114
115        /**
116         * @return {@link #managingOrganization} (The organization where the Practitioner performs the roles associated.)
117         */
118        public Reference getManagingOrganization() { 
119          if (this.managingOrganization == null)
120            if (Configuration.errorOnAutoCreate())
121              throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.managingOrganization");
122            else if (Configuration.doAutoCreate())
123              this.managingOrganization = new Reference(); // cc
124          return this.managingOrganization;
125        }
126
127        public boolean hasManagingOrganization() { 
128          return this.managingOrganization != null && !this.managingOrganization.isEmpty();
129        }
130
131        /**
132         * @param value {@link #managingOrganization} (The organization where the Practitioner performs the roles associated.)
133         */
134        public PractitionerPractitionerRoleComponent setManagingOrganization(Reference value) { 
135          this.managingOrganization = value;
136          return this;
137        }
138
139        /**
140         * @return {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization where the Practitioner performs the roles associated.)
141         */
142        public Organization getManagingOrganizationTarget() { 
143          if (this.managingOrganizationTarget == null)
144            if (Configuration.errorOnAutoCreate())
145              throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.managingOrganization");
146            else if (Configuration.doAutoCreate())
147              this.managingOrganizationTarget = new Organization(); // aa
148          return this.managingOrganizationTarget;
149        }
150
151        /**
152         * @param value {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization where the Practitioner performs the roles associated.)
153         */
154        public PractitionerPractitionerRoleComponent setManagingOrganizationTarget(Organization value) { 
155          this.managingOrganizationTarget = value;
156          return this;
157        }
158
159        /**
160         * @return {@link #role} (Roles which this practitioner is authorized to perform for the organization.)
161         */
162        public CodeableConcept getRole() { 
163          if (this.role == null)
164            if (Configuration.errorOnAutoCreate())
165              throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.role");
166            else if (Configuration.doAutoCreate())
167              this.role = new CodeableConcept(); // cc
168          return this.role;
169        }
170
171        public boolean hasRole() { 
172          return this.role != null && !this.role.isEmpty();
173        }
174
175        /**
176         * @param value {@link #role} (Roles which this practitioner is authorized to perform for the organization.)
177         */
178        public PractitionerPractitionerRoleComponent setRole(CodeableConcept value) { 
179          this.role = value;
180          return this;
181        }
182
183        /**
184         * @return {@link #specialty} (Specific specialty of the practitioner.)
185         */
186        public List<CodeableConcept> getSpecialty() { 
187          if (this.specialty == null)
188            this.specialty = new ArrayList<CodeableConcept>();
189          return this.specialty;
190        }
191
192        public boolean hasSpecialty() { 
193          if (this.specialty == null)
194            return false;
195          for (CodeableConcept item : this.specialty)
196            if (!item.isEmpty())
197              return true;
198          return false;
199        }
200
201        /**
202         * @return {@link #specialty} (Specific specialty of the practitioner.)
203         */
204    // syntactic sugar
205        public CodeableConcept addSpecialty() { //3
206          CodeableConcept t = new CodeableConcept();
207          if (this.specialty == null)
208            this.specialty = new ArrayList<CodeableConcept>();
209          this.specialty.add(t);
210          return t;
211        }
212
213    // syntactic sugar
214        public PractitionerPractitionerRoleComponent addSpecialty(CodeableConcept t) { //3
215          if (t == null)
216            return this;
217          if (this.specialty == null)
218            this.specialty = new ArrayList<CodeableConcept>();
219          this.specialty.add(t);
220          return this;
221        }
222
223        /**
224         * @return {@link #period} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.)
225         */
226        public Period getPeriod() { 
227          if (this.period == null)
228            if (Configuration.errorOnAutoCreate())
229              throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.period");
230            else if (Configuration.doAutoCreate())
231              this.period = new Period(); // cc
232          return this.period;
233        }
234
235        public boolean hasPeriod() { 
236          return this.period != null && !this.period.isEmpty();
237        }
238
239        /**
240         * @param value {@link #period} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.)
241         */
242        public PractitionerPractitionerRoleComponent setPeriod(Period value) { 
243          this.period = value;
244          return this;
245        }
246
247        /**
248         * @return {@link #location} (The location(s) at which this practitioner provides care.)
249         */
250        public List<Reference> getLocation() { 
251          if (this.location == null)
252            this.location = new ArrayList<Reference>();
253          return this.location;
254        }
255
256        public boolean hasLocation() { 
257          if (this.location == null)
258            return false;
259          for (Reference item : this.location)
260            if (!item.isEmpty())
261              return true;
262          return false;
263        }
264
265        /**
266         * @return {@link #location} (The location(s) at which this practitioner provides care.)
267         */
268    // syntactic sugar
269        public Reference addLocation() { //3
270          Reference t = new Reference();
271          if (this.location == null)
272            this.location = new ArrayList<Reference>();
273          this.location.add(t);
274          return t;
275        }
276
277    // syntactic sugar
278        public PractitionerPractitionerRoleComponent addLocation(Reference t) { //3
279          if (t == null)
280            return this;
281          if (this.location == null)
282            this.location = new ArrayList<Reference>();
283          this.location.add(t);
284          return this;
285        }
286
287        /**
288         * @return {@link #location} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The location(s) at which this practitioner provides care.)
289         */
290        public List<Location> getLocationTarget() { 
291          if (this.locationTarget == null)
292            this.locationTarget = new ArrayList<Location>();
293          return this.locationTarget;
294        }
295
296    // syntactic sugar
297        /**
298         * @return {@link #location} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The location(s) at which this practitioner provides care.)
299         */
300        public Location addLocationTarget() { 
301          Location r = new Location();
302          if (this.locationTarget == null)
303            this.locationTarget = new ArrayList<Location>();
304          this.locationTarget.add(r);
305          return r;
306        }
307
308        /**
309         * @return {@link #healthcareService} (The list of healthcare services that this worker provides for this role's Organization/Location(s).)
310         */
311        public List<Reference> getHealthcareService() { 
312          if (this.healthcareService == null)
313            this.healthcareService = new ArrayList<Reference>();
314          return this.healthcareService;
315        }
316
317        public boolean hasHealthcareService() { 
318          if (this.healthcareService == null)
319            return false;
320          for (Reference item : this.healthcareService)
321            if (!item.isEmpty())
322              return true;
323          return false;
324        }
325
326        /**
327         * @return {@link #healthcareService} (The list of healthcare services that this worker provides for this role's Organization/Location(s).)
328         */
329    // syntactic sugar
330        public Reference addHealthcareService() { //3
331          Reference t = new Reference();
332          if (this.healthcareService == null)
333            this.healthcareService = new ArrayList<Reference>();
334          this.healthcareService.add(t);
335          return t;
336        }
337
338    // syntactic sugar
339        public PractitionerPractitionerRoleComponent addHealthcareService(Reference t) { //3
340          if (t == null)
341            return this;
342          if (this.healthcareService == null)
343            this.healthcareService = new ArrayList<Reference>();
344          this.healthcareService.add(t);
345          return this;
346        }
347
348        /**
349         * @return {@link #healthcareService} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The list of healthcare services that this worker provides for this role's Organization/Location(s).)
350         */
351        public List<HealthcareService> getHealthcareServiceTarget() { 
352          if (this.healthcareServiceTarget == null)
353            this.healthcareServiceTarget = new ArrayList<HealthcareService>();
354          return this.healthcareServiceTarget;
355        }
356
357    // syntactic sugar
358        /**
359         * @return {@link #healthcareService} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The list of healthcare services that this worker provides for this role's Organization/Location(s).)
360         */
361        public HealthcareService addHealthcareServiceTarget() { 
362          HealthcareService r = new HealthcareService();
363          if (this.healthcareServiceTarget == null)
364            this.healthcareServiceTarget = new ArrayList<HealthcareService>();
365          this.healthcareServiceTarget.add(r);
366          return r;
367        }
368
369        protected void listChildren(List<Property> childrenList) {
370          super.listChildren(childrenList);
371          childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The organization where the Practitioner performs the roles associated.", 0, java.lang.Integer.MAX_VALUE, managingOrganization));
372          childrenList.add(new Property("role", "CodeableConcept", "Roles which this practitioner is authorized to perform for the organization.", 0, java.lang.Integer.MAX_VALUE, role));
373          childrenList.add(new Property("specialty", "CodeableConcept", "Specific specialty of the practitioner.", 0, java.lang.Integer.MAX_VALUE, specialty));
374          childrenList.add(new Property("period", "Period", "The period during which the person is authorized to act as a practitioner in these role(s) for the organization.", 0, java.lang.Integer.MAX_VALUE, period));
375          childrenList.add(new Property("location", "Reference(Location)", "The location(s) at which this practitioner provides care.", 0, java.lang.Integer.MAX_VALUE, location));
376          childrenList.add(new Property("healthcareService", "Reference(HealthcareService)", "The list of healthcare services that this worker provides for this role's Organization/Location(s).", 0, java.lang.Integer.MAX_VALUE, healthcareService));
377        }
378
379      @Override
380      public void setProperty(String name, Base value) throws FHIRException {
381        if (name.equals("managingOrganization"))
382          this.managingOrganization = castToReference(value); // Reference
383        else if (name.equals("role"))
384          this.role = castToCodeableConcept(value); // CodeableConcept
385        else if (name.equals("specialty"))
386          this.getSpecialty().add(castToCodeableConcept(value));
387        else if (name.equals("period"))
388          this.period = castToPeriod(value); // Period
389        else if (name.equals("location"))
390          this.getLocation().add(castToReference(value));
391        else if (name.equals("healthcareService"))
392          this.getHealthcareService().add(castToReference(value));
393        else
394          super.setProperty(name, value);
395      }
396
397      @Override
398      public Base addChild(String name) throws FHIRException {
399        if (name.equals("managingOrganization")) {
400          this.managingOrganization = new Reference();
401          return this.managingOrganization;
402        }
403        else if (name.equals("role")) {
404          this.role = new CodeableConcept();
405          return this.role;
406        }
407        else if (name.equals("specialty")) {
408          return addSpecialty();
409        }
410        else if (name.equals("period")) {
411          this.period = new Period();
412          return this.period;
413        }
414        else if (name.equals("location")) {
415          return addLocation();
416        }
417        else if (name.equals("healthcareService")) {
418          return addHealthcareService();
419        }
420        else
421          return super.addChild(name);
422      }
423
424      public PractitionerPractitionerRoleComponent copy() {
425        PractitionerPractitionerRoleComponent dst = new PractitionerPractitionerRoleComponent();
426        copyValues(dst);
427        dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy();
428        dst.role = role == null ? null : role.copy();
429        if (specialty != null) {
430          dst.specialty = new ArrayList<CodeableConcept>();
431          for (CodeableConcept i : specialty)
432            dst.specialty.add(i.copy());
433        };
434        dst.period = period == null ? null : period.copy();
435        if (location != null) {
436          dst.location = new ArrayList<Reference>();
437          for (Reference i : location)
438            dst.location.add(i.copy());
439        };
440        if (healthcareService != null) {
441          dst.healthcareService = new ArrayList<Reference>();
442          for (Reference i : healthcareService)
443            dst.healthcareService.add(i.copy());
444        };
445        return dst;
446      }
447
448      @Override
449      public boolean equalsDeep(Base other) {
450        if (!super.equalsDeep(other))
451          return false;
452        if (!(other instanceof PractitionerPractitionerRoleComponent))
453          return false;
454        PractitionerPractitionerRoleComponent o = (PractitionerPractitionerRoleComponent) other;
455        return compareDeep(managingOrganization, o.managingOrganization, true) && compareDeep(role, o.role, true)
456           && compareDeep(specialty, o.specialty, true) && compareDeep(period, o.period, true) && compareDeep(location, o.location, true)
457           && compareDeep(healthcareService, o.healthcareService, true);
458      }
459
460      @Override
461      public boolean equalsShallow(Base other) {
462        if (!super.equalsShallow(other))
463          return false;
464        if (!(other instanceof PractitionerPractitionerRoleComponent))
465          return false;
466        PractitionerPractitionerRoleComponent o = (PractitionerPractitionerRoleComponent) other;
467        return true;
468      }
469
470      public boolean isEmpty() {
471        return super.isEmpty() && (managingOrganization == null || managingOrganization.isEmpty()) && (role == null || role.isEmpty())
472           && (specialty == null || specialty.isEmpty()) && (period == null || period.isEmpty()) && (location == null || location.isEmpty())
473           && (healthcareService == null || healthcareService.isEmpty());
474      }
475
476  public String fhirType() {
477    return "Practitioner.practitionerRole";
478
479  }
480
481  }
482
483    @Block()
484    public static class PractitionerQualificationComponent extends BackboneElement implements IBaseBackboneElement {
485        /**
486         * An identifier that applies to this person's qualification in this role.
487         */
488        @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
489        @Description(shortDefinition="An identifier for this qualification for the practitioner", formalDefinition="An identifier that applies to this person's qualification in this role." )
490        protected List<Identifier> identifier;
491
492        /**
493         * Coded representation of the qualification.
494         */
495        @Child(name = "code", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=false)
496        @Description(shortDefinition="Coded representation of the qualification", formalDefinition="Coded representation of the qualification." )
497        protected CodeableConcept code;
498
499        /**
500         * Period during which the qualification is valid.
501         */
502        @Child(name = "period", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=false)
503        @Description(shortDefinition="Period during which the qualification is valid", formalDefinition="Period during which the qualification is valid." )
504        protected Period period;
505
506        /**
507         * Organization that regulates and issues the qualification.
508         */
509        @Child(name = "issuer", type = {Organization.class}, order=4, min=0, max=1, modifier=false, summary=false)
510        @Description(shortDefinition="Organization that regulates and issues the qualification", formalDefinition="Organization that regulates and issues the qualification." )
511        protected Reference issuer;
512
513        /**
514         * The actual object that is the target of the reference (Organization that regulates and issues the qualification.)
515         */
516        protected Organization issuerTarget;
517
518        private static final long serialVersionUID = 1095219071L;
519
520    /*
521     * Constructor
522     */
523      public PractitionerQualificationComponent() {
524        super();
525      }
526
527    /*
528     * Constructor
529     */
530      public PractitionerQualificationComponent(CodeableConcept code) {
531        super();
532        this.code = code;
533      }
534
535        /**
536         * @return {@link #identifier} (An identifier that applies to this person's qualification in this role.)
537         */
538        public List<Identifier> getIdentifier() { 
539          if (this.identifier == null)
540            this.identifier = new ArrayList<Identifier>();
541          return this.identifier;
542        }
543
544        public boolean hasIdentifier() { 
545          if (this.identifier == null)
546            return false;
547          for (Identifier item : this.identifier)
548            if (!item.isEmpty())
549              return true;
550          return false;
551        }
552
553        /**
554         * @return {@link #identifier} (An identifier that applies to this person's qualification in this role.)
555         */
556    // syntactic sugar
557        public Identifier addIdentifier() { //3
558          Identifier t = new Identifier();
559          if (this.identifier == null)
560            this.identifier = new ArrayList<Identifier>();
561          this.identifier.add(t);
562          return t;
563        }
564
565    // syntactic sugar
566        public PractitionerQualificationComponent addIdentifier(Identifier t) { //3
567          if (t == null)
568            return this;
569          if (this.identifier == null)
570            this.identifier = new ArrayList<Identifier>();
571          this.identifier.add(t);
572          return this;
573        }
574
575        /**
576         * @return {@link #code} (Coded representation of the qualification.)
577         */
578        public CodeableConcept getCode() { 
579          if (this.code == null)
580            if (Configuration.errorOnAutoCreate())
581              throw new Error("Attempt to auto-create PractitionerQualificationComponent.code");
582            else if (Configuration.doAutoCreate())
583              this.code = new CodeableConcept(); // cc
584          return this.code;
585        }
586
587        public boolean hasCode() { 
588          return this.code != null && !this.code.isEmpty();
589        }
590
591        /**
592         * @param value {@link #code} (Coded representation of the qualification.)
593         */
594        public PractitionerQualificationComponent setCode(CodeableConcept value) { 
595          this.code = value;
596          return this;
597        }
598
599        /**
600         * @return {@link #period} (Period during which the qualification is valid.)
601         */
602        public Period getPeriod() { 
603          if (this.period == null)
604            if (Configuration.errorOnAutoCreate())
605              throw new Error("Attempt to auto-create PractitionerQualificationComponent.period");
606            else if (Configuration.doAutoCreate())
607              this.period = new Period(); // cc
608          return this.period;
609        }
610
611        public boolean hasPeriod() { 
612          return this.period != null && !this.period.isEmpty();
613        }
614
615        /**
616         * @param value {@link #period} (Period during which the qualification is valid.)
617         */
618        public PractitionerQualificationComponent setPeriod(Period value) { 
619          this.period = value;
620          return this;
621        }
622
623        /**
624         * @return {@link #issuer} (Organization that regulates and issues the qualification.)
625         */
626        public Reference getIssuer() { 
627          if (this.issuer == null)
628            if (Configuration.errorOnAutoCreate())
629              throw new Error("Attempt to auto-create PractitionerQualificationComponent.issuer");
630            else if (Configuration.doAutoCreate())
631              this.issuer = new Reference(); // cc
632          return this.issuer;
633        }
634
635        public boolean hasIssuer() { 
636          return this.issuer != null && !this.issuer.isEmpty();
637        }
638
639        /**
640         * @param value {@link #issuer} (Organization that regulates and issues the qualification.)
641         */
642        public PractitionerQualificationComponent setIssuer(Reference value) { 
643          this.issuer = value;
644          return this;
645        }
646
647        /**
648         * @return {@link #issuer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Organization that regulates and issues the qualification.)
649         */
650        public Organization getIssuerTarget() { 
651          if (this.issuerTarget == null)
652            if (Configuration.errorOnAutoCreate())
653              throw new Error("Attempt to auto-create PractitionerQualificationComponent.issuer");
654            else if (Configuration.doAutoCreate())
655              this.issuerTarget = new Organization(); // aa
656          return this.issuerTarget;
657        }
658
659        /**
660         * @param value {@link #issuer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Organization that regulates and issues the qualification.)
661         */
662        public PractitionerQualificationComponent setIssuerTarget(Organization value) { 
663          this.issuerTarget = value;
664          return this;
665        }
666
667        protected void listChildren(List<Property> childrenList) {
668          super.listChildren(childrenList);
669          childrenList.add(new Property("identifier", "Identifier", "An identifier that applies to this person's qualification in this role.", 0, java.lang.Integer.MAX_VALUE, identifier));
670          childrenList.add(new Property("code", "CodeableConcept", "Coded representation of the qualification.", 0, java.lang.Integer.MAX_VALUE, code));
671          childrenList.add(new Property("period", "Period", "Period during which the qualification is valid.", 0, java.lang.Integer.MAX_VALUE, period));
672          childrenList.add(new Property("issuer", "Reference(Organization)", "Organization that regulates and issues the qualification.", 0, java.lang.Integer.MAX_VALUE, issuer));
673        }
674
675      @Override
676      public void setProperty(String name, Base value) throws FHIRException {
677        if (name.equals("identifier"))
678          this.getIdentifier().add(castToIdentifier(value));
679        else if (name.equals("code"))
680          this.code = castToCodeableConcept(value); // CodeableConcept
681        else if (name.equals("period"))
682          this.period = castToPeriod(value); // Period
683        else if (name.equals("issuer"))
684          this.issuer = castToReference(value); // Reference
685        else
686          super.setProperty(name, value);
687      }
688
689      @Override
690      public Base addChild(String name) throws FHIRException {
691        if (name.equals("identifier")) {
692          return addIdentifier();
693        }
694        else if (name.equals("code")) {
695          this.code = new CodeableConcept();
696          return this.code;
697        }
698        else if (name.equals("period")) {
699          this.period = new Period();
700          return this.period;
701        }
702        else if (name.equals("issuer")) {
703          this.issuer = new Reference();
704          return this.issuer;
705        }
706        else
707          return super.addChild(name);
708      }
709
710      public PractitionerQualificationComponent copy() {
711        PractitionerQualificationComponent dst = new PractitionerQualificationComponent();
712        copyValues(dst);
713        if (identifier != null) {
714          dst.identifier = new ArrayList<Identifier>();
715          for (Identifier i : identifier)
716            dst.identifier.add(i.copy());
717        };
718        dst.code = code == null ? null : code.copy();
719        dst.period = period == null ? null : period.copy();
720        dst.issuer = issuer == null ? null : issuer.copy();
721        return dst;
722      }
723
724      @Override
725      public boolean equalsDeep(Base other) {
726        if (!super.equalsDeep(other))
727          return false;
728        if (!(other instanceof PractitionerQualificationComponent))
729          return false;
730        PractitionerQualificationComponent o = (PractitionerQualificationComponent) other;
731        return compareDeep(identifier, o.identifier, true) && compareDeep(code, o.code, true) && compareDeep(period, o.period, true)
732           && compareDeep(issuer, o.issuer, true);
733      }
734
735      @Override
736      public boolean equalsShallow(Base other) {
737        if (!super.equalsShallow(other))
738          return false;
739        if (!(other instanceof PractitionerQualificationComponent))
740          return false;
741        PractitionerQualificationComponent o = (PractitionerQualificationComponent) other;
742        return true;
743      }
744
745      public boolean isEmpty() {
746        return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty())
747           && (period == null || period.isEmpty()) && (issuer == null || issuer.isEmpty());
748      }
749
750  public String fhirType() {
751    return "Practitioner.qualification";
752
753  }
754
755  }
756
757    /**
758     * An identifier that applies to this person in this role.
759     */
760    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
761    @Description(shortDefinition="A identifier for the person as this agent", formalDefinition="An identifier that applies to this person in this role." )
762    protected List<Identifier> identifier;
763
764    /**
765     * Whether this practitioner's record is in active use.
766     */
767    @Child(name = "active", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=true)
768    @Description(shortDefinition="Whether this practitioner's record is in active use", formalDefinition="Whether this practitioner's record is in active use." )
769    protected BooleanType active;
770
771    /**
772     * A name associated with the person.
773     */
774    @Child(name = "name", type = {HumanName.class}, order=2, min=0, max=1, modifier=false, summary=true)
775    @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." )
776    protected HumanName name;
777
778    /**
779     * A contact detail for the practitioner, e.g. a telephone number or an email address.
780     */
781    @Child(name = "telecom", type = {ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
782    @Description(shortDefinition="A contact detail for the practitioner", formalDefinition="A contact detail for the practitioner, e.g. a telephone number or an email address." )
783    protected List<ContactPoint> telecom;
784
785    /**
786     * The postal address where the practitioner can be found or visited or to which mail can be delivered.
787     */
788    @Child(name = "address", type = {Address.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
789    @Description(shortDefinition="Where practitioner can be found/visited", formalDefinition="The postal address where the practitioner can be found or visited or to which mail can be delivered." )
790    protected List<Address> address;
791
792    /**
793     * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
794     */
795    @Child(name = "gender", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=true)
796    @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." )
797    protected Enumeration<AdministrativeGender> gender;
798
799    /**
800     * The date of birth for the practitioner.
801     */
802    @Child(name = "birthDate", type = {DateType.class}, order=6, min=0, max=1, modifier=false, summary=true)
803    @Description(shortDefinition="The date  on which the practitioner was born", formalDefinition="The date of birth for the practitioner." )
804    protected DateType birthDate;
805
806    /**
807     * Image of the person.
808     */
809    @Child(name = "photo", type = {Attachment.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
810    @Description(shortDefinition="Image of the person", formalDefinition="Image of the person." )
811    protected List<Attachment> photo;
812
813    /**
814     * The list of roles/organizations that the practitioner is associated with.
815     */
816    @Child(name = "practitionerRole", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
817    @Description(shortDefinition="Roles/organizations the practitioner is associated with", formalDefinition="The list of roles/organizations that the practitioner is associated with." )
818    protected List<PractitionerPractitionerRoleComponent> practitionerRole;
819
820    /**
821     * Qualifications obtained by training and certification.
822     */
823    @Child(name = "qualification", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
824    @Description(shortDefinition="Qualifications obtained by training and certification", formalDefinition="Qualifications obtained by training and certification." )
825    protected List<PractitionerQualificationComponent> qualification;
826
827    /**
828     * A language the practitioner is able to use in patient communication.
829     */
830    @Child(name = "communication", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
831    @Description(shortDefinition="A language the practitioner is able to use in patient communication", formalDefinition="A language the practitioner is able to use in patient communication." )
832    protected List<CodeableConcept> communication;
833
834    private static final long serialVersionUID = 1066276346L;
835
836  /*
837   * Constructor
838   */
839    public Practitioner() {
840      super();
841    }
842
843    /**
844     * @return {@link #identifier} (An identifier that applies to this person in this role.)
845     */
846    public List<Identifier> getIdentifier() { 
847      if (this.identifier == null)
848        this.identifier = new ArrayList<Identifier>();
849      return this.identifier;
850    }
851
852    public boolean hasIdentifier() { 
853      if (this.identifier == null)
854        return false;
855      for (Identifier item : this.identifier)
856        if (!item.isEmpty())
857          return true;
858      return false;
859    }
860
861    /**
862     * @return {@link #identifier} (An identifier that applies to this person in this role.)
863     */
864    // syntactic sugar
865    public Identifier addIdentifier() { //3
866      Identifier t = new Identifier();
867      if (this.identifier == null)
868        this.identifier = new ArrayList<Identifier>();
869      this.identifier.add(t);
870      return t;
871    }
872
873    // syntactic sugar
874    public Practitioner addIdentifier(Identifier t) { //3
875      if (t == null)
876        return this;
877      if (this.identifier == null)
878        this.identifier = new ArrayList<Identifier>();
879      this.identifier.add(t);
880      return this;
881    }
882
883    /**
884     * @return {@link #active} (Whether this practitioner's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value
885     */
886    public BooleanType getActiveElement() { 
887      if (this.active == null)
888        if (Configuration.errorOnAutoCreate())
889          throw new Error("Attempt to auto-create Practitioner.active");
890        else if (Configuration.doAutoCreate())
891          this.active = new BooleanType(); // bb
892      return this.active;
893    }
894
895    public boolean hasActiveElement() { 
896      return this.active != null && !this.active.isEmpty();
897    }
898
899    public boolean hasActive() { 
900      return this.active != null && !this.active.isEmpty();
901    }
902
903    /**
904     * @param value {@link #active} (Whether this practitioner's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value
905     */
906    public Practitioner setActiveElement(BooleanType value) { 
907      this.active = value;
908      return this;
909    }
910
911    /**
912     * @return Whether this practitioner's record is in active use.
913     */
914    public boolean getActive() { 
915      return this.active == null || this.active.isEmpty() ? false : this.active.getValue();
916    }
917
918    /**
919     * @param value Whether this practitioner's record is in active use.
920     */
921    public Practitioner setActive(boolean value) { 
922        if (this.active == null)
923          this.active = new BooleanType();
924        this.active.setValue(value);
925      return this;
926    }
927
928    /**
929     * @return {@link #name} (A name associated with the person.)
930     */
931    public HumanName getName() { 
932      if (this.name == null)
933        if (Configuration.errorOnAutoCreate())
934          throw new Error("Attempt to auto-create Practitioner.name");
935        else if (Configuration.doAutoCreate())
936          this.name = new HumanName(); // cc
937      return this.name;
938    }
939
940    public boolean hasName() { 
941      return this.name != null && !this.name.isEmpty();
942    }
943
944    /**
945     * @param value {@link #name} (A name associated with the person.)
946     */
947    public Practitioner setName(HumanName value) { 
948      this.name = value;
949      return this;
950    }
951
952    /**
953     * @return {@link #telecom} (A contact detail for the practitioner, e.g. a telephone number or an email address.)
954     */
955    public List<ContactPoint> getTelecom() { 
956      if (this.telecom == null)
957        this.telecom = new ArrayList<ContactPoint>();
958      return this.telecom;
959    }
960
961    public boolean hasTelecom() { 
962      if (this.telecom == null)
963        return false;
964      for (ContactPoint item : this.telecom)
965        if (!item.isEmpty())
966          return true;
967      return false;
968    }
969
970    /**
971     * @return {@link #telecom} (A contact detail for the practitioner, e.g. a telephone number or an email address.)
972     */
973    // syntactic sugar
974    public ContactPoint addTelecom() { //3
975      ContactPoint t = new ContactPoint();
976      if (this.telecom == null)
977        this.telecom = new ArrayList<ContactPoint>();
978      this.telecom.add(t);
979      return t;
980    }
981
982    // syntactic sugar
983    public Practitioner addTelecom(ContactPoint t) { //3
984      if (t == null)
985        return this;
986      if (this.telecom == null)
987        this.telecom = new ArrayList<ContactPoint>();
988      this.telecom.add(t);
989      return this;
990    }
991
992    /**
993     * @return {@link #address} (The postal address where the practitioner can be found or visited or to which mail can be delivered.)
994     */
995    public List<Address> getAddress() { 
996      if (this.address == null)
997        this.address = new ArrayList<Address>();
998      return this.address;
999    }
1000
1001    public boolean hasAddress() { 
1002      if (this.address == null)
1003        return false;
1004      for (Address item : this.address)
1005        if (!item.isEmpty())
1006          return true;
1007      return false;
1008    }
1009
1010    /**
1011     * @return {@link #address} (The postal address where the practitioner can be found or visited or to which mail can be delivered.)
1012     */
1013    // syntactic sugar
1014    public Address addAddress() { //3
1015      Address t = new Address();
1016      if (this.address == null)
1017        this.address = new ArrayList<Address>();
1018      this.address.add(t);
1019      return t;
1020    }
1021
1022    // syntactic sugar
1023    public Practitioner addAddress(Address t) { //3
1024      if (t == null)
1025        return this;
1026      if (this.address == null)
1027        this.address = new ArrayList<Address>();
1028      this.address.add(t);
1029      return this;
1030    }
1031
1032    /**
1033     * @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value
1034     */
1035    public Enumeration<AdministrativeGender> getGenderElement() { 
1036      if (this.gender == null)
1037        if (Configuration.errorOnAutoCreate())
1038          throw new Error("Attempt to auto-create Practitioner.gender");
1039        else if (Configuration.doAutoCreate())
1040          this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory()); // bb
1041      return this.gender;
1042    }
1043
1044    public boolean hasGenderElement() { 
1045      return this.gender != null && !this.gender.isEmpty();
1046    }
1047
1048    public boolean hasGender() { 
1049      return this.gender != null && !this.gender.isEmpty();
1050    }
1051
1052    /**
1053     * @param value {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value
1054     */
1055    public Practitioner setGenderElement(Enumeration<AdministrativeGender> value) { 
1056      this.gender = value;
1057      return this;
1058    }
1059
1060    /**
1061     * @return Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
1062     */
1063    public AdministrativeGender getGender() { 
1064      return this.gender == null ? null : this.gender.getValue();
1065    }
1066
1067    /**
1068     * @param value Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.
1069     */
1070    public Practitioner setGender(AdministrativeGender value) { 
1071      if (value == null)
1072        this.gender = null;
1073      else {
1074        if (this.gender == null)
1075          this.gender = new Enumeration<AdministrativeGender>(new AdministrativeGenderEnumFactory());
1076        this.gender.setValue(value);
1077      }
1078      return this;
1079    }
1080
1081    /**
1082     * @return {@link #birthDate} (The date of birth for the practitioner.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value
1083     */
1084    public DateType getBirthDateElement() { 
1085      if (this.birthDate == null)
1086        if (Configuration.errorOnAutoCreate())
1087          throw new Error("Attempt to auto-create Practitioner.birthDate");
1088        else if (Configuration.doAutoCreate())
1089          this.birthDate = new DateType(); // bb
1090      return this.birthDate;
1091    }
1092
1093    public boolean hasBirthDateElement() { 
1094      return this.birthDate != null && !this.birthDate.isEmpty();
1095    }
1096
1097    public boolean hasBirthDate() { 
1098      return this.birthDate != null && !this.birthDate.isEmpty();
1099    }
1100
1101    /**
1102     * @param value {@link #birthDate} (The date of birth for the practitioner.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value
1103     */
1104    public Practitioner setBirthDateElement(DateType value) { 
1105      this.birthDate = value;
1106      return this;
1107    }
1108
1109    /**
1110     * @return The date of birth for the practitioner.
1111     */
1112    public Date getBirthDate() { 
1113      return this.birthDate == null ? null : this.birthDate.getValue();
1114    }
1115
1116    /**
1117     * @param value The date of birth for the practitioner.
1118     */
1119    public Practitioner setBirthDate(Date value) { 
1120      if (value == null)
1121        this.birthDate = null;
1122      else {
1123        if (this.birthDate == null)
1124          this.birthDate = new DateType();
1125        this.birthDate.setValue(value);
1126      }
1127      return this;
1128    }
1129
1130    /**
1131     * @return {@link #photo} (Image of the person.)
1132     */
1133    public List<Attachment> getPhoto() { 
1134      if (this.photo == null)
1135        this.photo = new ArrayList<Attachment>();
1136      return this.photo;
1137    }
1138
1139    public boolean hasPhoto() { 
1140      if (this.photo == null)
1141        return false;
1142      for (Attachment item : this.photo)
1143        if (!item.isEmpty())
1144          return true;
1145      return false;
1146    }
1147
1148    /**
1149     * @return {@link #photo} (Image of the person.)
1150     */
1151    // syntactic sugar
1152    public Attachment addPhoto() { //3
1153      Attachment t = new Attachment();
1154      if (this.photo == null)
1155        this.photo = new ArrayList<Attachment>();
1156      this.photo.add(t);
1157      return t;
1158    }
1159
1160    // syntactic sugar
1161    public Practitioner addPhoto(Attachment t) { //3
1162      if (t == null)
1163        return this;
1164      if (this.photo == null)
1165        this.photo = new ArrayList<Attachment>();
1166      this.photo.add(t);
1167      return this;
1168    }
1169
1170    /**
1171     * @return {@link #practitionerRole} (The list of roles/organizations that the practitioner is associated with.)
1172     */
1173    public List<PractitionerPractitionerRoleComponent> getPractitionerRole() { 
1174      if (this.practitionerRole == null)
1175        this.practitionerRole = new ArrayList<PractitionerPractitionerRoleComponent>();
1176      return this.practitionerRole;
1177    }
1178
1179    public boolean hasPractitionerRole() { 
1180      if (this.practitionerRole == null)
1181        return false;
1182      for (PractitionerPractitionerRoleComponent item : this.practitionerRole)
1183        if (!item.isEmpty())
1184          return true;
1185      return false;
1186    }
1187
1188    /**
1189     * @return {@link #practitionerRole} (The list of roles/organizations that the practitioner is associated with.)
1190     */
1191    // syntactic sugar
1192    public PractitionerPractitionerRoleComponent addPractitionerRole() { //3
1193      PractitionerPractitionerRoleComponent t = new PractitionerPractitionerRoleComponent();
1194      if (this.practitionerRole == null)
1195        this.practitionerRole = new ArrayList<PractitionerPractitionerRoleComponent>();
1196      this.practitionerRole.add(t);
1197      return t;
1198    }
1199
1200    // syntactic sugar
1201    public Practitioner addPractitionerRole(PractitionerPractitionerRoleComponent t) { //3
1202      if (t == null)
1203        return this;
1204      if (this.practitionerRole == null)
1205        this.practitionerRole = new ArrayList<PractitionerPractitionerRoleComponent>();
1206      this.practitionerRole.add(t);
1207      return this;
1208    }
1209
1210    /**
1211     * @return {@link #qualification} (Qualifications obtained by training and certification.)
1212     */
1213    public List<PractitionerQualificationComponent> getQualification() { 
1214      if (this.qualification == null)
1215        this.qualification = new ArrayList<PractitionerQualificationComponent>();
1216      return this.qualification;
1217    }
1218
1219    public boolean hasQualification() { 
1220      if (this.qualification == null)
1221        return false;
1222      for (PractitionerQualificationComponent item : this.qualification)
1223        if (!item.isEmpty())
1224          return true;
1225      return false;
1226    }
1227
1228    /**
1229     * @return {@link #qualification} (Qualifications obtained by training and certification.)
1230     */
1231    // syntactic sugar
1232    public PractitionerQualificationComponent addQualification() { //3
1233      PractitionerQualificationComponent t = new PractitionerQualificationComponent();
1234      if (this.qualification == null)
1235        this.qualification = new ArrayList<PractitionerQualificationComponent>();
1236      this.qualification.add(t);
1237      return t;
1238    }
1239
1240    // syntactic sugar
1241    public Practitioner addQualification(PractitionerQualificationComponent t) { //3
1242      if (t == null)
1243        return this;
1244      if (this.qualification == null)
1245        this.qualification = new ArrayList<PractitionerQualificationComponent>();
1246      this.qualification.add(t);
1247      return this;
1248    }
1249
1250    /**
1251     * @return {@link #communication} (A language the practitioner is able to use in patient communication.)
1252     */
1253    public List<CodeableConcept> getCommunication() { 
1254      if (this.communication == null)
1255        this.communication = new ArrayList<CodeableConcept>();
1256      return this.communication;
1257    }
1258
1259    public boolean hasCommunication() { 
1260      if (this.communication == null)
1261        return false;
1262      for (CodeableConcept item : this.communication)
1263        if (!item.isEmpty())
1264          return true;
1265      return false;
1266    }
1267
1268    /**
1269     * @return {@link #communication} (A language the practitioner is able to use in patient communication.)
1270     */
1271    // syntactic sugar
1272    public CodeableConcept addCommunication() { //3
1273      CodeableConcept t = new CodeableConcept();
1274      if (this.communication == null)
1275        this.communication = new ArrayList<CodeableConcept>();
1276      this.communication.add(t);
1277      return t;
1278    }
1279
1280    // syntactic sugar
1281    public Practitioner addCommunication(CodeableConcept t) { //3
1282      if (t == null)
1283        return this;
1284      if (this.communication == null)
1285        this.communication = new ArrayList<CodeableConcept>();
1286      this.communication.add(t);
1287      return this;
1288    }
1289
1290      protected void listChildren(List<Property> childrenList) {
1291        super.listChildren(childrenList);
1292        childrenList.add(new Property("identifier", "Identifier", "An identifier that applies to this person in this role.", 0, java.lang.Integer.MAX_VALUE, identifier));
1293        childrenList.add(new Property("active", "boolean", "Whether this practitioner's record is in active use.", 0, java.lang.Integer.MAX_VALUE, active));
1294        childrenList.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name));
1295        childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the practitioner, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom));
1296        childrenList.add(new Property("address", "Address", "The postal address where the practitioner can be found or visited or to which mail can be delivered.", 0, java.lang.Integer.MAX_VALUE, address));
1297        childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender));
1298        childrenList.add(new Property("birthDate", "date", "The date of birth for the practitioner.", 0, java.lang.Integer.MAX_VALUE, birthDate));
1299        childrenList.add(new Property("photo", "Attachment", "Image of the person.", 0, java.lang.Integer.MAX_VALUE, photo));
1300        childrenList.add(new Property("practitionerRole", "", "The list of roles/organizations that the practitioner is associated with.", 0, java.lang.Integer.MAX_VALUE, practitionerRole));
1301        childrenList.add(new Property("qualification", "", "Qualifications obtained by training and certification.", 0, java.lang.Integer.MAX_VALUE, qualification));
1302        childrenList.add(new Property("communication", "CodeableConcept", "A language the practitioner is able to use in patient communication.", 0, java.lang.Integer.MAX_VALUE, communication));
1303      }
1304
1305      @Override
1306      public void setProperty(String name, Base value) throws FHIRException {
1307        if (name.equals("identifier"))
1308          this.getIdentifier().add(castToIdentifier(value));
1309        else if (name.equals("active"))
1310          this.active = castToBoolean(value); // BooleanType
1311        else if (name.equals("name"))
1312          this.name = castToHumanName(value); // HumanName
1313        else if (name.equals("telecom"))
1314          this.getTelecom().add(castToContactPoint(value));
1315        else if (name.equals("address"))
1316          this.getAddress().add(castToAddress(value));
1317        else if (name.equals("gender"))
1318          this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration<AdministrativeGender>
1319        else if (name.equals("birthDate"))
1320          this.birthDate = castToDate(value); // DateType
1321        else if (name.equals("photo"))
1322          this.getPhoto().add(castToAttachment(value));
1323        else if (name.equals("practitionerRole"))
1324          this.getPractitionerRole().add((PractitionerPractitionerRoleComponent) value);
1325        else if (name.equals("qualification"))
1326          this.getQualification().add((PractitionerQualificationComponent) value);
1327        else if (name.equals("communication"))
1328          this.getCommunication().add(castToCodeableConcept(value));
1329        else
1330          super.setProperty(name, value);
1331      }
1332
1333      @Override
1334      public Base addChild(String name) throws FHIRException {
1335        if (name.equals("identifier")) {
1336          return addIdentifier();
1337        }
1338        else if (name.equals("active")) {
1339          throw new FHIRException("Cannot call addChild on a primitive type Practitioner.active");
1340        }
1341        else if (name.equals("name")) {
1342          this.name = new HumanName();
1343          return this.name;
1344        }
1345        else if (name.equals("telecom")) {
1346          return addTelecom();
1347        }
1348        else if (name.equals("address")) {
1349          return addAddress();
1350        }
1351        else if (name.equals("gender")) {
1352          throw new FHIRException("Cannot call addChild on a primitive type Practitioner.gender");
1353        }
1354        else if (name.equals("birthDate")) {
1355          throw new FHIRException("Cannot call addChild on a primitive type Practitioner.birthDate");
1356        }
1357        else if (name.equals("photo")) {
1358          return addPhoto();
1359        }
1360        else if (name.equals("practitionerRole")) {
1361          return addPractitionerRole();
1362        }
1363        else if (name.equals("qualification")) {
1364          return addQualification();
1365        }
1366        else if (name.equals("communication")) {
1367          return addCommunication();
1368        }
1369        else
1370          return super.addChild(name);
1371      }
1372
1373  public String fhirType() {
1374    return "Practitioner";
1375
1376  }
1377
1378      public Practitioner copy() {
1379        Practitioner dst = new Practitioner();
1380        copyValues(dst);
1381        if (identifier != null) {
1382          dst.identifier = new ArrayList<Identifier>();
1383          for (Identifier i : identifier)
1384            dst.identifier.add(i.copy());
1385        };
1386        dst.active = active == null ? null : active.copy();
1387        dst.name = name == null ? null : name.copy();
1388        if (telecom != null) {
1389          dst.telecom = new ArrayList<ContactPoint>();
1390          for (ContactPoint i : telecom)
1391            dst.telecom.add(i.copy());
1392        };
1393        if (address != null) {
1394          dst.address = new ArrayList<Address>();
1395          for (Address i : address)
1396            dst.address.add(i.copy());
1397        };
1398        dst.gender = gender == null ? null : gender.copy();
1399        dst.birthDate = birthDate == null ? null : birthDate.copy();
1400        if (photo != null) {
1401          dst.photo = new ArrayList<Attachment>();
1402          for (Attachment i : photo)
1403            dst.photo.add(i.copy());
1404        };
1405        if (practitionerRole != null) {
1406          dst.practitionerRole = new ArrayList<PractitionerPractitionerRoleComponent>();
1407          for (PractitionerPractitionerRoleComponent i : practitionerRole)
1408            dst.practitionerRole.add(i.copy());
1409        };
1410        if (qualification != null) {
1411          dst.qualification = new ArrayList<PractitionerQualificationComponent>();
1412          for (PractitionerQualificationComponent i : qualification)
1413            dst.qualification.add(i.copy());
1414        };
1415        if (communication != null) {
1416          dst.communication = new ArrayList<CodeableConcept>();
1417          for (CodeableConcept i : communication)
1418            dst.communication.add(i.copy());
1419        };
1420        return dst;
1421      }
1422
1423      protected Practitioner typedCopy() {
1424        return copy();
1425      }
1426
1427      @Override
1428      public boolean equalsDeep(Base other) {
1429        if (!super.equalsDeep(other))
1430          return false;
1431        if (!(other instanceof Practitioner))
1432          return false;
1433        Practitioner o = (Practitioner) other;
1434        return compareDeep(identifier, o.identifier, true) && compareDeep(active, o.active, true) && compareDeep(name, o.name, true)
1435           && compareDeep(telecom, o.telecom, true) && compareDeep(address, o.address, true) && compareDeep(gender, o.gender, true)
1436           && compareDeep(birthDate, o.birthDate, true) && compareDeep(photo, o.photo, true) && compareDeep(practitionerRole, o.practitionerRole, true)
1437           && compareDeep(qualification, o.qualification, true) && compareDeep(communication, o.communication, true)
1438          ;
1439      }
1440
1441      @Override
1442      public boolean equalsShallow(Base other) {
1443        if (!super.equalsShallow(other))
1444          return false;
1445        if (!(other instanceof Practitioner))
1446          return false;
1447        Practitioner o = (Practitioner) other;
1448        return compareValues(active, o.active, true) && compareValues(gender, o.gender, true) && compareValues(birthDate, o.birthDate, true)
1449          ;
1450      }
1451
1452      public boolean isEmpty() {
1453        return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (active == null || active.isEmpty())
1454           && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty())
1455           && (gender == null || gender.isEmpty()) && (birthDate == null || birthDate.isEmpty()) && (photo == null || photo.isEmpty())
1456           && (practitionerRole == null || practitionerRole.isEmpty()) && (qualification == null || qualification.isEmpty())
1457           && (communication == null || communication.isEmpty());
1458      }
1459
1460  @Override
1461  public ResourceType getResourceType() {
1462    return ResourceType.Practitioner;
1463   }
1464
1465  @SearchParamDefinition(name="identifier", path="Practitioner.identifier", description="A practitioner's Identifier", type="token" )
1466  public static final String SP_IDENTIFIER = "identifier";
1467  @SearchParamDefinition(name="given", path="Practitioner.name.given", description="A portion of the given name", type="string" )
1468  public static final String SP_GIVEN = "given";
1469  @SearchParamDefinition(name="specialty", path="Practitioner.practitionerRole.specialty", description="The practitioner has this specialty at an organization", type="token" )
1470  public static final String SP_SPECIALTY = "specialty";
1471  @SearchParamDefinition(name="address", path="Practitioner.address", description="An address in any kind of address/part", type="string" )
1472  public static final String SP_ADDRESS = "address";
1473  @SearchParamDefinition(name="role", path="Practitioner.practitionerRole.role", description="The practitioner can perform this role at for the organization", type="token" )
1474  public static final String SP_ROLE = "role";
1475  @SearchParamDefinition(name="address-state", path="Practitioner.address.state", description="A state specified in an address", type="string" )
1476  public static final String SP_ADDRESSSTATE = "address-state";
1477  @SearchParamDefinition(name="gender", path="Practitioner.gender", description="Gender of the practitioner", type="token" )
1478  public static final String SP_GENDER = "gender";
1479  @SearchParamDefinition(name="address-postalcode", path="Practitioner.address.postalCode", description="A postalCode specified in an address", type="string" )
1480  public static final String SP_ADDRESSPOSTALCODE = "address-postalcode";
1481  @SearchParamDefinition(name="address-country", path="Practitioner.address.country", description="A country specified in an address", type="string" )
1482  public static final String SP_ADDRESSCOUNTRY = "address-country";
1483  @SearchParamDefinition(name="phonetic", path="Practitioner.name", description="A portion of either family or given name using some kind of phonetic matching algorithm", type="string" )
1484  public static final String SP_PHONETIC = "phonetic";
1485  @SearchParamDefinition(name="phone", path="Practitioner.telecom.where(system='phone')", description="A value in a phone contact", type="token" )
1486  public static final String SP_PHONE = "phone";
1487  @SearchParamDefinition(name="organization", path="Practitioner.practitionerRole.managingOrganization", description="The identity of the organization the practitioner represents / acts on behalf of", type="reference" )
1488  public static final String SP_ORGANIZATION = "organization";
1489  @SearchParamDefinition(name="name", path="Practitioner.name", description="A portion of either family or given name", type="string" )
1490  public static final String SP_NAME = "name";
1491  @SearchParamDefinition(name="address-use", path="Practitioner.address.use", description="A use code specified in an address", type="token" )
1492  public static final String SP_ADDRESSUSE = "address-use";
1493  @SearchParamDefinition(name="telecom", path="Practitioner.telecom", description="The value in any kind of contact", type="token" )
1494  public static final String SP_TELECOM = "telecom";
1495  @SearchParamDefinition(name="location", path="Practitioner.practitionerRole.location", description="One of the locations at which this practitioner provides care", type="reference" )
1496  public static final String SP_LOCATION = "location";
1497  @SearchParamDefinition(name="family", path="Practitioner.name.family", description="A portion of the family name", type="string" )
1498  public static final String SP_FAMILY = "family";
1499  @SearchParamDefinition(name="address-city", path="Practitioner.address.city", description="A city specified in an address", type="string" )
1500  public static final String SP_ADDRESSCITY = "address-city";
1501  @SearchParamDefinition(name="communication", path="Practitioner.communication", description="One of the languages that the practitioner can communicate with", type="token" )
1502  public static final String SP_COMMUNICATION = "communication";
1503  @SearchParamDefinition(name="email", path="Practitioner.telecom.where(system='email')", description="A value in an email contact", type="token" )
1504  public static final String SP_EMAIL = "email";
1505
1506}
1507