001package org.hl7.fhir.dstu2.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 Wed, Jul 13, 2016 05:32+1000 for FHIR v1.0.2
033import java.util.ArrayList;
034import java.util.List;
035
036import ca.uhn.fhir.model.api.annotation.Block;
037import ca.uhn.fhir.model.api.annotation.Child;
038import ca.uhn.fhir.model.api.annotation.Description;
039import ca.uhn.fhir.model.api.annotation.ResourceDef;
040import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
041import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
042import org.hl7.fhir.exceptions.FHIRException;
043import org.hl7.fhir.utilities.Utilities;
044
045/**
046 * The details of a healthcare service available at a location.
047 */
048@ResourceDef(name = "HealthcareService", profile = "http://hl7.org/fhir/Profile/HealthcareService")
049public class HealthcareService extends DomainResource {
050
051  public enum DaysOfWeek {
052    /**
053     * Monday
054     */
055    MON,
056    /**
057     * Tuesday
058     */
059    TUE,
060    /**
061     * Wednesday
062     */
063    WED,
064    /**
065     * Thursday
066     */
067    THU,
068    /**
069     * Friday
070     */
071    FRI,
072    /**
073     * Saturday
074     */
075    SAT,
076    /**
077     * Sunday
078     */
079    SUN,
080    /**
081     * added to help the parsers
082     */
083    NULL;
084
085    public static DaysOfWeek fromCode(String codeString) throws FHIRException {
086      if (codeString == null || "".equals(codeString))
087        return null;
088      if ("mon".equals(codeString))
089        return MON;
090      if ("tue".equals(codeString))
091        return TUE;
092      if ("wed".equals(codeString))
093        return WED;
094      if ("thu".equals(codeString))
095        return THU;
096      if ("fri".equals(codeString))
097        return FRI;
098      if ("sat".equals(codeString))
099        return SAT;
100      if ("sun".equals(codeString))
101        return SUN;
102      throw new FHIRException("Unknown DaysOfWeek code '" + codeString + "'");
103    }
104
105    public String toCode() {
106      switch (this) {
107      case MON:
108        return "mon";
109      case TUE:
110        return "tue";
111      case WED:
112        return "wed";
113      case THU:
114        return "thu";
115      case FRI:
116        return "fri";
117      case SAT:
118        return "sat";
119      case SUN:
120        return "sun";
121      case NULL:
122        return null;
123      default:
124        return "?";
125      }
126    }
127
128    public String getSystem() {
129      switch (this) {
130      case MON:
131        return "http://hl7.org/fhir/days-of-week";
132      case TUE:
133        return "http://hl7.org/fhir/days-of-week";
134      case WED:
135        return "http://hl7.org/fhir/days-of-week";
136      case THU:
137        return "http://hl7.org/fhir/days-of-week";
138      case FRI:
139        return "http://hl7.org/fhir/days-of-week";
140      case SAT:
141        return "http://hl7.org/fhir/days-of-week";
142      case SUN:
143        return "http://hl7.org/fhir/days-of-week";
144      case NULL:
145        return null;
146      default:
147        return "?";
148      }
149    }
150
151    public String getDefinition() {
152      switch (this) {
153      case MON:
154        return "Monday";
155      case TUE:
156        return "Tuesday";
157      case WED:
158        return "Wednesday";
159      case THU:
160        return "Thursday";
161      case FRI:
162        return "Friday";
163      case SAT:
164        return "Saturday";
165      case SUN:
166        return "Sunday";
167      case NULL:
168        return null;
169      default:
170        return "?";
171      }
172    }
173
174    public String getDisplay() {
175      switch (this) {
176      case MON:
177        return "Monday";
178      case TUE:
179        return "Tuesday";
180      case WED:
181        return "Wednesday";
182      case THU:
183        return "Thursday";
184      case FRI:
185        return "Friday";
186      case SAT:
187        return "Saturday";
188      case SUN:
189        return "Sunday";
190      case NULL:
191        return null;
192      default:
193        return "?";
194      }
195    }
196  }
197
198  public static class DaysOfWeekEnumFactory implements EnumFactory<DaysOfWeek> {
199    public DaysOfWeek fromCode(String codeString) throws IllegalArgumentException {
200      if (codeString == null || "".equals(codeString))
201        if (codeString == null || "".equals(codeString))
202          return null;
203      if ("mon".equals(codeString))
204        return DaysOfWeek.MON;
205      if ("tue".equals(codeString))
206        return DaysOfWeek.TUE;
207      if ("wed".equals(codeString))
208        return DaysOfWeek.WED;
209      if ("thu".equals(codeString))
210        return DaysOfWeek.THU;
211      if ("fri".equals(codeString))
212        return DaysOfWeek.FRI;
213      if ("sat".equals(codeString))
214        return DaysOfWeek.SAT;
215      if ("sun".equals(codeString))
216        return DaysOfWeek.SUN;
217      throw new IllegalArgumentException("Unknown DaysOfWeek code '" + codeString + "'");
218    }
219
220    public Enumeration<DaysOfWeek> fromType(Base code) throws FHIRException {
221      if (code == null || code.isEmpty())
222        return null;
223      String codeString = ((PrimitiveType) code).asStringValue();
224      if (codeString == null || "".equals(codeString))
225        return null;
226      if ("mon".equals(codeString))
227        return new Enumeration<DaysOfWeek>(this, DaysOfWeek.MON);
228      if ("tue".equals(codeString))
229        return new Enumeration<DaysOfWeek>(this, DaysOfWeek.TUE);
230      if ("wed".equals(codeString))
231        return new Enumeration<DaysOfWeek>(this, DaysOfWeek.WED);
232      if ("thu".equals(codeString))
233        return new Enumeration<DaysOfWeek>(this, DaysOfWeek.THU);
234      if ("fri".equals(codeString))
235        return new Enumeration<DaysOfWeek>(this, DaysOfWeek.FRI);
236      if ("sat".equals(codeString))
237        return new Enumeration<DaysOfWeek>(this, DaysOfWeek.SAT);
238      if ("sun".equals(codeString))
239        return new Enumeration<DaysOfWeek>(this, DaysOfWeek.SUN);
240      throw new FHIRException("Unknown DaysOfWeek code '" + codeString + "'");
241    }
242
243    public String toCode(DaysOfWeek code)
244   {
245       if (code == DaysOfWeek.NULL)
246           return null;
247       if (code == DaysOfWeek.MON)
248        return "mon";
249      if (code == DaysOfWeek.TUE)
250        return "tue";
251      if (code == DaysOfWeek.WED)
252        return "wed";
253      if (code == DaysOfWeek.THU)
254        return "thu";
255      if (code == DaysOfWeek.FRI)
256        return "fri";
257      if (code == DaysOfWeek.SAT)
258        return "sat";
259      if (code == DaysOfWeek.SUN)
260        return "sun";
261      return "?";
262   }
263  }
264
265  @Block()
266  public static class ServiceTypeComponent extends BackboneElement implements IBaseBackboneElement {
267    /**
268     * The specific type of service being delivered or performed.
269     */
270    @Child(name = "type", type = {
271        CodeableConcept.class }, order = 1, min = 1, max = 1, modifier = false, summary = true)
272    @Description(shortDefinition = "Type of service delivered or performed", formalDefinition = "The specific type of service being delivered or performed.")
273    protected CodeableConcept type;
274
275    /**
276     * Collection of specialties handled by the service site. This is more of a
277     * medical term.
278     */
279    @Child(name = "specialty", type = {
280        CodeableConcept.class }, order = 2, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
281    @Description(shortDefinition = "Specialties handled by the Service Site", formalDefinition = "Collection of specialties handled by the service site. This is more of a medical term.")
282    protected List<CodeableConcept> specialty;
283
284    private static final long serialVersionUID = 1703986174L;
285
286    /*
287     * Constructor
288     */
289    public ServiceTypeComponent() {
290      super();
291    }
292
293    /*
294     * Constructor
295     */
296    public ServiceTypeComponent(CodeableConcept type) {
297      super();
298      this.type = type;
299    }
300
301    /**
302     * @return {@link #type} (The specific type of service being delivered or
303     *         performed.)
304     */
305    public CodeableConcept getType() {
306      if (this.type == null)
307        if (Configuration.errorOnAutoCreate())
308          throw new Error("Attempt to auto-create ServiceTypeComponent.type");
309        else if (Configuration.doAutoCreate())
310          this.type = new CodeableConcept(); // cc
311      return this.type;
312    }
313
314    public boolean hasType() {
315      return this.type != null && !this.type.isEmpty();
316    }
317
318    /**
319     * @param value {@link #type} (The specific type of service being delivered or
320     *              performed.)
321     */
322    public ServiceTypeComponent setType(CodeableConcept value) {
323      this.type = value;
324      return this;
325    }
326
327    /**
328     * @return {@link #specialty} (Collection of specialties handled by the service
329     *         site. This is more of a medical term.)
330     */
331    public List<CodeableConcept> getSpecialty() {
332      if (this.specialty == null)
333        this.specialty = new ArrayList<CodeableConcept>();
334      return this.specialty;
335    }
336
337    public boolean hasSpecialty() {
338      if (this.specialty == null)
339        return false;
340      for (CodeableConcept item : this.specialty)
341        if (!item.isEmpty())
342          return true;
343      return false;
344    }
345
346    /**
347     * @return {@link #specialty} (Collection of specialties handled by the service
348     *         site. This is more of a medical term.)
349     */
350    // syntactic sugar
351    public CodeableConcept addSpecialty() { // 3
352      CodeableConcept t = new CodeableConcept();
353      if (this.specialty == null)
354        this.specialty = new ArrayList<CodeableConcept>();
355      this.specialty.add(t);
356      return t;
357    }
358
359    // syntactic sugar
360    public ServiceTypeComponent addSpecialty(CodeableConcept t) { // 3
361      if (t == null)
362        return this;
363      if (this.specialty == null)
364        this.specialty = new ArrayList<CodeableConcept>();
365      this.specialty.add(t);
366      return this;
367    }
368
369    protected void listChildren(List<Property> childrenList) {
370      super.listChildren(childrenList);
371      childrenList.add(new Property("type", "CodeableConcept",
372          "The specific type of service being delivered or performed.", 0, java.lang.Integer.MAX_VALUE, type));
373      childrenList.add(new Property("specialty", "CodeableConcept",
374          "Collection of specialties handled by the service site. This is more of a medical term.", 0,
375          java.lang.Integer.MAX_VALUE, specialty));
376    }
377
378    @Override
379    public void setProperty(String name, Base value) throws FHIRException {
380      if (name.equals("type"))
381        this.type = castToCodeableConcept(value); // CodeableConcept
382      else if (name.equals("specialty"))
383        this.getSpecialty().add(castToCodeableConcept(value));
384      else
385        super.setProperty(name, value);
386    }
387
388    @Override
389    public Base addChild(String name) throws FHIRException {
390      if (name.equals("type")) {
391        this.type = new CodeableConcept();
392        return this.type;
393      } else if (name.equals("specialty")) {
394        return addSpecialty();
395      } else
396        return super.addChild(name);
397    }
398
399    public ServiceTypeComponent copy() {
400      ServiceTypeComponent dst = new ServiceTypeComponent();
401      copyValues(dst);
402      dst.type = type == null ? null : type.copy();
403      if (specialty != null) {
404        dst.specialty = new ArrayList<CodeableConcept>();
405        for (CodeableConcept i : specialty)
406          dst.specialty.add(i.copy());
407      }
408      ;
409      return dst;
410    }
411
412    @Override
413    public boolean equalsDeep(Base other) {
414      if (!super.equalsDeep(other))
415        return false;
416      if (!(other instanceof ServiceTypeComponent))
417        return false;
418      ServiceTypeComponent o = (ServiceTypeComponent) other;
419      return compareDeep(type, o.type, true) && compareDeep(specialty, o.specialty, true);
420    }
421
422    @Override
423    public boolean equalsShallow(Base other) {
424      if (!super.equalsShallow(other))
425        return false;
426      if (!(other instanceof ServiceTypeComponent))
427        return false;
428      ServiceTypeComponent o = (ServiceTypeComponent) other;
429      return true;
430    }
431
432    public boolean isEmpty() {
433      return super.isEmpty() && (type == null || type.isEmpty()) && (specialty == null || specialty.isEmpty());
434    }
435
436    public String fhirType() {
437      return "HealthcareService.serviceType";
438
439    }
440
441  }
442
443  @Block()
444  public static class HealthcareServiceAvailableTimeComponent extends BackboneElement implements IBaseBackboneElement {
445    /**
446     * Indicates which days of the week are available between the start and end
447     * Times.
448     */
449    @Child(name = "daysOfWeek", type = {
450        CodeType.class }, order = 1, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
451    @Description(shortDefinition = "mon | tue | wed | thu | fri | sat | sun", formalDefinition = "Indicates which days of the week are available between the start and end Times.")
452    protected List<Enumeration<DaysOfWeek>> daysOfWeek;
453
454    /**
455     * Is this always available? (hence times are irrelevant) e.g. 24 hour service.
456     */
457    @Child(name = "allDay", type = {
458        BooleanType.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
459    @Description(shortDefinition = "Always available? e.g. 24 hour service", formalDefinition = "Is this always available? (hence times are irrelevant) e.g. 24 hour service.")
460    protected BooleanType allDay;
461
462    /**
463     * The opening time of day. Note: If the AllDay flag is set, then this time is
464     * ignored.
465     */
466    @Child(name = "availableStartTime", type = {
467        TimeType.class }, order = 3, min = 0, max = 1, modifier = false, summary = false)
468    @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.")
469    protected TimeType availableStartTime;
470
471    /**
472     * The closing time of day. Note: If the AllDay flag is set, then this time is
473     * ignored.
474     */
475    @Child(name = "availableEndTime", type = {
476        TimeType.class }, order = 4, min = 0, max = 1, modifier = false, summary = false)
477    @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.")
478    protected TimeType availableEndTime;
479
480    private static final long serialVersionUID = -2139510127L;
481
482    /*
483     * Constructor
484     */
485    public HealthcareServiceAvailableTimeComponent() {
486      super();
487    }
488
489    /**
490     * @return {@link #daysOfWeek} (Indicates which days of the week are available
491     *         between the start and end Times.)
492     */
493    public List<Enumeration<DaysOfWeek>> getDaysOfWeek() {
494      if (this.daysOfWeek == null)
495        this.daysOfWeek = new ArrayList<Enumeration<DaysOfWeek>>();
496      return this.daysOfWeek;
497    }
498
499    public boolean hasDaysOfWeek() {
500      if (this.daysOfWeek == null)
501        return false;
502      for (Enumeration<DaysOfWeek> item : this.daysOfWeek)
503        if (!item.isEmpty())
504          return true;
505      return false;
506    }
507
508    /**
509     * @return Returns a reference to <code>this</code> for easy method chaining
510     */
511    public HealthcareServiceAvailableTimeComponent setDaysOfWeek(List<Enumeration<DaysOfWeek>> daysOfWeek) {
512      this.daysOfWeek = daysOfWeek;
513      return this;
514    }
515
516    /**
517     * @return {@link #daysOfWeek} (Indicates which days of the week are available
518     *         between the start and end Times.)
519     */
520    // syntactic sugar
521    public Enumeration<DaysOfWeek> addDaysOfWeekElement() {// 2
522      Enumeration<DaysOfWeek> t = new Enumeration<DaysOfWeek>(new DaysOfWeekEnumFactory());
523      if (this.daysOfWeek == null)
524        this.daysOfWeek = new ArrayList<Enumeration<DaysOfWeek>>();
525      this.daysOfWeek.add(t);
526      return t;
527    }
528
529    /**
530     * @param value {@link #daysOfWeek} (Indicates which days of the week are
531     *              available between the start and end Times.)
532     */
533    public HealthcareServiceAvailableTimeComponent addDaysOfWeek(DaysOfWeek value) { // 1
534      Enumeration<DaysOfWeek> t = new Enumeration<DaysOfWeek>(new DaysOfWeekEnumFactory());
535      t.setValue(value);
536      if (this.daysOfWeek == null)
537        this.daysOfWeek = new ArrayList<Enumeration<DaysOfWeek>>();
538      this.daysOfWeek.add(t);
539      return this;
540    }
541
542    /**
543     * @param value {@link #daysOfWeek} (Indicates which days of the week are
544     *              available between the start and end Times.)
545     */
546    public boolean hasDaysOfWeek(DaysOfWeek value) {
547      if (this.daysOfWeek == null)
548        return false;
549      for (Enumeration<DaysOfWeek> v : this.daysOfWeek)
550        if (v.equals(value)) // code
551          return true;
552      return false;
553    }
554
555    /**
556     * @return {@link #allDay} (Is this always available? (hence times are
557     *         irrelevant) e.g. 24 hour service.). This is the underlying object
558     *         with id, value and extensions. The accessor "getAllDay" gives direct
559     *         access to the value
560     */
561    public BooleanType getAllDayElement() {
562      if (this.allDay == null)
563        if (Configuration.errorOnAutoCreate())
564          throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.allDay");
565        else if (Configuration.doAutoCreate())
566          this.allDay = new BooleanType(); // bb
567      return this.allDay;
568    }
569
570    public boolean hasAllDayElement() {
571      return this.allDay != null && !this.allDay.isEmpty();
572    }
573
574    public boolean hasAllDay() {
575      return this.allDay != null && !this.allDay.isEmpty();
576    }
577
578    /**
579     * @param value {@link #allDay} (Is this always available? (hence times are
580     *              irrelevant) e.g. 24 hour service.). This is the underlying
581     *              object with id, value and extensions. The accessor "getAllDay"
582     *              gives direct access to the value
583     */
584    public HealthcareServiceAvailableTimeComponent setAllDayElement(BooleanType value) {
585      this.allDay = value;
586      return this;
587    }
588
589    /**
590     * @return Is this always available? (hence times are irrelevant) e.g. 24 hour
591     *         service.
592     */
593    public boolean getAllDay() {
594      return this.allDay == null || this.allDay.isEmpty() ? false : this.allDay.getValue();
595    }
596
597    /**
598     * @param value Is this always available? (hence times are irrelevant) e.g. 24
599     *              hour service.
600     */
601    public HealthcareServiceAvailableTimeComponent setAllDay(boolean value) {
602      if (this.allDay == null)
603        this.allDay = new BooleanType();
604      this.allDay.setValue(value);
605      return this;
606    }
607
608    /**
609     * @return {@link #availableStartTime} (The opening time of day. Note: If the
610     *         AllDay flag is set, then this time is ignored.). This is the
611     *         underlying object with id, value and extensions. The accessor
612     *         "getAvailableStartTime" gives direct access to the value
613     */
614    public TimeType getAvailableStartTimeElement() {
615      if (this.availableStartTime == null)
616        if (Configuration.errorOnAutoCreate())
617          throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.availableStartTime");
618        else if (Configuration.doAutoCreate())
619          this.availableStartTime = new TimeType(); // bb
620      return this.availableStartTime;
621    }
622
623    public boolean hasAvailableStartTimeElement() {
624      return this.availableStartTime != null && !this.availableStartTime.isEmpty();
625    }
626
627    public boolean hasAvailableStartTime() {
628      return this.availableStartTime != null && !this.availableStartTime.isEmpty();
629    }
630
631    /**
632     * @param value {@link #availableStartTime} (The opening time of day. Note: If
633     *              the AllDay flag is set, then this time is ignored.). This is the
634     *              underlying object with id, value and extensions. The accessor
635     *              "getAvailableStartTime" gives direct access to the value
636     */
637    public HealthcareServiceAvailableTimeComponent setAvailableStartTimeElement(TimeType value) {
638      this.availableStartTime = value;
639      return this;
640    }
641
642    /**
643     * @return The opening time of day. Note: If the AllDay flag is set, then this
644     *         time is ignored.
645     */
646    public String getAvailableStartTime() {
647      return this.availableStartTime == null ? null : this.availableStartTime.getValue();
648    }
649
650    /**
651     * @param value The opening time of day. Note: If the AllDay flag is set, then
652     *              this time is ignored.
653     */
654    public HealthcareServiceAvailableTimeComponent setAvailableStartTime(String value) {
655      if (value == null)
656        this.availableStartTime = null;
657      else {
658        if (this.availableStartTime == null)
659          this.availableStartTime = new TimeType();
660        this.availableStartTime.setValue(value);
661      }
662      return this;
663    }
664
665    /**
666     * @return {@link #availableEndTime} (The closing time of day. Note: If the
667     *         AllDay flag is set, then this time is ignored.). This is the
668     *         underlying object with id, value and extensions. The accessor
669     *         "getAvailableEndTime" gives direct access to the value
670     */
671    public TimeType getAvailableEndTimeElement() {
672      if (this.availableEndTime == null)
673        if (Configuration.errorOnAutoCreate())
674          throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.availableEndTime");
675        else if (Configuration.doAutoCreate())
676          this.availableEndTime = new TimeType(); // bb
677      return this.availableEndTime;
678    }
679
680    public boolean hasAvailableEndTimeElement() {
681      return this.availableEndTime != null && !this.availableEndTime.isEmpty();
682    }
683
684    public boolean hasAvailableEndTime() {
685      return this.availableEndTime != null && !this.availableEndTime.isEmpty();
686    }
687
688    /**
689     * @param value {@link #availableEndTime} (The closing time of day. Note: If the
690     *              AllDay flag is set, then this time is ignored.). This is the
691     *              underlying object with id, value and extensions. The accessor
692     *              "getAvailableEndTime" gives direct access to the value
693     */
694    public HealthcareServiceAvailableTimeComponent setAvailableEndTimeElement(TimeType value) {
695      this.availableEndTime = value;
696      return this;
697    }
698
699    /**
700     * @return The closing time of day. Note: If the AllDay flag is set, then this
701     *         time is ignored.
702     */
703    public String getAvailableEndTime() {
704      return this.availableEndTime == null ? null : this.availableEndTime.getValue();
705    }
706
707    /**
708     * @param value The closing time of day. Note: If the AllDay flag is set, then
709     *              this time is ignored.
710     */
711    public HealthcareServiceAvailableTimeComponent setAvailableEndTime(String value) {
712      if (value == null)
713        this.availableEndTime = null;
714      else {
715        if (this.availableEndTime == null)
716          this.availableEndTime = new TimeType();
717        this.availableEndTime.setValue(value);
718      }
719      return this;
720    }
721
722    protected void listChildren(List<Property> childrenList) {
723      super.listChildren(childrenList);
724      childrenList.add(new Property("daysOfWeek", "code",
725          "Indicates which days of the week are available between the start and end Times.", 0,
726          java.lang.Integer.MAX_VALUE, daysOfWeek));
727      childrenList.add(new Property("allDay", "boolean",
728          "Is this always available? (hence times are irrelevant) e.g. 24 hour service.", 0,
729          java.lang.Integer.MAX_VALUE, allDay));
730      childrenList.add(new Property("availableStartTime", "time",
731          "The opening time of day. Note: If the AllDay flag is set, then this time is ignored.", 0,
732          java.lang.Integer.MAX_VALUE, availableStartTime));
733      childrenList.add(new Property("availableEndTime", "time",
734          "The closing time of day. Note: If the AllDay flag is set, then this time is ignored.", 0,
735          java.lang.Integer.MAX_VALUE, availableEndTime));
736    }
737
738    @Override
739    public void setProperty(String name, Base value) throws FHIRException {
740      if (name.equals("daysOfWeek"))
741        this.getDaysOfWeek().add(new DaysOfWeekEnumFactory().fromType(value));
742      else if (name.equals("allDay"))
743        this.allDay = castToBoolean(value); // BooleanType
744      else if (name.equals("availableStartTime"))
745        this.availableStartTime = castToTime(value); // TimeType
746      else if (name.equals("availableEndTime"))
747        this.availableEndTime = castToTime(value); // TimeType
748      else
749        super.setProperty(name, value);
750    }
751
752    @Override
753    public Base addChild(String name) throws FHIRException {
754      if (name.equals("daysOfWeek")) {
755        throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.daysOfWeek");
756      } else if (name.equals("allDay")) {
757        throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.allDay");
758      } else if (name.equals("availableStartTime")) {
759        throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.availableStartTime");
760      } else if (name.equals("availableEndTime")) {
761        throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.availableEndTime");
762      } else
763        return super.addChild(name);
764    }
765
766    public HealthcareServiceAvailableTimeComponent copy() {
767      HealthcareServiceAvailableTimeComponent dst = new HealthcareServiceAvailableTimeComponent();
768      copyValues(dst);
769      if (daysOfWeek != null) {
770        dst.daysOfWeek = new ArrayList<Enumeration<DaysOfWeek>>();
771        for (Enumeration<DaysOfWeek> i : daysOfWeek)
772          dst.daysOfWeek.add(i.copy());
773      }
774      ;
775      dst.allDay = allDay == null ? null : allDay.copy();
776      dst.availableStartTime = availableStartTime == null ? null : availableStartTime.copy();
777      dst.availableEndTime = availableEndTime == null ? null : availableEndTime.copy();
778      return dst;
779    }
780
781    @Override
782    public boolean equalsDeep(Base other) {
783      if (!super.equalsDeep(other))
784        return false;
785      if (!(other instanceof HealthcareServiceAvailableTimeComponent))
786        return false;
787      HealthcareServiceAvailableTimeComponent o = (HealthcareServiceAvailableTimeComponent) other;
788      return compareDeep(daysOfWeek, o.daysOfWeek, true) && compareDeep(allDay, o.allDay, true)
789          && compareDeep(availableStartTime, o.availableStartTime, true)
790          && compareDeep(availableEndTime, o.availableEndTime, true);
791    }
792
793    @Override
794    public boolean equalsShallow(Base other) {
795      if (!super.equalsShallow(other))
796        return false;
797      if (!(other instanceof HealthcareServiceAvailableTimeComponent))
798        return false;
799      HealthcareServiceAvailableTimeComponent o = (HealthcareServiceAvailableTimeComponent) other;
800      return compareValues(daysOfWeek, o.daysOfWeek, true) && compareValues(allDay, o.allDay, true)
801          && compareValues(availableStartTime, o.availableStartTime, true)
802          && compareValues(availableEndTime, o.availableEndTime, true);
803    }
804
805    public boolean isEmpty() {
806      return super.isEmpty() && (daysOfWeek == null || daysOfWeek.isEmpty()) && (allDay == null || allDay.isEmpty())
807          && (availableStartTime == null || availableStartTime.isEmpty())
808          && (availableEndTime == null || availableEndTime.isEmpty());
809    }
810
811    public String fhirType() {
812      return "HealthcareService.availableTime";
813
814    }
815
816  }
817
818  @Block()
819  public static class HealthcareServiceNotAvailableComponent extends BackboneElement implements IBaseBackboneElement {
820    /**
821     * The reason that can be presented to the user as to why this time is not
822     * available.
823     */
824    @Child(name = "description", type = {
825        StringType.class }, order = 1, min = 1, max = 1, modifier = false, summary = false)
826    @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.")
827    protected StringType description;
828
829    /**
830     * Service is not available (seasonally or for a public holiday) from this date.
831     */
832    @Child(name = "during", type = { Period.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
833    @Description(shortDefinition = "Service not availablefrom this date", formalDefinition = "Service is not available (seasonally or for a public holiday) from this date.")
834    protected Period during;
835
836    private static final long serialVersionUID = 310849929L;
837
838    /*
839     * Constructor
840     */
841    public HealthcareServiceNotAvailableComponent() {
842      super();
843    }
844
845    /*
846     * Constructor
847     */
848    public HealthcareServiceNotAvailableComponent(StringType description) {
849      super();
850      this.description = description;
851    }
852
853    /**
854     * @return {@link #description} (The reason that can be presented to the user as
855     *         to why this time is not available.). This is the underlying object
856     *         with id, value and extensions. The accessor "getDescription" gives
857     *         direct access to the value
858     */
859    public StringType getDescriptionElement() {
860      if (this.description == null)
861        if (Configuration.errorOnAutoCreate())
862          throw new Error("Attempt to auto-create HealthcareServiceNotAvailableComponent.description");
863        else if (Configuration.doAutoCreate())
864          this.description = new StringType(); // bb
865      return this.description;
866    }
867
868    public boolean hasDescriptionElement() {
869      return this.description != null && !this.description.isEmpty();
870    }
871
872    public boolean hasDescription() {
873      return this.description != null && !this.description.isEmpty();
874    }
875
876    /**
877     * @param value {@link #description} (The reason that can be presented to the
878     *              user as to why this time is not available.). This is the
879     *              underlying object with id, value and extensions. The accessor
880     *              "getDescription" gives direct access to the value
881     */
882    public HealthcareServiceNotAvailableComponent setDescriptionElement(StringType value) {
883      this.description = value;
884      return this;
885    }
886
887    /**
888     * @return The reason that can be presented to the user as to why this time is
889     *         not available.
890     */
891    public String getDescription() {
892      return this.description == null ? null : this.description.getValue();
893    }
894
895    /**
896     * @param value The reason that can be presented to the user as to why this time
897     *              is not available.
898     */
899    public HealthcareServiceNotAvailableComponent setDescription(String value) {
900      if (this.description == null)
901        this.description = new StringType();
902      this.description.setValue(value);
903      return this;
904    }
905
906    /**
907     * @return {@link #during} (Service is not available (seasonally or for a public
908     *         holiday) from this date.)
909     */
910    public Period getDuring() {
911      if (this.during == null)
912        if (Configuration.errorOnAutoCreate())
913          throw new Error("Attempt to auto-create HealthcareServiceNotAvailableComponent.during");
914        else if (Configuration.doAutoCreate())
915          this.during = new Period(); // cc
916      return this.during;
917    }
918
919    public boolean hasDuring() {
920      return this.during != null && !this.during.isEmpty();
921    }
922
923    /**
924     * @param value {@link #during} (Service is not available (seasonally or for a
925     *              public holiday) from this date.)
926     */
927    public HealthcareServiceNotAvailableComponent setDuring(Period value) {
928      this.during = value;
929      return this;
930    }
931
932    protected void listChildren(List<Property> childrenList) {
933      super.listChildren(childrenList);
934      childrenList.add(new Property("description", "string",
935          "The reason that can be presented to the user as to why this time is not available.", 0,
936          java.lang.Integer.MAX_VALUE, description));
937      childrenList.add(new Property("during", "Period",
938          "Service is not available (seasonally or for a public holiday) from this date.", 0,
939          java.lang.Integer.MAX_VALUE, during));
940    }
941
942    @Override
943    public void setProperty(String name, Base value) throws FHIRException {
944      if (name.equals("description"))
945        this.description = castToString(value); // StringType
946      else if (name.equals("during"))
947        this.during = castToPeriod(value); // Period
948      else
949        super.setProperty(name, value);
950    }
951
952    @Override
953    public Base addChild(String name) throws FHIRException {
954      if (name.equals("description")) {
955        throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.description");
956      } else if (name.equals("during")) {
957        this.during = new Period();
958        return this.during;
959      } else
960        return super.addChild(name);
961    }
962
963    public HealthcareServiceNotAvailableComponent copy() {
964      HealthcareServiceNotAvailableComponent dst = new HealthcareServiceNotAvailableComponent();
965      copyValues(dst);
966      dst.description = description == null ? null : description.copy();
967      dst.during = during == null ? null : during.copy();
968      return dst;
969    }
970
971    @Override
972    public boolean equalsDeep(Base other) {
973      if (!super.equalsDeep(other))
974        return false;
975      if (!(other instanceof HealthcareServiceNotAvailableComponent))
976        return false;
977      HealthcareServiceNotAvailableComponent o = (HealthcareServiceNotAvailableComponent) other;
978      return compareDeep(description, o.description, true) && compareDeep(during, o.during, true);
979    }
980
981    @Override
982    public boolean equalsShallow(Base other) {
983      if (!super.equalsShallow(other))
984        return false;
985      if (!(other instanceof HealthcareServiceNotAvailableComponent))
986        return false;
987      HealthcareServiceNotAvailableComponent o = (HealthcareServiceNotAvailableComponent) other;
988      return compareValues(description, o.description, true);
989    }
990
991    public boolean isEmpty() {
992      return super.isEmpty() && (description == null || description.isEmpty()) && (during == null || during.isEmpty());
993    }
994
995    public String fhirType() {
996      return "HealthcareService.notAvailable";
997
998    }
999
1000  }
1001
1002  /**
1003   * External identifiers for this item.
1004   */
1005  @Child(name = "identifier", type = {
1006      Identifier.class }, order = 0, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
1007  @Description(shortDefinition = "External identifiers for this item", formalDefinition = "External identifiers for this item.")
1008  protected List<Identifier> identifier;
1009
1010  /**
1011   * The organization that provides this healthcare service.
1012   */
1013  @Child(name = "providedBy", type = {
1014      Organization.class }, order = 1, min = 0, max = 1, modifier = false, summary = true)
1015  @Description(shortDefinition = "Organization that provides this service", formalDefinition = "The organization that provides this healthcare service.")
1016  protected Reference providedBy;
1017
1018  /**
1019   * The actual object that is the target of the reference (The organization that
1020   * provides this healthcare service.)
1021   */
1022  protected Organization providedByTarget;
1023
1024  /**
1025   * Identifies the broad category of service being performed or delivered.
1026   */
1027  @Child(name = "serviceCategory", type = {
1028      CodeableConcept.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
1029  @Description(shortDefinition = "Broad category of service being performed or delivered", formalDefinition = "Identifies the broad category of service being performed or delivered.")
1030  protected CodeableConcept serviceCategory;
1031
1032  /**
1033   * A specific type of service that may be delivered or performed.
1034   */
1035  @Child(name = "serviceType", type = {}, order = 3, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
1036  @Description(shortDefinition = "Specific service delivered or performed", formalDefinition = "A specific type of service that may be delivered or performed.")
1037  protected List<ServiceTypeComponent> serviceType;
1038
1039  /**
1040   * The location where this healthcare service may be provided.
1041   */
1042  @Child(name = "location", type = { Location.class }, order = 4, min = 1, max = 1, modifier = false, summary = true)
1043  @Description(shortDefinition = "Location where service may be provided", formalDefinition = "The location where this healthcare service may be provided.")
1044  protected Reference location;
1045
1046  /**
1047   * The actual object that is the target of the reference (The location where
1048   * this healthcare service may be provided.)
1049   */
1050  protected Location locationTarget;
1051
1052  /**
1053   * Further description of the service as it would be presented to a consumer
1054   * while searching.
1055   */
1056  @Child(name = "serviceName", type = {
1057      StringType.class }, order = 5, min = 0, max = 1, modifier = false, summary = true)
1058  @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.")
1059  protected StringType serviceName;
1060
1061  /**
1062   * Any additional description of the service and/or any specific issues not
1063   * covered by the other attributes, which can be displayed as further detail
1064   * under the serviceName.
1065   */
1066  @Child(name = "comment", type = { StringType.class }, order = 6, min = 0, max = 1, modifier = false, summary = true)
1067  @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.")
1068  protected StringType comment;
1069
1070  /**
1071   * Extra details about the service that can't be placed in the other fields.
1072   */
1073  @Child(name = "extraDetails", type = {
1074      StringType.class }, order = 7, min = 0, max = 1, modifier = false, summary = false)
1075  @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.")
1076  protected StringType extraDetails;
1077
1078  /**
1079   * If there is a photo/symbol associated with this HealthcareService, it may be
1080   * included here to facilitate quick identification of the service in a list.
1081   */
1082  @Child(name = "photo", type = { Attachment.class }, order = 8, min = 0, max = 1, modifier = false, summary = true)
1083  @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.")
1084  protected Attachment photo;
1085
1086  /**
1087   * List of contacts related to this specific healthcare service.
1088   */
1089  @Child(name = "telecom", type = {
1090      ContactPoint.class }, order = 9, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1091  @Description(shortDefinition = "Contacts related to the healthcare service", formalDefinition = "List of contacts related to this specific healthcare service.")
1092  protected List<ContactPoint> telecom;
1093
1094  /**
1095   * The location(s) that this service is available to (not where the service is
1096   * provided).
1097   */
1098  @Child(name = "coverageArea", type = {
1099      Location.class }, order = 10, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1100  @Description(shortDefinition = "Location(s) service is inteded for/available to", formalDefinition = "The location(s) that this service is available to (not where the service is provided).")
1101  protected List<Reference> coverageArea;
1102  /**
1103   * The actual objects that are the target of the reference (The location(s) that
1104   * this service is available to (not where the service is provided).)
1105   */
1106  protected List<Location> coverageAreaTarget;
1107
1108  /**
1109   * The code(s) that detail the conditions under which the healthcare service is
1110   * available/offered.
1111   */
1112  @Child(name = "serviceProvisionCode", type = {
1113      CodeableConcept.class }, order = 11, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1114  @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.")
1115  protected List<CodeableConcept> serviceProvisionCode;
1116
1117  /**
1118   * Does this service have specific eligibility requirements that need to be met
1119   * in order to use the service?
1120   */
1121  @Child(name = "eligibility", type = {
1122      CodeableConcept.class }, order = 12, min = 0, max = 1, modifier = false, summary = false)
1123  @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?")
1124  protected CodeableConcept eligibility;
1125
1126  /**
1127   * Describes the eligibility conditions for the service.
1128   */
1129  @Child(name = "eligibilityNote", type = {
1130      StringType.class }, order = 13, min = 0, max = 1, modifier = false, summary = false)
1131  @Description(shortDefinition = "Describes the eligibility conditions for the service", formalDefinition = "Describes the eligibility conditions for the service.")
1132  protected StringType eligibilityNote;
1133
1134  /**
1135   * Program Names that can be used to categorize the service.
1136   */
1137  @Child(name = "programName", type = {
1138      StringType.class }, order = 14, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1139  @Description(shortDefinition = "Program Names that categorize the service", formalDefinition = "Program Names that can be used to categorize the service.")
1140  protected List<StringType> programName;
1141
1142  /**
1143   * Collection of characteristics (attributes).
1144   */
1145  @Child(name = "characteristic", type = {
1146      CodeableConcept.class }, order = 15, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1147  @Description(shortDefinition = "Collection of characteristics (attributes)", formalDefinition = "Collection of characteristics (attributes).")
1148  protected List<CodeableConcept> characteristic;
1149
1150  /**
1151   * Ways that the service accepts referrals, if this is not provided then it is
1152   * implied that no referral is required.
1153   */
1154  @Child(name = "referralMethod", type = {
1155      CodeableConcept.class }, order = 16, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1156  @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.")
1157  protected List<CodeableConcept> referralMethod;
1158
1159  /**
1160   * The public part of the 'keys' allocated to an Organization by an accredited
1161   * body to support secure exchange of data over the internet. To be provided by
1162   * the Organization, where available.
1163   */
1164  @Child(name = "publicKey", type = {
1165      StringType.class }, order = 17, min = 0, max = 1, modifier = false, summary = false)
1166  @Description(shortDefinition = "PKI Public keys to support secure communications", formalDefinition = "The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.")
1167  protected StringType publicKey;
1168
1169  /**
1170   * Indicates whether or not a prospective consumer will require an appointment
1171   * for a particular service at a site to be provided by the Organization.
1172   * Indicates if an appointment is required for access to this service.
1173   */
1174  @Child(name = "appointmentRequired", type = {
1175      BooleanType.class }, order = 18, min = 0, max = 1, modifier = false, summary = false)
1176  @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.")
1177  protected BooleanType appointmentRequired;
1178
1179  /**
1180   * A collection of times that the Service Site is available.
1181   */
1182  @Child(name = "availableTime", type = {}, order = 19, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1183  @Description(shortDefinition = "Times the Service Site is available", formalDefinition = "A collection of times that the Service Site is available.")
1184  protected List<HealthcareServiceAvailableTimeComponent> availableTime;
1185
1186  /**
1187   * The HealthcareService is not available during this period of time due to the
1188   * provided reason.
1189   */
1190  @Child(name = "notAvailable", type = {}, order = 20, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1191  @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.")
1192  protected List<HealthcareServiceNotAvailableComponent> notAvailable;
1193
1194  /**
1195   * A description of site availability exceptions, e.g. public holiday
1196   * availability. Succinctly describing all possible exceptions to normal site
1197   * availability as details in the available Times and not available Times.
1198   */
1199  @Child(name = "availabilityExceptions", type = {
1200      StringType.class }, order = 21, min = 0, max = 1, modifier = false, summary = false)
1201  @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.")
1202  protected StringType availabilityExceptions;
1203
1204  private static final long serialVersionUID = 683771126L;
1205
1206  /*
1207   * Constructor
1208   */
1209  public HealthcareService() {
1210    super();
1211  }
1212
1213  /*
1214   * Constructor
1215   */
1216  public HealthcareService(Reference location) {
1217    super();
1218    this.location = location;
1219  }
1220
1221  /**
1222   * @return {@link #identifier} (External identifiers for this item.)
1223   */
1224  public List<Identifier> getIdentifier() {
1225    if (this.identifier == null)
1226      this.identifier = new ArrayList<Identifier>();
1227    return this.identifier;
1228  }
1229
1230  public boolean hasIdentifier() {
1231    if (this.identifier == null)
1232      return false;
1233    for (Identifier item : this.identifier)
1234      if (!item.isEmpty())
1235        return true;
1236    return false;
1237  }
1238
1239  /**
1240   * @return {@link #identifier} (External identifiers for this item.)
1241   */
1242  // syntactic sugar
1243  public Identifier addIdentifier() { // 3
1244    Identifier t = new Identifier();
1245    if (this.identifier == null)
1246      this.identifier = new ArrayList<Identifier>();
1247    this.identifier.add(t);
1248    return t;
1249  }
1250
1251  // syntactic sugar
1252  public HealthcareService addIdentifier(Identifier t) { // 3
1253    if (t == null)
1254      return this;
1255    if (this.identifier == null)
1256      this.identifier = new ArrayList<Identifier>();
1257    this.identifier.add(t);
1258    return this;
1259  }
1260
1261  /**
1262   * @return {@link #providedBy} (The organization that provides this healthcare
1263   *         service.)
1264   */
1265  public Reference getProvidedBy() {
1266    if (this.providedBy == null)
1267      if (Configuration.errorOnAutoCreate())
1268        throw new Error("Attempt to auto-create HealthcareService.providedBy");
1269      else if (Configuration.doAutoCreate())
1270        this.providedBy = new Reference(); // cc
1271    return this.providedBy;
1272  }
1273
1274  public boolean hasProvidedBy() {
1275    return this.providedBy != null && !this.providedBy.isEmpty();
1276  }
1277
1278  /**
1279   * @param value {@link #providedBy} (The organization that provides this
1280   *              healthcare service.)
1281   */
1282  public HealthcareService setProvidedBy(Reference value) {
1283    this.providedBy = value;
1284    return this;
1285  }
1286
1287  /**
1288   * @return {@link #providedBy} The actual object that is the target of the
1289   *         reference. The reference library doesn't populate this, but you can
1290   *         use it to hold the resource if you resolve it. (The organization that
1291   *         provides this healthcare service.)
1292   */
1293  public Organization getProvidedByTarget() {
1294    if (this.providedByTarget == null)
1295      if (Configuration.errorOnAutoCreate())
1296        throw new Error("Attempt to auto-create HealthcareService.providedBy");
1297      else if (Configuration.doAutoCreate())
1298        this.providedByTarget = new Organization(); // aa
1299    return this.providedByTarget;
1300  }
1301
1302  /**
1303   * @param value {@link #providedBy} The actual object that is the target of the
1304   *              reference. The reference library doesn't use these, but you can
1305   *              use it to hold the resource if you resolve it. (The organization
1306   *              that provides this healthcare service.)
1307   */
1308  public HealthcareService setProvidedByTarget(Organization value) {
1309    this.providedByTarget = value;
1310    return this;
1311  }
1312
1313  /**
1314   * @return {@link #serviceCategory} (Identifies the broad category of service
1315   *         being performed or delivered.)
1316   */
1317  public CodeableConcept getServiceCategory() {
1318    if (this.serviceCategory == null)
1319      if (Configuration.errorOnAutoCreate())
1320        throw new Error("Attempt to auto-create HealthcareService.serviceCategory");
1321      else if (Configuration.doAutoCreate())
1322        this.serviceCategory = new CodeableConcept(); // cc
1323    return this.serviceCategory;
1324  }
1325
1326  public boolean hasServiceCategory() {
1327    return this.serviceCategory != null && !this.serviceCategory.isEmpty();
1328  }
1329
1330  /**
1331   * @param value {@link #serviceCategory} (Identifies the broad category of
1332   *              service being performed or delivered.)
1333   */
1334  public HealthcareService setServiceCategory(CodeableConcept value) {
1335    this.serviceCategory = value;
1336    return this;
1337  }
1338
1339  /**
1340   * @return {@link #serviceType} (A specific type of service that may be
1341   *         delivered or performed.)
1342   */
1343  public List<ServiceTypeComponent> getServiceType() {
1344    if (this.serviceType == null)
1345      this.serviceType = new ArrayList<ServiceTypeComponent>();
1346    return this.serviceType;
1347  }
1348
1349  public boolean hasServiceType() {
1350    if (this.serviceType == null)
1351      return false;
1352    for (ServiceTypeComponent item : this.serviceType)
1353      if (!item.isEmpty())
1354        return true;
1355    return false;
1356  }
1357
1358  /**
1359   * @return {@link #serviceType} (A specific type of service that may be
1360   *         delivered or performed.)
1361   */
1362  // syntactic sugar
1363  public ServiceTypeComponent addServiceType() { // 3
1364    ServiceTypeComponent t = new ServiceTypeComponent();
1365    if (this.serviceType == null)
1366      this.serviceType = new ArrayList<ServiceTypeComponent>();
1367    this.serviceType.add(t);
1368    return t;
1369  }
1370
1371  // syntactic sugar
1372  public HealthcareService addServiceType(ServiceTypeComponent t) { // 3
1373    if (t == null)
1374      return this;
1375    if (this.serviceType == null)
1376      this.serviceType = new ArrayList<ServiceTypeComponent>();
1377    this.serviceType.add(t);
1378    return this;
1379  }
1380
1381  /**
1382   * @return {@link #location} (The location where this healthcare service may be
1383   *         provided.)
1384   */
1385  public Reference getLocation() {
1386    if (this.location == null)
1387      if (Configuration.errorOnAutoCreate())
1388        throw new Error("Attempt to auto-create HealthcareService.location");
1389      else if (Configuration.doAutoCreate())
1390        this.location = new Reference(); // cc
1391    return this.location;
1392  }
1393
1394  public boolean hasLocation() {
1395    return this.location != null && !this.location.isEmpty();
1396  }
1397
1398  /**
1399   * @param value {@link #location} (The location where this healthcare service
1400   *              may be provided.)
1401   */
1402  public HealthcareService setLocation(Reference value) {
1403    this.location = value;
1404    return this;
1405  }
1406
1407  /**
1408   * @return {@link #location} The actual object that is the target of the
1409   *         reference. The reference library doesn't populate this, but you can
1410   *         use it to hold the resource if you resolve it. (The location where
1411   *         this healthcare service may be provided.)
1412   */
1413  public Location getLocationTarget() {
1414    if (this.locationTarget == null)
1415      if (Configuration.errorOnAutoCreate())
1416        throw new Error("Attempt to auto-create HealthcareService.location");
1417      else if (Configuration.doAutoCreate())
1418        this.locationTarget = new Location(); // aa
1419    return this.locationTarget;
1420  }
1421
1422  /**
1423   * @param value {@link #location} The actual object that is the target of the
1424   *              reference. The reference library doesn't use these, but you can
1425   *              use it to hold the resource if you resolve it. (The location
1426   *              where this healthcare service may be provided.)
1427   */
1428  public HealthcareService setLocationTarget(Location value) {
1429    this.locationTarget = value;
1430    return this;
1431  }
1432
1433  /**
1434   * @return {@link #serviceName} (Further description of the service as it would
1435   *         be presented to a consumer while searching.). This is the underlying
1436   *         object with id, value and extensions. The accessor "getServiceName"
1437   *         gives direct access to the value
1438   */
1439  public StringType getServiceNameElement() {
1440    if (this.serviceName == null)
1441      if (Configuration.errorOnAutoCreate())
1442        throw new Error("Attempt to auto-create HealthcareService.serviceName");
1443      else if (Configuration.doAutoCreate())
1444        this.serviceName = new StringType(); // bb
1445    return this.serviceName;
1446  }
1447
1448  public boolean hasServiceNameElement() {
1449    return this.serviceName != null && !this.serviceName.isEmpty();
1450  }
1451
1452  public boolean hasServiceName() {
1453    return this.serviceName != null && !this.serviceName.isEmpty();
1454  }
1455
1456  /**
1457   * @param value {@link #serviceName} (Further description of the service as it
1458   *              would be presented to a consumer while searching.). This is the
1459   *              underlying object with id, value and extensions. The accessor
1460   *              "getServiceName" gives direct access to the value
1461   */
1462  public HealthcareService setServiceNameElement(StringType value) {
1463    this.serviceName = value;
1464    return this;
1465  }
1466
1467  /**
1468   * @return Further description of the service as it would be presented to a
1469   *         consumer while searching.
1470   */
1471  public String getServiceName() {
1472    return this.serviceName == null ? null : this.serviceName.getValue();
1473  }
1474
1475  /**
1476   * @param value Further description of the service as it would be presented to a
1477   *              consumer while searching.
1478   */
1479  public HealthcareService setServiceName(String value) {
1480    if (Utilities.noString(value))
1481      this.serviceName = null;
1482    else {
1483      if (this.serviceName == null)
1484        this.serviceName = new StringType();
1485      this.serviceName.setValue(value);
1486    }
1487    return this;
1488  }
1489
1490  /**
1491   * @return {@link #comment} (Any additional description of the service and/or
1492   *         any specific issues not covered by the other attributes, which can be
1493   *         displayed as further detail under the serviceName.). This is the
1494   *         underlying object with id, value and extensions. The accessor
1495   *         "getComment" gives direct access to the value
1496   */
1497  public StringType getCommentElement() {
1498    if (this.comment == null)
1499      if (Configuration.errorOnAutoCreate())
1500        throw new Error("Attempt to auto-create HealthcareService.comment");
1501      else if (Configuration.doAutoCreate())
1502        this.comment = new StringType(); // bb
1503    return this.comment;
1504  }
1505
1506  public boolean hasCommentElement() {
1507    return this.comment != null && !this.comment.isEmpty();
1508  }
1509
1510  public boolean hasComment() {
1511    return this.comment != null && !this.comment.isEmpty();
1512  }
1513
1514  /**
1515   * @param value {@link #comment} (Any additional description of the service
1516   *              and/or any specific issues not covered by the other attributes,
1517   *              which can be displayed as further detail under the
1518   *              serviceName.). This is the underlying object with id, value and
1519   *              extensions. The accessor "getComment" gives direct access to the
1520   *              value
1521   */
1522  public HealthcareService setCommentElement(StringType value) {
1523    this.comment = value;
1524    return this;
1525  }
1526
1527  /**
1528   * @return Any additional description of the service and/or any specific issues
1529   *         not covered by the other attributes, which can be displayed as
1530   *         further detail under the serviceName.
1531   */
1532  public String getComment() {
1533    return this.comment == null ? null : this.comment.getValue();
1534  }
1535
1536  /**
1537   * @param value Any additional description of the service and/or any specific
1538   *              issues not covered by the other attributes, which can be
1539   *              displayed as further detail under the serviceName.
1540   */
1541  public HealthcareService setComment(String value) {
1542    if (Utilities.noString(value))
1543      this.comment = null;
1544    else {
1545      if (this.comment == null)
1546        this.comment = new StringType();
1547      this.comment.setValue(value);
1548    }
1549    return this;
1550  }
1551
1552  /**
1553   * @return {@link #extraDetails} (Extra details about the service that can't be
1554   *         placed in the other fields.). This is the underlying object with id,
1555   *         value and extensions. The accessor "getExtraDetails" gives direct
1556   *         access to the value
1557   */
1558  public StringType getExtraDetailsElement() {
1559    if (this.extraDetails == null)
1560      if (Configuration.errorOnAutoCreate())
1561        throw new Error("Attempt to auto-create HealthcareService.extraDetails");
1562      else if (Configuration.doAutoCreate())
1563        this.extraDetails = new StringType(); // bb
1564    return this.extraDetails;
1565  }
1566
1567  public boolean hasExtraDetailsElement() {
1568    return this.extraDetails != null && !this.extraDetails.isEmpty();
1569  }
1570
1571  public boolean hasExtraDetails() {
1572    return this.extraDetails != null && !this.extraDetails.isEmpty();
1573  }
1574
1575  /**
1576   * @param value {@link #extraDetails} (Extra details about the service that
1577   *              can't be placed in the other fields.). This is the underlying
1578   *              object with id, value and extensions. The accessor
1579   *              "getExtraDetails" gives direct access to the value
1580   */
1581  public HealthcareService setExtraDetailsElement(StringType value) {
1582    this.extraDetails = value;
1583    return this;
1584  }
1585
1586  /**
1587   * @return Extra details about the service that can't be placed in the other
1588   *         fields.
1589   */
1590  public String getExtraDetails() {
1591    return this.extraDetails == null ? null : this.extraDetails.getValue();
1592  }
1593
1594  /**
1595   * @param value Extra details about the service that can't be placed in the
1596   *              other fields.
1597   */
1598  public HealthcareService setExtraDetails(String value) {
1599    if (Utilities.noString(value))
1600      this.extraDetails = null;
1601    else {
1602      if (this.extraDetails == null)
1603        this.extraDetails = new StringType();
1604      this.extraDetails.setValue(value);
1605    }
1606    return this;
1607  }
1608
1609  /**
1610   * @return {@link #photo} (If there is a photo/symbol associated with this
1611   *         HealthcareService, it may be included here to facilitate quick
1612   *         identification of the service in a list.)
1613   */
1614  public Attachment getPhoto() {
1615    if (this.photo == null)
1616      if (Configuration.errorOnAutoCreate())
1617        throw new Error("Attempt to auto-create HealthcareService.photo");
1618      else if (Configuration.doAutoCreate())
1619        this.photo = new Attachment(); // cc
1620    return this.photo;
1621  }
1622
1623  public boolean hasPhoto() {
1624    return this.photo != null && !this.photo.isEmpty();
1625  }
1626
1627  /**
1628   * @param value {@link #photo} (If there is a photo/symbol associated with this
1629   *              HealthcareService, it may be included here to facilitate quick
1630   *              identification of the service in a list.)
1631   */
1632  public HealthcareService setPhoto(Attachment value) {
1633    this.photo = value;
1634    return this;
1635  }
1636
1637  /**
1638   * @return {@link #telecom} (List of contacts related to this specific
1639   *         healthcare service.)
1640   */
1641  public List<ContactPoint> getTelecom() {
1642    if (this.telecom == null)
1643      this.telecom = new ArrayList<ContactPoint>();
1644    return this.telecom;
1645  }
1646
1647  public boolean hasTelecom() {
1648    if (this.telecom == null)
1649      return false;
1650    for (ContactPoint item : this.telecom)
1651      if (!item.isEmpty())
1652        return true;
1653    return false;
1654  }
1655
1656  /**
1657   * @return {@link #telecom} (List of contacts related to this specific
1658   *         healthcare service.)
1659   */
1660  // syntactic sugar
1661  public ContactPoint addTelecom() { // 3
1662    ContactPoint t = new ContactPoint();
1663    if (this.telecom == null)
1664      this.telecom = new ArrayList<ContactPoint>();
1665    this.telecom.add(t);
1666    return t;
1667  }
1668
1669  // syntactic sugar
1670  public HealthcareService addTelecom(ContactPoint t) { // 3
1671    if (t == null)
1672      return this;
1673    if (this.telecom == null)
1674      this.telecom = new ArrayList<ContactPoint>();
1675    this.telecom.add(t);
1676    return this;
1677  }
1678
1679  /**
1680   * @return {@link #coverageArea} (The location(s) that this service is available
1681   *         to (not where the service is provided).)
1682   */
1683  public List<Reference> getCoverageArea() {
1684    if (this.coverageArea == null)
1685      this.coverageArea = new ArrayList<Reference>();
1686    return this.coverageArea;
1687  }
1688
1689  public boolean hasCoverageArea() {
1690    if (this.coverageArea == null)
1691      return false;
1692    for (Reference item : this.coverageArea)
1693      if (!item.isEmpty())
1694        return true;
1695    return false;
1696  }
1697
1698  /**
1699   * @return {@link #coverageArea} (The location(s) that this service is available
1700   *         to (not where the service is provided).)
1701   */
1702  // syntactic sugar
1703  public Reference addCoverageArea() { // 3
1704    Reference t = new Reference();
1705    if (this.coverageArea == null)
1706      this.coverageArea = new ArrayList<Reference>();
1707    this.coverageArea.add(t);
1708    return t;
1709  }
1710
1711  // syntactic sugar
1712  public HealthcareService addCoverageArea(Reference t) { // 3
1713    if (t == null)
1714      return this;
1715    if (this.coverageArea == null)
1716      this.coverageArea = new ArrayList<Reference>();
1717    this.coverageArea.add(t);
1718    return this;
1719  }
1720
1721  /**
1722   * @return {@link #coverageArea} (The actual objects that are the target of the
1723   *         reference. The reference library doesn't populate this, but you can
1724   *         use this to hold the resources if you resolvethemt. The location(s)
1725   *         that this service is available to (not where the service is
1726   *         provided).)
1727   */
1728  public List<Location> getCoverageAreaTarget() {
1729    if (this.coverageAreaTarget == null)
1730      this.coverageAreaTarget = new ArrayList<Location>();
1731    return this.coverageAreaTarget;
1732  }
1733
1734  // syntactic sugar
1735  /**
1736   * @return {@link #coverageArea} (Add an actual object that is the target of the
1737   *         reference. The reference library doesn't use these, but you can use
1738   *         this to hold the resources if you resolvethemt. The location(s) that
1739   *         this service is available to (not where the service is provided).)
1740   */
1741  public Location addCoverageAreaTarget() {
1742    Location r = new Location();
1743    if (this.coverageAreaTarget == null)
1744      this.coverageAreaTarget = new ArrayList<Location>();
1745    this.coverageAreaTarget.add(r);
1746    return r;
1747  }
1748
1749  /**
1750   * @return {@link #serviceProvisionCode} (The code(s) that detail the conditions
1751   *         under which the healthcare service is available/offered.)
1752   */
1753  public List<CodeableConcept> getServiceProvisionCode() {
1754    if (this.serviceProvisionCode == null)
1755      this.serviceProvisionCode = new ArrayList<CodeableConcept>();
1756    return this.serviceProvisionCode;
1757  }
1758
1759  public boolean hasServiceProvisionCode() {
1760    if (this.serviceProvisionCode == null)
1761      return false;
1762    for (CodeableConcept item : this.serviceProvisionCode)
1763      if (!item.isEmpty())
1764        return true;
1765    return false;
1766  }
1767
1768  /**
1769   * @return {@link #serviceProvisionCode} (The code(s) that detail the conditions
1770   *         under which the healthcare service is available/offered.)
1771   */
1772  // syntactic sugar
1773  public CodeableConcept addServiceProvisionCode() { // 3
1774    CodeableConcept t = new CodeableConcept();
1775    if (this.serviceProvisionCode == null)
1776      this.serviceProvisionCode = new ArrayList<CodeableConcept>();
1777    this.serviceProvisionCode.add(t);
1778    return t;
1779  }
1780
1781  // syntactic sugar
1782  public HealthcareService addServiceProvisionCode(CodeableConcept t) { // 3
1783    if (t == null)
1784      return this;
1785    if (this.serviceProvisionCode == null)
1786      this.serviceProvisionCode = new ArrayList<CodeableConcept>();
1787    this.serviceProvisionCode.add(t);
1788    return this;
1789  }
1790
1791  /**
1792   * @return {@link #eligibility} (Does this service have specific eligibility
1793   *         requirements that need to be met in order to use the service?)
1794   */
1795  public CodeableConcept getEligibility() {
1796    if (this.eligibility == null)
1797      if (Configuration.errorOnAutoCreate())
1798        throw new Error("Attempt to auto-create HealthcareService.eligibility");
1799      else if (Configuration.doAutoCreate())
1800        this.eligibility = new CodeableConcept(); // cc
1801    return this.eligibility;
1802  }
1803
1804  public boolean hasEligibility() {
1805    return this.eligibility != null && !this.eligibility.isEmpty();
1806  }
1807
1808  /**
1809   * @param value {@link #eligibility} (Does this service have specific
1810   *              eligibility requirements that need to be met in order to use the
1811   *              service?)
1812   */
1813  public HealthcareService setEligibility(CodeableConcept value) {
1814    this.eligibility = value;
1815    return this;
1816  }
1817
1818  /**
1819   * @return {@link #eligibilityNote} (Describes the eligibility conditions for
1820   *         the service.). This is the underlying object with id, value and
1821   *         extensions. The accessor "getEligibilityNote" gives direct access to
1822   *         the value
1823   */
1824  public StringType getEligibilityNoteElement() {
1825    if (this.eligibilityNote == null)
1826      if (Configuration.errorOnAutoCreate())
1827        throw new Error("Attempt to auto-create HealthcareService.eligibilityNote");
1828      else if (Configuration.doAutoCreate())
1829        this.eligibilityNote = new StringType(); // bb
1830    return this.eligibilityNote;
1831  }
1832
1833  public boolean hasEligibilityNoteElement() {
1834    return this.eligibilityNote != null && !this.eligibilityNote.isEmpty();
1835  }
1836
1837  public boolean hasEligibilityNote() {
1838    return this.eligibilityNote != null && !this.eligibilityNote.isEmpty();
1839  }
1840
1841  /**
1842   * @param value {@link #eligibilityNote} (Describes the eligibility conditions
1843   *              for the service.). This is the underlying object with id, value
1844   *              and extensions. The accessor "getEligibilityNote" gives direct
1845   *              access to the value
1846   */
1847  public HealthcareService setEligibilityNoteElement(StringType value) {
1848    this.eligibilityNote = value;
1849    return this;
1850  }
1851
1852  /**
1853   * @return Describes the eligibility conditions for the service.
1854   */
1855  public String getEligibilityNote() {
1856    return this.eligibilityNote == null ? null : this.eligibilityNote.getValue();
1857  }
1858
1859  /**
1860   * @param value Describes the eligibility conditions for the service.
1861   */
1862  public HealthcareService setEligibilityNote(String value) {
1863    if (Utilities.noString(value))
1864      this.eligibilityNote = null;
1865    else {
1866      if (this.eligibilityNote == null)
1867        this.eligibilityNote = new StringType();
1868      this.eligibilityNote.setValue(value);
1869    }
1870    return this;
1871  }
1872
1873  /**
1874   * @return {@link #programName} (Program Names that can be used to categorize
1875   *         the service.)
1876   */
1877  public List<StringType> getProgramName() {
1878    if (this.programName == null)
1879      this.programName = new ArrayList<StringType>();
1880    return this.programName;
1881  }
1882
1883  public boolean hasProgramName() {
1884    if (this.programName == null)
1885      return false;
1886    for (StringType item : this.programName)
1887      if (!item.isEmpty())
1888        return true;
1889    return false;
1890  }
1891
1892  /**
1893   * @return {@link #programName} (Program Names that can be used to categorize
1894   *         the service.)
1895   */
1896  // syntactic sugar
1897  public StringType addProgramNameElement() {// 2
1898    StringType t = new StringType();
1899    if (this.programName == null)
1900      this.programName = new ArrayList<StringType>();
1901    this.programName.add(t);
1902    return t;
1903  }
1904
1905  /**
1906   * @param value {@link #programName} (Program Names that can be used to
1907   *              categorize the service.)
1908   */
1909  public HealthcareService addProgramName(String value) { // 1
1910    StringType t = new StringType();
1911    t.setValue(value);
1912    if (this.programName == null)
1913      this.programName = new ArrayList<StringType>();
1914    this.programName.add(t);
1915    return this;
1916  }
1917
1918  /**
1919   * @param value {@link #programName} (Program Names that can be used to
1920   *              categorize the service.)
1921   */
1922  public boolean hasProgramName(String value) {
1923    if (this.programName == null)
1924      return false;
1925    for (StringType v : this.programName)
1926      if (v.equals(value)) // string
1927        return true;
1928    return false;
1929  }
1930
1931  /**
1932   * @return {@link #characteristic} (Collection of characteristics (attributes).)
1933   */
1934  public List<CodeableConcept> getCharacteristic() {
1935    if (this.characteristic == null)
1936      this.characteristic = new ArrayList<CodeableConcept>();
1937    return this.characteristic;
1938  }
1939
1940  public boolean hasCharacteristic() {
1941    if (this.characteristic == null)
1942      return false;
1943    for (CodeableConcept item : this.characteristic)
1944      if (!item.isEmpty())
1945        return true;
1946    return false;
1947  }
1948
1949  /**
1950   * @return {@link #characteristic} (Collection of characteristics (attributes).)
1951   */
1952  // syntactic sugar
1953  public CodeableConcept addCharacteristic() { // 3
1954    CodeableConcept t = new CodeableConcept();
1955    if (this.characteristic == null)
1956      this.characteristic = new ArrayList<CodeableConcept>();
1957    this.characteristic.add(t);
1958    return t;
1959  }
1960
1961  // syntactic sugar
1962  public HealthcareService addCharacteristic(CodeableConcept t) { // 3
1963    if (t == null)
1964      return this;
1965    if (this.characteristic == null)
1966      this.characteristic = new ArrayList<CodeableConcept>();
1967    this.characteristic.add(t);
1968    return this;
1969  }
1970
1971  /**
1972   * @return {@link #referralMethod} (Ways that the service accepts referrals, if
1973   *         this is not provided then it is implied that no referral is
1974   *         required.)
1975   */
1976  public List<CodeableConcept> getReferralMethod() {
1977    if (this.referralMethod == null)
1978      this.referralMethod = new ArrayList<CodeableConcept>();
1979    return this.referralMethod;
1980  }
1981
1982  public boolean hasReferralMethod() {
1983    if (this.referralMethod == null)
1984      return false;
1985    for (CodeableConcept item : this.referralMethod)
1986      if (!item.isEmpty())
1987        return true;
1988    return false;
1989  }
1990
1991  /**
1992   * @return {@link #referralMethod} (Ways that the service accepts referrals, if
1993   *         this is not provided then it is implied that no referral is
1994   *         required.)
1995   */
1996  // syntactic sugar
1997  public CodeableConcept addReferralMethod() { // 3
1998    CodeableConcept t = new CodeableConcept();
1999    if (this.referralMethod == null)
2000      this.referralMethod = new ArrayList<CodeableConcept>();
2001    this.referralMethod.add(t);
2002    return t;
2003  }
2004
2005  // syntactic sugar
2006  public HealthcareService addReferralMethod(CodeableConcept t) { // 3
2007    if (t == null)
2008      return this;
2009    if (this.referralMethod == null)
2010      this.referralMethod = new ArrayList<CodeableConcept>();
2011    this.referralMethod.add(t);
2012    return this;
2013  }
2014
2015  /**
2016   * @return {@link #publicKey} (The public part of the 'keys' allocated to an
2017   *         Organization by an accredited body to support secure exchange of data
2018   *         over the internet. To be provided by the Organization, where
2019   *         available.). This is the underlying object with id, value and
2020   *         extensions. The accessor "getPublicKey" gives direct access to the
2021   *         value
2022   */
2023  public StringType getPublicKeyElement() {
2024    if (this.publicKey == null)
2025      if (Configuration.errorOnAutoCreate())
2026        throw new Error("Attempt to auto-create HealthcareService.publicKey");
2027      else if (Configuration.doAutoCreate())
2028        this.publicKey = new StringType(); // bb
2029    return this.publicKey;
2030  }
2031
2032  public boolean hasPublicKeyElement() {
2033    return this.publicKey != null && !this.publicKey.isEmpty();
2034  }
2035
2036  public boolean hasPublicKey() {
2037    return this.publicKey != null && !this.publicKey.isEmpty();
2038  }
2039
2040  /**
2041   * @param value {@link #publicKey} (The public part of the 'keys' allocated to
2042   *              an Organization by an accredited body to support secure exchange
2043   *              of data over the internet. To be provided by the Organization,
2044   *              where available.). This is the underlying object with id, value
2045   *              and extensions. The accessor "getPublicKey" gives direct access
2046   *              to the value
2047   */
2048  public HealthcareService setPublicKeyElement(StringType value) {
2049    this.publicKey = value;
2050    return this;
2051  }
2052
2053  /**
2054   * @return The public part of the 'keys' allocated to an Organization by an
2055   *         accredited body to support secure exchange of data over the internet.
2056   *         To be provided by the Organization, where available.
2057   */
2058  public String getPublicKey() {
2059    return this.publicKey == null ? null : this.publicKey.getValue();
2060  }
2061
2062  /**
2063   * @param value The public part of the 'keys' allocated to an Organization by an
2064   *              accredited body to support secure exchange of data over the
2065   *              internet. To be provided by the Organization, where available.
2066   */
2067  public HealthcareService setPublicKey(String value) {
2068    if (Utilities.noString(value))
2069      this.publicKey = null;
2070    else {
2071      if (this.publicKey == null)
2072        this.publicKey = new StringType();
2073      this.publicKey.setValue(value);
2074    }
2075    return this;
2076  }
2077
2078  /**
2079   * @return {@link #appointmentRequired} (Indicates whether or not a prospective
2080   *         consumer will require an appointment for a particular service at a
2081   *         site to be provided by the Organization. Indicates if an appointment
2082   *         is required for access to this service.). This is the underlying
2083   *         object with id, value and extensions. The accessor
2084   *         "getAppointmentRequired" gives direct access to the value
2085   */
2086  public BooleanType getAppointmentRequiredElement() {
2087    if (this.appointmentRequired == null)
2088      if (Configuration.errorOnAutoCreate())
2089        throw new Error("Attempt to auto-create HealthcareService.appointmentRequired");
2090      else if (Configuration.doAutoCreate())
2091        this.appointmentRequired = new BooleanType(); // bb
2092    return this.appointmentRequired;
2093  }
2094
2095  public boolean hasAppointmentRequiredElement() {
2096    return this.appointmentRequired != null && !this.appointmentRequired.isEmpty();
2097  }
2098
2099  public boolean hasAppointmentRequired() {
2100    return this.appointmentRequired != null && !this.appointmentRequired.isEmpty();
2101  }
2102
2103  /**
2104   * @param value {@link #appointmentRequired} (Indicates whether or not a
2105   *              prospective consumer will require an appointment for a
2106   *              particular service at a site to be provided by the Organization.
2107   *              Indicates if an appointment is required for access to this
2108   *              service.). This is the underlying object with id, value and
2109   *              extensions. The accessor "getAppointmentRequired" gives direct
2110   *              access to the value
2111   */
2112  public HealthcareService setAppointmentRequiredElement(BooleanType value) {
2113    this.appointmentRequired = value;
2114    return this;
2115  }
2116
2117  /**
2118   * @return Indicates whether or not a prospective consumer will require an
2119   *         appointment for a particular service at a site to be provided by the
2120   *         Organization. Indicates if an appointment is required for access to
2121   *         this service.
2122   */
2123  public boolean getAppointmentRequired() {
2124    return this.appointmentRequired == null || this.appointmentRequired.isEmpty() ? false
2125        : this.appointmentRequired.getValue();
2126  }
2127
2128  /**
2129   * @param value Indicates whether or not a prospective consumer will require an
2130   *              appointment for a particular service at a site to be provided by
2131   *              the Organization. Indicates if an appointment is required for
2132   *              access to this service.
2133   */
2134  public HealthcareService setAppointmentRequired(boolean value) {
2135    if (this.appointmentRequired == null)
2136      this.appointmentRequired = new BooleanType();
2137    this.appointmentRequired.setValue(value);
2138    return this;
2139  }
2140
2141  /**
2142   * @return {@link #availableTime} (A collection of times that the Service Site
2143   *         is available.)
2144   */
2145  public List<HealthcareServiceAvailableTimeComponent> getAvailableTime() {
2146    if (this.availableTime == null)
2147      this.availableTime = new ArrayList<HealthcareServiceAvailableTimeComponent>();
2148    return this.availableTime;
2149  }
2150
2151  public boolean hasAvailableTime() {
2152    if (this.availableTime == null)
2153      return false;
2154    for (HealthcareServiceAvailableTimeComponent item : this.availableTime)
2155      if (!item.isEmpty())
2156        return true;
2157    return false;
2158  }
2159
2160  /**
2161   * @return {@link #availableTime} (A collection of times that the Service Site
2162   *         is available.)
2163   */
2164  // syntactic sugar
2165  public HealthcareServiceAvailableTimeComponent addAvailableTime() { // 3
2166    HealthcareServiceAvailableTimeComponent t = new HealthcareServiceAvailableTimeComponent();
2167    if (this.availableTime == null)
2168      this.availableTime = new ArrayList<HealthcareServiceAvailableTimeComponent>();
2169    this.availableTime.add(t);
2170    return t;
2171  }
2172
2173  // syntactic sugar
2174  public HealthcareService addAvailableTime(HealthcareServiceAvailableTimeComponent t) { // 3
2175    if (t == null)
2176      return this;
2177    if (this.availableTime == null)
2178      this.availableTime = new ArrayList<HealthcareServiceAvailableTimeComponent>();
2179    this.availableTime.add(t);
2180    return this;
2181  }
2182
2183  /**
2184   * @return {@link #notAvailable} (The HealthcareService is not available during
2185   *         this period of time due to the provided reason.)
2186   */
2187  public List<HealthcareServiceNotAvailableComponent> getNotAvailable() {
2188    if (this.notAvailable == null)
2189      this.notAvailable = new ArrayList<HealthcareServiceNotAvailableComponent>();
2190    return this.notAvailable;
2191  }
2192
2193  public boolean hasNotAvailable() {
2194    if (this.notAvailable == null)
2195      return false;
2196    for (HealthcareServiceNotAvailableComponent item : this.notAvailable)
2197      if (!item.isEmpty())
2198        return true;
2199    return false;
2200  }
2201
2202  /**
2203   * @return {@link #notAvailable} (The HealthcareService is not available during
2204   *         this period of time due to the provided reason.)
2205   */
2206  // syntactic sugar
2207  public HealthcareServiceNotAvailableComponent addNotAvailable() { // 3
2208    HealthcareServiceNotAvailableComponent t = new HealthcareServiceNotAvailableComponent();
2209    if (this.notAvailable == null)
2210      this.notAvailable = new ArrayList<HealthcareServiceNotAvailableComponent>();
2211    this.notAvailable.add(t);
2212    return t;
2213  }
2214
2215  // syntactic sugar
2216  public HealthcareService addNotAvailable(HealthcareServiceNotAvailableComponent t) { // 3
2217    if (t == null)
2218      return this;
2219    if (this.notAvailable == null)
2220      this.notAvailable = new ArrayList<HealthcareServiceNotAvailableComponent>();
2221    this.notAvailable.add(t);
2222    return this;
2223  }
2224
2225  /**
2226   * @return {@link #availabilityExceptions} (A description of site availability
2227   *         exceptions, e.g. public holiday availability. Succinctly describing
2228   *         all possible exceptions to normal site availability as details in the
2229   *         available Times and not available Times.). This is the underlying
2230   *         object with id, value and extensions. The accessor
2231   *         "getAvailabilityExceptions" gives direct access to the value
2232   */
2233  public StringType getAvailabilityExceptionsElement() {
2234    if (this.availabilityExceptions == null)
2235      if (Configuration.errorOnAutoCreate())
2236        throw new Error("Attempt to auto-create HealthcareService.availabilityExceptions");
2237      else if (Configuration.doAutoCreate())
2238        this.availabilityExceptions = new StringType(); // bb
2239    return this.availabilityExceptions;
2240  }
2241
2242  public boolean hasAvailabilityExceptionsElement() {
2243    return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty();
2244  }
2245
2246  public boolean hasAvailabilityExceptions() {
2247    return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty();
2248  }
2249
2250  /**
2251   * @param value {@link #availabilityExceptions} (A description of site
2252   *              availability exceptions, e.g. public holiday availability.
2253   *              Succinctly describing all possible exceptions to normal site
2254   *              availability as details in the available Times and not available
2255   *              Times.). This is the underlying object with id, value and
2256   *              extensions. The accessor "getAvailabilityExceptions" gives
2257   *              direct access to the value
2258   */
2259  public HealthcareService setAvailabilityExceptionsElement(StringType value) {
2260    this.availabilityExceptions = value;
2261    return this;
2262  }
2263
2264  /**
2265   * @return A description of site availability exceptions, e.g. public holiday
2266   *         availability. Succinctly describing all possible exceptions to normal
2267   *         site availability as details in the available Times and not available
2268   *         Times.
2269   */
2270  public String getAvailabilityExceptions() {
2271    return this.availabilityExceptions == null ? null : this.availabilityExceptions.getValue();
2272  }
2273
2274  /**
2275   * @param value A description of site availability exceptions, e.g. public
2276   *              holiday availability. Succinctly describing all possible
2277   *              exceptions to normal site availability as details in the
2278   *              available Times and not available Times.
2279   */
2280  public HealthcareService setAvailabilityExceptions(String value) {
2281    if (Utilities.noString(value))
2282      this.availabilityExceptions = null;
2283    else {
2284      if (this.availabilityExceptions == null)
2285        this.availabilityExceptions = new StringType();
2286      this.availabilityExceptions.setValue(value);
2287    }
2288    return this;
2289  }
2290
2291  protected void listChildren(List<Property> childrenList) {
2292    super.listChildren(childrenList);
2293    childrenList.add(new Property("identifier", "Identifier", "External identifiers for this item.", 0,
2294        java.lang.Integer.MAX_VALUE, identifier));
2295    childrenList.add(new Property("providedBy", "Reference(Organization)",
2296        "The organization that provides this healthcare service.", 0, java.lang.Integer.MAX_VALUE, providedBy));
2297    childrenList.add(new Property("serviceCategory", "CodeableConcept",
2298        "Identifies the broad category of service being performed or delivered.", 0, java.lang.Integer.MAX_VALUE,
2299        serviceCategory));
2300    childrenList.add(new Property("serviceType", "", "A specific type of service that may be delivered or performed.",
2301        0, java.lang.Integer.MAX_VALUE, serviceType));
2302    childrenList.add(new Property("location", "Reference(Location)",
2303        "The location where this healthcare service may be provided.", 0, java.lang.Integer.MAX_VALUE, location));
2304    childrenList.add(new Property("serviceName", "string",
2305        "Further description of the service as it would be presented to a consumer while searching.", 0,
2306        java.lang.Integer.MAX_VALUE, serviceName));
2307    childrenList.add(new Property("comment", "string",
2308        "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.",
2309        0, java.lang.Integer.MAX_VALUE, comment));
2310    childrenList.add(new Property("extraDetails", "string",
2311        "Extra details about the service that can't be placed in the other fields.", 0, java.lang.Integer.MAX_VALUE,
2312        extraDetails));
2313    childrenList.add(new Property("photo", "Attachment",
2314        "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.",
2315        0, java.lang.Integer.MAX_VALUE, photo));
2316    childrenList.add(new Property("telecom", "ContactPoint",
2317        "List of contacts related to this specific healthcare service.", 0, java.lang.Integer.MAX_VALUE, telecom));
2318    childrenList.add(new Property("coverageArea", "Reference(Location)",
2319        "The location(s) that this service is available to (not where the service is provided).", 0,
2320        java.lang.Integer.MAX_VALUE, coverageArea));
2321    childrenList.add(new Property("serviceProvisionCode", "CodeableConcept",
2322        "The code(s) that detail the conditions under which the healthcare service is available/offered.", 0,
2323        java.lang.Integer.MAX_VALUE, serviceProvisionCode));
2324    childrenList.add(new Property("eligibility", "CodeableConcept",
2325        "Does this service have specific eligibility requirements that need to be met in order to use the service?", 0,
2326        java.lang.Integer.MAX_VALUE, eligibility));
2327    childrenList.add(new Property("eligibilityNote", "string", "Describes the eligibility conditions for the service.",
2328        0, java.lang.Integer.MAX_VALUE, eligibilityNote));
2329    childrenList.add(new Property("programName", "string", "Program Names that can be used to categorize the service.",
2330        0, java.lang.Integer.MAX_VALUE, programName));
2331    childrenList.add(new Property("characteristic", "CodeableConcept", "Collection of characteristics (attributes).", 0,
2332        java.lang.Integer.MAX_VALUE, characteristic));
2333    childrenList.add(new Property("referralMethod", "CodeableConcept",
2334        "Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.",
2335        0, java.lang.Integer.MAX_VALUE, referralMethod));
2336    childrenList.add(new Property("publicKey", "string",
2337        "The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.",
2338        0, java.lang.Integer.MAX_VALUE, publicKey));
2339    childrenList.add(new Property("appointmentRequired", "boolean",
2340        "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.",
2341        0, java.lang.Integer.MAX_VALUE, appointmentRequired));
2342    childrenList.add(new Property("availableTime", "", "A collection of times that the Service Site is available.", 0,
2343        java.lang.Integer.MAX_VALUE, availableTime));
2344    childrenList.add(new Property("notAvailable", "",
2345        "The HealthcareService is not available during this period of time due to the provided reason.", 0,
2346        java.lang.Integer.MAX_VALUE, notAvailable));
2347    childrenList.add(new Property("availabilityExceptions", "string",
2348        "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.",
2349        0, java.lang.Integer.MAX_VALUE, availabilityExceptions));
2350  }
2351
2352  @Override
2353  public void setProperty(String name, Base value) throws FHIRException {
2354    if (name.equals("identifier"))
2355      this.getIdentifier().add(castToIdentifier(value));
2356    else if (name.equals("providedBy"))
2357      this.providedBy = castToReference(value); // Reference
2358    else if (name.equals("serviceCategory"))
2359      this.serviceCategory = castToCodeableConcept(value); // CodeableConcept
2360    else if (name.equals("serviceType"))
2361      this.getServiceType().add((ServiceTypeComponent) value);
2362    else if (name.equals("location"))
2363      this.location = castToReference(value); // Reference
2364    else if (name.equals("serviceName"))
2365      this.serviceName = castToString(value); // StringType
2366    else if (name.equals("comment"))
2367      this.comment = castToString(value); // StringType
2368    else if (name.equals("extraDetails"))
2369      this.extraDetails = castToString(value); // StringType
2370    else if (name.equals("photo"))
2371      this.photo = castToAttachment(value); // Attachment
2372    else if (name.equals("telecom"))
2373      this.getTelecom().add(castToContactPoint(value));
2374    else if (name.equals("coverageArea"))
2375      this.getCoverageArea().add(castToReference(value));
2376    else if (name.equals("serviceProvisionCode"))
2377      this.getServiceProvisionCode().add(castToCodeableConcept(value));
2378    else if (name.equals("eligibility"))
2379      this.eligibility = castToCodeableConcept(value); // CodeableConcept
2380    else if (name.equals("eligibilityNote"))
2381      this.eligibilityNote = castToString(value); // StringType
2382    else if (name.equals("programName"))
2383      this.getProgramName().add(castToString(value));
2384    else if (name.equals("characteristic"))
2385      this.getCharacteristic().add(castToCodeableConcept(value));
2386    else if (name.equals("referralMethod"))
2387      this.getReferralMethod().add(castToCodeableConcept(value));
2388    else if (name.equals("publicKey"))
2389      this.publicKey = castToString(value); // StringType
2390    else if (name.equals("appointmentRequired"))
2391      this.appointmentRequired = castToBoolean(value); // BooleanType
2392    else if (name.equals("availableTime"))
2393      this.getAvailableTime().add((HealthcareServiceAvailableTimeComponent) value);
2394    else if (name.equals("notAvailable"))
2395      this.getNotAvailable().add((HealthcareServiceNotAvailableComponent) value);
2396    else if (name.equals("availabilityExceptions"))
2397      this.availabilityExceptions = castToString(value); // StringType
2398    else
2399      super.setProperty(name, value);
2400  }
2401
2402  @Override
2403  public Base addChild(String name) throws FHIRException {
2404    if (name.equals("identifier")) {
2405      return addIdentifier();
2406    } else if (name.equals("providedBy")) {
2407      this.providedBy = new Reference();
2408      return this.providedBy;
2409    } else if (name.equals("serviceCategory")) {
2410      this.serviceCategory = new CodeableConcept();
2411      return this.serviceCategory;
2412    } else if (name.equals("serviceType")) {
2413      return addServiceType();
2414    } else if (name.equals("location")) {
2415      this.location = new Reference();
2416      return this.location;
2417    } else if (name.equals("serviceName")) {
2418      throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.serviceName");
2419    } else if (name.equals("comment")) {
2420      throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.comment");
2421    } else if (name.equals("extraDetails")) {
2422      throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.extraDetails");
2423    } else if (name.equals("photo")) {
2424      this.photo = new Attachment();
2425      return this.photo;
2426    } else if (name.equals("telecom")) {
2427      return addTelecom();
2428    } else if (name.equals("coverageArea")) {
2429      return addCoverageArea();
2430    } else if (name.equals("serviceProvisionCode")) {
2431      return addServiceProvisionCode();
2432    } else if (name.equals("eligibility")) {
2433      this.eligibility = new CodeableConcept();
2434      return this.eligibility;
2435    } else if (name.equals("eligibilityNote")) {
2436      throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.eligibilityNote");
2437    } else if (name.equals("programName")) {
2438      throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.programName");
2439    } else if (name.equals("characteristic")) {
2440      return addCharacteristic();
2441    } else if (name.equals("referralMethod")) {
2442      return addReferralMethod();
2443    } else if (name.equals("publicKey")) {
2444      throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.publicKey");
2445    } else if (name.equals("appointmentRequired")) {
2446      throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.appointmentRequired");
2447    } else if (name.equals("availableTime")) {
2448      return addAvailableTime();
2449    } else if (name.equals("notAvailable")) {
2450      return addNotAvailable();
2451    } else if (name.equals("availabilityExceptions")) {
2452      throw new FHIRException("Cannot call addChild on a singleton property HealthcareService.availabilityExceptions");
2453    } else
2454      return super.addChild(name);
2455  }
2456
2457  public String fhirType() {
2458    return "HealthcareService";
2459
2460  }
2461
2462  public HealthcareService copy() {
2463    HealthcareService dst = new HealthcareService();
2464    copyValues(dst);
2465    if (identifier != null) {
2466      dst.identifier = new ArrayList<Identifier>();
2467      for (Identifier i : identifier)
2468        dst.identifier.add(i.copy());
2469    }
2470    ;
2471    dst.providedBy = providedBy == null ? null : providedBy.copy();
2472    dst.serviceCategory = serviceCategory == null ? null : serviceCategory.copy();
2473    if (serviceType != null) {
2474      dst.serviceType = new ArrayList<ServiceTypeComponent>();
2475      for (ServiceTypeComponent i : serviceType)
2476        dst.serviceType.add(i.copy());
2477    }
2478    ;
2479    dst.location = location == null ? null : location.copy();
2480    dst.serviceName = serviceName == null ? null : serviceName.copy();
2481    dst.comment = comment == null ? null : comment.copy();
2482    dst.extraDetails = extraDetails == null ? null : extraDetails.copy();
2483    dst.photo = photo == null ? null : photo.copy();
2484    if (telecom != null) {
2485      dst.telecom = new ArrayList<ContactPoint>();
2486      for (ContactPoint i : telecom)
2487        dst.telecom.add(i.copy());
2488    }
2489    ;
2490    if (coverageArea != null) {
2491      dst.coverageArea = new ArrayList<Reference>();
2492      for (Reference i : coverageArea)
2493        dst.coverageArea.add(i.copy());
2494    }
2495    ;
2496    if (serviceProvisionCode != null) {
2497      dst.serviceProvisionCode = new ArrayList<CodeableConcept>();
2498      for (CodeableConcept i : serviceProvisionCode)
2499        dst.serviceProvisionCode.add(i.copy());
2500    }
2501    ;
2502    dst.eligibility = eligibility == null ? null : eligibility.copy();
2503    dst.eligibilityNote = eligibilityNote == null ? null : eligibilityNote.copy();
2504    if (programName != null) {
2505      dst.programName = new ArrayList<StringType>();
2506      for (StringType i : programName)
2507        dst.programName.add(i.copy());
2508    }
2509    ;
2510    if (characteristic != null) {
2511      dst.characteristic = new ArrayList<CodeableConcept>();
2512      for (CodeableConcept i : characteristic)
2513        dst.characteristic.add(i.copy());
2514    }
2515    ;
2516    if (referralMethod != null) {
2517      dst.referralMethod = new ArrayList<CodeableConcept>();
2518      for (CodeableConcept i : referralMethod)
2519        dst.referralMethod.add(i.copy());
2520    }
2521    ;
2522    dst.publicKey = publicKey == null ? null : publicKey.copy();
2523    dst.appointmentRequired = appointmentRequired == null ? null : appointmentRequired.copy();
2524    if (availableTime != null) {
2525      dst.availableTime = new ArrayList<HealthcareServiceAvailableTimeComponent>();
2526      for (HealthcareServiceAvailableTimeComponent i : availableTime)
2527        dst.availableTime.add(i.copy());
2528    }
2529    ;
2530    if (notAvailable != null) {
2531      dst.notAvailable = new ArrayList<HealthcareServiceNotAvailableComponent>();
2532      for (HealthcareServiceNotAvailableComponent i : notAvailable)
2533        dst.notAvailable.add(i.copy());
2534    }
2535    ;
2536    dst.availabilityExceptions = availabilityExceptions == null ? null : availabilityExceptions.copy();
2537    return dst;
2538  }
2539
2540  protected HealthcareService typedCopy() {
2541    return copy();
2542  }
2543
2544  @Override
2545  public boolean equalsDeep(Base other) {
2546    if (!super.equalsDeep(other))
2547      return false;
2548    if (!(other instanceof HealthcareService))
2549      return false;
2550    HealthcareService o = (HealthcareService) other;
2551    return compareDeep(identifier, o.identifier, true) && compareDeep(providedBy, o.providedBy, true)
2552        && compareDeep(serviceCategory, o.serviceCategory, true) && compareDeep(serviceType, o.serviceType, true)
2553        && compareDeep(location, o.location, true) && compareDeep(serviceName, o.serviceName, true)
2554        && compareDeep(comment, o.comment, true) && compareDeep(extraDetails, o.extraDetails, true)
2555        && compareDeep(photo, o.photo, true) && compareDeep(telecom, o.telecom, true)
2556        && compareDeep(coverageArea, o.coverageArea, true)
2557        && compareDeep(serviceProvisionCode, o.serviceProvisionCode, true)
2558        && compareDeep(eligibility, o.eligibility, true) && compareDeep(eligibilityNote, o.eligibilityNote, true)
2559        && compareDeep(programName, o.programName, true) && compareDeep(characteristic, o.characteristic, true)
2560        && compareDeep(referralMethod, o.referralMethod, true) && compareDeep(publicKey, o.publicKey, true)
2561        && compareDeep(appointmentRequired, o.appointmentRequired, true)
2562        && compareDeep(availableTime, o.availableTime, true) && compareDeep(notAvailable, o.notAvailable, true)
2563        && compareDeep(availabilityExceptions, o.availabilityExceptions, true);
2564  }
2565
2566  @Override
2567  public boolean equalsShallow(Base other) {
2568    if (!super.equalsShallow(other))
2569      return false;
2570    if (!(other instanceof HealthcareService))
2571      return false;
2572    HealthcareService o = (HealthcareService) other;
2573    return compareValues(serviceName, o.serviceName, true) && compareValues(comment, o.comment, true)
2574        && compareValues(extraDetails, o.extraDetails, true) && compareValues(eligibilityNote, o.eligibilityNote, true)
2575        && compareValues(programName, o.programName, true) && compareValues(publicKey, o.publicKey, true)
2576        && compareValues(appointmentRequired, o.appointmentRequired, true)
2577        && compareValues(availabilityExceptions, o.availabilityExceptions, true);
2578  }
2579
2580  public boolean isEmpty() {
2581    return super.isEmpty() && (identifier == null || identifier.isEmpty())
2582        && (providedBy == null || providedBy.isEmpty()) && (serviceCategory == null || serviceCategory.isEmpty())
2583        && (serviceType == null || serviceType.isEmpty()) && (location == null || location.isEmpty())
2584        && (serviceName == null || serviceName.isEmpty()) && (comment == null || comment.isEmpty())
2585        && (extraDetails == null || extraDetails.isEmpty()) && (photo == null || photo.isEmpty())
2586        && (telecom == null || telecom.isEmpty()) && (coverageArea == null || coverageArea.isEmpty())
2587        && (serviceProvisionCode == null || serviceProvisionCode.isEmpty())
2588        && (eligibility == null || eligibility.isEmpty()) && (eligibilityNote == null || eligibilityNote.isEmpty())
2589        && (programName == null || programName.isEmpty()) && (characteristic == null || characteristic.isEmpty())
2590        && (referralMethod == null || referralMethod.isEmpty()) && (publicKey == null || publicKey.isEmpty())
2591        && (appointmentRequired == null || appointmentRequired.isEmpty())
2592        && (availableTime == null || availableTime.isEmpty()) && (notAvailable == null || notAvailable.isEmpty())
2593        && (availabilityExceptions == null || availabilityExceptions.isEmpty());
2594  }
2595
2596  @Override
2597  public ResourceType getResourceType() {
2598    return ResourceType.HealthcareService;
2599  }
2600
2601  @SearchParamDefinition(name = "identifier", path = "HealthcareService.identifier", description = "External identifiers for this item", type = "token")
2602  public static final String SP_IDENTIFIER = "identifier";
2603  @SearchParamDefinition(name = "servicecategory", path = "HealthcareService.serviceCategory", description = "Service Category of the Healthcare Service", type = "token")
2604  public static final String SP_SERVICECATEGORY = "servicecategory";
2605  @SearchParamDefinition(name = "servicetype", path = "HealthcareService.serviceType.type", description = "The type of service provided by this healthcare service", type = "token")
2606  public static final String SP_SERVICETYPE = "servicetype";
2607  @SearchParamDefinition(name = "organization", path = "HealthcareService.providedBy", description = "The organization that provides this Healthcare Service", type = "reference")
2608  public static final String SP_ORGANIZATION = "organization";
2609  @SearchParamDefinition(name = "name", path = "HealthcareService.serviceName", description = "A portion of the Healthcare service name", type = "string")
2610  public static final String SP_NAME = "name";
2611  @SearchParamDefinition(name = "programname", path = "HealthcareService.programName", description = "One of the Program Names serviced by this HealthcareService", type = "string")
2612  public static final String SP_PROGRAMNAME = "programname";
2613  @SearchParamDefinition(name = "location", path = "HealthcareService.location", description = "The location of the Healthcare Service", type = "reference")
2614  public static final String SP_LOCATION = "location";
2615  @SearchParamDefinition(name = "characteristic", path = "HealthcareService.characteristic", description = "One of the HealthcareService's characteristics", type = "token")
2616  public static final String SP_CHARACTERISTIC = "characteristic";
2617
2618}