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