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