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