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 * The details of a healthcare service available at a location.
048 */
049@ResourceDef(name = "HealthcareService", profile = "http://hl7.org/fhir/StructureDefinition/HealthcareService")
050public class HealthcareService extends DomainResource {
051
052  public enum DaysOfWeek {
053    /**
054     * Monday.
055     */
056    MON,
057    /**
058     * Tuesday.
059     */
060    TUE,
061    /**
062     * Wednesday.
063     */
064    WED,
065    /**
066     * Thursday.
067     */
068    THU,
069    /**
070     * Friday.
071     */
072    FRI,
073    /**
074     * Saturday.
075     */
076    SAT,
077    /**
078     * Sunday.
079     */
080    SUN,
081    /**
082     * added to help the parsers with the generic types
083     */
084    NULL;
085
086    public static DaysOfWeek fromCode(String codeString) throws FHIRException {
087      if (codeString == null || "".equals(codeString))
088        return null;
089      if ("mon".equals(codeString))
090        return MON;
091      if ("tue".equals(codeString))
092        return TUE;
093      if ("wed".equals(codeString))
094        return WED;
095      if ("thu".equals(codeString))
096        return THU;
097      if ("fri".equals(codeString))
098        return FRI;
099      if ("sat".equals(codeString))
100        return SAT;
101      if ("sun".equals(codeString))
102        return SUN;
103      if (Configuration.isAcceptInvalidEnums())
104        return null;
105      else
106        throw new FHIRException("Unknown DaysOfWeek code '" + codeString + "'");
107    }
108
109    public String toCode() {
110      switch (this) {
111      case MON:
112        return "mon";
113      case TUE:
114        return "tue";
115      case WED:
116        return "wed";
117      case THU:
118        return "thu";
119      case FRI:
120        return "fri";
121      case SAT:
122        return "sat";
123      case SUN:
124        return "sun";
125      case NULL:
126        return null;
127      default:
128        return "?";
129      }
130    }
131
132    public String getSystem() {
133      switch (this) {
134      case MON:
135        return "http://hl7.org/fhir/days-of-week";
136      case TUE:
137        return "http://hl7.org/fhir/days-of-week";
138      case WED:
139        return "http://hl7.org/fhir/days-of-week";
140      case THU:
141        return "http://hl7.org/fhir/days-of-week";
142      case FRI:
143        return "http://hl7.org/fhir/days-of-week";
144      case SAT:
145        return "http://hl7.org/fhir/days-of-week";
146      case SUN:
147        return "http://hl7.org/fhir/days-of-week";
148      case NULL:
149        return null;
150      default:
151        return "?";
152      }
153    }
154
155    public String getDefinition() {
156      switch (this) {
157      case MON:
158        return "Monday.";
159      case TUE:
160        return "Tuesday.";
161      case WED:
162        return "Wednesday.";
163      case THU:
164        return "Thursday.";
165      case FRI:
166        return "Friday.";
167      case SAT:
168        return "Saturday.";
169      case SUN:
170        return "Sunday.";
171      case NULL:
172        return null;
173      default:
174        return "?";
175      }
176    }
177
178    public String getDisplay() {
179      switch (this) {
180      case MON:
181        return "Monday";
182      case TUE:
183        return "Tuesday";
184      case WED:
185        return "Wednesday";
186      case THU:
187        return "Thursday";
188      case FRI:
189        return "Friday";
190      case SAT:
191        return "Saturday";
192      case SUN:
193        return "Sunday";
194      case NULL:
195        return null;
196      default:
197        return "?";
198      }
199    }
200  }
201
202  public static class DaysOfWeekEnumFactory implements EnumFactory<DaysOfWeek> {
203    public DaysOfWeek fromCode(String codeString) throws IllegalArgumentException {
204      if (codeString == null || "".equals(codeString))
205        if (codeString == null || "".equals(codeString))
206          return null;
207      if ("mon".equals(codeString))
208        return DaysOfWeek.MON;
209      if ("tue".equals(codeString))
210        return DaysOfWeek.TUE;
211      if ("wed".equals(codeString))
212        return DaysOfWeek.WED;
213      if ("thu".equals(codeString))
214        return DaysOfWeek.THU;
215      if ("fri".equals(codeString))
216        return DaysOfWeek.FRI;
217      if ("sat".equals(codeString))
218        return DaysOfWeek.SAT;
219      if ("sun".equals(codeString))
220        return DaysOfWeek.SUN;
221      throw new IllegalArgumentException("Unknown DaysOfWeek code '" + codeString + "'");
222    }
223
224    public Enumeration<DaysOfWeek> fromType(PrimitiveType<?> code) throws FHIRException {
225      if (code == null)
226        return null;
227      if (code.isEmpty())
228        return new Enumeration<DaysOfWeek>(this, DaysOfWeek.NULL, code);
229      String codeString = code.asStringValue();
230      if (codeString == null || "".equals(codeString))
231        return new Enumeration<DaysOfWeek>(this, DaysOfWeek.NULL, code);
232      if ("mon".equals(codeString))
233        return new Enumeration<DaysOfWeek>(this, DaysOfWeek.MON, code);
234      if ("tue".equals(codeString))
235        return new Enumeration<DaysOfWeek>(this, DaysOfWeek.TUE, code);
236      if ("wed".equals(codeString))
237        return new Enumeration<DaysOfWeek>(this, DaysOfWeek.WED, code);
238      if ("thu".equals(codeString))
239        return new Enumeration<DaysOfWeek>(this, DaysOfWeek.THU, code);
240      if ("fri".equals(codeString))
241        return new Enumeration<DaysOfWeek>(this, DaysOfWeek.FRI, code);
242      if ("sat".equals(codeString))
243        return new Enumeration<DaysOfWeek>(this, DaysOfWeek.SAT, code);
244      if ("sun".equals(codeString))
245        return new Enumeration<DaysOfWeek>(this, DaysOfWeek.SUN, code);
246      throw new FHIRException("Unknown DaysOfWeek code '" + codeString + "'");
247    }
248
249    public String toCode(DaysOfWeek code) {
250      if (code == DaysOfWeek.MON)
251        return "mon";
252      if (code == DaysOfWeek.TUE)
253        return "tue";
254      if (code == DaysOfWeek.WED)
255        return "wed";
256      if (code == DaysOfWeek.THU)
257        return "thu";
258      if (code == DaysOfWeek.FRI)
259        return "fri";
260      if (code == DaysOfWeek.SAT)
261        return "sat";
262      if (code == DaysOfWeek.SUN)
263        return "sun";
264      return "?";
265    }
266
267    public String toSystem(DaysOfWeek code) {
268      return code.getSystem();
269    }
270  }
271
272  @Block()
273  public static class HealthcareServiceEligibilityComponent extends BackboneElement implements IBaseBackboneElement {
274    /**
275     * Coded value for the eligibility.
276     */
277    @Child(name = "code", type = {
278        CodeableConcept.class }, order = 1, min = 0, max = 1, modifier = false, summary = false)
279    @Description(shortDefinition = "Coded value for the eligibility", formalDefinition = "Coded value for the eligibility.")
280    protected CodeableConcept code;
281
282    /**
283     * Describes the eligibility conditions for the service.
284     */
285    @Child(name = "comment", type = {
286        MarkdownType.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
287    @Description(shortDefinition = "Describes the eligibility conditions for the service", formalDefinition = "Describes the eligibility conditions for the service.")
288    protected MarkdownType comment;
289
290    private static final long serialVersionUID = 1078065348L;
291
292    /**
293     * Constructor
294     */
295    public HealthcareServiceEligibilityComponent() {
296      super();
297    }
298
299    /**
300     * @return {@link #code} (Coded value for the eligibility.)
301     */
302    public CodeableConcept getCode() {
303      if (this.code == null)
304        if (Configuration.errorOnAutoCreate())
305          throw new Error("Attempt to auto-create HealthcareServiceEligibilityComponent.code");
306        else if (Configuration.doAutoCreate())
307          this.code = new CodeableConcept(); // cc
308      return this.code;
309    }
310
311    public boolean hasCode() {
312      return this.code != null && !this.code.isEmpty();
313    }
314
315    /**
316     * @param value {@link #code} (Coded value for the eligibility.)
317     */
318    public HealthcareServiceEligibilityComponent setCode(CodeableConcept value) {
319      this.code = value;
320      return this;
321    }
322
323    /**
324     * @return {@link #comment} (Describes the eligibility conditions for the
325     *         service.). This is the underlying object with id, value and
326     *         extensions. The accessor "getComment" gives direct access to the
327     *         value
328     */
329    public MarkdownType getCommentElement() {
330      if (this.comment == null)
331        if (Configuration.errorOnAutoCreate())
332          throw new Error("Attempt to auto-create HealthcareServiceEligibilityComponent.comment");
333        else if (Configuration.doAutoCreate())
334          this.comment = new MarkdownType(); // bb
335      return this.comment;
336    }
337
338    public boolean hasCommentElement() {
339      return this.comment != null && !this.comment.isEmpty();
340    }
341
342    public boolean hasComment() {
343      return this.comment != null && !this.comment.isEmpty();
344    }
345
346    /**
347     * @param value {@link #comment} (Describes the eligibility conditions for the
348     *              service.). This is the underlying object with id, value and
349     *              extensions. The accessor "getComment" gives direct access to the
350     *              value
351     */
352    public HealthcareServiceEligibilityComponent setCommentElement(MarkdownType value) {
353      this.comment = value;
354      return this;
355    }
356
357    /**
358     * @return Describes the eligibility conditions for the service.
359     */
360    public String getComment() {
361      return this.comment == null ? null : this.comment.getValue();
362    }
363
364    /**
365     * @param value Describes the eligibility conditions for the service.
366     */
367    public HealthcareServiceEligibilityComponent setComment(String value) {
368      if (value == null)
369        this.comment = null;
370      else {
371        if (this.comment == null)
372          this.comment = new MarkdownType();
373        this.comment.setValue(value);
374      }
375      return this;
376    }
377
378    protected void listChildren(List<Property> children) {
379      super.listChildren(children);
380      children.add(new Property("code", "CodeableConcept", "Coded value for the eligibility.", 0, 1, code));
381      children.add(
382          new Property("comment", "markdown", "Describes the eligibility conditions for the service.", 0, 1, comment));
383    }
384
385    @Override
386    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
387      switch (_hash) {
388      case 3059181:
389        /* code */ return new Property("code", "CodeableConcept", "Coded value for the eligibility.", 0, 1, code);
390      case 950398559:
391        /* comment */ return new Property("comment", "markdown",
392            "Describes the eligibility conditions for the service.", 0, 1, comment);
393      default:
394        return super.getNamedProperty(_hash, _name, _checkValid);
395      }
396
397    }
398
399    @Override
400    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
401      switch (hash) {
402      case 3059181:
403        /* code */ return this.code == null ? new Base[0] : new Base[] { this.code }; // CodeableConcept
404      case 950398559:
405        /* comment */ return this.comment == null ? new Base[0] : new Base[] { this.comment }; // MarkdownType
406      default:
407        return super.getProperty(hash, name, checkValid);
408      }
409
410    }
411
412    @Override
413    public Base setProperty(int hash, String name, Base value) throws FHIRException {
414      switch (hash) {
415      case 3059181: // code
416        this.code = castToCodeableConcept(value); // CodeableConcept
417        return value;
418      case 950398559: // comment
419        this.comment = castToMarkdown(value); // MarkdownType
420        return value;
421      default:
422        return super.setProperty(hash, name, value);
423      }
424
425    }
426
427    @Override
428    public Base setProperty(String name, Base value) throws FHIRException {
429      if (name.equals("code")) {
430        this.code = castToCodeableConcept(value); // CodeableConcept
431      } else if (name.equals("comment")) {
432        this.comment = castToMarkdown(value); // MarkdownType
433      } else
434        return super.setProperty(name, value);
435      return value;
436    }
437
438    @Override
439    public Base makeProperty(int hash, String name) throws FHIRException {
440      switch (hash) {
441      case 3059181:
442        return getCode();
443      case 950398559:
444        return getCommentElement();
445      default:
446        return super.makeProperty(hash, name);
447      }
448
449    }
450
451    @Override
452    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
453      switch (hash) {
454      case 3059181:
455        /* code */ return new String[] { "CodeableConcept" };
456      case 950398559:
457        /* comment */ return new String[] { "markdown" };
458      default:
459        return super.getTypesForProperty(hash, name);
460      }
461
462    }
463
464    @Override
465    public Base addChild(String name) throws FHIRException {
466      if (name.equals("code")) {
467        this.code = new CodeableConcept();
468        return this.code;
469      } else if (name.equals("comment")) {
470        throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.comment");
471      } else
472        return super.addChild(name);
473    }
474
475    public HealthcareServiceEligibilityComponent copy() {
476      HealthcareServiceEligibilityComponent dst = new HealthcareServiceEligibilityComponent();
477      copyValues(dst);
478      return dst;
479    }
480
481    public void copyValues(HealthcareServiceEligibilityComponent dst) {
482      super.copyValues(dst);
483      dst.code = code == null ? null : code.copy();
484      dst.comment = comment == null ? null : comment.copy();
485    }
486
487    @Override
488    public boolean equalsDeep(Base other_) {
489      if (!super.equalsDeep(other_))
490        return false;
491      if (!(other_ instanceof HealthcareServiceEligibilityComponent))
492        return false;
493      HealthcareServiceEligibilityComponent o = (HealthcareServiceEligibilityComponent) other_;
494      return compareDeep(code, o.code, true) && compareDeep(comment, o.comment, true);
495    }
496
497    @Override
498    public boolean equalsShallow(Base other_) {
499      if (!super.equalsShallow(other_))
500        return false;
501      if (!(other_ instanceof HealthcareServiceEligibilityComponent))
502        return false;
503      HealthcareServiceEligibilityComponent o = (HealthcareServiceEligibilityComponent) other_;
504      return compareValues(comment, o.comment, true);
505    }
506
507    public boolean isEmpty() {
508      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, comment);
509    }
510
511    public String fhirType() {
512      return "HealthcareService.eligibility";
513
514    }
515
516  }
517
518  @Block()
519  public static class HealthcareServiceAvailableTimeComponent extends BackboneElement implements IBaseBackboneElement {
520    /**
521     * Indicates which days of the week are available between the start and end
522     * Times.
523     */
524    @Child(name = "daysOfWeek", type = {
525        CodeType.class }, order = 1, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
526    @Description(shortDefinition = "mon | tue | wed | thu | fri | sat | sun", formalDefinition = "Indicates which days of the week are available between the start and end Times.")
527    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/days-of-week")
528    protected List<Enumeration<DaysOfWeek>> daysOfWeek;
529
530    /**
531     * Is this always available? (hence times are irrelevant) e.g. 24 hour service.
532     */
533    @Child(name = "allDay", type = {
534        BooleanType.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
535    @Description(shortDefinition = "Always available? e.g. 24 hour service", formalDefinition = "Is this always available? (hence times are irrelevant) e.g. 24 hour service.")
536    protected BooleanType allDay;
537
538    /**
539     * The opening time of day. Note: If the AllDay flag is set, then this time is
540     * ignored.
541     */
542    @Child(name = "availableStartTime", type = {
543        TimeType.class }, order = 3, min = 0, max = 1, modifier = false, summary = false)
544    @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.")
545    protected TimeType availableStartTime;
546
547    /**
548     * The closing time of day. Note: If the AllDay flag is set, then this time is
549     * ignored.
550     */
551    @Child(name = "availableEndTime", type = {
552        TimeType.class }, order = 4, min = 0, max = 1, modifier = false, summary = false)
553    @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.")
554    protected TimeType availableEndTime;
555
556    private static final long serialVersionUID = -2139510127L;
557
558    /**
559     * Constructor
560     */
561    public HealthcareServiceAvailableTimeComponent() {
562      super();
563    }
564
565    /**
566     * @return {@link #daysOfWeek} (Indicates which days of the week are available
567     *         between the start and end Times.)
568     */
569    public List<Enumeration<DaysOfWeek>> getDaysOfWeek() {
570      if (this.daysOfWeek == null)
571        this.daysOfWeek = new ArrayList<Enumeration<DaysOfWeek>>();
572      return this.daysOfWeek;
573    }
574
575    /**
576     * @return Returns a reference to <code>this</code> for easy method chaining
577     */
578    public HealthcareServiceAvailableTimeComponent setDaysOfWeek(List<Enumeration<DaysOfWeek>> theDaysOfWeek) {
579      this.daysOfWeek = theDaysOfWeek;
580      return this;
581    }
582
583    public boolean hasDaysOfWeek() {
584      if (this.daysOfWeek == null)
585        return false;
586      for (Enumeration<DaysOfWeek> item : this.daysOfWeek)
587        if (!item.isEmpty())
588          return true;
589      return false;
590    }
591
592    /**
593     * @return {@link #daysOfWeek} (Indicates which days of the week are available
594     *         between the start and end Times.)
595     */
596    public Enumeration<DaysOfWeek> addDaysOfWeekElement() {// 2
597      Enumeration<DaysOfWeek> t = new Enumeration<DaysOfWeek>(new DaysOfWeekEnumFactory());
598      if (this.daysOfWeek == null)
599        this.daysOfWeek = new ArrayList<Enumeration<DaysOfWeek>>();
600      this.daysOfWeek.add(t);
601      return t;
602    }
603
604    /**
605     * @param value {@link #daysOfWeek} (Indicates which days of the week are
606     *              available between the start and end Times.)
607     */
608    public HealthcareServiceAvailableTimeComponent addDaysOfWeek(DaysOfWeek value) { // 1
609      Enumeration<DaysOfWeek> t = new Enumeration<DaysOfWeek>(new DaysOfWeekEnumFactory());
610      t.setValue(value);
611      if (this.daysOfWeek == null)
612        this.daysOfWeek = new ArrayList<Enumeration<DaysOfWeek>>();
613      this.daysOfWeek.add(t);
614      return this;
615    }
616
617    /**
618     * @param value {@link #daysOfWeek} (Indicates which days of the week are
619     *              available between the start and end Times.)
620     */
621    public boolean hasDaysOfWeek(DaysOfWeek value) {
622      if (this.daysOfWeek == null)
623        return false;
624      for (Enumeration<DaysOfWeek> v : this.daysOfWeek)
625        if (v.getValue().equals(value)) // code
626          return true;
627      return false;
628    }
629
630    /**
631     * @return {@link #allDay} (Is this always available? (hence times are
632     *         irrelevant) e.g. 24 hour service.). This is the underlying object
633     *         with id, value and extensions. The accessor "getAllDay" gives direct
634     *         access to the value
635     */
636    public BooleanType getAllDayElement() {
637      if (this.allDay == null)
638        if (Configuration.errorOnAutoCreate())
639          throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.allDay");
640        else if (Configuration.doAutoCreate())
641          this.allDay = new BooleanType(); // bb
642      return this.allDay;
643    }
644
645    public boolean hasAllDayElement() {
646      return this.allDay != null && !this.allDay.isEmpty();
647    }
648
649    public boolean hasAllDay() {
650      return this.allDay != null && !this.allDay.isEmpty();
651    }
652
653    /**
654     * @param value {@link #allDay} (Is this always available? (hence times are
655     *              irrelevant) e.g. 24 hour service.). This is the underlying
656     *              object with id, value and extensions. The accessor "getAllDay"
657     *              gives direct access to the value
658     */
659    public HealthcareServiceAvailableTimeComponent setAllDayElement(BooleanType value) {
660      this.allDay = value;
661      return this;
662    }
663
664    /**
665     * @return Is this always available? (hence times are irrelevant) e.g. 24 hour
666     *         service.
667     */
668    public boolean getAllDay() {
669      return this.allDay == null || this.allDay.isEmpty() ? false : this.allDay.getValue();
670    }
671
672    /**
673     * @param value Is this always available? (hence times are irrelevant) e.g. 24
674     *              hour service.
675     */
676    public HealthcareServiceAvailableTimeComponent setAllDay(boolean value) {
677      if (this.allDay == null)
678        this.allDay = new BooleanType();
679      this.allDay.setValue(value);
680      return this;
681    }
682
683    /**
684     * @return {@link #availableStartTime} (The opening time of day. Note: If the
685     *         AllDay flag is set, then this time is ignored.). This is the
686     *         underlying object with id, value and extensions. The accessor
687     *         "getAvailableStartTime" gives direct access to the value
688     */
689    public TimeType getAvailableStartTimeElement() {
690      if (this.availableStartTime == null)
691        if (Configuration.errorOnAutoCreate())
692          throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.availableStartTime");
693        else if (Configuration.doAutoCreate())
694          this.availableStartTime = new TimeType(); // bb
695      return this.availableStartTime;
696    }
697
698    public boolean hasAvailableStartTimeElement() {
699      return this.availableStartTime != null && !this.availableStartTime.isEmpty();
700    }
701
702    public boolean hasAvailableStartTime() {
703      return this.availableStartTime != null && !this.availableStartTime.isEmpty();
704    }
705
706    /**
707     * @param value {@link #availableStartTime} (The opening time of day. Note: If
708     *              the AllDay flag is set, then this time is ignored.). This is the
709     *              underlying object with id, value and extensions. The accessor
710     *              "getAvailableStartTime" gives direct access to the value
711     */
712    public HealthcareServiceAvailableTimeComponent setAvailableStartTimeElement(TimeType value) {
713      this.availableStartTime = value;
714      return this;
715    }
716
717    /**
718     * @return The opening time of day. Note: If the AllDay flag is set, then this
719     *         time is ignored.
720     */
721    public String getAvailableStartTime() {
722      return this.availableStartTime == null ? null : this.availableStartTime.getValue();
723    }
724
725    /**
726     * @param value The opening time of day. Note: If the AllDay flag is set, then
727     *              this time is ignored.
728     */
729    public HealthcareServiceAvailableTimeComponent setAvailableStartTime(String value) {
730      if (value == null)
731        this.availableStartTime = null;
732      else {
733        if (this.availableStartTime == null)
734          this.availableStartTime = new TimeType();
735        this.availableStartTime.setValue(value);
736      }
737      return this;
738    }
739
740    /**
741     * @return {@link #availableEndTime} (The closing time of day. Note: If the
742     *         AllDay flag is set, then this time is ignored.). This is the
743     *         underlying object with id, value and extensions. The accessor
744     *         "getAvailableEndTime" gives direct access to the value
745     */
746    public TimeType getAvailableEndTimeElement() {
747      if (this.availableEndTime == null)
748        if (Configuration.errorOnAutoCreate())
749          throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.availableEndTime");
750        else if (Configuration.doAutoCreate())
751          this.availableEndTime = new TimeType(); // bb
752      return this.availableEndTime;
753    }
754
755    public boolean hasAvailableEndTimeElement() {
756      return this.availableEndTime != null && !this.availableEndTime.isEmpty();
757    }
758
759    public boolean hasAvailableEndTime() {
760      return this.availableEndTime != null && !this.availableEndTime.isEmpty();
761    }
762
763    /**
764     * @param value {@link #availableEndTime} (The closing time of day. Note: If the
765     *              AllDay flag is set, then this time is ignored.). This is the
766     *              underlying object with id, value and extensions. The accessor
767     *              "getAvailableEndTime" gives direct access to the value
768     */
769    public HealthcareServiceAvailableTimeComponent setAvailableEndTimeElement(TimeType value) {
770      this.availableEndTime = value;
771      return this;
772    }
773
774    /**
775     * @return The closing time of day. Note: If the AllDay flag is set, then this
776     *         time is ignored.
777     */
778    public String getAvailableEndTime() {
779      return this.availableEndTime == null ? null : this.availableEndTime.getValue();
780    }
781
782    /**
783     * @param value The closing time of day. Note: If the AllDay flag is set, then
784     *              this time is ignored.
785     */
786    public HealthcareServiceAvailableTimeComponent setAvailableEndTime(String value) {
787      if (value == null)
788        this.availableEndTime = null;
789      else {
790        if (this.availableEndTime == null)
791          this.availableEndTime = new TimeType();
792        this.availableEndTime.setValue(value);
793      }
794      return this;
795    }
796
797    protected void listChildren(List<Property> children) {
798      super.listChildren(children);
799      children.add(new Property("daysOfWeek", "code",
800          "Indicates which days of the week are available between the start and end Times.", 0,
801          java.lang.Integer.MAX_VALUE, daysOfWeek));
802      children.add(new Property("allDay", "boolean",
803          "Is this always available? (hence times are irrelevant) e.g. 24 hour service.", 0, 1, allDay));
804      children.add(new Property("availableStartTime", "time",
805          "The opening time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, 1,
806          availableStartTime));
807      children.add(new Property("availableEndTime", "time",
808          "The closing time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, 1,
809          availableEndTime));
810    }
811
812    @Override
813    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
814      switch (_hash) {
815      case 68050338:
816        /* daysOfWeek */ return new Property("daysOfWeek", "code",
817            "Indicates which days of the week are available between the start and end Times.", 0,
818            java.lang.Integer.MAX_VALUE, daysOfWeek);
819      case -1414913477:
820        /* allDay */ return new Property("allDay", "boolean",
821            "Is this always available? (hence times are irrelevant) e.g. 24 hour service.", 0, 1, allDay);
822      case -1039453818:
823        /* availableStartTime */ return new Property("availableStartTime", "time",
824            "The opening time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, 1,
825            availableStartTime);
826      case 101151551:
827        /* availableEndTime */ return new Property("availableEndTime", "time",
828            "The closing time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, 1,
829            availableEndTime);
830      default:
831        return super.getNamedProperty(_hash, _name, _checkValid);
832      }
833
834    }
835
836    @Override
837    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
838      switch (hash) {
839      case 68050338:
840        /* daysOfWeek */ return this.daysOfWeek == null ? new Base[0]
841            : this.daysOfWeek.toArray(new Base[this.daysOfWeek.size()]); // Enumeration<DaysOfWeek>
842      case -1414913477:
843        /* allDay */ return this.allDay == null ? new Base[0] : new Base[] { this.allDay }; // BooleanType
844      case -1039453818:
845        /* availableStartTime */ return this.availableStartTime == null ? new Base[0]
846            : new Base[] { this.availableStartTime }; // TimeType
847      case 101151551:
848        /* availableEndTime */ return this.availableEndTime == null ? new Base[0]
849            : new Base[] { this.availableEndTime }; // TimeType
850      default:
851        return super.getProperty(hash, name, checkValid);
852      }
853
854    }
855
856    @Override
857    public Base setProperty(int hash, String name, Base value) throws FHIRException {
858      switch (hash) {
859      case 68050338: // daysOfWeek
860        value = new DaysOfWeekEnumFactory().fromType(castToCode(value));
861        this.getDaysOfWeek().add((Enumeration) value); // Enumeration<DaysOfWeek>
862        return value;
863      case -1414913477: // allDay
864        this.allDay = castToBoolean(value); // BooleanType
865        return value;
866      case -1039453818: // availableStartTime
867        this.availableStartTime = castToTime(value); // TimeType
868        return value;
869      case 101151551: // availableEndTime
870        this.availableEndTime = castToTime(value); // TimeType
871        return value;
872      default:
873        return super.setProperty(hash, name, value);
874      }
875
876    }
877
878    @Override
879    public Base setProperty(String name, Base value) throws FHIRException {
880      if (name.equals("daysOfWeek")) {
881        value = new DaysOfWeekEnumFactory().fromType(castToCode(value));
882        this.getDaysOfWeek().add((Enumeration) value);
883      } else if (name.equals("allDay")) {
884        this.allDay = castToBoolean(value); // BooleanType
885      } else if (name.equals("availableStartTime")) {
886        this.availableStartTime = castToTime(value); // TimeType
887      } else if (name.equals("availableEndTime")) {
888        this.availableEndTime = castToTime(value); // TimeType
889      } else
890        return super.setProperty(name, value);
891      return value;
892    }
893
894    @Override
895    public Base makeProperty(int hash, String name) throws FHIRException {
896      switch (hash) {
897      case 68050338:
898        return addDaysOfWeekElement();
899      case -1414913477:
900        return getAllDayElement();
901      case -1039453818:
902        return getAvailableStartTimeElement();
903      case 101151551:
904        return getAvailableEndTimeElement();
905      default:
906        return super.makeProperty(hash, name);
907      }
908
909    }
910
911    @Override
912    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
913      switch (hash) {
914      case 68050338:
915        /* daysOfWeek */ return new String[] { "code" };
916      case -1414913477:
917        /* allDay */ return new String[] { "boolean" };
918      case -1039453818:
919        /* availableStartTime */ return new String[] { "time" };
920      case 101151551:
921        /* availableEndTime */ return new String[] { "time" };
922      default:
923        return super.getTypesForProperty(hash, name);
924      }
925
926    }
927
928    @Override
929    public Base addChild(String name) throws FHIRException {
930      if (name.equals("daysOfWeek")) {
931        throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.daysOfWeek");
932      } else if (name.equals("allDay")) {
933        throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.allDay");
934      } else if (name.equals("availableStartTime")) {
935        throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.availableStartTime");
936      } else if (name.equals("availableEndTime")) {
937        throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.availableEndTime");
938      } else
939        return super.addChild(name);
940    }
941
942    public HealthcareServiceAvailableTimeComponent copy() {
943      HealthcareServiceAvailableTimeComponent dst = new HealthcareServiceAvailableTimeComponent();
944      copyValues(dst);
945      return dst;
946    }
947
948    public void copyValues(HealthcareServiceAvailableTimeComponent dst) {
949      super.copyValues(dst);
950      if (daysOfWeek != null) {
951        dst.daysOfWeek = new ArrayList<Enumeration<DaysOfWeek>>();
952        for (Enumeration<DaysOfWeek> i : daysOfWeek)
953          dst.daysOfWeek.add(i.copy());
954      }
955      ;
956      dst.allDay = allDay == null ? null : allDay.copy();
957      dst.availableStartTime = availableStartTime == null ? null : availableStartTime.copy();
958      dst.availableEndTime = availableEndTime == null ? null : availableEndTime.copy();
959    }
960
961    @Override
962    public boolean equalsDeep(Base other_) {
963      if (!super.equalsDeep(other_))
964        return false;
965      if (!(other_ instanceof HealthcareServiceAvailableTimeComponent))
966        return false;
967      HealthcareServiceAvailableTimeComponent o = (HealthcareServiceAvailableTimeComponent) other_;
968      return compareDeep(daysOfWeek, o.daysOfWeek, true) && compareDeep(allDay, o.allDay, true)
969          && compareDeep(availableStartTime, o.availableStartTime, true)
970          && compareDeep(availableEndTime, o.availableEndTime, true);
971    }
972
973    @Override
974    public boolean equalsShallow(Base other_) {
975      if (!super.equalsShallow(other_))
976        return false;
977      if (!(other_ instanceof HealthcareServiceAvailableTimeComponent))
978        return false;
979      HealthcareServiceAvailableTimeComponent o = (HealthcareServiceAvailableTimeComponent) other_;
980      return compareValues(daysOfWeek, o.daysOfWeek, true) && compareValues(allDay, o.allDay, true)
981          && compareValues(availableStartTime, o.availableStartTime, true)
982          && compareValues(availableEndTime, o.availableEndTime, true);
983    }
984
985    public boolean isEmpty() {
986      return super.isEmpty()
987          && ca.uhn.fhir.util.ElementUtil.isEmpty(daysOfWeek, allDay, availableStartTime, availableEndTime);
988    }
989
990    public String fhirType() {
991      return "HealthcareService.availableTime";
992
993    }
994
995  }
996
997  @Block()
998  public static class HealthcareServiceNotAvailableComponent extends BackboneElement implements IBaseBackboneElement {
999    /**
1000     * The reason that can be presented to the user as to why this time is not
1001     * available.
1002     */
1003    @Child(name = "description", type = {
1004        StringType.class }, order = 1, min = 1, max = 1, modifier = false, summary = false)
1005    @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.")
1006    protected StringType description;
1007
1008    /**
1009     * Service is not available (seasonally or for a public holiday) from this date.
1010     */
1011    @Child(name = "during", type = { Period.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
1012    @Description(shortDefinition = "Service not available from this date", formalDefinition = "Service is not available (seasonally or for a public holiday) from this date.")
1013    protected Period during;
1014
1015    private static final long serialVersionUID = 310849929L;
1016
1017    /**
1018     * Constructor
1019     */
1020    public HealthcareServiceNotAvailableComponent() {
1021      super();
1022    }
1023
1024    /**
1025     * Constructor
1026     */
1027    public HealthcareServiceNotAvailableComponent(StringType description) {
1028      super();
1029      this.description = description;
1030    }
1031
1032    /**
1033     * @return {@link #description} (The reason that can be presented to the user as
1034     *         to why this time is not available.). This is the underlying object
1035     *         with id, value and extensions. The accessor "getDescription" gives
1036     *         direct access to the value
1037     */
1038    public StringType getDescriptionElement() {
1039      if (this.description == null)
1040        if (Configuration.errorOnAutoCreate())
1041          throw new Error("Attempt to auto-create HealthcareServiceNotAvailableComponent.description");
1042        else if (Configuration.doAutoCreate())
1043          this.description = new StringType(); // bb
1044      return this.description;
1045    }
1046
1047    public boolean hasDescriptionElement() {
1048      return this.description != null && !this.description.isEmpty();
1049    }
1050
1051    public boolean hasDescription() {
1052      return this.description != null && !this.description.isEmpty();
1053    }
1054
1055    /**
1056     * @param value {@link #description} (The reason that can be presented to the
1057     *              user as to why this time is not available.). This is the
1058     *              underlying object with id, value and extensions. The accessor
1059     *              "getDescription" gives direct access to the value
1060     */
1061    public HealthcareServiceNotAvailableComponent setDescriptionElement(StringType value) {
1062      this.description = value;
1063      return this;
1064    }
1065
1066    /**
1067     * @return The reason that can be presented to the user as to why this time is
1068     *         not available.
1069     */
1070    public String getDescription() {
1071      return this.description == null ? null : this.description.getValue();
1072    }
1073
1074    /**
1075     * @param value The reason that can be presented to the user as to why this time
1076     *              is not available.
1077     */
1078    public HealthcareServiceNotAvailableComponent setDescription(String value) {
1079      if (this.description == null)
1080        this.description = new StringType();
1081      this.description.setValue(value);
1082      return this;
1083    }
1084
1085    /**
1086     * @return {@link #during} (Service is not available (seasonally or for a public
1087     *         holiday) from this date.)
1088     */
1089    public Period getDuring() {
1090      if (this.during == null)
1091        if (Configuration.errorOnAutoCreate())
1092          throw new Error("Attempt to auto-create HealthcareServiceNotAvailableComponent.during");
1093        else if (Configuration.doAutoCreate())
1094          this.during = new Period(); // cc
1095      return this.during;
1096    }
1097
1098    public boolean hasDuring() {
1099      return this.during != null && !this.during.isEmpty();
1100    }
1101
1102    /**
1103     * @param value {@link #during} (Service is not available (seasonally or for a
1104     *              public holiday) from this date.)
1105     */
1106    public HealthcareServiceNotAvailableComponent setDuring(Period value) {
1107      this.during = value;
1108      return this;
1109    }
1110
1111    protected void listChildren(List<Property> children) {
1112      super.listChildren(children);
1113      children.add(new Property("description", "string",
1114          "The reason that can be presented to the user as to why this time is not available.", 0, 1, description));
1115      children.add(new Property("during", "Period",
1116          "Service is not available (seasonally or for a public holiday) from this date.", 0, 1, during));
1117    }
1118
1119    @Override
1120    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1121      switch (_hash) {
1122      case -1724546052:
1123        /* description */ return new Property("description", "string",
1124            "The reason that can be presented to the user as to why this time is not available.", 0, 1, description);
1125      case -1320499647:
1126        /* during */ return new Property("during", "Period",
1127            "Service is not available (seasonally or for a public holiday) from this date.", 0, 1, during);
1128      default:
1129        return super.getNamedProperty(_hash, _name, _checkValid);
1130      }
1131
1132    }
1133
1134    @Override
1135    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1136      switch (hash) {
1137      case -1724546052:
1138        /* description */ return this.description == null ? new Base[0] : new Base[] { this.description }; // StringType
1139      case -1320499647:
1140        /* during */ return this.during == null ? new Base[0] : new Base[] { this.during }; // Period
1141      default:
1142        return super.getProperty(hash, name, checkValid);
1143      }
1144
1145    }
1146
1147    @Override
1148    public Base setProperty(int hash, String name, Base value) throws FHIRException {
1149      switch (hash) {
1150      case -1724546052: // description
1151        this.description = castToString(value); // StringType
1152        return value;
1153      case -1320499647: // during
1154        this.during = castToPeriod(value); // Period
1155        return value;
1156      default:
1157        return super.setProperty(hash, name, value);
1158      }
1159
1160    }
1161
1162    @Override
1163    public Base setProperty(String name, Base value) throws FHIRException {
1164      if (name.equals("description")) {
1165        this.description = castToString(value); // StringType
1166      } else if (name.equals("during")) {
1167        this.during = castToPeriod(value); // Period
1168      } else
1169        return super.setProperty(name, value);
1170      return value;
1171    }
1172
1173    @Override
1174    public Base makeProperty(int hash, String name) throws FHIRException {
1175      switch (hash) {
1176      case -1724546052:
1177        return getDescriptionElement();
1178      case -1320499647:
1179        return getDuring();
1180      default:
1181        return super.makeProperty(hash, name);
1182      }
1183
1184    }
1185
1186    @Override
1187    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1188      switch (hash) {
1189      case -1724546052:
1190        /* description */ return new String[] { "string" };
1191      case -1320499647:
1192        /* during */ return new String[] { "Period" };
1193      default:
1194        return super.getTypesForProperty(hash, name);
1195      }
1196
1197    }
1198
1199    @Override
1200    public Base addChild(String name) throws FHIRException {
1201      if (name.equals("description")) {
1202        throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.description");
1203      } else if (name.equals("during")) {
1204        this.during = new Period();
1205        return this.during;
1206      } else
1207        return super.addChild(name);
1208    }
1209
1210    public HealthcareServiceNotAvailableComponent copy() {
1211      HealthcareServiceNotAvailableComponent dst = new HealthcareServiceNotAvailableComponent();
1212      copyValues(dst);
1213      return dst;
1214    }
1215
1216    public void copyValues(HealthcareServiceNotAvailableComponent dst) {
1217      super.copyValues(dst);
1218      dst.description = description == null ? null : description.copy();
1219      dst.during = during == null ? null : during.copy();
1220    }
1221
1222    @Override
1223    public boolean equalsDeep(Base other_) {
1224      if (!super.equalsDeep(other_))
1225        return false;
1226      if (!(other_ instanceof HealthcareServiceNotAvailableComponent))
1227        return false;
1228      HealthcareServiceNotAvailableComponent o = (HealthcareServiceNotAvailableComponent) other_;
1229      return compareDeep(description, o.description, true) && compareDeep(during, o.during, true);
1230    }
1231
1232    @Override
1233    public boolean equalsShallow(Base other_) {
1234      if (!super.equalsShallow(other_))
1235        return false;
1236      if (!(other_ instanceof HealthcareServiceNotAvailableComponent))
1237        return false;
1238      HealthcareServiceNotAvailableComponent o = (HealthcareServiceNotAvailableComponent) other_;
1239      return compareValues(description, o.description, true);
1240    }
1241
1242    public boolean isEmpty() {
1243      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(description, during);
1244    }
1245
1246    public String fhirType() {
1247      return "HealthcareService.notAvailable";
1248
1249    }
1250
1251  }
1252
1253  /**
1254   * External identifiers for this item.
1255   */
1256  @Child(name = "identifier", type = {
1257      Identifier.class }, order = 0, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
1258  @Description(shortDefinition = "External identifiers for this item", formalDefinition = "External identifiers for this item.")
1259  protected List<Identifier> identifier;
1260
1261  /**
1262   * This flag is used to mark the record to not be used. This is not used when a
1263   * center is closed for maintenance, or for holidays, the notAvailable period is
1264   * to be used for this.
1265   */
1266  @Child(name = "active", type = { BooleanType.class }, order = 1, min = 0, max = 1, modifier = true, summary = true)
1267  @Description(shortDefinition = "Whether this HealthcareService record is in active use", formalDefinition = "This flag is used to mark the record to not be used. This is not used when a center is closed for maintenance, or for holidays, the notAvailable period is to be used for this.")
1268  protected BooleanType active;
1269
1270  /**
1271   * The organization that provides this healthcare service.
1272   */
1273  @Child(name = "providedBy", type = {
1274      Organization.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
1275  @Description(shortDefinition = "Organization that provides this service", formalDefinition = "The organization that provides this healthcare service.")
1276  protected Reference providedBy;
1277
1278  /**
1279   * The actual object that is the target of the reference (The organization that
1280   * provides this healthcare service.)
1281   */
1282  protected Organization providedByTarget;
1283
1284  /**
1285   * Identifies the broad category of service being performed or delivered.
1286   */
1287  @Child(name = "category", type = {
1288      CodeableConcept.class }, order = 3, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
1289  @Description(shortDefinition = "Broad category of service being performed or delivered", formalDefinition = "Identifies the broad category of service being performed or delivered.")
1290  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/service-category")
1291  protected List<CodeableConcept> category;
1292
1293  /**
1294   * The specific type of service that may be delivered or performed.
1295   */
1296  @Child(name = "type", type = {
1297      CodeableConcept.class }, order = 4, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
1298  @Description(shortDefinition = "Type of service that may be delivered or performed", formalDefinition = "The specific type of service that may be delivered or performed.")
1299  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/service-type")
1300  protected List<CodeableConcept> type;
1301
1302  /**
1303   * Collection of specialties handled by the service site. This is more of a
1304   * medical term.
1305   */
1306  @Child(name = "specialty", type = {
1307      CodeableConcept.class }, order = 5, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
1308  @Description(shortDefinition = "Specialties handled by the HealthcareService", formalDefinition = "Collection of specialties handled by the service site. This is more of a medical term.")
1309  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/c80-practice-codes")
1310  protected List<CodeableConcept> specialty;
1311
1312  /**
1313   * The location(s) where this healthcare service may be provided.
1314   */
1315  @Child(name = "location", type = {
1316      Location.class }, order = 6, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
1317  @Description(shortDefinition = "Location(s) where service may be provided", formalDefinition = "The location(s) where this healthcare service may be provided.")
1318  protected List<Reference> location;
1319  /**
1320   * The actual objects that are the target of the reference (The location(s)
1321   * where this healthcare service may be provided.)
1322   */
1323  protected List<Location> locationTarget;
1324
1325  /**
1326   * Further description of the service as it would be presented to a consumer
1327   * while searching.
1328   */
1329  @Child(name = "name", type = { StringType.class }, order = 7, min = 0, max = 1, modifier = false, summary = true)
1330  @Description(shortDefinition = "Description of service as presented to a consumer while searching", formalDefinition = "Further description of the service as it would be presented to a consumer while searching.")
1331  protected StringType name;
1332
1333  /**
1334   * Any additional description of the service and/or any specific issues not
1335   * covered by the other attributes, which can be displayed as further detail
1336   * under the serviceName.
1337   */
1338  @Child(name = "comment", type = { StringType.class }, order = 8, min = 0, max = 1, modifier = false, summary = true)
1339  @Description(shortDefinition = "Additional description and/or any specific issues not covered elsewhere", formalDefinition = "Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.")
1340  protected StringType comment;
1341
1342  /**
1343   * Extra details about the service that can't be placed in the other fields.
1344   */
1345  @Child(name = "extraDetails", type = {
1346      MarkdownType.class }, order = 9, min = 0, max = 1, modifier = false, summary = false)
1347  @Description(shortDefinition = "Extra details about the service that can't be placed in the other fields", formalDefinition = "Extra details about the service that can't be placed in the other fields.")
1348  protected MarkdownType extraDetails;
1349
1350  /**
1351   * If there is a photo/symbol associated with this HealthcareService, it may be
1352   * included here to facilitate quick identification of the service in a list.
1353   */
1354  @Child(name = "photo", type = { Attachment.class }, order = 10, min = 0, max = 1, modifier = false, summary = true)
1355  @Description(shortDefinition = "Facilitates quick identification of the service", formalDefinition = "If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list.")
1356  protected Attachment photo;
1357
1358  /**
1359   * List of contacts related to this specific healthcare service.
1360   */
1361  @Child(name = "telecom", type = {
1362      ContactPoint.class }, order = 11, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1363  @Description(shortDefinition = "Contacts related to the healthcare service", formalDefinition = "List of contacts related to this specific healthcare service.")
1364  protected List<ContactPoint> telecom;
1365
1366  /**
1367   * The location(s) that this service is available to (not where the service is
1368   * provided).
1369   */
1370  @Child(name = "coverageArea", type = {
1371      Location.class }, order = 12, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1372  @Description(shortDefinition = "Location(s) service is intended for/available to", formalDefinition = "The location(s) that this service is available to (not where the service is provided).")
1373  protected List<Reference> coverageArea;
1374  /**
1375   * The actual objects that are the target of the reference (The location(s) that
1376   * this service is available to (not where the service is provided).)
1377   */
1378  protected List<Location> coverageAreaTarget;
1379
1380  /**
1381   * The code(s) that detail the conditions under which the healthcare service is
1382   * available/offered.
1383   */
1384  @Child(name = "serviceProvisionCode", type = {
1385      CodeableConcept.class }, order = 13, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1386  @Description(shortDefinition = "Conditions under which service is available/offered", formalDefinition = "The code(s) that detail the conditions under which the healthcare service is available/offered.")
1387  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/service-provision-conditions")
1388  protected List<CodeableConcept> serviceProvisionCode;
1389
1390  /**
1391   * Does this service have specific eligibility requirements that need to be met
1392   * in order to use the service?
1393   */
1394  @Child(name = "eligibility", type = {}, order = 14, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1395  @Description(shortDefinition = "Specific eligibility requirements required to use the service", formalDefinition = "Does this service have specific eligibility requirements that need to be met in order to use the service?")
1396  protected List<HealthcareServiceEligibilityComponent> eligibility;
1397
1398  /**
1399   * Programs that this service is applicable to.
1400   */
1401  @Child(name = "program", type = {
1402      CodeableConcept.class }, order = 15, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1403  @Description(shortDefinition = "Programs that this service is applicable to", formalDefinition = "Programs that this service is applicable to.")
1404  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/program")
1405  protected List<CodeableConcept> program;
1406
1407  /**
1408   * Collection of characteristics (attributes).
1409   */
1410  @Child(name = "characteristic", type = {
1411      CodeableConcept.class }, order = 16, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1412  @Description(shortDefinition = "Collection of characteristics (attributes)", formalDefinition = "Collection of characteristics (attributes).")
1413  protected List<CodeableConcept> characteristic;
1414
1415  /**
1416   * Some services are specifically made available in multiple languages, this
1417   * property permits a directory to declare the languages this is offered in.
1418   * Typically this is only provided where a service operates in communities with
1419   * mixed languages used.
1420   */
1421  @Child(name = "communication", type = {
1422      CodeableConcept.class }, order = 17, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1423  @Description(shortDefinition = "The language that this service is offered in", formalDefinition = "Some services are specifically made available in multiple languages, this property permits a directory to declare the languages this is offered in. Typically this is only provided where a service operates in communities with mixed languages used.")
1424  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/languages")
1425  protected List<CodeableConcept> communication;
1426
1427  /**
1428   * Ways that the service accepts referrals, if this is not provided then it is
1429   * implied that no referral is required.
1430   */
1431  @Child(name = "referralMethod", type = {
1432      CodeableConcept.class }, order = 18, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1433  @Description(shortDefinition = "Ways that the service accepts referrals", formalDefinition = "Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.")
1434  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/service-referral-method")
1435  protected List<CodeableConcept> referralMethod;
1436
1437  /**
1438   * Indicates whether or not a prospective consumer will require an appointment
1439   * for a particular service at a site to be provided by the Organization.
1440   * Indicates if an appointment is required for access to this service.
1441   */
1442  @Child(name = "appointmentRequired", type = {
1443      BooleanType.class }, order = 19, min = 0, max = 1, modifier = false, summary = false)
1444  @Description(shortDefinition = "If an appointment is required for access to this service", formalDefinition = "Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service.")
1445  protected BooleanType appointmentRequired;
1446
1447  /**
1448   * A collection of times that the Service Site is available.
1449   */
1450  @Child(name = "availableTime", type = {}, order = 20, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1451  @Description(shortDefinition = "Times the Service Site is available", formalDefinition = "A collection of times that the Service Site is available.")
1452  protected List<HealthcareServiceAvailableTimeComponent> availableTime;
1453
1454  /**
1455   * The HealthcareService is not available during this period of time due to the
1456   * provided reason.
1457   */
1458  @Child(name = "notAvailable", type = {}, order = 21, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1459  @Description(shortDefinition = "Not available during this time due to provided reason", formalDefinition = "The HealthcareService is not available during this period of time due to the provided reason.")
1460  protected List<HealthcareServiceNotAvailableComponent> notAvailable;
1461
1462  /**
1463   * A description of site availability exceptions, e.g. public holiday
1464   * availability. Succinctly describing all possible exceptions to normal site
1465   * availability as details in the available Times and not available Times.
1466   */
1467  @Child(name = "availabilityExceptions", type = {
1468      StringType.class }, order = 22, min = 0, max = 1, modifier = false, summary = false)
1469  @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.")
1470  protected StringType availabilityExceptions;
1471
1472  /**
1473   * Technical endpoints providing access to services operated for the specific
1474   * healthcare services defined at this resource.
1475   */
1476  @Child(name = "endpoint", type = {
1477      Endpoint.class }, order = 23, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1478  @Description(shortDefinition = "Technical endpoints providing access to electronic services operated for the healthcare service", formalDefinition = "Technical endpoints providing access to services operated for the specific healthcare services defined at this resource.")
1479  protected List<Reference> endpoint;
1480  /**
1481   * The actual objects that are the target of the reference (Technical endpoints
1482   * providing access to services operated for the specific healthcare services
1483   * defined at this resource.)
1484   */
1485  protected List<Endpoint> endpointTarget;
1486
1487  private static final long serialVersionUID = -2002412666L;
1488
1489  /**
1490   * Constructor
1491   */
1492  public HealthcareService() {
1493    super();
1494  }
1495
1496  /**
1497   * @return {@link #identifier} (External identifiers for this item.)
1498   */
1499  public List<Identifier> getIdentifier() {
1500    if (this.identifier == null)
1501      this.identifier = new ArrayList<Identifier>();
1502    return this.identifier;
1503  }
1504
1505  /**
1506   * @return Returns a reference to <code>this</code> for easy method chaining
1507   */
1508  public HealthcareService setIdentifier(List<Identifier> theIdentifier) {
1509    this.identifier = theIdentifier;
1510    return this;
1511  }
1512
1513  public boolean hasIdentifier() {
1514    if (this.identifier == null)
1515      return false;
1516    for (Identifier item : this.identifier)
1517      if (!item.isEmpty())
1518        return true;
1519    return false;
1520  }
1521
1522  public Identifier addIdentifier() { // 3
1523    Identifier t = new Identifier();
1524    if (this.identifier == null)
1525      this.identifier = new ArrayList<Identifier>();
1526    this.identifier.add(t);
1527    return t;
1528  }
1529
1530  public HealthcareService addIdentifier(Identifier t) { // 3
1531    if (t == null)
1532      return this;
1533    if (this.identifier == null)
1534      this.identifier = new ArrayList<Identifier>();
1535    this.identifier.add(t);
1536    return this;
1537  }
1538
1539  /**
1540   * @return The first repetition of repeating field {@link #identifier}, creating
1541   *         it if it does not already exist
1542   */
1543  public Identifier getIdentifierFirstRep() {
1544    if (getIdentifier().isEmpty()) {
1545      addIdentifier();
1546    }
1547    return getIdentifier().get(0);
1548  }
1549
1550  /**
1551   * @return {@link #active} (This flag is used to mark the record to not be used.
1552   *         This is not used when a center is closed for maintenance, or for
1553   *         holidays, the notAvailable period is to be used for this.). This is
1554   *         the underlying object with id, value and extensions. The accessor
1555   *         "getActive" gives direct access to the value
1556   */
1557  public BooleanType getActiveElement() {
1558    if (this.active == null)
1559      if (Configuration.errorOnAutoCreate())
1560        throw new Error("Attempt to auto-create HealthcareService.active");
1561      else if (Configuration.doAutoCreate())
1562        this.active = new BooleanType(); // bb
1563    return this.active;
1564  }
1565
1566  public boolean hasActiveElement() {
1567    return this.active != null && !this.active.isEmpty();
1568  }
1569
1570  public boolean hasActive() {
1571    return this.active != null && !this.active.isEmpty();
1572  }
1573
1574  /**
1575   * @param value {@link #active} (This flag is used to mark the record to not be
1576   *              used. This is not used when a center is closed for maintenance,
1577   *              or for holidays, the notAvailable period is to be used for
1578   *              this.). This is the underlying object with id, value and
1579   *              extensions. The accessor "getActive" gives direct access to the
1580   *              value
1581   */
1582  public HealthcareService setActiveElement(BooleanType value) {
1583    this.active = value;
1584    return this;
1585  }
1586
1587  /**
1588   * @return This flag is used to mark the record to not be used. This is not used
1589   *         when a center is closed for maintenance, or for holidays, the
1590   *         notAvailable period is to be used for this.
1591   */
1592  public boolean getActive() {
1593    return this.active == null || this.active.isEmpty() ? false : this.active.getValue();
1594  }
1595
1596  /**
1597   * @param value This flag is used to mark the record to not be used. This is not
1598   *              used when a center is closed for maintenance, or for holidays,
1599   *              the notAvailable period is to be used for this.
1600   */
1601  public HealthcareService setActive(boolean value) {
1602    if (this.active == null)
1603      this.active = new BooleanType();
1604    this.active.setValue(value);
1605    return this;
1606  }
1607
1608  /**
1609   * @return {@link #providedBy} (The organization that provides this healthcare
1610   *         service.)
1611   */
1612  public Reference getProvidedBy() {
1613    if (this.providedBy == null)
1614      if (Configuration.errorOnAutoCreate())
1615        throw new Error("Attempt to auto-create HealthcareService.providedBy");
1616      else if (Configuration.doAutoCreate())
1617        this.providedBy = new Reference(); // cc
1618    return this.providedBy;
1619  }
1620
1621  public boolean hasProvidedBy() {
1622    return this.providedBy != null && !this.providedBy.isEmpty();
1623  }
1624
1625  /**
1626   * @param value {@link #providedBy} (The organization that provides this
1627   *              healthcare service.)
1628   */
1629  public HealthcareService setProvidedBy(Reference value) {
1630    this.providedBy = value;
1631    return this;
1632  }
1633
1634  /**
1635   * @return {@link #providedBy} The actual object that is the target of the
1636   *         reference. The reference library doesn't populate this, but you can
1637   *         use it to hold the resource if you resolve it. (The organization that
1638   *         provides this healthcare service.)
1639   */
1640  public Organization getProvidedByTarget() {
1641    if (this.providedByTarget == null)
1642      if (Configuration.errorOnAutoCreate())
1643        throw new Error("Attempt to auto-create HealthcareService.providedBy");
1644      else if (Configuration.doAutoCreate())
1645        this.providedByTarget = new Organization(); // aa
1646    return this.providedByTarget;
1647  }
1648
1649  /**
1650   * @param value {@link #providedBy} The actual object that is the target of the
1651   *              reference. The reference library doesn't use these, but you can
1652   *              use it to hold the resource if you resolve it. (The organization
1653   *              that provides this healthcare service.)
1654   */
1655  public HealthcareService setProvidedByTarget(Organization value) {
1656    this.providedByTarget = value;
1657    return this;
1658  }
1659
1660  /**
1661   * @return {@link #category} (Identifies the broad category of service being
1662   *         performed or delivered.)
1663   */
1664  public List<CodeableConcept> getCategory() {
1665    if (this.category == null)
1666      this.category = new ArrayList<CodeableConcept>();
1667    return this.category;
1668  }
1669
1670  /**
1671   * @return Returns a reference to <code>this</code> for easy method chaining
1672   */
1673  public HealthcareService setCategory(List<CodeableConcept> theCategory) {
1674    this.category = theCategory;
1675    return this;
1676  }
1677
1678  public boolean hasCategory() {
1679    if (this.category == null)
1680      return false;
1681    for (CodeableConcept item : this.category)
1682      if (!item.isEmpty())
1683        return true;
1684    return false;
1685  }
1686
1687  public CodeableConcept addCategory() { // 3
1688    CodeableConcept t = new CodeableConcept();
1689    if (this.category == null)
1690      this.category = new ArrayList<CodeableConcept>();
1691    this.category.add(t);
1692    return t;
1693  }
1694
1695  public HealthcareService addCategory(CodeableConcept t) { // 3
1696    if (t == null)
1697      return this;
1698    if (this.category == null)
1699      this.category = new ArrayList<CodeableConcept>();
1700    this.category.add(t);
1701    return this;
1702  }
1703
1704  /**
1705   * @return The first repetition of repeating field {@link #category}, creating
1706   *         it if it does not already exist
1707   */
1708  public CodeableConcept getCategoryFirstRep() {
1709    if (getCategory().isEmpty()) {
1710      addCategory();
1711    }
1712    return getCategory().get(0);
1713  }
1714
1715  /**
1716   * @return {@link #type} (The specific type of service that may be delivered or
1717   *         performed.)
1718   */
1719  public List<CodeableConcept> getType() {
1720    if (this.type == null)
1721      this.type = new ArrayList<CodeableConcept>();
1722    return this.type;
1723  }
1724
1725  /**
1726   * @return Returns a reference to <code>this</code> for easy method chaining
1727   */
1728  public HealthcareService setType(List<CodeableConcept> theType) {
1729    this.type = theType;
1730    return this;
1731  }
1732
1733  public boolean hasType() {
1734    if (this.type == null)
1735      return false;
1736    for (CodeableConcept item : this.type)
1737      if (!item.isEmpty())
1738        return true;
1739    return false;
1740  }
1741
1742  public CodeableConcept addType() { // 3
1743    CodeableConcept t = new CodeableConcept();
1744    if (this.type == null)
1745      this.type = new ArrayList<CodeableConcept>();
1746    this.type.add(t);
1747    return t;
1748  }
1749
1750  public HealthcareService addType(CodeableConcept t) { // 3
1751    if (t == null)
1752      return this;
1753    if (this.type == null)
1754      this.type = new ArrayList<CodeableConcept>();
1755    this.type.add(t);
1756    return this;
1757  }
1758
1759  /**
1760   * @return The first repetition of repeating field {@link #type}, creating it if
1761   *         it does not already exist
1762   */
1763  public CodeableConcept getTypeFirstRep() {
1764    if (getType().isEmpty()) {
1765      addType();
1766    }
1767    return getType().get(0);
1768  }
1769
1770  /**
1771   * @return {@link #specialty} (Collection of specialties handled by the service
1772   *         site. This is more of a medical term.)
1773   */
1774  public List<CodeableConcept> getSpecialty() {
1775    if (this.specialty == null)
1776      this.specialty = new ArrayList<CodeableConcept>();
1777    return this.specialty;
1778  }
1779
1780  /**
1781   * @return Returns a reference to <code>this</code> for easy method chaining
1782   */
1783  public HealthcareService setSpecialty(List<CodeableConcept> theSpecialty) {
1784    this.specialty = theSpecialty;
1785    return this;
1786  }
1787
1788  public boolean hasSpecialty() {
1789    if (this.specialty == null)
1790      return false;
1791    for (CodeableConcept item : this.specialty)
1792      if (!item.isEmpty())
1793        return true;
1794    return false;
1795  }
1796
1797  public CodeableConcept addSpecialty() { // 3
1798    CodeableConcept t = new CodeableConcept();
1799    if (this.specialty == null)
1800      this.specialty = new ArrayList<CodeableConcept>();
1801    this.specialty.add(t);
1802    return t;
1803  }
1804
1805  public HealthcareService addSpecialty(CodeableConcept t) { // 3
1806    if (t == null)
1807      return this;
1808    if (this.specialty == null)
1809      this.specialty = new ArrayList<CodeableConcept>();
1810    this.specialty.add(t);
1811    return this;
1812  }
1813
1814  /**
1815   * @return The first repetition of repeating field {@link #specialty}, creating
1816   *         it if it does not already exist
1817   */
1818  public CodeableConcept getSpecialtyFirstRep() {
1819    if (getSpecialty().isEmpty()) {
1820      addSpecialty();
1821    }
1822    return getSpecialty().get(0);
1823  }
1824
1825  /**
1826   * @return {@link #location} (The location(s) where this healthcare service may
1827   *         be provided.)
1828   */
1829  public List<Reference> getLocation() {
1830    if (this.location == null)
1831      this.location = new ArrayList<Reference>();
1832    return this.location;
1833  }
1834
1835  /**
1836   * @return Returns a reference to <code>this</code> for easy method chaining
1837   */
1838  public HealthcareService setLocation(List<Reference> theLocation) {
1839    this.location = theLocation;
1840    return this;
1841  }
1842
1843  public boolean hasLocation() {
1844    if (this.location == null)
1845      return false;
1846    for (Reference item : this.location)
1847      if (!item.isEmpty())
1848        return true;
1849    return false;
1850  }
1851
1852  public Reference addLocation() { // 3
1853    Reference t = new Reference();
1854    if (this.location == null)
1855      this.location = new ArrayList<Reference>();
1856    this.location.add(t);
1857    return t;
1858  }
1859
1860  public HealthcareService addLocation(Reference t) { // 3
1861    if (t == null)
1862      return this;
1863    if (this.location == null)
1864      this.location = new ArrayList<Reference>();
1865    this.location.add(t);
1866    return this;
1867  }
1868
1869  /**
1870   * @return The first repetition of repeating field {@link #location}, creating
1871   *         it if it does not already exist
1872   */
1873  public Reference getLocationFirstRep() {
1874    if (getLocation().isEmpty()) {
1875      addLocation();
1876    }
1877    return getLocation().get(0);
1878  }
1879
1880  /**
1881   * @deprecated Use Reference#setResource(IBaseResource) instead
1882   */
1883  @Deprecated
1884  public List<Location> getLocationTarget() {
1885    if (this.locationTarget == null)
1886      this.locationTarget = new ArrayList<Location>();
1887    return this.locationTarget;
1888  }
1889
1890  /**
1891   * @deprecated Use Reference#setResource(IBaseResource) instead
1892   */
1893  @Deprecated
1894  public Location addLocationTarget() {
1895    Location r = new Location();
1896    if (this.locationTarget == null)
1897      this.locationTarget = new ArrayList<Location>();
1898    this.locationTarget.add(r);
1899    return r;
1900  }
1901
1902  /**
1903   * @return {@link #name} (Further description of the service as it would be
1904   *         presented to a consumer while searching.). This is the underlying
1905   *         object with id, value and extensions. The accessor "getName" gives
1906   *         direct access to the value
1907   */
1908  public StringType getNameElement() {
1909    if (this.name == null)
1910      if (Configuration.errorOnAutoCreate())
1911        throw new Error("Attempt to auto-create HealthcareService.name");
1912      else if (Configuration.doAutoCreate())
1913        this.name = new StringType(); // bb
1914    return this.name;
1915  }
1916
1917  public boolean hasNameElement() {
1918    return this.name != null && !this.name.isEmpty();
1919  }
1920
1921  public boolean hasName() {
1922    return this.name != null && !this.name.isEmpty();
1923  }
1924
1925  /**
1926   * @param value {@link #name} (Further description of the service as it would be
1927   *              presented to a consumer while searching.). This is the
1928   *              underlying object with id, value and extensions. The accessor
1929   *              "getName" gives direct access to the value
1930   */
1931  public HealthcareService setNameElement(StringType value) {
1932    this.name = value;
1933    return this;
1934  }
1935
1936  /**
1937   * @return Further description of the service as it would be presented to a
1938   *         consumer while searching.
1939   */
1940  public String getName() {
1941    return this.name == null ? null : this.name.getValue();
1942  }
1943
1944  /**
1945   * @param value Further description of the service as it would be presented to a
1946   *              consumer while searching.
1947   */
1948  public HealthcareService setName(String value) {
1949    if (Utilities.noString(value))
1950      this.name = null;
1951    else {
1952      if (this.name == null)
1953        this.name = new StringType();
1954      this.name.setValue(value);
1955    }
1956    return this;
1957  }
1958
1959  /**
1960   * @return {@link #comment} (Any additional description of the service and/or
1961   *         any specific issues not covered by the other attributes, which can be
1962   *         displayed as further detail under the serviceName.). This is the
1963   *         underlying object with id, value and extensions. The accessor
1964   *         "getComment" gives direct access to the value
1965   */
1966  public StringType getCommentElement() {
1967    if (this.comment == null)
1968      if (Configuration.errorOnAutoCreate())
1969        throw new Error("Attempt to auto-create HealthcareService.comment");
1970      else if (Configuration.doAutoCreate())
1971        this.comment = new StringType(); // bb
1972    return this.comment;
1973  }
1974
1975  public boolean hasCommentElement() {
1976    return this.comment != null && !this.comment.isEmpty();
1977  }
1978
1979  public boolean hasComment() {
1980    return this.comment != null && !this.comment.isEmpty();
1981  }
1982
1983  /**
1984   * @param value {@link #comment} (Any additional description of the service
1985   *              and/or any specific issues not covered by the other attributes,
1986   *              which can be displayed as further detail under the
1987   *              serviceName.). This is the underlying object with id, value and
1988   *              extensions. The accessor "getComment" gives direct access to the
1989   *              value
1990   */
1991  public HealthcareService setCommentElement(StringType value) {
1992    this.comment = value;
1993    return this;
1994  }
1995
1996  /**
1997   * @return Any additional description of the service and/or any specific issues
1998   *         not covered by the other attributes, which can be displayed as
1999   *         further detail under the serviceName.
2000   */
2001  public String getComment() {
2002    return this.comment == null ? null : this.comment.getValue();
2003  }
2004
2005  /**
2006   * @param value Any additional description of the service and/or any specific
2007   *              issues not covered by the other attributes, which can be
2008   *              displayed as further detail under the serviceName.
2009   */
2010  public HealthcareService setComment(String value) {
2011    if (Utilities.noString(value))
2012      this.comment = null;
2013    else {
2014      if (this.comment == null)
2015        this.comment = new StringType();
2016      this.comment.setValue(value);
2017    }
2018    return this;
2019  }
2020
2021  /**
2022   * @return {@link #extraDetails} (Extra details about the service that can't be
2023   *         placed in the other fields.). This is the underlying object with id,
2024   *         value and extensions. The accessor "getExtraDetails" gives direct
2025   *         access to the value
2026   */
2027  public MarkdownType getExtraDetailsElement() {
2028    if (this.extraDetails == null)
2029      if (Configuration.errorOnAutoCreate())
2030        throw new Error("Attempt to auto-create HealthcareService.extraDetails");
2031      else if (Configuration.doAutoCreate())
2032        this.extraDetails = new MarkdownType(); // bb
2033    return this.extraDetails;
2034  }
2035
2036  public boolean hasExtraDetailsElement() {
2037    return this.extraDetails != null && !this.extraDetails.isEmpty();
2038  }
2039
2040  public boolean hasExtraDetails() {
2041    return this.extraDetails != null && !this.extraDetails.isEmpty();
2042  }
2043
2044  /**
2045   * @param value {@link #extraDetails} (Extra details about the service that
2046   *              can't be placed in the other fields.). This is the underlying
2047   *              object with id, value and extensions. The accessor
2048   *              "getExtraDetails" gives direct access to the value
2049   */
2050  public HealthcareService setExtraDetailsElement(MarkdownType value) {
2051    this.extraDetails = value;
2052    return this;
2053  }
2054
2055  /**
2056   * @return Extra details about the service that can't be placed in the other
2057   *         fields.
2058   */
2059  public String getExtraDetails() {
2060    return this.extraDetails == null ? null : this.extraDetails.getValue();
2061  }
2062
2063  /**
2064   * @param value Extra details about the service that can't be placed in the
2065   *              other fields.
2066   */
2067  public HealthcareService setExtraDetails(String value) {
2068    if (value == null)
2069      this.extraDetails = null;
2070    else {
2071      if (this.extraDetails == null)
2072        this.extraDetails = new MarkdownType();
2073      this.extraDetails.setValue(value);
2074    }
2075    return this;
2076  }
2077
2078  /**
2079   * @return {@link #photo} (If there is a photo/symbol associated with this
2080   *         HealthcareService, it may be included here to facilitate quick
2081   *         identification of the service in a list.)
2082   */
2083  public Attachment getPhoto() {
2084    if (this.photo == null)
2085      if (Configuration.errorOnAutoCreate())
2086        throw new Error("Attempt to auto-create HealthcareService.photo");
2087      else if (Configuration.doAutoCreate())
2088        this.photo = new Attachment(); // cc
2089    return this.photo;
2090  }
2091
2092  public boolean hasPhoto() {
2093    return this.photo != null && !this.photo.isEmpty();
2094  }
2095
2096  /**
2097   * @param value {@link #photo} (If there is a photo/symbol associated with this
2098   *              HealthcareService, it may be included here to facilitate quick
2099   *              identification of the service in a list.)
2100   */
2101  public HealthcareService setPhoto(Attachment value) {
2102    this.photo = value;
2103    return this;
2104  }
2105
2106  /**
2107   * @return {@link #telecom} (List of contacts related to this specific
2108   *         healthcare service.)
2109   */
2110  public List<ContactPoint> getTelecom() {
2111    if (this.telecom == null)
2112      this.telecom = new ArrayList<ContactPoint>();
2113    return this.telecom;
2114  }
2115
2116  /**
2117   * @return Returns a reference to <code>this</code> for easy method chaining
2118   */
2119  public HealthcareService setTelecom(List<ContactPoint> theTelecom) {
2120    this.telecom = theTelecom;
2121    return this;
2122  }
2123
2124  public boolean hasTelecom() {
2125    if (this.telecom == null)
2126      return false;
2127    for (ContactPoint item : this.telecom)
2128      if (!item.isEmpty())
2129        return true;
2130    return false;
2131  }
2132
2133  public ContactPoint addTelecom() { // 3
2134    ContactPoint t = new ContactPoint();
2135    if (this.telecom == null)
2136      this.telecom = new ArrayList<ContactPoint>();
2137    this.telecom.add(t);
2138    return t;
2139  }
2140
2141  public HealthcareService addTelecom(ContactPoint t) { // 3
2142    if (t == null)
2143      return this;
2144    if (this.telecom == null)
2145      this.telecom = new ArrayList<ContactPoint>();
2146    this.telecom.add(t);
2147    return this;
2148  }
2149
2150  /**
2151   * @return The first repetition of repeating field {@link #telecom}, creating it
2152   *         if it does not already exist
2153   */
2154  public ContactPoint getTelecomFirstRep() {
2155    if (getTelecom().isEmpty()) {
2156      addTelecom();
2157    }
2158    return getTelecom().get(0);
2159  }
2160
2161  /**
2162   * @return {@link #coverageArea} (The location(s) that this service is available
2163   *         to (not where the service is provided).)
2164   */
2165  public List<Reference> getCoverageArea() {
2166    if (this.coverageArea == null)
2167      this.coverageArea = new ArrayList<Reference>();
2168    return this.coverageArea;
2169  }
2170
2171  /**
2172   * @return Returns a reference to <code>this</code> for easy method chaining
2173   */
2174  public HealthcareService setCoverageArea(List<Reference> theCoverageArea) {
2175    this.coverageArea = theCoverageArea;
2176    return this;
2177  }
2178
2179  public boolean hasCoverageArea() {
2180    if (this.coverageArea == null)
2181      return false;
2182    for (Reference item : this.coverageArea)
2183      if (!item.isEmpty())
2184        return true;
2185    return false;
2186  }
2187
2188  public Reference addCoverageArea() { // 3
2189    Reference t = new Reference();
2190    if (this.coverageArea == null)
2191      this.coverageArea = new ArrayList<Reference>();
2192    this.coverageArea.add(t);
2193    return t;
2194  }
2195
2196  public HealthcareService addCoverageArea(Reference t) { // 3
2197    if (t == null)
2198      return this;
2199    if (this.coverageArea == null)
2200      this.coverageArea = new ArrayList<Reference>();
2201    this.coverageArea.add(t);
2202    return this;
2203  }
2204
2205  /**
2206   * @return The first repetition of repeating field {@link #coverageArea},
2207   *         creating it if it does not already exist
2208   */
2209  public Reference getCoverageAreaFirstRep() {
2210    if (getCoverageArea().isEmpty()) {
2211      addCoverageArea();
2212    }
2213    return getCoverageArea().get(0);
2214  }
2215
2216  /**
2217   * @deprecated Use Reference#setResource(IBaseResource) instead
2218   */
2219  @Deprecated
2220  public List<Location> getCoverageAreaTarget() {
2221    if (this.coverageAreaTarget == null)
2222      this.coverageAreaTarget = new ArrayList<Location>();
2223    return this.coverageAreaTarget;
2224  }
2225
2226  /**
2227   * @deprecated Use Reference#setResource(IBaseResource) instead
2228   */
2229  @Deprecated
2230  public Location addCoverageAreaTarget() {
2231    Location r = new Location();
2232    if (this.coverageAreaTarget == null)
2233      this.coverageAreaTarget = new ArrayList<Location>();
2234    this.coverageAreaTarget.add(r);
2235    return r;
2236  }
2237
2238  /**
2239   * @return {@link #serviceProvisionCode} (The code(s) that detail the conditions
2240   *         under which the healthcare service is available/offered.)
2241   */
2242  public List<CodeableConcept> getServiceProvisionCode() {
2243    if (this.serviceProvisionCode == null)
2244      this.serviceProvisionCode = new ArrayList<CodeableConcept>();
2245    return this.serviceProvisionCode;
2246  }
2247
2248  /**
2249   * @return Returns a reference to <code>this</code> for easy method chaining
2250   */
2251  public HealthcareService setServiceProvisionCode(List<CodeableConcept> theServiceProvisionCode) {
2252    this.serviceProvisionCode = theServiceProvisionCode;
2253    return this;
2254  }
2255
2256  public boolean hasServiceProvisionCode() {
2257    if (this.serviceProvisionCode == null)
2258      return false;
2259    for (CodeableConcept item : this.serviceProvisionCode)
2260      if (!item.isEmpty())
2261        return true;
2262    return false;
2263  }
2264
2265  public CodeableConcept addServiceProvisionCode() { // 3
2266    CodeableConcept t = new CodeableConcept();
2267    if (this.serviceProvisionCode == null)
2268      this.serviceProvisionCode = new ArrayList<CodeableConcept>();
2269    this.serviceProvisionCode.add(t);
2270    return t;
2271  }
2272
2273  public HealthcareService addServiceProvisionCode(CodeableConcept t) { // 3
2274    if (t == null)
2275      return this;
2276    if (this.serviceProvisionCode == null)
2277      this.serviceProvisionCode = new ArrayList<CodeableConcept>();
2278    this.serviceProvisionCode.add(t);
2279    return this;
2280  }
2281
2282  /**
2283   * @return The first repetition of repeating field
2284   *         {@link #serviceProvisionCode}, creating it if it does not already
2285   *         exist
2286   */
2287  public CodeableConcept getServiceProvisionCodeFirstRep() {
2288    if (getServiceProvisionCode().isEmpty()) {
2289      addServiceProvisionCode();
2290    }
2291    return getServiceProvisionCode().get(0);
2292  }
2293
2294  /**
2295   * @return {@link #eligibility} (Does this service have specific eligibility
2296   *         requirements that need to be met in order to use the service?)
2297   */
2298  public List<HealthcareServiceEligibilityComponent> getEligibility() {
2299    if (this.eligibility == null)
2300      this.eligibility = new ArrayList<HealthcareServiceEligibilityComponent>();
2301    return this.eligibility;
2302  }
2303
2304  /**
2305   * @return Returns a reference to <code>this</code> for easy method chaining
2306   */
2307  public HealthcareService setEligibility(List<HealthcareServiceEligibilityComponent> theEligibility) {
2308    this.eligibility = theEligibility;
2309    return this;
2310  }
2311
2312  public boolean hasEligibility() {
2313    if (this.eligibility == null)
2314      return false;
2315    for (HealthcareServiceEligibilityComponent item : this.eligibility)
2316      if (!item.isEmpty())
2317        return true;
2318    return false;
2319  }
2320
2321  public HealthcareServiceEligibilityComponent addEligibility() { // 3
2322    HealthcareServiceEligibilityComponent t = new HealthcareServiceEligibilityComponent();
2323    if (this.eligibility == null)
2324      this.eligibility = new ArrayList<HealthcareServiceEligibilityComponent>();
2325    this.eligibility.add(t);
2326    return t;
2327  }
2328
2329  public HealthcareService addEligibility(HealthcareServiceEligibilityComponent t) { // 3
2330    if (t == null)
2331      return this;
2332    if (this.eligibility == null)
2333      this.eligibility = new ArrayList<HealthcareServiceEligibilityComponent>();
2334    this.eligibility.add(t);
2335    return this;
2336  }
2337
2338  /**
2339   * @return The first repetition of repeating field {@link #eligibility},
2340   *         creating it if it does not already exist
2341   */
2342  public HealthcareServiceEligibilityComponent getEligibilityFirstRep() {
2343    if (getEligibility().isEmpty()) {
2344      addEligibility();
2345    }
2346    return getEligibility().get(0);
2347  }
2348
2349  /**
2350   * @return {@link #program} (Programs that this service is applicable to.)
2351   */
2352  public List<CodeableConcept> getProgram() {
2353    if (this.program == null)
2354      this.program = new ArrayList<CodeableConcept>();
2355    return this.program;
2356  }
2357
2358  /**
2359   * @return Returns a reference to <code>this</code> for easy method chaining
2360   */
2361  public HealthcareService setProgram(List<CodeableConcept> theProgram) {
2362    this.program = theProgram;
2363    return this;
2364  }
2365
2366  public boolean hasProgram() {
2367    if (this.program == null)
2368      return false;
2369    for (CodeableConcept item : this.program)
2370      if (!item.isEmpty())
2371        return true;
2372    return false;
2373  }
2374
2375  public CodeableConcept addProgram() { // 3
2376    CodeableConcept t = new CodeableConcept();
2377    if (this.program == null)
2378      this.program = new ArrayList<CodeableConcept>();
2379    this.program.add(t);
2380    return t;
2381  }
2382
2383  public HealthcareService addProgram(CodeableConcept t) { // 3
2384    if (t == null)
2385      return this;
2386    if (this.program == null)
2387      this.program = new ArrayList<CodeableConcept>();
2388    this.program.add(t);
2389    return this;
2390  }
2391
2392  /**
2393   * @return The first repetition of repeating field {@link #program}, creating it
2394   *         if it does not already exist
2395   */
2396  public CodeableConcept getProgramFirstRep() {
2397    if (getProgram().isEmpty()) {
2398      addProgram();
2399    }
2400    return getProgram().get(0);
2401  }
2402
2403  /**
2404   * @return {@link #characteristic} (Collection of characteristics (attributes).)
2405   */
2406  public List<CodeableConcept> getCharacteristic() {
2407    if (this.characteristic == null)
2408      this.characteristic = new ArrayList<CodeableConcept>();
2409    return this.characteristic;
2410  }
2411
2412  /**
2413   * @return Returns a reference to <code>this</code> for easy method chaining
2414   */
2415  public HealthcareService setCharacteristic(List<CodeableConcept> theCharacteristic) {
2416    this.characteristic = theCharacteristic;
2417    return this;
2418  }
2419
2420  public boolean hasCharacteristic() {
2421    if (this.characteristic == null)
2422      return false;
2423    for (CodeableConcept item : this.characteristic)
2424      if (!item.isEmpty())
2425        return true;
2426    return false;
2427  }
2428
2429  public CodeableConcept addCharacteristic() { // 3
2430    CodeableConcept t = new CodeableConcept();
2431    if (this.characteristic == null)
2432      this.characteristic = new ArrayList<CodeableConcept>();
2433    this.characteristic.add(t);
2434    return t;
2435  }
2436
2437  public HealthcareService addCharacteristic(CodeableConcept t) { // 3
2438    if (t == null)
2439      return this;
2440    if (this.characteristic == null)
2441      this.characteristic = new ArrayList<CodeableConcept>();
2442    this.characteristic.add(t);
2443    return this;
2444  }
2445
2446  /**
2447   * @return The first repetition of repeating field {@link #characteristic},
2448   *         creating it if it does not already exist
2449   */
2450  public CodeableConcept getCharacteristicFirstRep() {
2451    if (getCharacteristic().isEmpty()) {
2452      addCharacteristic();
2453    }
2454    return getCharacteristic().get(0);
2455  }
2456
2457  /**
2458   * @return {@link #communication} (Some services are specifically made available
2459   *         in multiple languages, this property permits a directory to declare
2460   *         the languages this is offered in. Typically this is only provided
2461   *         where a service operates in communities with mixed languages used.)
2462   */
2463  public List<CodeableConcept> getCommunication() {
2464    if (this.communication == null)
2465      this.communication = new ArrayList<CodeableConcept>();
2466    return this.communication;
2467  }
2468
2469  /**
2470   * @return Returns a reference to <code>this</code> for easy method chaining
2471   */
2472  public HealthcareService setCommunication(List<CodeableConcept> theCommunication) {
2473    this.communication = theCommunication;
2474    return this;
2475  }
2476
2477  public boolean hasCommunication() {
2478    if (this.communication == null)
2479      return false;
2480    for (CodeableConcept item : this.communication)
2481      if (!item.isEmpty())
2482        return true;
2483    return false;
2484  }
2485
2486  public CodeableConcept addCommunication() { // 3
2487    CodeableConcept t = new CodeableConcept();
2488    if (this.communication == null)
2489      this.communication = new ArrayList<CodeableConcept>();
2490    this.communication.add(t);
2491    return t;
2492  }
2493
2494  public HealthcareService addCommunication(CodeableConcept t) { // 3
2495    if (t == null)
2496      return this;
2497    if (this.communication == null)
2498      this.communication = new ArrayList<CodeableConcept>();
2499    this.communication.add(t);
2500    return this;
2501  }
2502
2503  /**
2504   * @return The first repetition of repeating field {@link #communication},
2505   *         creating it if it does not already exist
2506   */
2507  public CodeableConcept getCommunicationFirstRep() {
2508    if (getCommunication().isEmpty()) {
2509      addCommunication();
2510    }
2511    return getCommunication().get(0);
2512  }
2513
2514  /**
2515   * @return {@link #referralMethod} (Ways that the service accepts referrals, if
2516   *         this is not provided then it is implied that no referral is
2517   *         required.)
2518   */
2519  public List<CodeableConcept> getReferralMethod() {
2520    if (this.referralMethod == null)
2521      this.referralMethod = new ArrayList<CodeableConcept>();
2522    return this.referralMethod;
2523  }
2524
2525  /**
2526   * @return Returns a reference to <code>this</code> for easy method chaining
2527   */
2528  public HealthcareService setReferralMethod(List<CodeableConcept> theReferralMethod) {
2529    this.referralMethod = theReferralMethod;
2530    return this;
2531  }
2532
2533  public boolean hasReferralMethod() {
2534    if (this.referralMethod == null)
2535      return false;
2536    for (CodeableConcept item : this.referralMethod)
2537      if (!item.isEmpty())
2538        return true;
2539    return false;
2540  }
2541
2542  public CodeableConcept addReferralMethod() { // 3
2543    CodeableConcept t = new CodeableConcept();
2544    if (this.referralMethod == null)
2545      this.referralMethod = new ArrayList<CodeableConcept>();
2546    this.referralMethod.add(t);
2547    return t;
2548  }
2549
2550  public HealthcareService addReferralMethod(CodeableConcept t) { // 3
2551    if (t == null)
2552      return this;
2553    if (this.referralMethod == null)
2554      this.referralMethod = new ArrayList<CodeableConcept>();
2555    this.referralMethod.add(t);
2556    return this;
2557  }
2558
2559  /**
2560   * @return The first repetition of repeating field {@link #referralMethod},
2561   *         creating it if it does not already exist
2562   */
2563  public CodeableConcept getReferralMethodFirstRep() {
2564    if (getReferralMethod().isEmpty()) {
2565      addReferralMethod();
2566    }
2567    return getReferralMethod().get(0);
2568  }
2569
2570  /**
2571   * @return {@link #appointmentRequired} (Indicates whether or not a prospective
2572   *         consumer will require an appointment for a particular service at a
2573   *         site to be provided by the Organization. Indicates if an appointment
2574   *         is required for access to this service.). This is the underlying
2575   *         object with id, value and extensions. The accessor
2576   *         "getAppointmentRequired" gives direct access to the value
2577   */
2578  public BooleanType getAppointmentRequiredElement() {
2579    if (this.appointmentRequired == null)
2580      if (Configuration.errorOnAutoCreate())
2581        throw new Error("Attempt to auto-create HealthcareService.appointmentRequired");
2582      else if (Configuration.doAutoCreate())
2583        this.appointmentRequired = new BooleanType(); // bb
2584    return this.appointmentRequired;
2585  }
2586
2587  public boolean hasAppointmentRequiredElement() {
2588    return this.appointmentRequired != null && !this.appointmentRequired.isEmpty();
2589  }
2590
2591  public boolean hasAppointmentRequired() {
2592    return this.appointmentRequired != null && !this.appointmentRequired.isEmpty();
2593  }
2594
2595  /**
2596   * @param value {@link #appointmentRequired} (Indicates whether or not a
2597   *              prospective consumer will require an appointment for a
2598   *              particular service at a site to be provided by the Organization.
2599   *              Indicates if an appointment is required for access to this
2600   *              service.). This is the underlying object with id, value and
2601   *              extensions. The accessor "getAppointmentRequired" gives direct
2602   *              access to the value
2603   */
2604  public HealthcareService setAppointmentRequiredElement(BooleanType value) {
2605    this.appointmentRequired = value;
2606    return this;
2607  }
2608
2609  /**
2610   * @return Indicates whether or not a prospective consumer will require an
2611   *         appointment for a particular service at a site to be provided by the
2612   *         Organization. Indicates if an appointment is required for access to
2613   *         this service.
2614   */
2615  public boolean getAppointmentRequired() {
2616    return this.appointmentRequired == null || this.appointmentRequired.isEmpty() ? false
2617        : this.appointmentRequired.getValue();
2618  }
2619
2620  /**
2621   * @param value Indicates whether or not a prospective consumer will require an
2622   *              appointment for a particular service at a site to be provided by
2623   *              the Organization. Indicates if an appointment is required for
2624   *              access to this service.
2625   */
2626  public HealthcareService setAppointmentRequired(boolean value) {
2627    if (this.appointmentRequired == null)
2628      this.appointmentRequired = new BooleanType();
2629    this.appointmentRequired.setValue(value);
2630    return this;
2631  }
2632
2633  /**
2634   * @return {@link #availableTime} (A collection of times that the Service Site
2635   *         is available.)
2636   */
2637  public List<HealthcareServiceAvailableTimeComponent> getAvailableTime() {
2638    if (this.availableTime == null)
2639      this.availableTime = new ArrayList<HealthcareServiceAvailableTimeComponent>();
2640    return this.availableTime;
2641  }
2642
2643  /**
2644   * @return Returns a reference to <code>this</code> for easy method chaining
2645   */
2646  public HealthcareService setAvailableTime(List<HealthcareServiceAvailableTimeComponent> theAvailableTime) {
2647    this.availableTime = theAvailableTime;
2648    return this;
2649  }
2650
2651  public boolean hasAvailableTime() {
2652    if (this.availableTime == null)
2653      return false;
2654    for (HealthcareServiceAvailableTimeComponent item : this.availableTime)
2655      if (!item.isEmpty())
2656        return true;
2657    return false;
2658  }
2659
2660  public HealthcareServiceAvailableTimeComponent addAvailableTime() { // 3
2661    HealthcareServiceAvailableTimeComponent t = new HealthcareServiceAvailableTimeComponent();
2662    if (this.availableTime == null)
2663      this.availableTime = new ArrayList<HealthcareServiceAvailableTimeComponent>();
2664    this.availableTime.add(t);
2665    return t;
2666  }
2667
2668  public HealthcareService addAvailableTime(HealthcareServiceAvailableTimeComponent t) { // 3
2669    if (t == null)
2670      return this;
2671    if (this.availableTime == null)
2672      this.availableTime = new ArrayList<HealthcareServiceAvailableTimeComponent>();
2673    this.availableTime.add(t);
2674    return this;
2675  }
2676
2677  /**
2678   * @return The first repetition of repeating field {@link #availableTime},
2679   *         creating it if it does not already exist
2680   */
2681  public HealthcareServiceAvailableTimeComponent getAvailableTimeFirstRep() {
2682    if (getAvailableTime().isEmpty()) {
2683      addAvailableTime();
2684    }
2685    return getAvailableTime().get(0);
2686  }
2687
2688  /**
2689   * @return {@link #notAvailable} (The HealthcareService is not available during
2690   *         this period of time due to the provided reason.)
2691   */
2692  public List<HealthcareServiceNotAvailableComponent> getNotAvailable() {
2693    if (this.notAvailable == null)
2694      this.notAvailable = new ArrayList<HealthcareServiceNotAvailableComponent>();
2695    return this.notAvailable;
2696  }
2697
2698  /**
2699   * @return Returns a reference to <code>this</code> for easy method chaining
2700   */
2701  public HealthcareService setNotAvailable(List<HealthcareServiceNotAvailableComponent> theNotAvailable) {
2702    this.notAvailable = theNotAvailable;
2703    return this;
2704  }
2705
2706  public boolean hasNotAvailable() {
2707    if (this.notAvailable == null)
2708      return false;
2709    for (HealthcareServiceNotAvailableComponent item : this.notAvailable)
2710      if (!item.isEmpty())
2711        return true;
2712    return false;
2713  }
2714
2715  public HealthcareServiceNotAvailableComponent addNotAvailable() { // 3
2716    HealthcareServiceNotAvailableComponent t = new HealthcareServiceNotAvailableComponent();
2717    if (this.notAvailable == null)
2718      this.notAvailable = new ArrayList<HealthcareServiceNotAvailableComponent>();
2719    this.notAvailable.add(t);
2720    return t;
2721  }
2722
2723  public HealthcareService addNotAvailable(HealthcareServiceNotAvailableComponent t) { // 3
2724    if (t == null)
2725      return this;
2726    if (this.notAvailable == null)
2727      this.notAvailable = new ArrayList<HealthcareServiceNotAvailableComponent>();
2728    this.notAvailable.add(t);
2729    return this;
2730  }
2731
2732  /**
2733   * @return The first repetition of repeating field {@link #notAvailable},
2734   *         creating it if it does not already exist
2735   */
2736  public HealthcareServiceNotAvailableComponent getNotAvailableFirstRep() {
2737    if (getNotAvailable().isEmpty()) {
2738      addNotAvailable();
2739    }
2740    return getNotAvailable().get(0);
2741  }
2742
2743  /**
2744   * @return {@link #availabilityExceptions} (A description of site availability
2745   *         exceptions, e.g. public holiday availability. Succinctly describing
2746   *         all possible exceptions to normal site availability as details in the
2747   *         available Times and not available Times.). This is the underlying
2748   *         object with id, value and extensions. The accessor
2749   *         "getAvailabilityExceptions" gives direct access to the value
2750   */
2751  public StringType getAvailabilityExceptionsElement() {
2752    if (this.availabilityExceptions == null)
2753      if (Configuration.errorOnAutoCreate())
2754        throw new Error("Attempt to auto-create HealthcareService.availabilityExceptions");
2755      else if (Configuration.doAutoCreate())
2756        this.availabilityExceptions = new StringType(); // bb
2757    return this.availabilityExceptions;
2758  }
2759
2760  public boolean hasAvailabilityExceptionsElement() {
2761    return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty();
2762  }
2763
2764  public boolean hasAvailabilityExceptions() {
2765    return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty();
2766  }
2767
2768  /**
2769   * @param value {@link #availabilityExceptions} (A description of site
2770   *              availability exceptions, e.g. public holiday availability.
2771   *              Succinctly describing all possible exceptions to normal site
2772   *              availability as details in the available Times and not available
2773   *              Times.). This is the underlying object with id, value and
2774   *              extensions. The accessor "getAvailabilityExceptions" gives
2775   *              direct access to the value
2776   */
2777  public HealthcareService setAvailabilityExceptionsElement(StringType value) {
2778    this.availabilityExceptions = value;
2779    return this;
2780  }
2781
2782  /**
2783   * @return A description of site availability exceptions, e.g. public holiday
2784   *         availability. Succinctly describing all possible exceptions to normal
2785   *         site availability as details in the available Times and not available
2786   *         Times.
2787   */
2788  public String getAvailabilityExceptions() {
2789    return this.availabilityExceptions == null ? null : this.availabilityExceptions.getValue();
2790  }
2791
2792  /**
2793   * @param value A description of site availability exceptions, e.g. public
2794   *              holiday availability. Succinctly describing all possible
2795   *              exceptions to normal site availability as details in the
2796   *              available Times and not available Times.
2797   */
2798  public HealthcareService setAvailabilityExceptions(String value) {
2799    if (Utilities.noString(value))
2800      this.availabilityExceptions = null;
2801    else {
2802      if (this.availabilityExceptions == null)
2803        this.availabilityExceptions = new StringType();
2804      this.availabilityExceptions.setValue(value);
2805    }
2806    return this;
2807  }
2808
2809  /**
2810   * @return {@link #endpoint} (Technical endpoints providing access to services
2811   *         operated for the specific healthcare services defined at this
2812   *         resource.)
2813   */
2814  public List<Reference> getEndpoint() {
2815    if (this.endpoint == null)
2816      this.endpoint = new ArrayList<Reference>();
2817    return this.endpoint;
2818  }
2819
2820  /**
2821   * @return Returns a reference to <code>this</code> for easy method chaining
2822   */
2823  public HealthcareService setEndpoint(List<Reference> theEndpoint) {
2824    this.endpoint = theEndpoint;
2825    return this;
2826  }
2827
2828  public boolean hasEndpoint() {
2829    if (this.endpoint == null)
2830      return false;
2831    for (Reference item : this.endpoint)
2832      if (!item.isEmpty())
2833        return true;
2834    return false;
2835  }
2836
2837  public Reference addEndpoint() { // 3
2838    Reference t = new Reference();
2839    if (this.endpoint == null)
2840      this.endpoint = new ArrayList<Reference>();
2841    this.endpoint.add(t);
2842    return t;
2843  }
2844
2845  public HealthcareService addEndpoint(Reference t) { // 3
2846    if (t == null)
2847      return this;
2848    if (this.endpoint == null)
2849      this.endpoint = new ArrayList<Reference>();
2850    this.endpoint.add(t);
2851    return this;
2852  }
2853
2854  /**
2855   * @return The first repetition of repeating field {@link #endpoint}, creating
2856   *         it if it does not already exist
2857   */
2858  public Reference getEndpointFirstRep() {
2859    if (getEndpoint().isEmpty()) {
2860      addEndpoint();
2861    }
2862    return getEndpoint().get(0);
2863  }
2864
2865  /**
2866   * @deprecated Use Reference#setResource(IBaseResource) instead
2867   */
2868  @Deprecated
2869  public List<Endpoint> getEndpointTarget() {
2870    if (this.endpointTarget == null)
2871      this.endpointTarget = new ArrayList<Endpoint>();
2872    return this.endpointTarget;
2873  }
2874
2875  /**
2876   * @deprecated Use Reference#setResource(IBaseResource) instead
2877   */
2878  @Deprecated
2879  public Endpoint addEndpointTarget() {
2880    Endpoint r = new Endpoint();
2881    if (this.endpointTarget == null)
2882      this.endpointTarget = new ArrayList<Endpoint>();
2883    this.endpointTarget.add(r);
2884    return r;
2885  }
2886
2887  protected void listChildren(List<Property> children) {
2888    super.listChildren(children);
2889    children.add(new Property("identifier", "Identifier", "External identifiers for this item.", 0,
2890        java.lang.Integer.MAX_VALUE, identifier));
2891    children.add(new Property("active", "boolean",
2892        "This flag is used to mark the record to not be used. This is not used when a center is closed for maintenance, or for holidays, the notAvailable period is to be used for this.",
2893        0, 1, active));
2894    children.add(new Property("providedBy", "Reference(Organization)",
2895        "The organization that provides this healthcare service.", 0, 1, providedBy));
2896    children.add(new Property("category", "CodeableConcept",
2897        "Identifies the broad category of service being performed or delivered.", 0, java.lang.Integer.MAX_VALUE,
2898        category));
2899    children.add(new Property("type", "CodeableConcept",
2900        "The specific type of service that may be delivered or performed.", 0, java.lang.Integer.MAX_VALUE, type));
2901    children.add(new Property("specialty", "CodeableConcept",
2902        "Collection of specialties handled by the service site. This is more of a medical term.", 0,
2903        java.lang.Integer.MAX_VALUE, specialty));
2904    children.add(new Property("location", "Reference(Location)",
2905        "The location(s) where this healthcare service may be provided.", 0, java.lang.Integer.MAX_VALUE, location));
2906    children.add(new Property("name", "string",
2907        "Further description of the service as it would be presented to a consumer while searching.", 0, 1, name));
2908    children.add(new Property("comment", "string",
2909        "Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.",
2910        0, 1, comment));
2911    children.add(new Property("extraDetails", "markdown",
2912        "Extra details about the service that can't be placed in the other fields.", 0, 1, extraDetails));
2913    children.add(new Property("photo", "Attachment",
2914        "If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list.",
2915        0, 1, photo));
2916    children.add(new Property("telecom", "ContactPoint",
2917        "List of contacts related to this specific healthcare service.", 0, java.lang.Integer.MAX_VALUE, telecom));
2918    children.add(new Property("coverageArea", "Reference(Location)",
2919        "The location(s) that this service is available to (not where the service is provided).", 0,
2920        java.lang.Integer.MAX_VALUE, coverageArea));
2921    children.add(new Property("serviceProvisionCode", "CodeableConcept",
2922        "The code(s) that detail the conditions under which the healthcare service is available/offered.", 0,
2923        java.lang.Integer.MAX_VALUE, serviceProvisionCode));
2924    children.add(new Property("eligibility", "",
2925        "Does this service have specific eligibility requirements that need to be met in order to use the service?", 0,
2926        java.lang.Integer.MAX_VALUE, eligibility));
2927    children.add(new Property("program", "CodeableConcept", "Programs that this service is applicable to.", 0,
2928        java.lang.Integer.MAX_VALUE, program));
2929    children.add(new Property("characteristic", "CodeableConcept", "Collection of characteristics (attributes).", 0,
2930        java.lang.Integer.MAX_VALUE, characteristic));
2931    children.add(new Property("communication", "CodeableConcept",
2932        "Some services are specifically made available in multiple languages, this property permits a directory to declare the languages this is offered in. Typically this is only provided where a service operates in communities with mixed languages used.",
2933        0, java.lang.Integer.MAX_VALUE, communication));
2934    children.add(new Property("referralMethod", "CodeableConcept",
2935        "Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.",
2936        0, java.lang.Integer.MAX_VALUE, referralMethod));
2937    children.add(new Property("appointmentRequired", "boolean",
2938        "Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service.",
2939        0, 1, appointmentRequired));
2940    children.add(new Property("availableTime", "", "A collection of times that the Service Site is available.", 0,
2941        java.lang.Integer.MAX_VALUE, availableTime));
2942    children.add(new Property("notAvailable", "",
2943        "The HealthcareService is not available during this period of time due to the provided reason.", 0,
2944        java.lang.Integer.MAX_VALUE, notAvailable));
2945    children.add(new Property("availabilityExceptions", "string",
2946        "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.",
2947        0, 1, availabilityExceptions));
2948    children.add(new Property("endpoint", "Reference(Endpoint)",
2949        "Technical endpoints providing access to services operated for the specific healthcare services defined at this resource.",
2950        0, java.lang.Integer.MAX_VALUE, endpoint));
2951  }
2952
2953  @Override
2954  public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2955    switch (_hash) {
2956    case -1618432855:
2957      /* identifier */ return new Property("identifier", "Identifier", "External identifiers for this item.", 0,
2958          java.lang.Integer.MAX_VALUE, identifier);
2959    case -1422950650:
2960      /* active */ return new Property("active", "boolean",
2961          "This flag is used to mark the record to not be used. This is not used when a center is closed for maintenance, or for holidays, the notAvailable period is to be used for this.",
2962          0, 1, active);
2963    case 205136282:
2964      /* providedBy */ return new Property("providedBy", "Reference(Organization)",
2965          "The organization that provides this healthcare service.", 0, 1, providedBy);
2966    case 50511102:
2967      /* category */ return new Property("category", "CodeableConcept",
2968          "Identifies the broad category of service being performed or delivered.", 0, java.lang.Integer.MAX_VALUE,
2969          category);
2970    case 3575610:
2971      /* type */ return new Property("type", "CodeableConcept",
2972          "The specific type of service that may be delivered or performed.", 0, java.lang.Integer.MAX_VALUE, type);
2973    case -1694759682:
2974      /* specialty */ return new Property("specialty", "CodeableConcept",
2975          "Collection of specialties handled by the service site. This is more of a medical term.", 0,
2976          java.lang.Integer.MAX_VALUE, specialty);
2977    case 1901043637:
2978      /* location */ return new Property("location", "Reference(Location)",
2979          "The location(s) where this healthcare service may be provided.", 0, java.lang.Integer.MAX_VALUE, location);
2980    case 3373707:
2981      /* name */ return new Property("name", "string",
2982          "Further description of the service as it would be presented to a consumer while searching.", 0, 1, name);
2983    case 950398559:
2984      /* comment */ return new Property("comment", "string",
2985          "Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.",
2986          0, 1, comment);
2987    case -1469168622:
2988      /* extraDetails */ return new Property("extraDetails", "markdown",
2989          "Extra details about the service that can't be placed in the other fields.", 0, 1, extraDetails);
2990    case 106642994:
2991      /* photo */ return new Property("photo", "Attachment",
2992          "If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list.",
2993          0, 1, photo);
2994    case -1429363305:
2995      /* telecom */ return new Property("telecom", "ContactPoint",
2996          "List of contacts related to this specific healthcare service.", 0, java.lang.Integer.MAX_VALUE, telecom);
2997    case -1532328299:
2998      /* coverageArea */ return new Property("coverageArea", "Reference(Location)",
2999          "The location(s) that this service is available to (not where the service is provided).", 0,
3000          java.lang.Integer.MAX_VALUE, coverageArea);
3001    case 1504575405:
3002      /* serviceProvisionCode */ return new Property("serviceProvisionCode", "CodeableConcept",
3003          "The code(s) that detail the conditions under which the healthcare service is available/offered.", 0,
3004          java.lang.Integer.MAX_VALUE, serviceProvisionCode);
3005    case -930847859:
3006      /* eligibility */ return new Property("eligibility", "",
3007          "Does this service have specific eligibility requirements that need to be met in order to use the service?",
3008          0, java.lang.Integer.MAX_VALUE, eligibility);
3009    case -309387644:
3010      /* program */ return new Property("program", "CodeableConcept", "Programs that this service is applicable to.", 0,
3011          java.lang.Integer.MAX_VALUE, program);
3012    case 366313883:
3013      /* characteristic */ return new Property("characteristic", "CodeableConcept",
3014          "Collection of characteristics (attributes).", 0, java.lang.Integer.MAX_VALUE, characteristic);
3015    case -1035284522:
3016      /* communication */ return new Property("communication", "CodeableConcept",
3017          "Some services are specifically made available in multiple languages, this property permits a directory to declare the languages this is offered in. Typically this is only provided where a service operates in communities with mixed languages used.",
3018          0, java.lang.Integer.MAX_VALUE, communication);
3019    case -2092740898:
3020      /* referralMethod */ return new Property("referralMethod", "CodeableConcept",
3021          "Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.",
3022          0, java.lang.Integer.MAX_VALUE, referralMethod);
3023    case 427220062:
3024      /* appointmentRequired */ return new Property("appointmentRequired", "boolean",
3025          "Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service.",
3026          0, 1, appointmentRequired);
3027    case 1873069366:
3028      /* availableTime */ return new Property("availableTime", "",
3029          "A collection of times that the Service Site is available.", 0, java.lang.Integer.MAX_VALUE, availableTime);
3030    case -629572298:
3031      /* notAvailable */ return new Property("notAvailable", "",
3032          "The HealthcareService is not available during this period of time due to the provided reason.", 0,
3033          java.lang.Integer.MAX_VALUE, notAvailable);
3034    case -1149143617:
3035      /* availabilityExceptions */ return new Property("availabilityExceptions", "string",
3036          "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.",
3037          0, 1, availabilityExceptions);
3038    case 1741102485:
3039      /* endpoint */ return new Property("endpoint", "Reference(Endpoint)",
3040          "Technical endpoints providing access to services operated for the specific healthcare services defined at this resource.",
3041          0, java.lang.Integer.MAX_VALUE, endpoint);
3042    default:
3043      return super.getNamedProperty(_hash, _name, _checkValid);
3044    }
3045
3046  }
3047
3048  @Override
3049  public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3050    switch (hash) {
3051    case -1618432855:
3052      /* identifier */ return this.identifier == null ? new Base[0]
3053          : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3054    case -1422950650:
3055      /* active */ return this.active == null ? new Base[0] : new Base[] { this.active }; // BooleanType
3056    case 205136282:
3057      /* providedBy */ return this.providedBy == null ? new Base[0] : new Base[] { this.providedBy }; // Reference
3058    case 50511102:
3059      /* category */ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
3060    case 3575610:
3061      /* type */ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
3062    case -1694759682:
3063      /* specialty */ return this.specialty == null ? new Base[0]
3064          : this.specialty.toArray(new Base[this.specialty.size()]); // CodeableConcept
3065    case 1901043637:
3066      /* location */ return this.location == null ? new Base[0] : this.location.toArray(new Base[this.location.size()]); // Reference
3067    case 3373707:
3068      /* name */ return this.name == null ? new Base[0] : new Base[] { this.name }; // StringType
3069    case 950398559:
3070      /* comment */ return this.comment == null ? new Base[0] : new Base[] { this.comment }; // StringType
3071    case -1469168622:
3072      /* extraDetails */ return this.extraDetails == null ? new Base[0] : new Base[] { this.extraDetails }; // MarkdownType
3073    case 106642994:
3074      /* photo */ return this.photo == null ? new Base[0] : new Base[] { this.photo }; // Attachment
3075    case -1429363305:
3076      /* telecom */ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint
3077    case -1532328299:
3078      /* coverageArea */ return this.coverageArea == null ? new Base[0]
3079          : this.coverageArea.toArray(new Base[this.coverageArea.size()]); // Reference
3080    case 1504575405:
3081      /* serviceProvisionCode */ return this.serviceProvisionCode == null ? new Base[0]
3082          : this.serviceProvisionCode.toArray(new Base[this.serviceProvisionCode.size()]); // CodeableConcept
3083    case -930847859:
3084      /* eligibility */ return this.eligibility == null ? new Base[0]
3085          : this.eligibility.toArray(new Base[this.eligibility.size()]); // HealthcareServiceEligibilityComponent
3086    case -309387644:
3087      /* program */ return this.program == null ? new Base[0] : this.program.toArray(new Base[this.program.size()]); // CodeableConcept
3088    case 366313883:
3089      /* characteristic */ return this.characteristic == null ? new Base[0]
3090          : this.characteristic.toArray(new Base[this.characteristic.size()]); // CodeableConcept
3091    case -1035284522:
3092      /* communication */ return this.communication == null ? new Base[0]
3093          : this.communication.toArray(new Base[this.communication.size()]); // CodeableConcept
3094    case -2092740898:
3095      /* referralMethod */ return this.referralMethod == null ? new Base[0]
3096          : this.referralMethod.toArray(new Base[this.referralMethod.size()]); // CodeableConcept
3097    case 427220062:
3098      /* appointmentRequired */ return this.appointmentRequired == null ? new Base[0]
3099          : new Base[] { this.appointmentRequired }; // BooleanType
3100    case 1873069366:
3101      /* availableTime */ return this.availableTime == null ? new Base[0]
3102          : this.availableTime.toArray(new Base[this.availableTime.size()]); // HealthcareServiceAvailableTimeComponent
3103    case -629572298:
3104      /* notAvailable */ return this.notAvailable == null ? new Base[0]
3105          : this.notAvailable.toArray(new Base[this.notAvailable.size()]); // HealthcareServiceNotAvailableComponent
3106    case -1149143617:
3107      /* availabilityExceptions */ return this.availabilityExceptions == null ? new Base[0]
3108          : new Base[] { this.availabilityExceptions }; // StringType
3109    case 1741102485:
3110      /* endpoint */ return this.endpoint == null ? new Base[0] : this.endpoint.toArray(new Base[this.endpoint.size()]); // Reference
3111    default:
3112      return super.getProperty(hash, name, checkValid);
3113    }
3114
3115  }
3116
3117  @Override
3118  public Base setProperty(int hash, String name, Base value) throws FHIRException {
3119    switch (hash) {
3120    case -1618432855: // identifier
3121      this.getIdentifier().add(castToIdentifier(value)); // Identifier
3122      return value;
3123    case -1422950650: // active
3124      this.active = castToBoolean(value); // BooleanType
3125      return value;
3126    case 205136282: // providedBy
3127      this.providedBy = castToReference(value); // Reference
3128      return value;
3129    case 50511102: // category
3130      this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept
3131      return value;
3132    case 3575610: // type
3133      this.getType().add(castToCodeableConcept(value)); // CodeableConcept
3134      return value;
3135    case -1694759682: // specialty
3136      this.getSpecialty().add(castToCodeableConcept(value)); // CodeableConcept
3137      return value;
3138    case 1901043637: // location
3139      this.getLocation().add(castToReference(value)); // Reference
3140      return value;
3141    case 3373707: // name
3142      this.name = castToString(value); // StringType
3143      return value;
3144    case 950398559: // comment
3145      this.comment = castToString(value); // StringType
3146      return value;
3147    case -1469168622: // extraDetails
3148      this.extraDetails = castToMarkdown(value); // MarkdownType
3149      return value;
3150    case 106642994: // photo
3151      this.photo = castToAttachment(value); // Attachment
3152      return value;
3153    case -1429363305: // telecom
3154      this.getTelecom().add(castToContactPoint(value)); // ContactPoint
3155      return value;
3156    case -1532328299: // coverageArea
3157      this.getCoverageArea().add(castToReference(value)); // Reference
3158      return value;
3159    case 1504575405: // serviceProvisionCode
3160      this.getServiceProvisionCode().add(castToCodeableConcept(value)); // CodeableConcept
3161      return value;
3162    case -930847859: // eligibility
3163      this.getEligibility().add((HealthcareServiceEligibilityComponent) value); // HealthcareServiceEligibilityComponent
3164      return value;
3165    case -309387644: // program
3166      this.getProgram().add(castToCodeableConcept(value)); // CodeableConcept
3167      return value;
3168    case 366313883: // characteristic
3169      this.getCharacteristic().add(castToCodeableConcept(value)); // CodeableConcept
3170      return value;
3171    case -1035284522: // communication
3172      this.getCommunication().add(castToCodeableConcept(value)); // CodeableConcept
3173      return value;
3174    case -2092740898: // referralMethod
3175      this.getReferralMethod().add(castToCodeableConcept(value)); // CodeableConcept
3176      return value;
3177    case 427220062: // appointmentRequired
3178      this.appointmentRequired = castToBoolean(value); // BooleanType
3179      return value;
3180    case 1873069366: // availableTime
3181      this.getAvailableTime().add((HealthcareServiceAvailableTimeComponent) value); // HealthcareServiceAvailableTimeComponent
3182      return value;
3183    case -629572298: // notAvailable
3184      this.getNotAvailable().add((HealthcareServiceNotAvailableComponent) value); // HealthcareServiceNotAvailableComponent
3185      return value;
3186    case -1149143617: // availabilityExceptions
3187      this.availabilityExceptions = castToString(value); // StringType
3188      return value;
3189    case 1741102485: // endpoint
3190      this.getEndpoint().add(castToReference(value)); // Reference
3191      return value;
3192    default:
3193      return super.setProperty(hash, name, value);
3194    }
3195
3196  }
3197
3198  @Override
3199  public Base setProperty(String name, Base value) throws FHIRException {
3200    if (name.equals("identifier")) {
3201      this.getIdentifier().add(castToIdentifier(value));
3202    } else if (name.equals("active")) {
3203      this.active = castToBoolean(value); // BooleanType
3204    } else if (name.equals("providedBy")) {
3205      this.providedBy = castToReference(value); // Reference
3206    } else if (name.equals("category")) {
3207      this.getCategory().add(castToCodeableConcept(value));
3208    } else if (name.equals("type")) {
3209      this.getType().add(castToCodeableConcept(value));
3210    } else if (name.equals("specialty")) {
3211      this.getSpecialty().add(castToCodeableConcept(value));
3212    } else if (name.equals("location")) {
3213      this.getLocation().add(castToReference(value));
3214    } else if (name.equals("name")) {
3215      this.name = castToString(value); // StringType
3216    } else if (name.equals("comment")) {
3217      this.comment = castToString(value); // StringType
3218    } else if (name.equals("extraDetails")) {
3219      this.extraDetails = castToMarkdown(value); // MarkdownType
3220    } else if (name.equals("photo")) {
3221      this.photo = castToAttachment(value); // Attachment
3222    } else if (name.equals("telecom")) {
3223      this.getTelecom().add(castToContactPoint(value));
3224    } else if (name.equals("coverageArea")) {
3225      this.getCoverageArea().add(castToReference(value));
3226    } else if (name.equals("serviceProvisionCode")) {
3227      this.getServiceProvisionCode().add(castToCodeableConcept(value));
3228    } else if (name.equals("eligibility")) {
3229      this.getEligibility().add((HealthcareServiceEligibilityComponent) value);
3230    } else if (name.equals("program")) {
3231      this.getProgram().add(castToCodeableConcept(value));
3232    } else if (name.equals("characteristic")) {
3233      this.getCharacteristic().add(castToCodeableConcept(value));
3234    } else if (name.equals("communication")) {
3235      this.getCommunication().add(castToCodeableConcept(value));
3236    } else if (name.equals("referralMethod")) {
3237      this.getReferralMethod().add(castToCodeableConcept(value));
3238    } else if (name.equals("appointmentRequired")) {
3239      this.appointmentRequired = castToBoolean(value); // BooleanType
3240    } else if (name.equals("availableTime")) {
3241      this.getAvailableTime().add((HealthcareServiceAvailableTimeComponent) value);
3242    } else if (name.equals("notAvailable")) {
3243      this.getNotAvailable().add((HealthcareServiceNotAvailableComponent) value);
3244    } else if (name.equals("availabilityExceptions")) {
3245      this.availabilityExceptions = castToString(value); // StringType
3246    } else if (name.equals("endpoint")) {
3247      this.getEndpoint().add(castToReference(value));
3248    } else
3249      return super.setProperty(name, value);
3250    return value;
3251  }
3252
3253  @Override
3254  public Base makeProperty(int hash, String name) throws FHIRException {
3255    switch (hash) {
3256    case -1618432855:
3257      return addIdentifier();
3258    case -1422950650:
3259      return getActiveElement();
3260    case 205136282:
3261      return getProvidedBy();
3262    case 50511102:
3263      return addCategory();
3264    case 3575610:
3265      return addType();
3266    case -1694759682:
3267      return addSpecialty();
3268    case 1901043637:
3269      return addLocation();
3270    case 3373707:
3271      return getNameElement();
3272    case 950398559:
3273      return getCommentElement();
3274    case -1469168622:
3275      return getExtraDetailsElement();
3276    case 106642994:
3277      return getPhoto();
3278    case -1429363305:
3279      return addTelecom();
3280    case -1532328299:
3281      return addCoverageArea();
3282    case 1504575405:
3283      return addServiceProvisionCode();
3284    case -930847859:
3285      return addEligibility();
3286    case -309387644:
3287      return addProgram();
3288    case 366313883:
3289      return addCharacteristic();
3290    case -1035284522:
3291      return addCommunication();
3292    case -2092740898:
3293      return addReferralMethod();
3294    case 427220062:
3295      return getAppointmentRequiredElement();
3296    case 1873069366:
3297      return addAvailableTime();
3298    case -629572298:
3299      return addNotAvailable();
3300    case -1149143617:
3301      return getAvailabilityExceptionsElement();
3302    case 1741102485:
3303      return addEndpoint();
3304    default:
3305      return super.makeProperty(hash, name);
3306    }
3307
3308  }
3309
3310  @Override
3311  public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3312    switch (hash) {
3313    case -1618432855:
3314      /* identifier */ return new String[] { "Identifier" };
3315    case -1422950650:
3316      /* active */ return new String[] { "boolean" };
3317    case 205136282:
3318      /* providedBy */ return new String[] { "Reference" };
3319    case 50511102:
3320      /* category */ return new String[] { "CodeableConcept" };
3321    case 3575610:
3322      /* type */ return new String[] { "CodeableConcept" };
3323    case -1694759682:
3324      /* specialty */ return new String[] { "CodeableConcept" };
3325    case 1901043637:
3326      /* location */ return new String[] { "Reference" };
3327    case 3373707:
3328      /* name */ return new String[] { "string" };
3329    case 950398559:
3330      /* comment */ return new String[] { "string" };
3331    case -1469168622:
3332      /* extraDetails */ return new String[] { "markdown" };
3333    case 106642994:
3334      /* photo */ return new String[] { "Attachment" };
3335    case -1429363305:
3336      /* telecom */ return new String[] { "ContactPoint" };
3337    case -1532328299:
3338      /* coverageArea */ return new String[] { "Reference" };
3339    case 1504575405:
3340      /* serviceProvisionCode */ return new String[] { "CodeableConcept" };
3341    case -930847859:
3342      /* eligibility */ return new String[] {};
3343    case -309387644:
3344      /* program */ return new String[] { "CodeableConcept" };
3345    case 366313883:
3346      /* characteristic */ return new String[] { "CodeableConcept" };
3347    case -1035284522:
3348      /* communication */ return new String[] { "CodeableConcept" };
3349    case -2092740898:
3350      /* referralMethod */ return new String[] { "CodeableConcept" };
3351    case 427220062:
3352      /* appointmentRequired */ return new String[] { "boolean" };
3353    case 1873069366:
3354      /* availableTime */ return new String[] {};
3355    case -629572298:
3356      /* notAvailable */ return new String[] {};
3357    case -1149143617:
3358      /* availabilityExceptions */ return new String[] { "string" };
3359    case 1741102485:
3360      /* endpoint */ return new String[] { "Reference" };
3361    default:
3362      return super.getTypesForProperty(hash, name);
3363    }
3364
3365  }
3366
3367  @Override
3368  public Base addChild(String name) throws FHIRException {
3369    if (name.equals("identifier")) {
3370      return addIdentifier();
3371    } else if (name.equals("active")) {
3372      throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.active");
3373    } else if (name.equals("providedBy")) {
3374      this.providedBy = new Reference();
3375      return this.providedBy;
3376    } else if (name.equals("category")) {
3377      return addCategory();
3378    } else if (name.equals("type")) {
3379      return addType();
3380    } else if (name.equals("specialty")) {
3381      return addSpecialty();
3382    } else if (name.equals("location")) {
3383      return addLocation();
3384    } else if (name.equals("name")) {
3385      throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.name");
3386    } else if (name.equals("comment")) {
3387      throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.comment");
3388    } else if (name.equals("extraDetails")) {
3389      throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.extraDetails");
3390    } else if (name.equals("photo")) {
3391      this.photo = new Attachment();
3392      return this.photo;
3393    } else if (name.equals("telecom")) {
3394      return addTelecom();
3395    } else if (name.equals("coverageArea")) {
3396      return addCoverageArea();
3397    } else if (name.equals("serviceProvisionCode")) {
3398      return addServiceProvisionCode();
3399    } else if (name.equals("eligibility")) {
3400      return addEligibility();
3401    } else if (name.equals("program")) {
3402      return addProgram();
3403    } else if (name.equals("characteristic")) {
3404      return addCharacteristic();
3405    } else if (name.equals("communication")) {
3406      return addCommunication();
3407    } else if (name.equals("referralMethod")) {
3408      return addReferralMethod();
3409    } else if (name.equals("appointmentRequired")) {
3410      throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.appointmentRequired");
3411    } else if (name.equals("availableTime")) {
3412      return addAvailableTime();
3413    } else if (name.equals("notAvailable")) {
3414      return addNotAvailable();
3415    } else if (name.equals("availabilityExceptions")) {
3416      throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.availabilityExceptions");
3417    } else if (name.equals("endpoint")) {
3418      return addEndpoint();
3419    } else
3420      return super.addChild(name);
3421  }
3422
3423  public String fhirType() {
3424    return "HealthcareService";
3425
3426  }
3427
3428  public HealthcareService copy() {
3429    HealthcareService dst = new HealthcareService();
3430    copyValues(dst);
3431    return dst;
3432  }
3433
3434  public void copyValues(HealthcareService dst) {
3435    super.copyValues(dst);
3436    if (identifier != null) {
3437      dst.identifier = new ArrayList<Identifier>();
3438      for (Identifier i : identifier)
3439        dst.identifier.add(i.copy());
3440    }
3441    ;
3442    dst.active = active == null ? null : active.copy();
3443    dst.providedBy = providedBy == null ? null : providedBy.copy();
3444    if (category != null) {
3445      dst.category = new ArrayList<CodeableConcept>();
3446      for (CodeableConcept i : category)
3447        dst.category.add(i.copy());
3448    }
3449    ;
3450    if (type != null) {
3451      dst.type = new ArrayList<CodeableConcept>();
3452      for (CodeableConcept i : type)
3453        dst.type.add(i.copy());
3454    }
3455    ;
3456    if (specialty != null) {
3457      dst.specialty = new ArrayList<CodeableConcept>();
3458      for (CodeableConcept i : specialty)
3459        dst.specialty.add(i.copy());
3460    }
3461    ;
3462    if (location != null) {
3463      dst.location = new ArrayList<Reference>();
3464      for (Reference i : location)
3465        dst.location.add(i.copy());
3466    }
3467    ;
3468    dst.name = name == null ? null : name.copy();
3469    dst.comment = comment == null ? null : comment.copy();
3470    dst.extraDetails = extraDetails == null ? null : extraDetails.copy();
3471    dst.photo = photo == null ? null : photo.copy();
3472    if (telecom != null) {
3473      dst.telecom = new ArrayList<ContactPoint>();
3474      for (ContactPoint i : telecom)
3475        dst.telecom.add(i.copy());
3476    }
3477    ;
3478    if (coverageArea != null) {
3479      dst.coverageArea = new ArrayList<Reference>();
3480      for (Reference i : coverageArea)
3481        dst.coverageArea.add(i.copy());
3482    }
3483    ;
3484    if (serviceProvisionCode != null) {
3485      dst.serviceProvisionCode = new ArrayList<CodeableConcept>();
3486      for (CodeableConcept i : serviceProvisionCode)
3487        dst.serviceProvisionCode.add(i.copy());
3488    }
3489    ;
3490    if (eligibility != null) {
3491      dst.eligibility = new ArrayList<HealthcareServiceEligibilityComponent>();
3492      for (HealthcareServiceEligibilityComponent i : eligibility)
3493        dst.eligibility.add(i.copy());
3494    }
3495    ;
3496    if (program != null) {
3497      dst.program = new ArrayList<CodeableConcept>();
3498      for (CodeableConcept i : program)
3499        dst.program.add(i.copy());
3500    }
3501    ;
3502    if (characteristic != null) {
3503      dst.characteristic = new ArrayList<CodeableConcept>();
3504      for (CodeableConcept i : characteristic)
3505        dst.characteristic.add(i.copy());
3506    }
3507    ;
3508    if (communication != null) {
3509      dst.communication = new ArrayList<CodeableConcept>();
3510      for (CodeableConcept i : communication)
3511        dst.communication.add(i.copy());
3512    }
3513    ;
3514    if (referralMethod != null) {
3515      dst.referralMethod = new ArrayList<CodeableConcept>();
3516      for (CodeableConcept i : referralMethod)
3517        dst.referralMethod.add(i.copy());
3518    }
3519    ;
3520    dst.appointmentRequired = appointmentRequired == null ? null : appointmentRequired.copy();
3521    if (availableTime != null) {
3522      dst.availableTime = new ArrayList<HealthcareServiceAvailableTimeComponent>();
3523      for (HealthcareServiceAvailableTimeComponent i : availableTime)
3524        dst.availableTime.add(i.copy());
3525    }
3526    ;
3527    if (notAvailable != null) {
3528      dst.notAvailable = new ArrayList<HealthcareServiceNotAvailableComponent>();
3529      for (HealthcareServiceNotAvailableComponent i : notAvailable)
3530        dst.notAvailable.add(i.copy());
3531    }
3532    ;
3533    dst.availabilityExceptions = availabilityExceptions == null ? null : availabilityExceptions.copy();
3534    if (endpoint != null) {
3535      dst.endpoint = new ArrayList<Reference>();
3536      for (Reference i : endpoint)
3537        dst.endpoint.add(i.copy());
3538    }
3539    ;
3540  }
3541
3542  protected HealthcareService typedCopy() {
3543    return copy();
3544  }
3545
3546  @Override
3547  public boolean equalsDeep(Base other_) {
3548    if (!super.equalsDeep(other_))
3549      return false;
3550    if (!(other_ instanceof HealthcareService))
3551      return false;
3552    HealthcareService o = (HealthcareService) other_;
3553    return compareDeep(identifier, o.identifier, true) && compareDeep(active, o.active, true)
3554        && compareDeep(providedBy, o.providedBy, true) && compareDeep(category, o.category, true)
3555        && compareDeep(type, o.type, true) && compareDeep(specialty, o.specialty, true)
3556        && compareDeep(location, o.location, true) && compareDeep(name, o.name, true)
3557        && compareDeep(comment, o.comment, true) && compareDeep(extraDetails, o.extraDetails, true)
3558        && compareDeep(photo, o.photo, true) && compareDeep(telecom, o.telecom, true)
3559        && compareDeep(coverageArea, o.coverageArea, true)
3560        && compareDeep(serviceProvisionCode, o.serviceProvisionCode, true)
3561        && compareDeep(eligibility, o.eligibility, true) && compareDeep(program, o.program, true)
3562        && compareDeep(characteristic, o.characteristic, true) && compareDeep(communication, o.communication, true)
3563        && compareDeep(referralMethod, o.referralMethod, true)
3564        && compareDeep(appointmentRequired, o.appointmentRequired, true)
3565        && compareDeep(availableTime, o.availableTime, true) && compareDeep(notAvailable, o.notAvailable, true)
3566        && compareDeep(availabilityExceptions, o.availabilityExceptions, true)
3567        && compareDeep(endpoint, o.endpoint, true);
3568  }
3569
3570  @Override
3571  public boolean equalsShallow(Base other_) {
3572    if (!super.equalsShallow(other_))
3573      return false;
3574    if (!(other_ instanceof HealthcareService))
3575      return false;
3576    HealthcareService o = (HealthcareService) other_;
3577    return compareValues(active, o.active, true) && compareValues(name, o.name, true)
3578        && compareValues(comment, o.comment, true) && compareValues(extraDetails, o.extraDetails, true)
3579        && compareValues(appointmentRequired, o.appointmentRequired, true)
3580        && compareValues(availabilityExceptions, o.availabilityExceptions, true);
3581  }
3582
3583  public boolean isEmpty() {
3584    return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, active, providedBy, category, type,
3585        specialty, location, name, comment, extraDetails, photo, telecom, coverageArea, serviceProvisionCode,
3586        eligibility, program, characteristic, communication, referralMethod, appointmentRequired, availableTime,
3587        notAvailable, availabilityExceptions, endpoint);
3588  }
3589
3590  @Override
3591  public ResourceType getResourceType() {
3592    return ResourceType.HealthcareService;
3593  }
3594
3595  /**
3596   * Search parameter: <b>identifier</b>
3597   * <p>
3598   * Description: <b>External identifiers for this item</b><br>
3599   * Type: <b>token</b><br>
3600   * Path: <b>HealthcareService.identifier</b><br>
3601   * </p>
3602   */
3603  @SearchParamDefinition(name = "identifier", path = "HealthcareService.identifier", description = "External identifiers for this item", type = "token")
3604  public static final String SP_IDENTIFIER = "identifier";
3605  /**
3606   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3607   * <p>
3608   * Description: <b>External identifiers for this item</b><br>
3609   * Type: <b>token</b><br>
3610   * Path: <b>HealthcareService.identifier</b><br>
3611   * </p>
3612   */
3613  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3614      SP_IDENTIFIER);
3615
3616  /**
3617   * Search parameter: <b>specialty</b>
3618   * <p>
3619   * Description: <b>The specialty of the service provided by this healthcare
3620   * service</b><br>
3621   * Type: <b>token</b><br>
3622   * Path: <b>HealthcareService.specialty</b><br>
3623   * </p>
3624   */
3625  @SearchParamDefinition(name = "specialty", path = "HealthcareService.specialty", description = "The specialty of the service provided by this healthcare service", type = "token")
3626  public static final String SP_SPECIALTY = "specialty";
3627  /**
3628   * <b>Fluent Client</b> search parameter constant for <b>specialty</b>
3629   * <p>
3630   * Description: <b>The specialty of the service provided by this healthcare
3631   * service</b><br>
3632   * Type: <b>token</b><br>
3633   * Path: <b>HealthcareService.specialty</b><br>
3634   * </p>
3635   */
3636  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SPECIALTY = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3637      SP_SPECIALTY);
3638
3639  /**
3640   * Search parameter: <b>endpoint</b>
3641   * <p>
3642   * Description: <b>Technical endpoints providing access to electronic services
3643   * operated for the healthcare service</b><br>
3644   * Type: <b>reference</b><br>
3645   * Path: <b>HealthcareService.endpoint</b><br>
3646   * </p>
3647   */
3648  @SearchParamDefinition(name = "endpoint", path = "HealthcareService.endpoint", description = "Technical endpoints providing access to electronic services operated for the healthcare service", type = "reference", target = {
3649      Endpoint.class })
3650  public static final String SP_ENDPOINT = "endpoint";
3651  /**
3652   * <b>Fluent Client</b> search parameter constant for <b>endpoint</b>
3653   * <p>
3654   * Description: <b>Technical endpoints providing access to electronic services
3655   * operated for the healthcare service</b><br>
3656   * Type: <b>reference</b><br>
3657   * Path: <b>HealthcareService.endpoint</b><br>
3658   * </p>
3659   */
3660  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENDPOINT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
3661      SP_ENDPOINT);
3662
3663  /**
3664   * Constant for fluent queries to be used to add include statements. Specifies
3665   * the path value of "<b>HealthcareService:endpoint</b>".
3666   */
3667  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENDPOINT = new ca.uhn.fhir.model.api.Include(
3668      "HealthcareService:endpoint").toLocked();
3669
3670  /**
3671   * Search parameter: <b>service-category</b>
3672   * <p>
3673   * Description: <b>Service Category of the Healthcare Service</b><br>
3674   * Type: <b>token</b><br>
3675   * Path: <b>HealthcareService.category</b><br>
3676   * </p>
3677   */
3678  @SearchParamDefinition(name = "service-category", path = "HealthcareService.category", description = "Service Category of the Healthcare Service", type = "token")
3679  public static final String SP_SERVICE_CATEGORY = "service-category";
3680  /**
3681   * <b>Fluent Client</b> search parameter constant for <b>service-category</b>
3682   * <p>
3683   * Description: <b>Service Category of the Healthcare Service</b><br>
3684   * Type: <b>token</b><br>
3685   * Path: <b>HealthcareService.category</b><br>
3686   * </p>
3687   */
3688  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SERVICE_CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3689      SP_SERVICE_CATEGORY);
3690
3691  /**
3692   * Search parameter: <b>coverage-area</b>
3693   * <p>
3694   * Description: <b>Location(s) service is intended for/available to</b><br>
3695   * Type: <b>reference</b><br>
3696   * Path: <b>HealthcareService.coverageArea</b><br>
3697   * </p>
3698   */
3699  @SearchParamDefinition(name = "coverage-area", path = "HealthcareService.coverageArea", description = "Location(s) service is intended for/available to", type = "reference", target = {
3700      Location.class })
3701  public static final String SP_COVERAGE_AREA = "coverage-area";
3702  /**
3703   * <b>Fluent Client</b> search parameter constant for <b>coverage-area</b>
3704   * <p>
3705   * Description: <b>Location(s) service is intended for/available to</b><br>
3706   * Type: <b>reference</b><br>
3707   * Path: <b>HealthcareService.coverageArea</b><br>
3708   * </p>
3709   */
3710  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam COVERAGE_AREA = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
3711      SP_COVERAGE_AREA);
3712
3713  /**
3714   * Constant for fluent queries to be used to add include statements. Specifies
3715   * the path value of "<b>HealthcareService:coverage-area</b>".
3716   */
3717  public static final ca.uhn.fhir.model.api.Include INCLUDE_COVERAGE_AREA = new ca.uhn.fhir.model.api.Include(
3718      "HealthcareService:coverage-area").toLocked();
3719
3720  /**
3721   * Search parameter: <b>service-type</b>
3722   * <p>
3723   * Description: <b>The type of service provided by this healthcare
3724   * service</b><br>
3725   * Type: <b>token</b><br>
3726   * Path: <b>HealthcareService.type</b><br>
3727   * </p>
3728   */
3729  @SearchParamDefinition(name = "service-type", path = "HealthcareService.type", description = "The type of service provided by this healthcare service", type = "token")
3730  public static final String SP_SERVICE_TYPE = "service-type";
3731  /**
3732   * <b>Fluent Client</b> search parameter constant for <b>service-type</b>
3733   * <p>
3734   * Description: <b>The type of service provided by this healthcare
3735   * service</b><br>
3736   * Type: <b>token</b><br>
3737   * Path: <b>HealthcareService.type</b><br>
3738   * </p>
3739   */
3740  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SERVICE_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3741      SP_SERVICE_TYPE);
3742
3743  /**
3744   * Search parameter: <b>organization</b>
3745   * <p>
3746   * Description: <b>The organization that provides this Healthcare
3747   * Service</b><br>
3748   * Type: <b>reference</b><br>
3749   * Path: <b>HealthcareService.providedBy</b><br>
3750   * </p>
3751   */
3752  @SearchParamDefinition(name = "organization", path = "HealthcareService.providedBy", description = "The organization that provides this Healthcare Service", type = "reference", target = {
3753      Organization.class })
3754  public static final String SP_ORGANIZATION = "organization";
3755  /**
3756   * <b>Fluent Client</b> search parameter constant for <b>organization</b>
3757   * <p>
3758   * Description: <b>The organization that provides this Healthcare
3759   * Service</b><br>
3760   * Type: <b>reference</b><br>
3761   * Path: <b>HealthcareService.providedBy</b><br>
3762   * </p>
3763   */
3764  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
3765      SP_ORGANIZATION);
3766
3767  /**
3768   * Constant for fluent queries to be used to add include statements. Specifies
3769   * the path value of "<b>HealthcareService:organization</b>".
3770   */
3771  public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include(
3772      "HealthcareService:organization").toLocked();
3773
3774  /**
3775   * Search parameter: <b>name</b>
3776   * <p>
3777   * Description: <b>A portion of the Healthcare service name</b><br>
3778   * Type: <b>string</b><br>
3779   * Path: <b>HealthcareService.name</b><br>
3780   * </p>
3781   */
3782  @SearchParamDefinition(name = "name", path = "HealthcareService.name", description = "A portion of the Healthcare service name", type = "string")
3783  public static final String SP_NAME = "name";
3784  /**
3785   * <b>Fluent Client</b> search parameter constant for <b>name</b>
3786   * <p>
3787   * Description: <b>A portion of the Healthcare service name</b><br>
3788   * Type: <b>string</b><br>
3789   * Path: <b>HealthcareService.name</b><br>
3790   * </p>
3791   */
3792  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(
3793      SP_NAME);
3794
3795  /**
3796   * Search parameter: <b>active</b>
3797   * <p>
3798   * Description: <b>The Healthcare Service is currently marked as active</b><br>
3799   * Type: <b>token</b><br>
3800   * Path: <b>HealthcareService.active</b><br>
3801   * </p>
3802   */
3803  @SearchParamDefinition(name = "active", path = "HealthcareService.active", description = "The Healthcare Service is currently marked as active", type = "token")
3804  public static final String SP_ACTIVE = "active";
3805  /**
3806   * <b>Fluent Client</b> search parameter constant for <b>active</b>
3807   * <p>
3808   * Description: <b>The Healthcare Service is currently marked as active</b><br>
3809   * Type: <b>token</b><br>
3810   * Path: <b>HealthcareService.active</b><br>
3811   * </p>
3812   */
3813  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTIVE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3814      SP_ACTIVE);
3815
3816  /**
3817   * Search parameter: <b>location</b>
3818   * <p>
3819   * Description: <b>The location of the Healthcare Service</b><br>
3820   * Type: <b>reference</b><br>
3821   * Path: <b>HealthcareService.location</b><br>
3822   * </p>
3823   */
3824  @SearchParamDefinition(name = "location", path = "HealthcareService.location", description = "The location of the Healthcare Service", type = "reference", target = {
3825      Location.class })
3826  public static final String SP_LOCATION = "location";
3827  /**
3828   * <b>Fluent Client</b> search parameter constant for <b>location</b>
3829   * <p>
3830   * Description: <b>The location of the Healthcare Service</b><br>
3831   * Type: <b>reference</b><br>
3832   * Path: <b>HealthcareService.location</b><br>
3833   * </p>
3834   */
3835  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
3836      SP_LOCATION);
3837
3838  /**
3839   * Constant for fluent queries to be used to add include statements. Specifies
3840   * the path value of "<b>HealthcareService:location</b>".
3841   */
3842  public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include(
3843      "HealthcareService:location").toLocked();
3844
3845  /**
3846   * Search parameter: <b>program</b>
3847   * <p>
3848   * Description: <b>One of the Programs supported by this
3849   * HealthcareService</b><br>
3850   * Type: <b>token</b><br>
3851   * Path: <b>HealthcareService.program</b><br>
3852   * </p>
3853   */
3854  @SearchParamDefinition(name = "program", path = "HealthcareService.program", description = "One of the Programs supported by this HealthcareService", type = "token")
3855  public static final String SP_PROGRAM = "program";
3856  /**
3857   * <b>Fluent Client</b> search parameter constant for <b>program</b>
3858   * <p>
3859   * Description: <b>One of the Programs supported by this
3860   * HealthcareService</b><br>
3861   * Type: <b>token</b><br>
3862   * Path: <b>HealthcareService.program</b><br>
3863   * </p>
3864   */
3865  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PROGRAM = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3866      SP_PROGRAM);
3867
3868  /**
3869   * Search parameter: <b>characteristic</b>
3870   * <p>
3871   * Description: <b>One of the HealthcareService's characteristics</b><br>
3872   * Type: <b>token</b><br>
3873   * Path: <b>HealthcareService.characteristic</b><br>
3874   * </p>
3875   */
3876  @SearchParamDefinition(name = "characteristic", path = "HealthcareService.characteristic", description = "One of the HealthcareService's characteristics", type = "token")
3877  public static final String SP_CHARACTERISTIC = "characteristic";
3878  /**
3879   * <b>Fluent Client</b> search parameter constant for <b>characteristic</b>
3880   * <p>
3881   * Description: <b>One of the HealthcareService's characteristics</b><br>
3882   * Type: <b>token</b><br>
3883   * Path: <b>HealthcareService.characteristic</b><br>
3884   * </p>
3885   */
3886  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CHARACTERISTIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3887      SP_CHARACTERISTIC);
3888
3889}