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