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