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