001package org.hl7.fhir.r4.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034
035// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
036
037import java.util.*;
038
039import org.hl7.fhir.utilities.Utilities;
040import ca.uhn.fhir.model.api.annotation.ResourceDef;
041import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
042import ca.uhn.fhir.model.api.annotation.Child;
043import ca.uhn.fhir.model.api.annotation.ChildOrder;
044import ca.uhn.fhir.model.api.annotation.Description;
045import ca.uhn.fhir.model.api.annotation.Block;
046import org.hl7.fhir.instance.model.api.*;
047import org.hl7.fhir.exceptions.FHIRException;
048/**
049 * A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time.
050 */
051@ResourceDef(name="PractitionerRole", profile="http://hl7.org/fhir/StructureDefinition/PractitionerRole")
052public class PractitionerRole extends DomainResource {
053
054    public enum DaysOfWeek {
055        /**
056         * Monday.
057         */
058        MON, 
059        /**
060         * Tuesday.
061         */
062        TUE, 
063        /**
064         * Wednesday.
065         */
066        WED, 
067        /**
068         * Thursday.
069         */
070        THU, 
071        /**
072         * Friday.
073         */
074        FRI, 
075        /**
076         * Saturday.
077         */
078        SAT, 
079        /**
080         * Sunday.
081         */
082        SUN, 
083        /**
084         * added to help the parsers with the generic types
085         */
086        NULL;
087        public static DaysOfWeek fromCode(String codeString) throws FHIRException {
088            if (codeString == null || "".equals(codeString))
089                return null;
090        if ("mon".equals(codeString))
091          return MON;
092        if ("tue".equals(codeString))
093          return TUE;
094        if ("wed".equals(codeString))
095          return WED;
096        if ("thu".equals(codeString))
097          return THU;
098        if ("fri".equals(codeString))
099          return FRI;
100        if ("sat".equals(codeString))
101          return SAT;
102        if ("sun".equals(codeString))
103          return SUN;
104        if (Configuration.isAcceptInvalidEnums())
105          return null;
106        else
107          throw new FHIRException("Unknown DaysOfWeek code '"+codeString+"'");
108        }
109        public String toCode() {
110          switch (this) {
111            case MON: return "mon";
112            case TUE: return "tue";
113            case WED: return "wed";
114            case THU: return "thu";
115            case FRI: return "fri";
116            case SAT: return "sat";
117            case SUN: return "sun";
118            default: return "?";
119          }
120        }
121        public String getSystem() {
122          switch (this) {
123            case MON: return "http://hl7.org/fhir/days-of-week";
124            case TUE: return "http://hl7.org/fhir/days-of-week";
125            case WED: return "http://hl7.org/fhir/days-of-week";
126            case THU: return "http://hl7.org/fhir/days-of-week";
127            case FRI: return "http://hl7.org/fhir/days-of-week";
128            case SAT: return "http://hl7.org/fhir/days-of-week";
129            case SUN: return "http://hl7.org/fhir/days-of-week";
130            default: return "?";
131          }
132        }
133        public String getDefinition() {
134          switch (this) {
135            case MON: return "Monday.";
136            case TUE: return "Tuesday.";
137            case WED: return "Wednesday.";
138            case THU: return "Thursday.";
139            case FRI: return "Friday.";
140            case SAT: return "Saturday.";
141            case SUN: return "Sunday.";
142            default: return "?";
143          }
144        }
145        public String getDisplay() {
146          switch (this) {
147            case MON: return "Monday";
148            case TUE: return "Tuesday";
149            case WED: return "Wednesday";
150            case THU: return "Thursday";
151            case FRI: return "Friday";
152            case SAT: return "Saturday";
153            case SUN: return "Sunday";
154            default: return "?";
155          }
156        }
157    }
158
159  public static class DaysOfWeekEnumFactory implements EnumFactory<DaysOfWeek> {
160    public DaysOfWeek fromCode(String codeString) throws IllegalArgumentException {
161      if (codeString == null || "".equals(codeString))
162            if (codeString == null || "".equals(codeString))
163                return null;
164        if ("mon".equals(codeString))
165          return DaysOfWeek.MON;
166        if ("tue".equals(codeString))
167          return DaysOfWeek.TUE;
168        if ("wed".equals(codeString))
169          return DaysOfWeek.WED;
170        if ("thu".equals(codeString))
171          return DaysOfWeek.THU;
172        if ("fri".equals(codeString))
173          return DaysOfWeek.FRI;
174        if ("sat".equals(codeString))
175          return DaysOfWeek.SAT;
176        if ("sun".equals(codeString))
177          return DaysOfWeek.SUN;
178        throw new IllegalArgumentException("Unknown DaysOfWeek code '"+codeString+"'");
179        }
180        public Enumeration<DaysOfWeek> fromType(Base code) throws FHIRException {
181          if (code == null)
182            return null;
183          if (code.isEmpty())
184            return new Enumeration<DaysOfWeek>(this);
185          String codeString = ((PrimitiveType) code).asStringValue();
186          if (codeString == null || "".equals(codeString))
187            return null;
188        if ("mon".equals(codeString))
189          return new Enumeration<DaysOfWeek>(this, DaysOfWeek.MON);
190        if ("tue".equals(codeString))
191          return new Enumeration<DaysOfWeek>(this, DaysOfWeek.TUE);
192        if ("wed".equals(codeString))
193          return new Enumeration<DaysOfWeek>(this, DaysOfWeek.WED);
194        if ("thu".equals(codeString))
195          return new Enumeration<DaysOfWeek>(this, DaysOfWeek.THU);
196        if ("fri".equals(codeString))
197          return new Enumeration<DaysOfWeek>(this, DaysOfWeek.FRI);
198        if ("sat".equals(codeString))
199          return new Enumeration<DaysOfWeek>(this, DaysOfWeek.SAT);
200        if ("sun".equals(codeString))
201          return new Enumeration<DaysOfWeek>(this, DaysOfWeek.SUN);
202        throw new FHIRException("Unknown DaysOfWeek code '"+codeString+"'");
203        }
204    public String toCode(DaysOfWeek code) {
205      if (code == DaysOfWeek.MON)
206        return "mon";
207      if (code == DaysOfWeek.TUE)
208        return "tue";
209      if (code == DaysOfWeek.WED)
210        return "wed";
211      if (code == DaysOfWeek.THU)
212        return "thu";
213      if (code == DaysOfWeek.FRI)
214        return "fri";
215      if (code == DaysOfWeek.SAT)
216        return "sat";
217      if (code == DaysOfWeek.SUN)
218        return "sun";
219      return "?";
220      }
221    public String toSystem(DaysOfWeek code) {
222      return code.getSystem();
223      }
224    }
225
226    @Block()
227    public static class PractitionerRoleAvailableTimeComponent extends BackboneElement implements IBaseBackboneElement {
228        /**
229         * Indicates which days of the week are available between the start and end Times.
230         */
231        @Child(name = "daysOfWeek", type = {CodeType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
232        @Description(shortDefinition="mon | tue | wed | thu | fri | sat | sun", formalDefinition="Indicates which days of the week are available between the start and end Times." )
233        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/days-of-week")
234        protected List<Enumeration<DaysOfWeek>> daysOfWeek;
235
236        /**
237         * Is this always available? (hence times are irrelevant) e.g. 24 hour service.
238         */
239        @Child(name = "allDay", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
240        @Description(shortDefinition="Always available? e.g. 24 hour service", formalDefinition="Is this always available? (hence times are irrelevant) e.g. 24 hour service." )
241        protected BooleanType allDay;
242
243        /**
244         * The opening time of day. Note: If the AllDay flag is set, then this time is ignored.
245         */
246        @Child(name = "availableStartTime", type = {TimeType.class}, order=3, min=0, max=1, modifier=false, summary=false)
247        @Description(shortDefinition="Opening time of day (ignored if allDay = true)", formalDefinition="The opening time of day. Note: If the AllDay flag is set, then this time is ignored." )
248        protected TimeType availableStartTime;
249
250        /**
251         * The closing time of day. Note: If the AllDay flag is set, then this time is ignored.
252         */
253        @Child(name = "availableEndTime", type = {TimeType.class}, order=4, min=0, max=1, modifier=false, summary=false)
254        @Description(shortDefinition="Closing time of day (ignored if allDay = true)", formalDefinition="The closing time of day. Note: If the AllDay flag is set, then this time is ignored." )
255        protected TimeType availableEndTime;
256
257        private static final long serialVersionUID = -2139510127L;
258
259    /**
260     * Constructor
261     */
262      public PractitionerRoleAvailableTimeComponent() {
263        super();
264      }
265
266        /**
267         * @return {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.)
268         */
269        public List<Enumeration<DaysOfWeek>> getDaysOfWeek() { 
270          if (this.daysOfWeek == null)
271            this.daysOfWeek = new ArrayList<Enumeration<DaysOfWeek>>();
272          return this.daysOfWeek;
273        }
274
275        /**
276         * @return Returns a reference to <code>this</code> for easy method chaining
277         */
278        public PractitionerRoleAvailableTimeComponent setDaysOfWeek(List<Enumeration<DaysOfWeek>> theDaysOfWeek) { 
279          this.daysOfWeek = theDaysOfWeek;
280          return this;
281        }
282
283        public boolean hasDaysOfWeek() { 
284          if (this.daysOfWeek == null)
285            return false;
286          for (Enumeration<DaysOfWeek> item : this.daysOfWeek)
287            if (!item.isEmpty())
288              return true;
289          return false;
290        }
291
292        /**
293         * @return {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.)
294         */
295        public Enumeration<DaysOfWeek> addDaysOfWeekElement() {//2 
296          Enumeration<DaysOfWeek> t = new Enumeration<DaysOfWeek>(new DaysOfWeekEnumFactory());
297          if (this.daysOfWeek == null)
298            this.daysOfWeek = new ArrayList<Enumeration<DaysOfWeek>>();
299          this.daysOfWeek.add(t);
300          return t;
301        }
302
303        /**
304         * @param value {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.)
305         */
306        public PractitionerRoleAvailableTimeComponent addDaysOfWeek(DaysOfWeek value) { //1
307          Enumeration<DaysOfWeek> t = new Enumeration<DaysOfWeek>(new DaysOfWeekEnumFactory());
308          t.setValue(value);
309          if (this.daysOfWeek == null)
310            this.daysOfWeek = new ArrayList<Enumeration<DaysOfWeek>>();
311          this.daysOfWeek.add(t);
312          return this;
313        }
314
315        /**
316         * @param value {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.)
317         */
318        public boolean hasDaysOfWeek(DaysOfWeek value) { 
319          if (this.daysOfWeek == null)
320            return false;
321          for (Enumeration<DaysOfWeek> v : this.daysOfWeek)
322            if (v.getValue().equals(value)) // code
323              return true;
324          return false;
325        }
326
327        /**
328         * @return {@link #allDay} (Is this always available? (hence times are irrelevant) e.g. 24 hour service.). This is the underlying object with id, value and extensions. The accessor "getAllDay" gives direct access to the value
329         */
330        public BooleanType getAllDayElement() { 
331          if (this.allDay == null)
332            if (Configuration.errorOnAutoCreate())
333              throw new Error("Attempt to auto-create PractitionerRoleAvailableTimeComponent.allDay");
334            else if (Configuration.doAutoCreate())
335              this.allDay = new BooleanType(); // bb
336          return this.allDay;
337        }
338
339        public boolean hasAllDayElement() { 
340          return this.allDay != null && !this.allDay.isEmpty();
341        }
342
343        public boolean hasAllDay() { 
344          return this.allDay != null && !this.allDay.isEmpty();
345        }
346
347        /**
348         * @param value {@link #allDay} (Is this always available? (hence times are irrelevant) e.g. 24 hour service.). This is the underlying object with id, value and extensions. The accessor "getAllDay" gives direct access to the value
349         */
350        public PractitionerRoleAvailableTimeComponent setAllDayElement(BooleanType value) { 
351          this.allDay = value;
352          return this;
353        }
354
355        /**
356         * @return Is this always available? (hence times are irrelevant) e.g. 24 hour service.
357         */
358        public boolean getAllDay() { 
359          return this.allDay == null || this.allDay.isEmpty() ? false : this.allDay.getValue();
360        }
361
362        /**
363         * @param value Is this always available? (hence times are irrelevant) e.g. 24 hour service.
364         */
365        public PractitionerRoleAvailableTimeComponent setAllDay(boolean value) { 
366            if (this.allDay == null)
367              this.allDay = new BooleanType();
368            this.allDay.setValue(value);
369          return this;
370        }
371
372        /**
373         * @return {@link #availableStartTime} (The opening time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableStartTime" gives direct access to the value
374         */
375        public TimeType getAvailableStartTimeElement() { 
376          if (this.availableStartTime == null)
377            if (Configuration.errorOnAutoCreate())
378              throw new Error("Attempt to auto-create PractitionerRoleAvailableTimeComponent.availableStartTime");
379            else if (Configuration.doAutoCreate())
380              this.availableStartTime = new TimeType(); // bb
381          return this.availableStartTime;
382        }
383
384        public boolean hasAvailableStartTimeElement() { 
385          return this.availableStartTime != null && !this.availableStartTime.isEmpty();
386        }
387
388        public boolean hasAvailableStartTime() { 
389          return this.availableStartTime != null && !this.availableStartTime.isEmpty();
390        }
391
392        /**
393         * @param value {@link #availableStartTime} (The opening time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableStartTime" gives direct access to the value
394         */
395        public PractitionerRoleAvailableTimeComponent setAvailableStartTimeElement(TimeType value) { 
396          this.availableStartTime = value;
397          return this;
398        }
399
400        /**
401         * @return The opening time of day. Note: If the AllDay flag is set, then this time is ignored.
402         */
403        public String getAvailableStartTime() { 
404          return this.availableStartTime == null ? null : this.availableStartTime.getValue();
405        }
406
407        /**
408         * @param value The opening time of day. Note: If the AllDay flag is set, then this time is ignored.
409         */
410        public PractitionerRoleAvailableTimeComponent setAvailableStartTime(String value) { 
411          if (value == null)
412            this.availableStartTime = null;
413          else {
414            if (this.availableStartTime == null)
415              this.availableStartTime = new TimeType();
416            this.availableStartTime.setValue(value);
417          }
418          return this;
419        }
420
421        /**
422         * @return {@link #availableEndTime} (The closing time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableEndTime" gives direct access to the value
423         */
424        public TimeType getAvailableEndTimeElement() { 
425          if (this.availableEndTime == null)
426            if (Configuration.errorOnAutoCreate())
427              throw new Error("Attempt to auto-create PractitionerRoleAvailableTimeComponent.availableEndTime");
428            else if (Configuration.doAutoCreate())
429              this.availableEndTime = new TimeType(); // bb
430          return this.availableEndTime;
431        }
432
433        public boolean hasAvailableEndTimeElement() { 
434          return this.availableEndTime != null && !this.availableEndTime.isEmpty();
435        }
436
437        public boolean hasAvailableEndTime() { 
438          return this.availableEndTime != null && !this.availableEndTime.isEmpty();
439        }
440
441        /**
442         * @param value {@link #availableEndTime} (The closing time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableEndTime" gives direct access to the value
443         */
444        public PractitionerRoleAvailableTimeComponent setAvailableEndTimeElement(TimeType value) { 
445          this.availableEndTime = value;
446          return this;
447        }
448
449        /**
450         * @return The closing time of day. Note: If the AllDay flag is set, then this time is ignored.
451         */
452        public String getAvailableEndTime() { 
453          return this.availableEndTime == null ? null : this.availableEndTime.getValue();
454        }
455
456        /**
457         * @param value The closing time of day. Note: If the AllDay flag is set, then this time is ignored.
458         */
459        public PractitionerRoleAvailableTimeComponent setAvailableEndTime(String value) { 
460          if (value == null)
461            this.availableEndTime = null;
462          else {
463            if (this.availableEndTime == null)
464              this.availableEndTime = new TimeType();
465            this.availableEndTime.setValue(value);
466          }
467          return this;
468        }
469
470        protected void listChildren(List<Property> children) {
471          super.listChildren(children);
472          children.add(new Property("daysOfWeek", "code", "Indicates which days of the week are available between the start and end Times.", 0, java.lang.Integer.MAX_VALUE, daysOfWeek));
473          children.add(new Property("allDay", "boolean", "Is this always available? (hence times are irrelevant) e.g. 24 hour service.", 0, 1, allDay));
474          children.add(new Property("availableStartTime", "time", "The opening time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, 1, availableStartTime));
475          children.add(new Property("availableEndTime", "time", "The closing time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, 1, availableEndTime));
476        }
477
478        @Override
479        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
480          switch (_hash) {
481          case 68050338: /*daysOfWeek*/  return new Property("daysOfWeek", "code", "Indicates which days of the week are available between the start and end Times.", 0, java.lang.Integer.MAX_VALUE, daysOfWeek);
482          case -1414913477: /*allDay*/  return new Property("allDay", "boolean", "Is this always available? (hence times are irrelevant) e.g. 24 hour service.", 0, 1, allDay);
483          case -1039453818: /*availableStartTime*/  return new Property("availableStartTime", "time", "The opening time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, 1, availableStartTime);
484          case 101151551: /*availableEndTime*/  return new Property("availableEndTime", "time", "The closing time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, 1, availableEndTime);
485          default: return super.getNamedProperty(_hash, _name, _checkValid);
486          }
487
488        }
489
490      @Override
491      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
492        switch (hash) {
493        case 68050338: /*daysOfWeek*/ return this.daysOfWeek == null ? new Base[0] : this.daysOfWeek.toArray(new Base[this.daysOfWeek.size()]); // Enumeration<DaysOfWeek>
494        case -1414913477: /*allDay*/ return this.allDay == null ? new Base[0] : new Base[] {this.allDay}; // BooleanType
495        case -1039453818: /*availableStartTime*/ return this.availableStartTime == null ? new Base[0] : new Base[] {this.availableStartTime}; // TimeType
496        case 101151551: /*availableEndTime*/ return this.availableEndTime == null ? new Base[0] : new Base[] {this.availableEndTime}; // TimeType
497        default: return super.getProperty(hash, name, checkValid);
498        }
499
500      }
501
502      @Override
503      public Base setProperty(int hash, String name, Base value) throws FHIRException {
504        switch (hash) {
505        case 68050338: // daysOfWeek
506          value = new DaysOfWeekEnumFactory().fromType(castToCode(value));
507          this.getDaysOfWeek().add((Enumeration) value); // Enumeration<DaysOfWeek>
508          return value;
509        case -1414913477: // allDay
510          this.allDay = castToBoolean(value); // BooleanType
511          return value;
512        case -1039453818: // availableStartTime
513          this.availableStartTime = castToTime(value); // TimeType
514          return value;
515        case 101151551: // availableEndTime
516          this.availableEndTime = castToTime(value); // TimeType
517          return value;
518        default: return super.setProperty(hash, name, value);
519        }
520
521      }
522
523      @Override
524      public Base setProperty(String name, Base value) throws FHIRException {
525        if (name.equals("daysOfWeek")) {
526          value = new DaysOfWeekEnumFactory().fromType(castToCode(value));
527          this.getDaysOfWeek().add((Enumeration) value);
528        } else if (name.equals("allDay")) {
529          this.allDay = castToBoolean(value); // BooleanType
530        } else if (name.equals("availableStartTime")) {
531          this.availableStartTime = castToTime(value); // TimeType
532        } else if (name.equals("availableEndTime")) {
533          this.availableEndTime = castToTime(value); // TimeType
534        } else
535          return super.setProperty(name, value);
536        return value;
537      }
538
539      @Override
540      public Base makeProperty(int hash, String name) throws FHIRException {
541        switch (hash) {
542        case 68050338:  return addDaysOfWeekElement();
543        case -1414913477:  return getAllDayElement();
544        case -1039453818:  return getAvailableStartTimeElement();
545        case 101151551:  return getAvailableEndTimeElement();
546        default: return super.makeProperty(hash, name);
547        }
548
549      }
550
551      @Override
552      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
553        switch (hash) {
554        case 68050338: /*daysOfWeek*/ return new String[] {"code"};
555        case -1414913477: /*allDay*/ return new String[] {"boolean"};
556        case -1039453818: /*availableStartTime*/ return new String[] {"time"};
557        case 101151551: /*availableEndTime*/ return new String[] {"time"};
558        default: return super.getTypesForProperty(hash, name);
559        }
560
561      }
562
563      @Override
564      public Base addChild(String name) throws FHIRException {
565        if (name.equals("daysOfWeek")) {
566          throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.daysOfWeek");
567        }
568        else if (name.equals("allDay")) {
569          throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.allDay");
570        }
571        else if (name.equals("availableStartTime")) {
572          throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.availableStartTime");
573        }
574        else if (name.equals("availableEndTime")) {
575          throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.availableEndTime");
576        }
577        else
578          return super.addChild(name);
579      }
580
581      public PractitionerRoleAvailableTimeComponent copy() {
582        PractitionerRoleAvailableTimeComponent dst = new PractitionerRoleAvailableTimeComponent();
583        copyValues(dst);
584        return dst;
585      }
586
587      public void copyValues(PractitionerRoleAvailableTimeComponent dst) {
588        super.copyValues(dst);
589        if (daysOfWeek != null) {
590          dst.daysOfWeek = new ArrayList<Enumeration<DaysOfWeek>>();
591          for (Enumeration<DaysOfWeek> i : daysOfWeek)
592            dst.daysOfWeek.add(i.copy());
593        };
594        dst.allDay = allDay == null ? null : allDay.copy();
595        dst.availableStartTime = availableStartTime == null ? null : availableStartTime.copy();
596        dst.availableEndTime = availableEndTime == null ? null : availableEndTime.copy();
597      }
598
599      @Override
600      public boolean equalsDeep(Base other_) {
601        if (!super.equalsDeep(other_))
602          return false;
603        if (!(other_ instanceof PractitionerRoleAvailableTimeComponent))
604          return false;
605        PractitionerRoleAvailableTimeComponent o = (PractitionerRoleAvailableTimeComponent) other_;
606        return compareDeep(daysOfWeek, o.daysOfWeek, true) && compareDeep(allDay, o.allDay, true) && compareDeep(availableStartTime, o.availableStartTime, true)
607           && compareDeep(availableEndTime, o.availableEndTime, true);
608      }
609
610      @Override
611      public boolean equalsShallow(Base other_) {
612        if (!super.equalsShallow(other_))
613          return false;
614        if (!(other_ instanceof PractitionerRoleAvailableTimeComponent))
615          return false;
616        PractitionerRoleAvailableTimeComponent o = (PractitionerRoleAvailableTimeComponent) other_;
617        return compareValues(daysOfWeek, o.daysOfWeek, true) && compareValues(allDay, o.allDay, true) && compareValues(availableStartTime, o.availableStartTime, true)
618           && compareValues(availableEndTime, o.availableEndTime, true);
619      }
620
621      public boolean isEmpty() {
622        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(daysOfWeek, allDay, availableStartTime
623          , availableEndTime);
624      }
625
626  public String fhirType() {
627    return "PractitionerRole.availableTime";
628
629  }
630
631  }
632
633    @Block()
634    public static class PractitionerRoleNotAvailableComponent extends BackboneElement implements IBaseBackboneElement {
635        /**
636         * The reason that can be presented to the user as to why this time is not available.
637         */
638        @Child(name = "description", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
639        @Description(shortDefinition="Reason presented to the user explaining why time not available", formalDefinition="The reason that can be presented to the user as to why this time is not available." )
640        protected StringType description;
641
642        /**
643         * Service is not available (seasonally or for a public holiday) from this date.
644         */
645        @Child(name = "during", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=false)
646        @Description(shortDefinition="Service not available from this date", formalDefinition="Service is not available (seasonally or for a public holiday) from this date." )
647        protected Period during;
648
649        private static final long serialVersionUID = 310849929L;
650
651    /**
652     * Constructor
653     */
654      public PractitionerRoleNotAvailableComponent() {
655        super();
656      }
657
658    /**
659     * Constructor
660     */
661      public PractitionerRoleNotAvailableComponent(StringType description) {
662        super();
663        this.description = description;
664      }
665
666        /**
667         * @return {@link #description} (The reason that can be presented to the user as to why this time is not available.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
668         */
669        public StringType getDescriptionElement() { 
670          if (this.description == null)
671            if (Configuration.errorOnAutoCreate())
672              throw new Error("Attempt to auto-create PractitionerRoleNotAvailableComponent.description");
673            else if (Configuration.doAutoCreate())
674              this.description = new StringType(); // bb
675          return this.description;
676        }
677
678        public boolean hasDescriptionElement() { 
679          return this.description != null && !this.description.isEmpty();
680        }
681
682        public boolean hasDescription() { 
683          return this.description != null && !this.description.isEmpty();
684        }
685
686        /**
687         * @param value {@link #description} (The reason that can be presented to the user as to why this time is not available.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
688         */
689        public PractitionerRoleNotAvailableComponent setDescriptionElement(StringType value) { 
690          this.description = value;
691          return this;
692        }
693
694        /**
695         * @return The reason that can be presented to the user as to why this time is not available.
696         */
697        public String getDescription() { 
698          return this.description == null ? null : this.description.getValue();
699        }
700
701        /**
702         * @param value The reason that can be presented to the user as to why this time is not available.
703         */
704        public PractitionerRoleNotAvailableComponent setDescription(String value) { 
705            if (this.description == null)
706              this.description = new StringType();
707            this.description.setValue(value);
708          return this;
709        }
710
711        /**
712         * @return {@link #during} (Service is not available (seasonally or for a public holiday) from this date.)
713         */
714        public Period getDuring() { 
715          if (this.during == null)
716            if (Configuration.errorOnAutoCreate())
717              throw new Error("Attempt to auto-create PractitionerRoleNotAvailableComponent.during");
718            else if (Configuration.doAutoCreate())
719              this.during = new Period(); // cc
720          return this.during;
721        }
722
723        public boolean hasDuring() { 
724          return this.during != null && !this.during.isEmpty();
725        }
726
727        /**
728         * @param value {@link #during} (Service is not available (seasonally or for a public holiday) from this date.)
729         */
730        public PractitionerRoleNotAvailableComponent setDuring(Period value) { 
731          this.during = value;
732          return this;
733        }
734
735        protected void listChildren(List<Property> children) {
736          super.listChildren(children);
737          children.add(new Property("description", "string", "The reason that can be presented to the user as to why this time is not available.", 0, 1, description));
738          children.add(new Property("during", "Period", "Service is not available (seasonally or for a public holiday) from this date.", 0, 1, during));
739        }
740
741        @Override
742        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
743          switch (_hash) {
744          case -1724546052: /*description*/  return new Property("description", "string", "The reason that can be presented to the user as to why this time is not available.", 0, 1, description);
745          case -1320499647: /*during*/  return new Property("during", "Period", "Service is not available (seasonally or for a public holiday) from this date.", 0, 1, during);
746          default: return super.getNamedProperty(_hash, _name, _checkValid);
747          }
748
749        }
750
751      @Override
752      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
753        switch (hash) {
754        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
755        case -1320499647: /*during*/ return this.during == null ? new Base[0] : new Base[] {this.during}; // Period
756        default: return super.getProperty(hash, name, checkValid);
757        }
758
759      }
760
761      @Override
762      public Base setProperty(int hash, String name, Base value) throws FHIRException {
763        switch (hash) {
764        case -1724546052: // description
765          this.description = castToString(value); // StringType
766          return value;
767        case -1320499647: // during
768          this.during = castToPeriod(value); // Period
769          return value;
770        default: return super.setProperty(hash, name, value);
771        }
772
773      }
774
775      @Override
776      public Base setProperty(String name, Base value) throws FHIRException {
777        if (name.equals("description")) {
778          this.description = castToString(value); // StringType
779        } else if (name.equals("during")) {
780          this.during = castToPeriod(value); // Period
781        } else
782          return super.setProperty(name, value);
783        return value;
784      }
785
786      @Override
787      public Base makeProperty(int hash, String name) throws FHIRException {
788        switch (hash) {
789        case -1724546052:  return getDescriptionElement();
790        case -1320499647:  return getDuring(); 
791        default: return super.makeProperty(hash, name);
792        }
793
794      }
795
796      @Override
797      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
798        switch (hash) {
799        case -1724546052: /*description*/ return new String[] {"string"};
800        case -1320499647: /*during*/ return new String[] {"Period"};
801        default: return super.getTypesForProperty(hash, name);
802        }
803
804      }
805
806      @Override
807      public Base addChild(String name) throws FHIRException {
808        if (name.equals("description")) {
809          throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.description");
810        }
811        else if (name.equals("during")) {
812          this.during = new Period();
813          return this.during;
814        }
815        else
816          return super.addChild(name);
817      }
818
819      public PractitionerRoleNotAvailableComponent copy() {
820        PractitionerRoleNotAvailableComponent dst = new PractitionerRoleNotAvailableComponent();
821        copyValues(dst);
822        return dst;
823      }
824
825      public void copyValues(PractitionerRoleNotAvailableComponent dst) {
826        super.copyValues(dst);
827        dst.description = description == null ? null : description.copy();
828        dst.during = during == null ? null : during.copy();
829      }
830
831      @Override
832      public boolean equalsDeep(Base other_) {
833        if (!super.equalsDeep(other_))
834          return false;
835        if (!(other_ instanceof PractitionerRoleNotAvailableComponent))
836          return false;
837        PractitionerRoleNotAvailableComponent o = (PractitionerRoleNotAvailableComponent) other_;
838        return compareDeep(description, o.description, true) && compareDeep(during, o.during, true);
839      }
840
841      @Override
842      public boolean equalsShallow(Base other_) {
843        if (!super.equalsShallow(other_))
844          return false;
845        if (!(other_ instanceof PractitionerRoleNotAvailableComponent))
846          return false;
847        PractitionerRoleNotAvailableComponent o = (PractitionerRoleNotAvailableComponent) other_;
848        return compareValues(description, o.description, true);
849      }
850
851      public boolean isEmpty() {
852        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(description, during);
853      }
854
855  public String fhirType() {
856    return "PractitionerRole.notAvailable";
857
858  }
859
860  }
861
862    /**
863     * Business Identifiers that are specific to a role/location.
864     */
865    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
866    @Description(shortDefinition="Business Identifiers that are specific to a role/location", formalDefinition="Business Identifiers that are specific to a role/location." )
867    protected List<Identifier> identifier;
868
869    /**
870     * Whether this practitioner role record is in active use.
871     */
872    @Child(name = "active", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=true)
873    @Description(shortDefinition="Whether this practitioner role record is in active use", formalDefinition="Whether this practitioner role record is in active use." )
874    protected BooleanType active;
875
876    /**
877     * The period during which the person is authorized to act as a practitioner in these role(s) for the organization.
878     */
879    @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=true)
880    @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." )
881    protected Period period;
882
883    /**
884     * Practitioner that is able to provide the defined services for the organization.
885     */
886    @Child(name = "practitioner", type = {Practitioner.class}, order=3, min=0, max=1, modifier=false, summary=true)
887    @Description(shortDefinition="Practitioner that is able to provide the defined services for the organization", formalDefinition="Practitioner that is able to provide the defined services for the organization." )
888    protected Reference practitioner;
889
890    /**
891     * The actual object that is the target of the reference (Practitioner that is able to provide the defined services for the organization.)
892     */
893    protected Practitioner practitionerTarget;
894
895    /**
896     * The organization where the Practitioner performs the roles associated.
897     */
898    @Child(name = "organization", type = {Organization.class}, order=4, min=0, max=1, modifier=false, summary=true)
899    @Description(shortDefinition="Organization where the roles are available", formalDefinition="The organization where the Practitioner performs the roles associated." )
900    protected Reference organization;
901
902    /**
903     * The actual object that is the target of the reference (The organization where the Practitioner performs the roles associated.)
904     */
905    protected Organization organizationTarget;
906
907    /**
908     * Roles which this practitioner is authorized to perform for the organization.
909     */
910    @Child(name = "code", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
911    @Description(shortDefinition="Roles which this practitioner may perform", formalDefinition="Roles which this practitioner is authorized to perform for the organization." )
912    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/practitioner-role")
913    protected List<CodeableConcept> code;
914
915    /**
916     * Specific specialty of the practitioner.
917     */
918    @Child(name = "specialty", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
919    @Description(shortDefinition="Specific specialty of the practitioner", formalDefinition="Specific specialty of the practitioner." )
920    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/c80-practice-codes")
921    protected List<CodeableConcept> specialty;
922
923    /**
924     * The location(s) at which this practitioner provides care.
925     */
926    @Child(name = "location", type = {Location.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
927    @Description(shortDefinition="The location(s) at which this practitioner provides care", formalDefinition="The location(s) at which this practitioner provides care." )
928    protected List<Reference> location;
929    /**
930     * The actual objects that are the target of the reference (The location(s) at which this practitioner provides care.)
931     */
932    protected List<Location> locationTarget;
933
934
935    /**
936     * The list of healthcare services that this worker provides for this role's Organization/Location(s).
937     */
938    @Child(name = "healthcareService", type = {HealthcareService.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
939    @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)." )
940    protected List<Reference> healthcareService;
941    /**
942     * 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).)
943     */
944    protected List<HealthcareService> healthcareServiceTarget;
945
946
947    /**
948     * Contact details that are specific to the role/location/service.
949     */
950    @Child(name = "telecom", type = {ContactPoint.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
951    @Description(shortDefinition="Contact details that are specific to the role/location/service", formalDefinition="Contact details that are specific to the role/location/service." )
952    protected List<ContactPoint> telecom;
953
954    /**
955     * A collection of times the practitioner is available or performing this role at the location and/or healthcareservice.
956     */
957    @Child(name = "availableTime", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
958    @Description(shortDefinition="Times the Service Site is available", formalDefinition="A collection of times the practitioner is available or performing this role at the location and/or healthcareservice." )
959    protected List<PractitionerRoleAvailableTimeComponent> availableTime;
960
961    /**
962     * The practitioner is not available or performing this role during this period of time due to the provided reason.
963     */
964    @Child(name = "notAvailable", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
965    @Description(shortDefinition="Not available during this time due to provided reason", formalDefinition="The practitioner is not available or performing this role during this period of time due to the provided reason." )
966    protected List<PractitionerRoleNotAvailableComponent> notAvailable;
967
968    /**
969     * A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.
970     */
971    @Child(name = "availabilityExceptions", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false)
972    @Description(shortDefinition="Description of availability exceptions", formalDefinition="A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times." )
973    protected StringType availabilityExceptions;
974
975    /**
976     * Technical endpoints providing access to services operated for the practitioner with this role.
977     */
978    @Child(name = "endpoint", type = {Endpoint.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
979    @Description(shortDefinition="Technical endpoints providing access to services operated for the practitioner with this role", formalDefinition="Technical endpoints providing access to services operated for the practitioner with this role." )
980    protected List<Reference> endpoint;
981    /**
982     * The actual objects that are the target of the reference (Technical endpoints providing access to services operated for the practitioner with this role.)
983     */
984    protected List<Endpoint> endpointTarget;
985
986
987    private static final long serialVersionUID = 423338051L;
988
989  /**
990   * Constructor
991   */
992    public PractitionerRole() {
993      super();
994    }
995
996    /**
997     * @return {@link #identifier} (Business Identifiers that are specific to a role/location.)
998     */
999    public List<Identifier> getIdentifier() { 
1000      if (this.identifier == null)
1001        this.identifier = new ArrayList<Identifier>();
1002      return this.identifier;
1003    }
1004
1005    /**
1006     * @return Returns a reference to <code>this</code> for easy method chaining
1007     */
1008    public PractitionerRole setIdentifier(List<Identifier> theIdentifier) { 
1009      this.identifier = theIdentifier;
1010      return this;
1011    }
1012
1013    public boolean hasIdentifier() { 
1014      if (this.identifier == null)
1015        return false;
1016      for (Identifier item : this.identifier)
1017        if (!item.isEmpty())
1018          return true;
1019      return false;
1020    }
1021
1022    public Identifier addIdentifier() { //3
1023      Identifier t = new Identifier();
1024      if (this.identifier == null)
1025        this.identifier = new ArrayList<Identifier>();
1026      this.identifier.add(t);
1027      return t;
1028    }
1029
1030    public PractitionerRole addIdentifier(Identifier t) { //3
1031      if (t == null)
1032        return this;
1033      if (this.identifier == null)
1034        this.identifier = new ArrayList<Identifier>();
1035      this.identifier.add(t);
1036      return this;
1037    }
1038
1039    /**
1040     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
1041     */
1042    public Identifier getIdentifierFirstRep() { 
1043      if (getIdentifier().isEmpty()) {
1044        addIdentifier();
1045      }
1046      return getIdentifier().get(0);
1047    }
1048
1049    /**
1050     * @return {@link #active} (Whether this practitioner role record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value
1051     */
1052    public BooleanType getActiveElement() { 
1053      if (this.active == null)
1054        if (Configuration.errorOnAutoCreate())
1055          throw new Error("Attempt to auto-create PractitionerRole.active");
1056        else if (Configuration.doAutoCreate())
1057          this.active = new BooleanType(); // bb
1058      return this.active;
1059    }
1060
1061    public boolean hasActiveElement() { 
1062      return this.active != null && !this.active.isEmpty();
1063    }
1064
1065    public boolean hasActive() { 
1066      return this.active != null && !this.active.isEmpty();
1067    }
1068
1069    /**
1070     * @param value {@link #active} (Whether this practitioner role record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value
1071     */
1072    public PractitionerRole setActiveElement(BooleanType value) { 
1073      this.active = value;
1074      return this;
1075    }
1076
1077    /**
1078     * @return Whether this practitioner role record is in active use.
1079     */
1080    public boolean getActive() { 
1081      return this.active == null || this.active.isEmpty() ? false : this.active.getValue();
1082    }
1083
1084    /**
1085     * @param value Whether this practitioner role record is in active use.
1086     */
1087    public PractitionerRole setActive(boolean value) { 
1088        if (this.active == null)
1089          this.active = new BooleanType();
1090        this.active.setValue(value);
1091      return this;
1092    }
1093
1094    /**
1095     * @return {@link #period} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.)
1096     */
1097    public Period getPeriod() { 
1098      if (this.period == null)
1099        if (Configuration.errorOnAutoCreate())
1100          throw new Error("Attempt to auto-create PractitionerRole.period");
1101        else if (Configuration.doAutoCreate())
1102          this.period = new Period(); // cc
1103      return this.period;
1104    }
1105
1106    public boolean hasPeriod() { 
1107      return this.period != null && !this.period.isEmpty();
1108    }
1109
1110    /**
1111     * @param value {@link #period} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.)
1112     */
1113    public PractitionerRole setPeriod(Period value) { 
1114      this.period = value;
1115      return this;
1116    }
1117
1118    /**
1119     * @return {@link #practitioner} (Practitioner that is able to provide the defined services for the organization.)
1120     */
1121    public Reference getPractitioner() { 
1122      if (this.practitioner == null)
1123        if (Configuration.errorOnAutoCreate())
1124          throw new Error("Attempt to auto-create PractitionerRole.practitioner");
1125        else if (Configuration.doAutoCreate())
1126          this.practitioner = new Reference(); // cc
1127      return this.practitioner;
1128    }
1129
1130    public boolean hasPractitioner() { 
1131      return this.practitioner != null && !this.practitioner.isEmpty();
1132    }
1133
1134    /**
1135     * @param value {@link #practitioner} (Practitioner that is able to provide the defined services for the organization.)
1136     */
1137    public PractitionerRole setPractitioner(Reference value) { 
1138      this.practitioner = value;
1139      return this;
1140    }
1141
1142    /**
1143     * @return {@link #practitioner} 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. (Practitioner that is able to provide the defined services for the organization.)
1144     */
1145    public Practitioner getPractitionerTarget() { 
1146      if (this.practitionerTarget == null)
1147        if (Configuration.errorOnAutoCreate())
1148          throw new Error("Attempt to auto-create PractitionerRole.practitioner");
1149        else if (Configuration.doAutoCreate())
1150          this.practitionerTarget = new Practitioner(); // aa
1151      return this.practitionerTarget;
1152    }
1153
1154    /**
1155     * @param value {@link #practitioner} 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. (Practitioner that is able to provide the defined services for the organization.)
1156     */
1157    public PractitionerRole setPractitionerTarget(Practitioner value) { 
1158      this.practitionerTarget = value;
1159      return this;
1160    }
1161
1162    /**
1163     * @return {@link #organization} (The organization where the Practitioner performs the roles associated.)
1164     */
1165    public Reference getOrganization() { 
1166      if (this.organization == null)
1167        if (Configuration.errorOnAutoCreate())
1168          throw new Error("Attempt to auto-create PractitionerRole.organization");
1169        else if (Configuration.doAutoCreate())
1170          this.organization = new Reference(); // cc
1171      return this.organization;
1172    }
1173
1174    public boolean hasOrganization() { 
1175      return this.organization != null && !this.organization.isEmpty();
1176    }
1177
1178    /**
1179     * @param value {@link #organization} (The organization where the Practitioner performs the roles associated.)
1180     */
1181    public PractitionerRole setOrganization(Reference value) { 
1182      this.organization = value;
1183      return this;
1184    }
1185
1186    /**
1187     * @return {@link #organization} 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.)
1188     */
1189    public Organization getOrganizationTarget() { 
1190      if (this.organizationTarget == null)
1191        if (Configuration.errorOnAutoCreate())
1192          throw new Error("Attempt to auto-create PractitionerRole.organization");
1193        else if (Configuration.doAutoCreate())
1194          this.organizationTarget = new Organization(); // aa
1195      return this.organizationTarget;
1196    }
1197
1198    /**
1199     * @param value {@link #organization} 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.)
1200     */
1201    public PractitionerRole setOrganizationTarget(Organization value) { 
1202      this.organizationTarget = value;
1203      return this;
1204    }
1205
1206    /**
1207     * @return {@link #code} (Roles which this practitioner is authorized to perform for the organization.)
1208     */
1209    public List<CodeableConcept> getCode() { 
1210      if (this.code == null)
1211        this.code = new ArrayList<CodeableConcept>();
1212      return this.code;
1213    }
1214
1215    /**
1216     * @return Returns a reference to <code>this</code> for easy method chaining
1217     */
1218    public PractitionerRole setCode(List<CodeableConcept> theCode) { 
1219      this.code = theCode;
1220      return this;
1221    }
1222
1223    public boolean hasCode() { 
1224      if (this.code == null)
1225        return false;
1226      for (CodeableConcept item : this.code)
1227        if (!item.isEmpty())
1228          return true;
1229      return false;
1230    }
1231
1232    public CodeableConcept addCode() { //3
1233      CodeableConcept t = new CodeableConcept();
1234      if (this.code == null)
1235        this.code = new ArrayList<CodeableConcept>();
1236      this.code.add(t);
1237      return t;
1238    }
1239
1240    public PractitionerRole addCode(CodeableConcept t) { //3
1241      if (t == null)
1242        return this;
1243      if (this.code == null)
1244        this.code = new ArrayList<CodeableConcept>();
1245      this.code.add(t);
1246      return this;
1247    }
1248
1249    /**
1250     * @return The first repetition of repeating field {@link #code}, creating it if it does not already exist
1251     */
1252    public CodeableConcept getCodeFirstRep() { 
1253      if (getCode().isEmpty()) {
1254        addCode();
1255      }
1256      return getCode().get(0);
1257    }
1258
1259    /**
1260     * @return {@link #specialty} (Specific specialty of the practitioner.)
1261     */
1262    public List<CodeableConcept> getSpecialty() { 
1263      if (this.specialty == null)
1264        this.specialty = new ArrayList<CodeableConcept>();
1265      return this.specialty;
1266    }
1267
1268    /**
1269     * @return Returns a reference to <code>this</code> for easy method chaining
1270     */
1271    public PractitionerRole setSpecialty(List<CodeableConcept> theSpecialty) { 
1272      this.specialty = theSpecialty;
1273      return this;
1274    }
1275
1276    public boolean hasSpecialty() { 
1277      if (this.specialty == null)
1278        return false;
1279      for (CodeableConcept item : this.specialty)
1280        if (!item.isEmpty())
1281          return true;
1282      return false;
1283    }
1284
1285    public CodeableConcept addSpecialty() { //3
1286      CodeableConcept t = new CodeableConcept();
1287      if (this.specialty == null)
1288        this.specialty = new ArrayList<CodeableConcept>();
1289      this.specialty.add(t);
1290      return t;
1291    }
1292
1293    public PractitionerRole addSpecialty(CodeableConcept t) { //3
1294      if (t == null)
1295        return this;
1296      if (this.specialty == null)
1297        this.specialty = new ArrayList<CodeableConcept>();
1298      this.specialty.add(t);
1299      return this;
1300    }
1301
1302    /**
1303     * @return The first repetition of repeating field {@link #specialty}, creating it if it does not already exist
1304     */
1305    public CodeableConcept getSpecialtyFirstRep() { 
1306      if (getSpecialty().isEmpty()) {
1307        addSpecialty();
1308      }
1309      return getSpecialty().get(0);
1310    }
1311
1312    /**
1313     * @return {@link #location} (The location(s) at which this practitioner provides care.)
1314     */
1315    public List<Reference> getLocation() { 
1316      if (this.location == null)
1317        this.location = new ArrayList<Reference>();
1318      return this.location;
1319    }
1320
1321    /**
1322     * @return Returns a reference to <code>this</code> for easy method chaining
1323     */
1324    public PractitionerRole setLocation(List<Reference> theLocation) { 
1325      this.location = theLocation;
1326      return this;
1327    }
1328
1329    public boolean hasLocation() { 
1330      if (this.location == null)
1331        return false;
1332      for (Reference item : this.location)
1333        if (!item.isEmpty())
1334          return true;
1335      return false;
1336    }
1337
1338    public Reference addLocation() { //3
1339      Reference t = new Reference();
1340      if (this.location == null)
1341        this.location = new ArrayList<Reference>();
1342      this.location.add(t);
1343      return t;
1344    }
1345
1346    public PractitionerRole addLocation(Reference t) { //3
1347      if (t == null)
1348        return this;
1349      if (this.location == null)
1350        this.location = new ArrayList<Reference>();
1351      this.location.add(t);
1352      return this;
1353    }
1354
1355    /**
1356     * @return The first repetition of repeating field {@link #location}, creating it if it does not already exist
1357     */
1358    public Reference getLocationFirstRep() { 
1359      if (getLocation().isEmpty()) {
1360        addLocation();
1361      }
1362      return getLocation().get(0);
1363    }
1364
1365    /**
1366     * @deprecated Use Reference#setResource(IBaseResource) instead
1367     */
1368    @Deprecated
1369    public List<Location> getLocationTarget() { 
1370      if (this.locationTarget == null)
1371        this.locationTarget = new ArrayList<Location>();
1372      return this.locationTarget;
1373    }
1374
1375    /**
1376     * @deprecated Use Reference#setResource(IBaseResource) instead
1377     */
1378    @Deprecated
1379    public Location addLocationTarget() { 
1380      Location r = new Location();
1381      if (this.locationTarget == null)
1382        this.locationTarget = new ArrayList<Location>();
1383      this.locationTarget.add(r);
1384      return r;
1385    }
1386
1387    /**
1388     * @return {@link #healthcareService} (The list of healthcare services that this worker provides for this role's Organization/Location(s).)
1389     */
1390    public List<Reference> getHealthcareService() { 
1391      if (this.healthcareService == null)
1392        this.healthcareService = new ArrayList<Reference>();
1393      return this.healthcareService;
1394    }
1395
1396    /**
1397     * @return Returns a reference to <code>this</code> for easy method chaining
1398     */
1399    public PractitionerRole setHealthcareService(List<Reference> theHealthcareService) { 
1400      this.healthcareService = theHealthcareService;
1401      return this;
1402    }
1403
1404    public boolean hasHealthcareService() { 
1405      if (this.healthcareService == null)
1406        return false;
1407      for (Reference item : this.healthcareService)
1408        if (!item.isEmpty())
1409          return true;
1410      return false;
1411    }
1412
1413    public Reference addHealthcareService() { //3
1414      Reference t = new Reference();
1415      if (this.healthcareService == null)
1416        this.healthcareService = new ArrayList<Reference>();
1417      this.healthcareService.add(t);
1418      return t;
1419    }
1420
1421    public PractitionerRole addHealthcareService(Reference t) { //3
1422      if (t == null)
1423        return this;
1424      if (this.healthcareService == null)
1425        this.healthcareService = new ArrayList<Reference>();
1426      this.healthcareService.add(t);
1427      return this;
1428    }
1429
1430    /**
1431     * @return The first repetition of repeating field {@link #healthcareService}, creating it if it does not already exist
1432     */
1433    public Reference getHealthcareServiceFirstRep() { 
1434      if (getHealthcareService().isEmpty()) {
1435        addHealthcareService();
1436      }
1437      return getHealthcareService().get(0);
1438    }
1439
1440    /**
1441     * @deprecated Use Reference#setResource(IBaseResource) instead
1442     */
1443    @Deprecated
1444    public List<HealthcareService> getHealthcareServiceTarget() { 
1445      if (this.healthcareServiceTarget == null)
1446        this.healthcareServiceTarget = new ArrayList<HealthcareService>();
1447      return this.healthcareServiceTarget;
1448    }
1449
1450    /**
1451     * @deprecated Use Reference#setResource(IBaseResource) instead
1452     */
1453    @Deprecated
1454    public HealthcareService addHealthcareServiceTarget() { 
1455      HealthcareService r = new HealthcareService();
1456      if (this.healthcareServiceTarget == null)
1457        this.healthcareServiceTarget = new ArrayList<HealthcareService>();
1458      this.healthcareServiceTarget.add(r);
1459      return r;
1460    }
1461
1462    /**
1463     * @return {@link #telecom} (Contact details that are specific to the role/location/service.)
1464     */
1465    public List<ContactPoint> getTelecom() { 
1466      if (this.telecom == null)
1467        this.telecom = new ArrayList<ContactPoint>();
1468      return this.telecom;
1469    }
1470
1471    /**
1472     * @return Returns a reference to <code>this</code> for easy method chaining
1473     */
1474    public PractitionerRole setTelecom(List<ContactPoint> theTelecom) { 
1475      this.telecom = theTelecom;
1476      return this;
1477    }
1478
1479    public boolean hasTelecom() { 
1480      if (this.telecom == null)
1481        return false;
1482      for (ContactPoint item : this.telecom)
1483        if (!item.isEmpty())
1484          return true;
1485      return false;
1486    }
1487
1488    public ContactPoint addTelecom() { //3
1489      ContactPoint t = new ContactPoint();
1490      if (this.telecom == null)
1491        this.telecom = new ArrayList<ContactPoint>();
1492      this.telecom.add(t);
1493      return t;
1494    }
1495
1496    public PractitionerRole addTelecom(ContactPoint t) { //3
1497      if (t == null)
1498        return this;
1499      if (this.telecom == null)
1500        this.telecom = new ArrayList<ContactPoint>();
1501      this.telecom.add(t);
1502      return this;
1503    }
1504
1505    /**
1506     * @return The first repetition of repeating field {@link #telecom}, creating it if it does not already exist
1507     */
1508    public ContactPoint getTelecomFirstRep() { 
1509      if (getTelecom().isEmpty()) {
1510        addTelecom();
1511      }
1512      return getTelecom().get(0);
1513    }
1514
1515    /**
1516     * @return {@link #availableTime} (A collection of times the practitioner is available or performing this role at the location and/or healthcareservice.)
1517     */
1518    public List<PractitionerRoleAvailableTimeComponent> getAvailableTime() { 
1519      if (this.availableTime == null)
1520        this.availableTime = new ArrayList<PractitionerRoleAvailableTimeComponent>();
1521      return this.availableTime;
1522    }
1523
1524    /**
1525     * @return Returns a reference to <code>this</code> for easy method chaining
1526     */
1527    public PractitionerRole setAvailableTime(List<PractitionerRoleAvailableTimeComponent> theAvailableTime) { 
1528      this.availableTime = theAvailableTime;
1529      return this;
1530    }
1531
1532    public boolean hasAvailableTime() { 
1533      if (this.availableTime == null)
1534        return false;
1535      for (PractitionerRoleAvailableTimeComponent item : this.availableTime)
1536        if (!item.isEmpty())
1537          return true;
1538      return false;
1539    }
1540
1541    public PractitionerRoleAvailableTimeComponent addAvailableTime() { //3
1542      PractitionerRoleAvailableTimeComponent t = new PractitionerRoleAvailableTimeComponent();
1543      if (this.availableTime == null)
1544        this.availableTime = new ArrayList<PractitionerRoleAvailableTimeComponent>();
1545      this.availableTime.add(t);
1546      return t;
1547    }
1548
1549    public PractitionerRole addAvailableTime(PractitionerRoleAvailableTimeComponent t) { //3
1550      if (t == null)
1551        return this;
1552      if (this.availableTime == null)
1553        this.availableTime = new ArrayList<PractitionerRoleAvailableTimeComponent>();
1554      this.availableTime.add(t);
1555      return this;
1556    }
1557
1558    /**
1559     * @return The first repetition of repeating field {@link #availableTime}, creating it if it does not already exist
1560     */
1561    public PractitionerRoleAvailableTimeComponent getAvailableTimeFirstRep() { 
1562      if (getAvailableTime().isEmpty()) {
1563        addAvailableTime();
1564      }
1565      return getAvailableTime().get(0);
1566    }
1567
1568    /**
1569     * @return {@link #notAvailable} (The practitioner is not available or performing this role during this period of time due to the provided reason.)
1570     */
1571    public List<PractitionerRoleNotAvailableComponent> getNotAvailable() { 
1572      if (this.notAvailable == null)
1573        this.notAvailable = new ArrayList<PractitionerRoleNotAvailableComponent>();
1574      return this.notAvailable;
1575    }
1576
1577    /**
1578     * @return Returns a reference to <code>this</code> for easy method chaining
1579     */
1580    public PractitionerRole setNotAvailable(List<PractitionerRoleNotAvailableComponent> theNotAvailable) { 
1581      this.notAvailable = theNotAvailable;
1582      return this;
1583    }
1584
1585    public boolean hasNotAvailable() { 
1586      if (this.notAvailable == null)
1587        return false;
1588      for (PractitionerRoleNotAvailableComponent item : this.notAvailable)
1589        if (!item.isEmpty())
1590          return true;
1591      return false;
1592    }
1593
1594    public PractitionerRoleNotAvailableComponent addNotAvailable() { //3
1595      PractitionerRoleNotAvailableComponent t = new PractitionerRoleNotAvailableComponent();
1596      if (this.notAvailable == null)
1597        this.notAvailable = new ArrayList<PractitionerRoleNotAvailableComponent>();
1598      this.notAvailable.add(t);
1599      return t;
1600    }
1601
1602    public PractitionerRole addNotAvailable(PractitionerRoleNotAvailableComponent t) { //3
1603      if (t == null)
1604        return this;
1605      if (this.notAvailable == null)
1606        this.notAvailable = new ArrayList<PractitionerRoleNotAvailableComponent>();
1607      this.notAvailable.add(t);
1608      return this;
1609    }
1610
1611    /**
1612     * @return The first repetition of repeating field {@link #notAvailable}, creating it if it does not already exist
1613     */
1614    public PractitionerRoleNotAvailableComponent getNotAvailableFirstRep() { 
1615      if (getNotAvailable().isEmpty()) {
1616        addNotAvailable();
1617      }
1618      return getNotAvailable().get(0);
1619    }
1620
1621    /**
1622     * @return {@link #availabilityExceptions} (A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.). This is the underlying object with id, value and extensions. The accessor "getAvailabilityExceptions" gives direct access to the value
1623     */
1624    public StringType getAvailabilityExceptionsElement() { 
1625      if (this.availabilityExceptions == null)
1626        if (Configuration.errorOnAutoCreate())
1627          throw new Error("Attempt to auto-create PractitionerRole.availabilityExceptions");
1628        else if (Configuration.doAutoCreate())
1629          this.availabilityExceptions = new StringType(); // bb
1630      return this.availabilityExceptions;
1631    }
1632
1633    public boolean hasAvailabilityExceptionsElement() { 
1634      return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty();
1635    }
1636
1637    public boolean hasAvailabilityExceptions() { 
1638      return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty();
1639    }
1640
1641    /**
1642     * @param value {@link #availabilityExceptions} (A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.). This is the underlying object with id, value and extensions. The accessor "getAvailabilityExceptions" gives direct access to the value
1643     */
1644    public PractitionerRole setAvailabilityExceptionsElement(StringType value) { 
1645      this.availabilityExceptions = value;
1646      return this;
1647    }
1648
1649    /**
1650     * @return A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.
1651     */
1652    public String getAvailabilityExceptions() { 
1653      return this.availabilityExceptions == null ? null : this.availabilityExceptions.getValue();
1654    }
1655
1656    /**
1657     * @param value A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.
1658     */
1659    public PractitionerRole setAvailabilityExceptions(String value) { 
1660      if (Utilities.noString(value))
1661        this.availabilityExceptions = null;
1662      else {
1663        if (this.availabilityExceptions == null)
1664          this.availabilityExceptions = new StringType();
1665        this.availabilityExceptions.setValue(value);
1666      }
1667      return this;
1668    }
1669
1670    /**
1671     * @return {@link #endpoint} (Technical endpoints providing access to services operated for the practitioner with this role.)
1672     */
1673    public List<Reference> getEndpoint() { 
1674      if (this.endpoint == null)
1675        this.endpoint = new ArrayList<Reference>();
1676      return this.endpoint;
1677    }
1678
1679    /**
1680     * @return Returns a reference to <code>this</code> for easy method chaining
1681     */
1682    public PractitionerRole setEndpoint(List<Reference> theEndpoint) { 
1683      this.endpoint = theEndpoint;
1684      return this;
1685    }
1686
1687    public boolean hasEndpoint() { 
1688      if (this.endpoint == null)
1689        return false;
1690      for (Reference item : this.endpoint)
1691        if (!item.isEmpty())
1692          return true;
1693      return false;
1694    }
1695
1696    public Reference addEndpoint() { //3
1697      Reference t = new Reference();
1698      if (this.endpoint == null)
1699        this.endpoint = new ArrayList<Reference>();
1700      this.endpoint.add(t);
1701      return t;
1702    }
1703
1704    public PractitionerRole addEndpoint(Reference t) { //3
1705      if (t == null)
1706        return this;
1707      if (this.endpoint == null)
1708        this.endpoint = new ArrayList<Reference>();
1709      this.endpoint.add(t);
1710      return this;
1711    }
1712
1713    /**
1714     * @return The first repetition of repeating field {@link #endpoint}, creating it if it does not already exist
1715     */
1716    public Reference getEndpointFirstRep() { 
1717      if (getEndpoint().isEmpty()) {
1718        addEndpoint();
1719      }
1720      return getEndpoint().get(0);
1721    }
1722
1723    /**
1724     * @deprecated Use Reference#setResource(IBaseResource) instead
1725     */
1726    @Deprecated
1727    public List<Endpoint> getEndpointTarget() { 
1728      if (this.endpointTarget == null)
1729        this.endpointTarget = new ArrayList<Endpoint>();
1730      return this.endpointTarget;
1731    }
1732
1733    /**
1734     * @deprecated Use Reference#setResource(IBaseResource) instead
1735     */
1736    @Deprecated
1737    public Endpoint addEndpointTarget() { 
1738      Endpoint r = new Endpoint();
1739      if (this.endpointTarget == null)
1740        this.endpointTarget = new ArrayList<Endpoint>();
1741      this.endpointTarget.add(r);
1742      return r;
1743    }
1744
1745      protected void listChildren(List<Property> children) {
1746        super.listChildren(children);
1747        children.add(new Property("identifier", "Identifier", "Business Identifiers that are specific to a role/location.", 0, java.lang.Integer.MAX_VALUE, identifier));
1748        children.add(new Property("active", "boolean", "Whether this practitioner role record is in active use.", 0, 1, active));
1749        children.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, 1, period));
1750        children.add(new Property("practitioner", "Reference(Practitioner)", "Practitioner that is able to provide the defined services for the organization.", 0, 1, practitioner));
1751        children.add(new Property("organization", "Reference(Organization)", "The organization where the Practitioner performs the roles associated.", 0, 1, organization));
1752        children.add(new Property("code", "CodeableConcept", "Roles which this practitioner is authorized to perform for the organization.", 0, java.lang.Integer.MAX_VALUE, code));
1753        children.add(new Property("specialty", "CodeableConcept", "Specific specialty of the practitioner.", 0, java.lang.Integer.MAX_VALUE, specialty));
1754        children.add(new Property("location", "Reference(Location)", "The location(s) at which this practitioner provides care.", 0, java.lang.Integer.MAX_VALUE, location));
1755        children.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));
1756        children.add(new Property("telecom", "ContactPoint", "Contact details that are specific to the role/location/service.", 0, java.lang.Integer.MAX_VALUE, telecom));
1757        children.add(new Property("availableTime", "", "A collection of times the practitioner is available or performing this role at the location and/or healthcareservice.", 0, java.lang.Integer.MAX_VALUE, availableTime));
1758        children.add(new Property("notAvailable", "", "The practitioner is not available or performing this role during this period of time due to the provided reason.", 0, java.lang.Integer.MAX_VALUE, notAvailable));
1759        children.add(new Property("availabilityExceptions", "string", "A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.", 0, 1, availabilityExceptions));
1760        children.add(new Property("endpoint", "Reference(Endpoint)", "Technical endpoints providing access to services operated for the practitioner with this role.", 0, java.lang.Integer.MAX_VALUE, endpoint));
1761      }
1762
1763      @Override
1764      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1765        switch (_hash) {
1766        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Business Identifiers that are specific to a role/location.", 0, java.lang.Integer.MAX_VALUE, identifier);
1767        case -1422950650: /*active*/  return new Property("active", "boolean", "Whether this practitioner role record is in active use.", 0, 1, active);
1768        case -991726143: /*period*/  return 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, 1, period);
1769        case 574573338: /*practitioner*/  return new Property("practitioner", "Reference(Practitioner)", "Practitioner that is able to provide the defined services for the organization.", 0, 1, practitioner);
1770        case 1178922291: /*organization*/  return new Property("organization", "Reference(Organization)", "The organization where the Practitioner performs the roles associated.", 0, 1, organization);
1771        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "Roles which this practitioner is authorized to perform for the organization.", 0, java.lang.Integer.MAX_VALUE, code);
1772        case -1694759682: /*specialty*/  return new Property("specialty", "CodeableConcept", "Specific specialty of the practitioner.", 0, java.lang.Integer.MAX_VALUE, specialty);
1773        case 1901043637: /*location*/  return new Property("location", "Reference(Location)", "The location(s) at which this practitioner provides care.", 0, java.lang.Integer.MAX_VALUE, location);
1774        case 1289661064: /*healthcareService*/  return 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);
1775        case -1429363305: /*telecom*/  return new Property("telecom", "ContactPoint", "Contact details that are specific to the role/location/service.", 0, java.lang.Integer.MAX_VALUE, telecom);
1776        case 1873069366: /*availableTime*/  return new Property("availableTime", "", "A collection of times the practitioner is available or performing this role at the location and/or healthcareservice.", 0, java.lang.Integer.MAX_VALUE, availableTime);
1777        case -629572298: /*notAvailable*/  return new Property("notAvailable", "", "The practitioner is not available or performing this role during this period of time due to the provided reason.", 0, java.lang.Integer.MAX_VALUE, notAvailable);
1778        case -1149143617: /*availabilityExceptions*/  return new Property("availabilityExceptions", "string", "A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.", 0, 1, availabilityExceptions);
1779        case 1741102485: /*endpoint*/  return new Property("endpoint", "Reference(Endpoint)", "Technical endpoints providing access to services operated for the practitioner with this role.", 0, java.lang.Integer.MAX_VALUE, endpoint);
1780        default: return super.getNamedProperty(_hash, _name, _checkValid);
1781        }
1782
1783      }
1784
1785      @Override
1786      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1787        switch (hash) {
1788        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1789        case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType
1790        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
1791        case 574573338: /*practitioner*/ return this.practitioner == null ? new Base[0] : new Base[] {this.practitioner}; // Reference
1792        case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference
1793        case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // CodeableConcept
1794        case -1694759682: /*specialty*/ return this.specialty == null ? new Base[0] : this.specialty.toArray(new Base[this.specialty.size()]); // CodeableConcept
1795        case 1901043637: /*location*/ return this.location == null ? new Base[0] : this.location.toArray(new Base[this.location.size()]); // Reference
1796        case 1289661064: /*healthcareService*/ return this.healthcareService == null ? new Base[0] : this.healthcareService.toArray(new Base[this.healthcareService.size()]); // Reference
1797        case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint
1798        case 1873069366: /*availableTime*/ return this.availableTime == null ? new Base[0] : this.availableTime.toArray(new Base[this.availableTime.size()]); // PractitionerRoleAvailableTimeComponent
1799        case -629572298: /*notAvailable*/ return this.notAvailable == null ? new Base[0] : this.notAvailable.toArray(new Base[this.notAvailable.size()]); // PractitionerRoleNotAvailableComponent
1800        case -1149143617: /*availabilityExceptions*/ return this.availabilityExceptions == null ? new Base[0] : new Base[] {this.availabilityExceptions}; // StringType
1801        case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : this.endpoint.toArray(new Base[this.endpoint.size()]); // Reference
1802        default: return super.getProperty(hash, name, checkValid);
1803        }
1804
1805      }
1806
1807      @Override
1808      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1809        switch (hash) {
1810        case -1618432855: // identifier
1811          this.getIdentifier().add(castToIdentifier(value)); // Identifier
1812          return value;
1813        case -1422950650: // active
1814          this.active = castToBoolean(value); // BooleanType
1815          return value;
1816        case -991726143: // period
1817          this.period = castToPeriod(value); // Period
1818          return value;
1819        case 574573338: // practitioner
1820          this.practitioner = castToReference(value); // Reference
1821          return value;
1822        case 1178922291: // organization
1823          this.organization = castToReference(value); // Reference
1824          return value;
1825        case 3059181: // code
1826          this.getCode().add(castToCodeableConcept(value)); // CodeableConcept
1827          return value;
1828        case -1694759682: // specialty
1829          this.getSpecialty().add(castToCodeableConcept(value)); // CodeableConcept
1830          return value;
1831        case 1901043637: // location
1832          this.getLocation().add(castToReference(value)); // Reference
1833          return value;
1834        case 1289661064: // healthcareService
1835          this.getHealthcareService().add(castToReference(value)); // Reference
1836          return value;
1837        case -1429363305: // telecom
1838          this.getTelecom().add(castToContactPoint(value)); // ContactPoint
1839          return value;
1840        case 1873069366: // availableTime
1841          this.getAvailableTime().add((PractitionerRoleAvailableTimeComponent) value); // PractitionerRoleAvailableTimeComponent
1842          return value;
1843        case -629572298: // notAvailable
1844          this.getNotAvailable().add((PractitionerRoleNotAvailableComponent) value); // PractitionerRoleNotAvailableComponent
1845          return value;
1846        case -1149143617: // availabilityExceptions
1847          this.availabilityExceptions = castToString(value); // StringType
1848          return value;
1849        case 1741102485: // endpoint
1850          this.getEndpoint().add(castToReference(value)); // Reference
1851          return value;
1852        default: return super.setProperty(hash, name, value);
1853        }
1854
1855      }
1856
1857      @Override
1858      public Base setProperty(String name, Base value) throws FHIRException {
1859        if (name.equals("identifier")) {
1860          this.getIdentifier().add(castToIdentifier(value));
1861        } else if (name.equals("active")) {
1862          this.active = castToBoolean(value); // BooleanType
1863        } else if (name.equals("period")) {
1864          this.period = castToPeriod(value); // Period
1865        } else if (name.equals("practitioner")) {
1866          this.practitioner = castToReference(value); // Reference
1867        } else if (name.equals("organization")) {
1868          this.organization = castToReference(value); // Reference
1869        } else if (name.equals("code")) {
1870          this.getCode().add(castToCodeableConcept(value));
1871        } else if (name.equals("specialty")) {
1872          this.getSpecialty().add(castToCodeableConcept(value));
1873        } else if (name.equals("location")) {
1874          this.getLocation().add(castToReference(value));
1875        } else if (name.equals("healthcareService")) {
1876          this.getHealthcareService().add(castToReference(value));
1877        } else if (name.equals("telecom")) {
1878          this.getTelecom().add(castToContactPoint(value));
1879        } else if (name.equals("availableTime")) {
1880          this.getAvailableTime().add((PractitionerRoleAvailableTimeComponent) value);
1881        } else if (name.equals("notAvailable")) {
1882          this.getNotAvailable().add((PractitionerRoleNotAvailableComponent) value);
1883        } else if (name.equals("availabilityExceptions")) {
1884          this.availabilityExceptions = castToString(value); // StringType
1885        } else if (name.equals("endpoint")) {
1886          this.getEndpoint().add(castToReference(value));
1887        } else
1888          return super.setProperty(name, value);
1889        return value;
1890      }
1891
1892      @Override
1893      public Base makeProperty(int hash, String name) throws FHIRException {
1894        switch (hash) {
1895        case -1618432855:  return addIdentifier(); 
1896        case -1422950650:  return getActiveElement();
1897        case -991726143:  return getPeriod(); 
1898        case 574573338:  return getPractitioner(); 
1899        case 1178922291:  return getOrganization(); 
1900        case 3059181:  return addCode(); 
1901        case -1694759682:  return addSpecialty(); 
1902        case 1901043637:  return addLocation(); 
1903        case 1289661064:  return addHealthcareService(); 
1904        case -1429363305:  return addTelecom(); 
1905        case 1873069366:  return addAvailableTime(); 
1906        case -629572298:  return addNotAvailable(); 
1907        case -1149143617:  return getAvailabilityExceptionsElement();
1908        case 1741102485:  return addEndpoint(); 
1909        default: return super.makeProperty(hash, name);
1910        }
1911
1912      }
1913
1914      @Override
1915      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1916        switch (hash) {
1917        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1918        case -1422950650: /*active*/ return new String[] {"boolean"};
1919        case -991726143: /*period*/ return new String[] {"Period"};
1920        case 574573338: /*practitioner*/ return new String[] {"Reference"};
1921        case 1178922291: /*organization*/ return new String[] {"Reference"};
1922        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1923        case -1694759682: /*specialty*/ return new String[] {"CodeableConcept"};
1924        case 1901043637: /*location*/ return new String[] {"Reference"};
1925        case 1289661064: /*healthcareService*/ return new String[] {"Reference"};
1926        case -1429363305: /*telecom*/ return new String[] {"ContactPoint"};
1927        case 1873069366: /*availableTime*/ return new String[] {};
1928        case -629572298: /*notAvailable*/ return new String[] {};
1929        case -1149143617: /*availabilityExceptions*/ return new String[] {"string"};
1930        case 1741102485: /*endpoint*/ return new String[] {"Reference"};
1931        default: return super.getTypesForProperty(hash, name);
1932        }
1933
1934      }
1935
1936      @Override
1937      public Base addChild(String name) throws FHIRException {
1938        if (name.equals("identifier")) {
1939          return addIdentifier();
1940        }
1941        else if (name.equals("active")) {
1942          throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.active");
1943        }
1944        else if (name.equals("period")) {
1945          this.period = new Period();
1946          return this.period;
1947        }
1948        else if (name.equals("practitioner")) {
1949          this.practitioner = new Reference();
1950          return this.practitioner;
1951        }
1952        else if (name.equals("organization")) {
1953          this.organization = new Reference();
1954          return this.organization;
1955        }
1956        else if (name.equals("code")) {
1957          return addCode();
1958        }
1959        else if (name.equals("specialty")) {
1960          return addSpecialty();
1961        }
1962        else if (name.equals("location")) {
1963          return addLocation();
1964        }
1965        else if (name.equals("healthcareService")) {
1966          return addHealthcareService();
1967        }
1968        else if (name.equals("telecom")) {
1969          return addTelecom();
1970        }
1971        else if (name.equals("availableTime")) {
1972          return addAvailableTime();
1973        }
1974        else if (name.equals("notAvailable")) {
1975          return addNotAvailable();
1976        }
1977        else if (name.equals("availabilityExceptions")) {
1978          throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.availabilityExceptions");
1979        }
1980        else if (name.equals("endpoint")) {
1981          return addEndpoint();
1982        }
1983        else
1984          return super.addChild(name);
1985      }
1986
1987  public String fhirType() {
1988    return "PractitionerRole";
1989
1990  }
1991
1992      public PractitionerRole copy() {
1993        PractitionerRole dst = new PractitionerRole();
1994        copyValues(dst);
1995        return dst;
1996      }
1997
1998      public void copyValues(PractitionerRole dst) {
1999        super.copyValues(dst);
2000        if (identifier != null) {
2001          dst.identifier = new ArrayList<Identifier>();
2002          for (Identifier i : identifier)
2003            dst.identifier.add(i.copy());
2004        };
2005        dst.active = active == null ? null : active.copy();
2006        dst.period = period == null ? null : period.copy();
2007        dst.practitioner = practitioner == null ? null : practitioner.copy();
2008        dst.organization = organization == null ? null : organization.copy();
2009        if (code != null) {
2010          dst.code = new ArrayList<CodeableConcept>();
2011          for (CodeableConcept i : code)
2012            dst.code.add(i.copy());
2013        };
2014        if (specialty != null) {
2015          dst.specialty = new ArrayList<CodeableConcept>();
2016          for (CodeableConcept i : specialty)
2017            dst.specialty.add(i.copy());
2018        };
2019        if (location != null) {
2020          dst.location = new ArrayList<Reference>();
2021          for (Reference i : location)
2022            dst.location.add(i.copy());
2023        };
2024        if (healthcareService != null) {
2025          dst.healthcareService = new ArrayList<Reference>();
2026          for (Reference i : healthcareService)
2027            dst.healthcareService.add(i.copy());
2028        };
2029        if (telecom != null) {
2030          dst.telecom = new ArrayList<ContactPoint>();
2031          for (ContactPoint i : telecom)
2032            dst.telecom.add(i.copy());
2033        };
2034        if (availableTime != null) {
2035          dst.availableTime = new ArrayList<PractitionerRoleAvailableTimeComponent>();
2036          for (PractitionerRoleAvailableTimeComponent i : availableTime)
2037            dst.availableTime.add(i.copy());
2038        };
2039        if (notAvailable != null) {
2040          dst.notAvailable = new ArrayList<PractitionerRoleNotAvailableComponent>();
2041          for (PractitionerRoleNotAvailableComponent i : notAvailable)
2042            dst.notAvailable.add(i.copy());
2043        };
2044        dst.availabilityExceptions = availabilityExceptions == null ? null : availabilityExceptions.copy();
2045        if (endpoint != null) {
2046          dst.endpoint = new ArrayList<Reference>();
2047          for (Reference i : endpoint)
2048            dst.endpoint.add(i.copy());
2049        };
2050      }
2051
2052      protected PractitionerRole typedCopy() {
2053        return copy();
2054      }
2055
2056      @Override
2057      public boolean equalsDeep(Base other_) {
2058        if (!super.equalsDeep(other_))
2059          return false;
2060        if (!(other_ instanceof PractitionerRole))
2061          return false;
2062        PractitionerRole o = (PractitionerRole) other_;
2063        return compareDeep(identifier, o.identifier, true) && compareDeep(active, o.active, true) && compareDeep(period, o.period, true)
2064           && compareDeep(practitioner, o.practitioner, true) && compareDeep(organization, o.organization, true)
2065           && compareDeep(code, o.code, true) && compareDeep(specialty, o.specialty, true) && compareDeep(location, o.location, true)
2066           && compareDeep(healthcareService, o.healthcareService, true) && compareDeep(telecom, o.telecom, true)
2067           && compareDeep(availableTime, o.availableTime, true) && compareDeep(notAvailable, o.notAvailable, true)
2068           && compareDeep(availabilityExceptions, o.availabilityExceptions, true) && compareDeep(endpoint, o.endpoint, true)
2069          ;
2070      }
2071
2072      @Override
2073      public boolean equalsShallow(Base other_) {
2074        if (!super.equalsShallow(other_))
2075          return false;
2076        if (!(other_ instanceof PractitionerRole))
2077          return false;
2078        PractitionerRole o = (PractitionerRole) other_;
2079        return compareValues(active, o.active, true) && compareValues(availabilityExceptions, o.availabilityExceptions, true)
2080          ;
2081      }
2082
2083      public boolean isEmpty() {
2084        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, active, period
2085          , practitioner, organization, code, specialty, location, healthcareService, telecom
2086          , availableTime, notAvailable, availabilityExceptions, endpoint);
2087      }
2088
2089  @Override
2090  public ResourceType getResourceType() {
2091    return ResourceType.PractitionerRole;
2092   }
2093
2094 /**
2095   * Search parameter: <b>date</b>
2096   * <p>
2097   * Description: <b>The period during which the practitioner is authorized to perform in these role(s)</b><br>
2098   * Type: <b>date</b><br>
2099   * Path: <b>PractitionerRole.period</b><br>
2100   * </p>
2101   */
2102  @SearchParamDefinition(name="date", path="PractitionerRole.period", description="The period during which the practitioner is authorized to perform in these role(s)", type="date" )
2103  public static final String SP_DATE = "date";
2104 /**
2105   * <b>Fluent Client</b> search parameter constant for <b>date</b>
2106   * <p>
2107   * Description: <b>The period during which the practitioner is authorized to perform in these role(s)</b><br>
2108   * Type: <b>date</b><br>
2109   * Path: <b>PractitionerRole.period</b><br>
2110   * </p>
2111   */
2112  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
2113
2114 /**
2115   * Search parameter: <b>identifier</b>
2116   * <p>
2117   * Description: <b>A practitioner's Identifier</b><br>
2118   * Type: <b>token</b><br>
2119   * Path: <b>PractitionerRole.identifier</b><br>
2120   * </p>
2121   */
2122  @SearchParamDefinition(name="identifier", path="PractitionerRole.identifier", description="A practitioner's Identifier", type="token" )
2123  public static final String SP_IDENTIFIER = "identifier";
2124 /**
2125   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2126   * <p>
2127   * Description: <b>A practitioner's Identifier</b><br>
2128   * Type: <b>token</b><br>
2129   * Path: <b>PractitionerRole.identifier</b><br>
2130   * </p>
2131   */
2132  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2133
2134 /**
2135   * Search parameter: <b>specialty</b>
2136   * <p>
2137   * Description: <b>The practitioner has this specialty at an organization</b><br>
2138   * Type: <b>token</b><br>
2139   * Path: <b>PractitionerRole.specialty</b><br>
2140   * </p>
2141   */
2142  @SearchParamDefinition(name="specialty", path="PractitionerRole.specialty", description="The practitioner has this specialty at an organization", type="token" )
2143  public static final String SP_SPECIALTY = "specialty";
2144 /**
2145   * <b>Fluent Client</b> search parameter constant for <b>specialty</b>
2146   * <p>
2147   * Description: <b>The practitioner has this specialty at an organization</b><br>
2148   * Type: <b>token</b><br>
2149   * Path: <b>PractitionerRole.specialty</b><br>
2150   * </p>
2151   */
2152  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SPECIALTY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SPECIALTY);
2153
2154 /**
2155   * Search parameter: <b>role</b>
2156   * <p>
2157   * Description: <b>The practitioner can perform this role at for the organization</b><br>
2158   * Type: <b>token</b><br>
2159   * Path: <b>PractitionerRole.code</b><br>
2160   * </p>
2161   */
2162  @SearchParamDefinition(name="role", path="PractitionerRole.code", description="The practitioner can perform this role at for the organization", type="token" )
2163  public static final String SP_ROLE = "role";
2164 /**
2165   * <b>Fluent Client</b> search parameter constant for <b>role</b>
2166   * <p>
2167   * Description: <b>The practitioner can perform this role at for the organization</b><br>
2168   * Type: <b>token</b><br>
2169   * Path: <b>PractitionerRole.code</b><br>
2170   * </p>
2171   */
2172  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ROLE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ROLE);
2173
2174 /**
2175   * Search parameter: <b>practitioner</b>
2176   * <p>
2177   * Description: <b>Practitioner that is able to provide the defined services for the organization</b><br>
2178   * Type: <b>reference</b><br>
2179   * Path: <b>PractitionerRole.practitioner</b><br>
2180   * </p>
2181   */
2182  @SearchParamDefinition(name="practitioner", path="PractitionerRole.practitioner", description="Practitioner that is able to provide the defined services for the organization", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Practitioner.class } )
2183  public static final String SP_PRACTITIONER = "practitioner";
2184 /**
2185   * <b>Fluent Client</b> search parameter constant for <b>practitioner</b>
2186   * <p>
2187   * Description: <b>Practitioner that is able to provide the defined services for the organization</b><br>
2188   * Type: <b>reference</b><br>
2189   * Path: <b>PractitionerRole.practitioner</b><br>
2190   * </p>
2191   */
2192  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRACTITIONER);
2193
2194/**
2195   * Constant for fluent queries to be used to add include statements. Specifies
2196   * the path value of "<b>PractitionerRole:practitioner</b>".
2197   */
2198  public static final ca.uhn.fhir.model.api.Include INCLUDE_PRACTITIONER = new ca.uhn.fhir.model.api.Include("PractitionerRole:practitioner").toLocked();
2199
2200 /**
2201   * Search parameter: <b>active</b>
2202   * <p>
2203   * Description: <b>Whether this practitioner role record is in active use</b><br>
2204   * Type: <b>token</b><br>
2205   * Path: <b>PractitionerRole.active</b><br>
2206   * </p>
2207   */
2208  @SearchParamDefinition(name="active", path="PractitionerRole.active", description="Whether this practitioner role record is in active use", type="token" )
2209  public static final String SP_ACTIVE = "active";
2210 /**
2211   * <b>Fluent Client</b> search parameter constant for <b>active</b>
2212   * <p>
2213   * Description: <b>Whether this practitioner role record is in active use</b><br>
2214   * Type: <b>token</b><br>
2215   * Path: <b>PractitionerRole.active</b><br>
2216   * </p>
2217   */
2218  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTIVE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTIVE);
2219
2220 /**
2221   * Search parameter: <b>endpoint</b>
2222   * <p>
2223   * Description: <b>Technical endpoints providing access to services operated for the practitioner with this role</b><br>
2224   * Type: <b>reference</b><br>
2225   * Path: <b>PractitionerRole.endpoint</b><br>
2226   * </p>
2227   */
2228  @SearchParamDefinition(name="endpoint", path="PractitionerRole.endpoint", description="Technical endpoints providing access to services operated for the practitioner with this role", type="reference", target={Endpoint.class } )
2229  public static final String SP_ENDPOINT = "endpoint";
2230 /**
2231   * <b>Fluent Client</b> search parameter constant for <b>endpoint</b>
2232   * <p>
2233   * Description: <b>Technical endpoints providing access to services operated for the practitioner with this role</b><br>
2234   * Type: <b>reference</b><br>
2235   * Path: <b>PractitionerRole.endpoint</b><br>
2236   * </p>
2237   */
2238  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENDPOINT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENDPOINT);
2239
2240/**
2241   * Constant for fluent queries to be used to add include statements. Specifies
2242   * the path value of "<b>PractitionerRole:endpoint</b>".
2243   */
2244  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENDPOINT = new ca.uhn.fhir.model.api.Include("PractitionerRole:endpoint").toLocked();
2245
2246 /**
2247   * Search parameter: <b>phone</b>
2248   * <p>
2249   * Description: <b>A value in a phone contact</b><br>
2250   * Type: <b>token</b><br>
2251   * Path: <b>PractitionerRole.telecom(system=phone)</b><br>
2252   * </p>
2253   */
2254  @SearchParamDefinition(name="phone", path="PractitionerRole.telecom.where(system='phone')", description="A value in a phone contact", type="token" )
2255  public static final String SP_PHONE = "phone";
2256 /**
2257   * <b>Fluent Client</b> search parameter constant for <b>phone</b>
2258   * <p>
2259   * Description: <b>A value in a phone contact</b><br>
2260   * Type: <b>token</b><br>
2261   * Path: <b>PractitionerRole.telecom(system=phone)</b><br>
2262   * </p>
2263   */
2264  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PHONE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PHONE);
2265
2266 /**
2267   * Search parameter: <b>service</b>
2268   * <p>
2269   * Description: <b>The list of healthcare services that this worker provides for this role's Organization/Location(s)</b><br>
2270   * Type: <b>reference</b><br>
2271   * Path: <b>PractitionerRole.healthcareService</b><br>
2272   * </p>
2273   */
2274  @SearchParamDefinition(name="service", path="PractitionerRole.healthcareService", description="The list of healthcare services that this worker provides for this role's Organization/Location(s)", type="reference", target={HealthcareService.class } )
2275  public static final String SP_SERVICE = "service";
2276 /**
2277   * <b>Fluent Client</b> search parameter constant for <b>service</b>
2278   * <p>
2279   * Description: <b>The list of healthcare services that this worker provides for this role's Organization/Location(s)</b><br>
2280   * Type: <b>reference</b><br>
2281   * Path: <b>PractitionerRole.healthcareService</b><br>
2282   * </p>
2283   */
2284  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SERVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SERVICE);
2285
2286/**
2287   * Constant for fluent queries to be used to add include statements. Specifies
2288   * the path value of "<b>PractitionerRole:service</b>".
2289   */
2290  public static final ca.uhn.fhir.model.api.Include INCLUDE_SERVICE = new ca.uhn.fhir.model.api.Include("PractitionerRole:service").toLocked();
2291
2292 /**
2293   * Search parameter: <b>organization</b>
2294   * <p>
2295   * Description: <b>The identity of the organization the practitioner represents / acts on behalf of</b><br>
2296   * Type: <b>reference</b><br>
2297   * Path: <b>PractitionerRole.organization</b><br>
2298   * </p>
2299   */
2300  @SearchParamDefinition(name="organization", path="PractitionerRole.organization", description="The identity of the organization the practitioner represents / acts on behalf of", type="reference", target={Organization.class } )
2301  public static final String SP_ORGANIZATION = "organization";
2302 /**
2303   * <b>Fluent Client</b> search parameter constant for <b>organization</b>
2304   * <p>
2305   * Description: <b>The identity of the organization the practitioner represents / acts on behalf of</b><br>
2306   * Type: <b>reference</b><br>
2307   * Path: <b>PractitionerRole.organization</b><br>
2308   * </p>
2309   */
2310  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION);
2311
2312/**
2313   * Constant for fluent queries to be used to add include statements. Specifies
2314   * the path value of "<b>PractitionerRole:organization</b>".
2315   */
2316  public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("PractitionerRole:organization").toLocked();
2317
2318 /**
2319   * Search parameter: <b>telecom</b>
2320   * <p>
2321   * Description: <b>The value in any kind of contact</b><br>
2322   * Type: <b>token</b><br>
2323   * Path: <b>PractitionerRole.telecom</b><br>
2324   * </p>
2325   */
2326  @SearchParamDefinition(name="telecom", path="PractitionerRole.telecom", description="The value in any kind of contact", type="token" )
2327  public static final String SP_TELECOM = "telecom";
2328 /**
2329   * <b>Fluent Client</b> search parameter constant for <b>telecom</b>
2330   * <p>
2331   * Description: <b>The value in any kind of contact</b><br>
2332   * Type: <b>token</b><br>
2333   * Path: <b>PractitionerRole.telecom</b><br>
2334   * </p>
2335   */
2336  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TELECOM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TELECOM);
2337
2338 /**
2339   * Search parameter: <b>location</b>
2340   * <p>
2341   * Description: <b>One of the locations at which this practitioner provides care</b><br>
2342   * Type: <b>reference</b><br>
2343   * Path: <b>PractitionerRole.location</b><br>
2344   * </p>
2345   */
2346  @SearchParamDefinition(name="location", path="PractitionerRole.location", description="One of the locations at which this practitioner provides care", type="reference", target={Location.class } )
2347  public static final String SP_LOCATION = "location";
2348 /**
2349   * <b>Fluent Client</b> search parameter constant for <b>location</b>
2350   * <p>
2351   * Description: <b>One of the locations at which this practitioner provides care</b><br>
2352   * Type: <b>reference</b><br>
2353   * Path: <b>PractitionerRole.location</b><br>
2354   * </p>
2355   */
2356  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION);
2357
2358/**
2359   * Constant for fluent queries to be used to add include statements. Specifies
2360   * the path value of "<b>PractitionerRole:location</b>".
2361   */
2362  public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("PractitionerRole:location").toLocked();
2363
2364 /**
2365   * Search parameter: <b>email</b>
2366   * <p>
2367   * Description: <b>A value in an email contact</b><br>
2368   * Type: <b>token</b><br>
2369   * Path: <b>PractitionerRole.telecom(system=email)</b><br>
2370   * </p>
2371   */
2372  @SearchParamDefinition(name="email", path="PractitionerRole.telecom.where(system='email')", description="A value in an email contact", type="token" )
2373  public static final String SP_EMAIL = "email";
2374 /**
2375   * <b>Fluent Client</b> search parameter constant for <b>email</b>
2376   * <p>
2377   * Description: <b>A value in an email contact</b><br>
2378   * Type: <b>token</b><br>
2379   * Path: <b>PractitionerRole.telecom(system=email)</b><br>
2380   * </p>
2381   */
2382  public static final ca.uhn.fhir.rest.gclient.TokenClientParam EMAIL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EMAIL);
2383
2384
2385}