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