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 Tue, Dec 28, 2021 07:16+1100 for FHIR v5.0.0-snapshot1
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) e.g. 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? e.g. 24 hour service", formalDefinition="Is this always available? (hence times are irrelevant) e.g. 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) e.g. 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) e.g. 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) e.g. 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) e.g. 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) e.g. 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) e.g. 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     * List of contacts related to this specific healthcare service.
999     */
1000    @Child(name = "telecom", type = {ContactPoint.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1001    @Description(shortDefinition="Contacts related to the healthcare service", formalDefinition="List of contacts related to this specific healthcare service." )
1002    protected List<ContactPoint> telecom;
1003
1004    /**
1005     * The location(s) that this service is available to (not where the service is provided).
1006     */
1007    @Child(name = "coverageArea", type = {Location.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1008    @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)." )
1009    protected List<Reference> coverageArea;
1010
1011    /**
1012     * The code(s) that detail the conditions under which the healthcare service is available/offered.
1013     */
1014    @Child(name = "serviceProvisionCode", type = {CodeableConcept.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1015    @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." )
1016    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-provision-conditions")
1017    protected List<CodeableConcept> serviceProvisionCode;
1018
1019    /**
1020     * Does this service have specific eligibility requirements that need to be met in order to use the service?
1021     */
1022    @Child(name = "eligibility", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1023    @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?" )
1024    protected List<HealthcareServiceEligibilityComponent> eligibility;
1025
1026    /**
1027     * Programs that this service is applicable to.
1028     */
1029    @Child(name = "program", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1030    @Description(shortDefinition="Programs that this service is applicable to", formalDefinition="Programs that this service is applicable to." )
1031    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/program")
1032    protected List<CodeableConcept> program;
1033
1034    /**
1035     * Collection of characteristics (attributes).
1036     */
1037    @Child(name = "characteristic", type = {CodeableConcept.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1038    @Description(shortDefinition="Collection of characteristics (attributes)", formalDefinition="Collection of characteristics (attributes)." )
1039    protected List<CodeableConcept> characteristic;
1040
1041    /**
1042     * 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.
1043     */
1044    @Child(name = "communication", type = {CodeableConcept.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1045    @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." )
1046    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages")
1047    protected List<CodeableConcept> communication;
1048
1049    /**
1050     * Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.
1051     */
1052    @Child(name = "referralMethod", type = {CodeableConcept.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1053    @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." )
1054    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-referral-method")
1055    protected List<CodeableConcept> referralMethod;
1056
1057    /**
1058     * 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.
1059     */
1060    @Child(name = "appointmentRequired", type = {BooleanType.class}, order=19, min=0, max=1, modifier=false, summary=false)
1061    @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." )
1062    protected BooleanType appointmentRequired;
1063
1064    /**
1065     * A collection of times that the Service Site is available.
1066     */
1067    @Child(name = "availableTime", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1068    @Description(shortDefinition="Times the Service Site is available", formalDefinition="A collection of times that the Service Site is available." )
1069    protected List<HealthcareServiceAvailableTimeComponent> availableTime;
1070
1071    /**
1072     * The HealthcareService is not available during this period of time due to the provided reason.
1073     */
1074    @Child(name = "notAvailable", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1075    @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." )
1076    protected List<HealthcareServiceNotAvailableComponent> notAvailable;
1077
1078    /**
1079     * 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.
1080     */
1081    @Child(name = "availabilityExceptions", type = {StringType.class}, order=22, min=0, max=1, modifier=false, summary=false)
1082    @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." )
1083    protected StringType availabilityExceptions;
1084
1085    /**
1086     * Technical endpoints providing access to services operated for the specific healthcare services defined at this resource.
1087     */
1088    @Child(name = "endpoint", type = {Endpoint.class}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1089    @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." )
1090    protected List<Reference> endpoint;
1091
1092    private static final long serialVersionUID = 25501899L;
1093
1094  /**
1095   * Constructor
1096   */
1097    public HealthcareService() {
1098      super();
1099    }
1100
1101    /**
1102     * @return {@link #identifier} (External identifiers for this item.)
1103     */
1104    public List<Identifier> getIdentifier() { 
1105      if (this.identifier == null)
1106        this.identifier = new ArrayList<Identifier>();
1107      return this.identifier;
1108    }
1109
1110    /**
1111     * @return Returns a reference to <code>this</code> for easy method chaining
1112     */
1113    public HealthcareService setIdentifier(List<Identifier> theIdentifier) { 
1114      this.identifier = theIdentifier;
1115      return this;
1116    }
1117
1118    public boolean hasIdentifier() { 
1119      if (this.identifier == null)
1120        return false;
1121      for (Identifier item : this.identifier)
1122        if (!item.isEmpty())
1123          return true;
1124      return false;
1125    }
1126
1127    public Identifier addIdentifier() { //3
1128      Identifier t = new Identifier();
1129      if (this.identifier == null)
1130        this.identifier = new ArrayList<Identifier>();
1131      this.identifier.add(t);
1132      return t;
1133    }
1134
1135    public HealthcareService addIdentifier(Identifier t) { //3
1136      if (t == null)
1137        return this;
1138      if (this.identifier == null)
1139        this.identifier = new ArrayList<Identifier>();
1140      this.identifier.add(t);
1141      return this;
1142    }
1143
1144    /**
1145     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1146     */
1147    public Identifier getIdentifierFirstRep() { 
1148      if (getIdentifier().isEmpty()) {
1149        addIdentifier();
1150      }
1151      return getIdentifier().get(0);
1152    }
1153
1154    /**
1155     * @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
1156     */
1157    public BooleanType getActiveElement() { 
1158      if (this.active == null)
1159        if (Configuration.errorOnAutoCreate())
1160          throw new Error("Attempt to auto-create HealthcareService.active");
1161        else if (Configuration.doAutoCreate())
1162          this.active = new BooleanType(); // bb
1163      return this.active;
1164    }
1165
1166    public boolean hasActiveElement() { 
1167      return this.active != null && !this.active.isEmpty();
1168    }
1169
1170    public boolean hasActive() { 
1171      return this.active != null && !this.active.isEmpty();
1172    }
1173
1174    /**
1175     * @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
1176     */
1177    public HealthcareService setActiveElement(BooleanType value) { 
1178      this.active = value;
1179      return this;
1180    }
1181
1182    /**
1183     * @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.
1184     */
1185    public boolean getActive() { 
1186      return this.active == null || this.active.isEmpty() ? false : this.active.getValue();
1187    }
1188
1189    /**
1190     * @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.
1191     */
1192    public HealthcareService setActive(boolean value) { 
1193        if (this.active == null)
1194          this.active = new BooleanType();
1195        this.active.setValue(value);
1196      return this;
1197    }
1198
1199    /**
1200     * @return {@link #providedBy} (The organization that provides this healthcare service.)
1201     */
1202    public Reference getProvidedBy() { 
1203      if (this.providedBy == null)
1204        if (Configuration.errorOnAutoCreate())
1205          throw new Error("Attempt to auto-create HealthcareService.providedBy");
1206        else if (Configuration.doAutoCreate())
1207          this.providedBy = new Reference(); // cc
1208      return this.providedBy;
1209    }
1210
1211    public boolean hasProvidedBy() { 
1212      return this.providedBy != null && !this.providedBy.isEmpty();
1213    }
1214
1215    /**
1216     * @param value {@link #providedBy} (The organization that provides this healthcare service.)
1217     */
1218    public HealthcareService setProvidedBy(Reference value) { 
1219      this.providedBy = value;
1220      return this;
1221    }
1222
1223    /**
1224     * @return {@link #category} (Identifies the broad category of service being performed or delivered.)
1225     */
1226    public List<CodeableConcept> getCategory() { 
1227      if (this.category == null)
1228        this.category = new ArrayList<CodeableConcept>();
1229      return this.category;
1230    }
1231
1232    /**
1233     * @return Returns a reference to <code>this</code> for easy method chaining
1234     */
1235    public HealthcareService setCategory(List<CodeableConcept> theCategory) { 
1236      this.category = theCategory;
1237      return this;
1238    }
1239
1240    public boolean hasCategory() { 
1241      if (this.category == null)
1242        return false;
1243      for (CodeableConcept item : this.category)
1244        if (!item.isEmpty())
1245          return true;
1246      return false;
1247    }
1248
1249    public CodeableConcept addCategory() { //3
1250      CodeableConcept t = new CodeableConcept();
1251      if (this.category == null)
1252        this.category = new ArrayList<CodeableConcept>();
1253      this.category.add(t);
1254      return t;
1255    }
1256
1257    public HealthcareService addCategory(CodeableConcept t) { //3
1258      if (t == null)
1259        return this;
1260      if (this.category == null)
1261        this.category = new ArrayList<CodeableConcept>();
1262      this.category.add(t);
1263      return this;
1264    }
1265
1266    /**
1267     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist {3}
1268     */
1269    public CodeableConcept getCategoryFirstRep() { 
1270      if (getCategory().isEmpty()) {
1271        addCategory();
1272      }
1273      return getCategory().get(0);
1274    }
1275
1276    /**
1277     * @return {@link #type} (The specific type of service that may be delivered or performed.)
1278     */
1279    public List<CodeableConcept> getType() { 
1280      if (this.type == null)
1281        this.type = new ArrayList<CodeableConcept>();
1282      return this.type;
1283    }
1284
1285    /**
1286     * @return Returns a reference to <code>this</code> for easy method chaining
1287     */
1288    public HealthcareService setType(List<CodeableConcept> theType) { 
1289      this.type = theType;
1290      return this;
1291    }
1292
1293    public boolean hasType() { 
1294      if (this.type == null)
1295        return false;
1296      for (CodeableConcept item : this.type)
1297        if (!item.isEmpty())
1298          return true;
1299      return false;
1300    }
1301
1302    public CodeableConcept addType() { //3
1303      CodeableConcept t = new CodeableConcept();
1304      if (this.type == null)
1305        this.type = new ArrayList<CodeableConcept>();
1306      this.type.add(t);
1307      return t;
1308    }
1309
1310    public HealthcareService addType(CodeableConcept t) { //3
1311      if (t == null)
1312        return this;
1313      if (this.type == null)
1314        this.type = new ArrayList<CodeableConcept>();
1315      this.type.add(t);
1316      return this;
1317    }
1318
1319    /**
1320     * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist {3}
1321     */
1322    public CodeableConcept getTypeFirstRep() { 
1323      if (getType().isEmpty()) {
1324        addType();
1325      }
1326      return getType().get(0);
1327    }
1328
1329    /**
1330     * @return {@link #specialty} (Collection of specialties handled by the service site. This is more of a medical term.)
1331     */
1332    public List<CodeableConcept> getSpecialty() { 
1333      if (this.specialty == null)
1334        this.specialty = new ArrayList<CodeableConcept>();
1335      return this.specialty;
1336    }
1337
1338    /**
1339     * @return Returns a reference to <code>this</code> for easy method chaining
1340     */
1341    public HealthcareService setSpecialty(List<CodeableConcept> theSpecialty) { 
1342      this.specialty = theSpecialty;
1343      return this;
1344    }
1345
1346    public boolean hasSpecialty() { 
1347      if (this.specialty == null)
1348        return false;
1349      for (CodeableConcept item : this.specialty)
1350        if (!item.isEmpty())
1351          return true;
1352      return false;
1353    }
1354
1355    public CodeableConcept addSpecialty() { //3
1356      CodeableConcept t = new CodeableConcept();
1357      if (this.specialty == null)
1358        this.specialty = new ArrayList<CodeableConcept>();
1359      this.specialty.add(t);
1360      return t;
1361    }
1362
1363    public HealthcareService addSpecialty(CodeableConcept t) { //3
1364      if (t == null)
1365        return this;
1366      if (this.specialty == null)
1367        this.specialty = new ArrayList<CodeableConcept>();
1368      this.specialty.add(t);
1369      return this;
1370    }
1371
1372    /**
1373     * @return The first repetition of repeating field {@link #specialty}, creating it if it does not already exist {3}
1374     */
1375    public CodeableConcept getSpecialtyFirstRep() { 
1376      if (getSpecialty().isEmpty()) {
1377        addSpecialty();
1378      }
1379      return getSpecialty().get(0);
1380    }
1381
1382    /**
1383     * @return {@link #location} (The location(s) where this healthcare service may be provided.)
1384     */
1385    public List<Reference> getLocation() { 
1386      if (this.location == null)
1387        this.location = new ArrayList<Reference>();
1388      return this.location;
1389    }
1390
1391    /**
1392     * @return Returns a reference to <code>this</code> for easy method chaining
1393     */
1394    public HealthcareService setLocation(List<Reference> theLocation) { 
1395      this.location = theLocation;
1396      return this;
1397    }
1398
1399    public boolean hasLocation() { 
1400      if (this.location == null)
1401        return false;
1402      for (Reference item : this.location)
1403        if (!item.isEmpty())
1404          return true;
1405      return false;
1406    }
1407
1408    public Reference addLocation() { //3
1409      Reference t = new Reference();
1410      if (this.location == null)
1411        this.location = new ArrayList<Reference>();
1412      this.location.add(t);
1413      return t;
1414    }
1415
1416    public HealthcareService addLocation(Reference t) { //3
1417      if (t == null)
1418        return this;
1419      if (this.location == null)
1420        this.location = new ArrayList<Reference>();
1421      this.location.add(t);
1422      return this;
1423    }
1424
1425    /**
1426     * @return The first repetition of repeating field {@link #location}, creating it if it does not already exist {3}
1427     */
1428    public Reference getLocationFirstRep() { 
1429      if (getLocation().isEmpty()) {
1430        addLocation();
1431      }
1432      return getLocation().get(0);
1433    }
1434
1435    /**
1436     * @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
1437     */
1438    public StringType getNameElement() { 
1439      if (this.name == null)
1440        if (Configuration.errorOnAutoCreate())
1441          throw new Error("Attempt to auto-create HealthcareService.name");
1442        else if (Configuration.doAutoCreate())
1443          this.name = new StringType(); // bb
1444      return this.name;
1445    }
1446
1447    public boolean hasNameElement() { 
1448      return this.name != null && !this.name.isEmpty();
1449    }
1450
1451    public boolean hasName() { 
1452      return this.name != null && !this.name.isEmpty();
1453    }
1454
1455    /**
1456     * @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
1457     */
1458    public HealthcareService setNameElement(StringType value) { 
1459      this.name = value;
1460      return this;
1461    }
1462
1463    /**
1464     * @return Further description of the service as it would be presented to a consumer while searching.
1465     */
1466    public String getName() { 
1467      return this.name == null ? null : this.name.getValue();
1468    }
1469
1470    /**
1471     * @param value Further description of the service as it would be presented to a consumer while searching.
1472     */
1473    public HealthcareService setName(String value) { 
1474      if (Utilities.noString(value))
1475        this.name = null;
1476      else {
1477        if (this.name == null)
1478          this.name = new StringType();
1479        this.name.setValue(value);
1480      }
1481      return this;
1482    }
1483
1484    /**
1485     * @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
1486     */
1487    public StringType getCommentElement() { 
1488      if (this.comment == null)
1489        if (Configuration.errorOnAutoCreate())
1490          throw new Error("Attempt to auto-create HealthcareService.comment");
1491        else if (Configuration.doAutoCreate())
1492          this.comment = new StringType(); // bb
1493      return this.comment;
1494    }
1495
1496    public boolean hasCommentElement() { 
1497      return this.comment != null && !this.comment.isEmpty();
1498    }
1499
1500    public boolean hasComment() { 
1501      return this.comment != null && !this.comment.isEmpty();
1502    }
1503
1504    /**
1505     * @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
1506     */
1507    public HealthcareService setCommentElement(StringType value) { 
1508      this.comment = value;
1509      return this;
1510    }
1511
1512    /**
1513     * @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.
1514     */
1515    public String getComment() { 
1516      return this.comment == null ? null : this.comment.getValue();
1517    }
1518
1519    /**
1520     * @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.
1521     */
1522    public HealthcareService setComment(String value) { 
1523      if (Utilities.noString(value))
1524        this.comment = null;
1525      else {
1526        if (this.comment == null)
1527          this.comment = new StringType();
1528        this.comment.setValue(value);
1529      }
1530      return this;
1531    }
1532
1533    /**
1534     * @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
1535     */
1536    public MarkdownType getExtraDetailsElement() { 
1537      if (this.extraDetails == null)
1538        if (Configuration.errorOnAutoCreate())
1539          throw new Error("Attempt to auto-create HealthcareService.extraDetails");
1540        else if (Configuration.doAutoCreate())
1541          this.extraDetails = new MarkdownType(); // bb
1542      return this.extraDetails;
1543    }
1544
1545    public boolean hasExtraDetailsElement() { 
1546      return this.extraDetails != null && !this.extraDetails.isEmpty();
1547    }
1548
1549    public boolean hasExtraDetails() { 
1550      return this.extraDetails != null && !this.extraDetails.isEmpty();
1551    }
1552
1553    /**
1554     * @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
1555     */
1556    public HealthcareService setExtraDetailsElement(MarkdownType value) { 
1557      this.extraDetails = value;
1558      return this;
1559    }
1560
1561    /**
1562     * @return Extra details about the service that can't be placed in the other fields.
1563     */
1564    public String getExtraDetails() { 
1565      return this.extraDetails == null ? null : this.extraDetails.getValue();
1566    }
1567
1568    /**
1569     * @param value Extra details about the service that can't be placed in the other fields.
1570     */
1571    public HealthcareService setExtraDetails(String value) { 
1572      if (value == null)
1573        this.extraDetails = null;
1574      else {
1575        if (this.extraDetails == null)
1576          this.extraDetails = new MarkdownType();
1577        this.extraDetails.setValue(value);
1578      }
1579      return this;
1580    }
1581
1582    /**
1583     * @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.)
1584     */
1585    public Attachment getPhoto() { 
1586      if (this.photo == null)
1587        if (Configuration.errorOnAutoCreate())
1588          throw new Error("Attempt to auto-create HealthcareService.photo");
1589        else if (Configuration.doAutoCreate())
1590          this.photo = new Attachment(); // cc
1591      return this.photo;
1592    }
1593
1594    public boolean hasPhoto() { 
1595      return this.photo != null && !this.photo.isEmpty();
1596    }
1597
1598    /**
1599     * @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.)
1600     */
1601    public HealthcareService setPhoto(Attachment value) { 
1602      this.photo = value;
1603      return this;
1604    }
1605
1606    /**
1607     * @return {@link #telecom} (List of contacts related to this specific healthcare service.)
1608     */
1609    public List<ContactPoint> getTelecom() { 
1610      if (this.telecom == null)
1611        this.telecom = new ArrayList<ContactPoint>();
1612      return this.telecom;
1613    }
1614
1615    /**
1616     * @return Returns a reference to <code>this</code> for easy method chaining
1617     */
1618    public HealthcareService setTelecom(List<ContactPoint> theTelecom) { 
1619      this.telecom = theTelecom;
1620      return this;
1621    }
1622
1623    public boolean hasTelecom() { 
1624      if (this.telecom == null)
1625        return false;
1626      for (ContactPoint item : this.telecom)
1627        if (!item.isEmpty())
1628          return true;
1629      return false;
1630    }
1631
1632    public ContactPoint addTelecom() { //3
1633      ContactPoint t = new ContactPoint();
1634      if (this.telecom == null)
1635        this.telecom = new ArrayList<ContactPoint>();
1636      this.telecom.add(t);
1637      return t;
1638    }
1639
1640    public HealthcareService addTelecom(ContactPoint t) { //3
1641      if (t == null)
1642        return this;
1643      if (this.telecom == null)
1644        this.telecom = new ArrayList<ContactPoint>();
1645      this.telecom.add(t);
1646      return this;
1647    }
1648
1649    /**
1650     * @return The first repetition of repeating field {@link #telecom}, creating it if it does not already exist {3}
1651     */
1652    public ContactPoint getTelecomFirstRep() { 
1653      if (getTelecom().isEmpty()) {
1654        addTelecom();
1655      }
1656      return getTelecom().get(0);
1657    }
1658
1659    /**
1660     * @return {@link #coverageArea} (The location(s) that this service is available to (not where the service is provided).)
1661     */
1662    public List<Reference> getCoverageArea() { 
1663      if (this.coverageArea == null)
1664        this.coverageArea = new ArrayList<Reference>();
1665      return this.coverageArea;
1666    }
1667
1668    /**
1669     * @return Returns a reference to <code>this</code> for easy method chaining
1670     */
1671    public HealthcareService setCoverageArea(List<Reference> theCoverageArea) { 
1672      this.coverageArea = theCoverageArea;
1673      return this;
1674    }
1675
1676    public boolean hasCoverageArea() { 
1677      if (this.coverageArea == null)
1678        return false;
1679      for (Reference item : this.coverageArea)
1680        if (!item.isEmpty())
1681          return true;
1682      return false;
1683    }
1684
1685    public Reference addCoverageArea() { //3
1686      Reference t = new Reference();
1687      if (this.coverageArea == null)
1688        this.coverageArea = new ArrayList<Reference>();
1689      this.coverageArea.add(t);
1690      return t;
1691    }
1692
1693    public HealthcareService addCoverageArea(Reference t) { //3
1694      if (t == null)
1695        return this;
1696      if (this.coverageArea == null)
1697        this.coverageArea = new ArrayList<Reference>();
1698      this.coverageArea.add(t);
1699      return this;
1700    }
1701
1702    /**
1703     * @return The first repetition of repeating field {@link #coverageArea}, creating it if it does not already exist {3}
1704     */
1705    public Reference getCoverageAreaFirstRep() { 
1706      if (getCoverageArea().isEmpty()) {
1707        addCoverageArea();
1708      }
1709      return getCoverageArea().get(0);
1710    }
1711
1712    /**
1713     * @return {@link #serviceProvisionCode} (The code(s) that detail the conditions under which the healthcare service is available/offered.)
1714     */
1715    public List<CodeableConcept> getServiceProvisionCode() { 
1716      if (this.serviceProvisionCode == null)
1717        this.serviceProvisionCode = new ArrayList<CodeableConcept>();
1718      return this.serviceProvisionCode;
1719    }
1720
1721    /**
1722     * @return Returns a reference to <code>this</code> for easy method chaining
1723     */
1724    public HealthcareService setServiceProvisionCode(List<CodeableConcept> theServiceProvisionCode) { 
1725      this.serviceProvisionCode = theServiceProvisionCode;
1726      return this;
1727    }
1728
1729    public boolean hasServiceProvisionCode() { 
1730      if (this.serviceProvisionCode == null)
1731        return false;
1732      for (CodeableConcept item : this.serviceProvisionCode)
1733        if (!item.isEmpty())
1734          return true;
1735      return false;
1736    }
1737
1738    public CodeableConcept addServiceProvisionCode() { //3
1739      CodeableConcept t = new CodeableConcept();
1740      if (this.serviceProvisionCode == null)
1741        this.serviceProvisionCode = new ArrayList<CodeableConcept>();
1742      this.serviceProvisionCode.add(t);
1743      return t;
1744    }
1745
1746    public HealthcareService addServiceProvisionCode(CodeableConcept t) { //3
1747      if (t == null)
1748        return this;
1749      if (this.serviceProvisionCode == null)
1750        this.serviceProvisionCode = new ArrayList<CodeableConcept>();
1751      this.serviceProvisionCode.add(t);
1752      return this;
1753    }
1754
1755    /**
1756     * @return The first repetition of repeating field {@link #serviceProvisionCode}, creating it if it does not already exist {3}
1757     */
1758    public CodeableConcept getServiceProvisionCodeFirstRep() { 
1759      if (getServiceProvisionCode().isEmpty()) {
1760        addServiceProvisionCode();
1761      }
1762      return getServiceProvisionCode().get(0);
1763    }
1764
1765    /**
1766     * @return {@link #eligibility} (Does this service have specific eligibility requirements that need to be met in order to use the service?)
1767     */
1768    public List<HealthcareServiceEligibilityComponent> getEligibility() { 
1769      if (this.eligibility == null)
1770        this.eligibility = new ArrayList<HealthcareServiceEligibilityComponent>();
1771      return this.eligibility;
1772    }
1773
1774    /**
1775     * @return Returns a reference to <code>this</code> for easy method chaining
1776     */
1777    public HealthcareService setEligibility(List<HealthcareServiceEligibilityComponent> theEligibility) { 
1778      this.eligibility = theEligibility;
1779      return this;
1780    }
1781
1782    public boolean hasEligibility() { 
1783      if (this.eligibility == null)
1784        return false;
1785      for (HealthcareServiceEligibilityComponent item : this.eligibility)
1786        if (!item.isEmpty())
1787          return true;
1788      return false;
1789    }
1790
1791    public HealthcareServiceEligibilityComponent addEligibility() { //3
1792      HealthcareServiceEligibilityComponent t = new HealthcareServiceEligibilityComponent();
1793      if (this.eligibility == null)
1794        this.eligibility = new ArrayList<HealthcareServiceEligibilityComponent>();
1795      this.eligibility.add(t);
1796      return t;
1797    }
1798
1799    public HealthcareService addEligibility(HealthcareServiceEligibilityComponent t) { //3
1800      if (t == null)
1801        return this;
1802      if (this.eligibility == null)
1803        this.eligibility = new ArrayList<HealthcareServiceEligibilityComponent>();
1804      this.eligibility.add(t);
1805      return this;
1806    }
1807
1808    /**
1809     * @return The first repetition of repeating field {@link #eligibility}, creating it if it does not already exist {3}
1810     */
1811    public HealthcareServiceEligibilityComponent getEligibilityFirstRep() { 
1812      if (getEligibility().isEmpty()) {
1813        addEligibility();
1814      }
1815      return getEligibility().get(0);
1816    }
1817
1818    /**
1819     * @return {@link #program} (Programs that this service is applicable to.)
1820     */
1821    public List<CodeableConcept> getProgram() { 
1822      if (this.program == null)
1823        this.program = new ArrayList<CodeableConcept>();
1824      return this.program;
1825    }
1826
1827    /**
1828     * @return Returns a reference to <code>this</code> for easy method chaining
1829     */
1830    public HealthcareService setProgram(List<CodeableConcept> theProgram) { 
1831      this.program = theProgram;
1832      return this;
1833    }
1834
1835    public boolean hasProgram() { 
1836      if (this.program == null)
1837        return false;
1838      for (CodeableConcept item : this.program)
1839        if (!item.isEmpty())
1840          return true;
1841      return false;
1842    }
1843
1844    public CodeableConcept addProgram() { //3
1845      CodeableConcept t = new CodeableConcept();
1846      if (this.program == null)
1847        this.program = new ArrayList<CodeableConcept>();
1848      this.program.add(t);
1849      return t;
1850    }
1851
1852    public HealthcareService addProgram(CodeableConcept t) { //3
1853      if (t == null)
1854        return this;
1855      if (this.program == null)
1856        this.program = new ArrayList<CodeableConcept>();
1857      this.program.add(t);
1858      return this;
1859    }
1860
1861    /**
1862     * @return The first repetition of repeating field {@link #program}, creating it if it does not already exist {3}
1863     */
1864    public CodeableConcept getProgramFirstRep() { 
1865      if (getProgram().isEmpty()) {
1866        addProgram();
1867      }
1868      return getProgram().get(0);
1869    }
1870
1871    /**
1872     * @return {@link #characteristic} (Collection of characteristics (attributes).)
1873     */
1874    public List<CodeableConcept> getCharacteristic() { 
1875      if (this.characteristic == null)
1876        this.characteristic = new ArrayList<CodeableConcept>();
1877      return this.characteristic;
1878    }
1879
1880    /**
1881     * @return Returns a reference to <code>this</code> for easy method chaining
1882     */
1883    public HealthcareService setCharacteristic(List<CodeableConcept> theCharacteristic) { 
1884      this.characteristic = theCharacteristic;
1885      return this;
1886    }
1887
1888    public boolean hasCharacteristic() { 
1889      if (this.characteristic == null)
1890        return false;
1891      for (CodeableConcept item : this.characteristic)
1892        if (!item.isEmpty())
1893          return true;
1894      return false;
1895    }
1896
1897    public CodeableConcept addCharacteristic() { //3
1898      CodeableConcept t = new CodeableConcept();
1899      if (this.characteristic == null)
1900        this.characteristic = new ArrayList<CodeableConcept>();
1901      this.characteristic.add(t);
1902      return t;
1903    }
1904
1905    public HealthcareService addCharacteristic(CodeableConcept t) { //3
1906      if (t == null)
1907        return this;
1908      if (this.characteristic == null)
1909        this.characteristic = new ArrayList<CodeableConcept>();
1910      this.characteristic.add(t);
1911      return this;
1912    }
1913
1914    /**
1915     * @return The first repetition of repeating field {@link #characteristic}, creating it if it does not already exist {3}
1916     */
1917    public CodeableConcept getCharacteristicFirstRep() { 
1918      if (getCharacteristic().isEmpty()) {
1919        addCharacteristic();
1920      }
1921      return getCharacteristic().get(0);
1922    }
1923
1924    /**
1925     * @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.)
1926     */
1927    public List<CodeableConcept> getCommunication() { 
1928      if (this.communication == null)
1929        this.communication = new ArrayList<CodeableConcept>();
1930      return this.communication;
1931    }
1932
1933    /**
1934     * @return Returns a reference to <code>this</code> for easy method chaining
1935     */
1936    public HealthcareService setCommunication(List<CodeableConcept> theCommunication) { 
1937      this.communication = theCommunication;
1938      return this;
1939    }
1940
1941    public boolean hasCommunication() { 
1942      if (this.communication == null)
1943        return false;
1944      for (CodeableConcept item : this.communication)
1945        if (!item.isEmpty())
1946          return true;
1947      return false;
1948    }
1949
1950    public CodeableConcept addCommunication() { //3
1951      CodeableConcept t = new CodeableConcept();
1952      if (this.communication == null)
1953        this.communication = new ArrayList<CodeableConcept>();
1954      this.communication.add(t);
1955      return t;
1956    }
1957
1958    public HealthcareService addCommunication(CodeableConcept t) { //3
1959      if (t == null)
1960        return this;
1961      if (this.communication == null)
1962        this.communication = new ArrayList<CodeableConcept>();
1963      this.communication.add(t);
1964      return this;
1965    }
1966
1967    /**
1968     * @return The first repetition of repeating field {@link #communication}, creating it if it does not already exist {3}
1969     */
1970    public CodeableConcept getCommunicationFirstRep() { 
1971      if (getCommunication().isEmpty()) {
1972        addCommunication();
1973      }
1974      return getCommunication().get(0);
1975    }
1976
1977    /**
1978     * @return {@link #referralMethod} (Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.)
1979     */
1980    public List<CodeableConcept> getReferralMethod() { 
1981      if (this.referralMethod == null)
1982        this.referralMethod = new ArrayList<CodeableConcept>();
1983      return this.referralMethod;
1984    }
1985
1986    /**
1987     * @return Returns a reference to <code>this</code> for easy method chaining
1988     */
1989    public HealthcareService setReferralMethod(List<CodeableConcept> theReferralMethod) { 
1990      this.referralMethod = theReferralMethod;
1991      return this;
1992    }
1993
1994    public boolean hasReferralMethod() { 
1995      if (this.referralMethod == null)
1996        return false;
1997      for (CodeableConcept item : this.referralMethod)
1998        if (!item.isEmpty())
1999          return true;
2000      return false;
2001    }
2002
2003    public CodeableConcept addReferralMethod() { //3
2004      CodeableConcept t = new CodeableConcept();
2005      if (this.referralMethod == null)
2006        this.referralMethod = new ArrayList<CodeableConcept>();
2007      this.referralMethod.add(t);
2008      return t;
2009    }
2010
2011    public HealthcareService addReferralMethod(CodeableConcept t) { //3
2012      if (t == null)
2013        return this;
2014      if (this.referralMethod == null)
2015        this.referralMethod = new ArrayList<CodeableConcept>();
2016      this.referralMethod.add(t);
2017      return this;
2018    }
2019
2020    /**
2021     * @return The first repetition of repeating field {@link #referralMethod}, creating it if it does not already exist {3}
2022     */
2023    public CodeableConcept getReferralMethodFirstRep() { 
2024      if (getReferralMethod().isEmpty()) {
2025        addReferralMethod();
2026      }
2027      return getReferralMethod().get(0);
2028    }
2029
2030    /**
2031     * @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
2032     */
2033    public BooleanType getAppointmentRequiredElement() { 
2034      if (this.appointmentRequired == null)
2035        if (Configuration.errorOnAutoCreate())
2036          throw new Error("Attempt to auto-create HealthcareService.appointmentRequired");
2037        else if (Configuration.doAutoCreate())
2038          this.appointmentRequired = new BooleanType(); // bb
2039      return this.appointmentRequired;
2040    }
2041
2042    public boolean hasAppointmentRequiredElement() { 
2043      return this.appointmentRequired != null && !this.appointmentRequired.isEmpty();
2044    }
2045
2046    public boolean hasAppointmentRequired() { 
2047      return this.appointmentRequired != null && !this.appointmentRequired.isEmpty();
2048    }
2049
2050    /**
2051     * @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
2052     */
2053    public HealthcareService setAppointmentRequiredElement(BooleanType value) { 
2054      this.appointmentRequired = value;
2055      return this;
2056    }
2057
2058    /**
2059     * @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.
2060     */
2061    public boolean getAppointmentRequired() { 
2062      return this.appointmentRequired == null || this.appointmentRequired.isEmpty() ? false : this.appointmentRequired.getValue();
2063    }
2064
2065    /**
2066     * @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.
2067     */
2068    public HealthcareService setAppointmentRequired(boolean value) { 
2069        if (this.appointmentRequired == null)
2070          this.appointmentRequired = new BooleanType();
2071        this.appointmentRequired.setValue(value);
2072      return this;
2073    }
2074
2075    /**
2076     * @return {@link #availableTime} (A collection of times that the Service Site is available.)
2077     */
2078    public List<HealthcareServiceAvailableTimeComponent> getAvailableTime() { 
2079      if (this.availableTime == null)
2080        this.availableTime = new ArrayList<HealthcareServiceAvailableTimeComponent>();
2081      return this.availableTime;
2082    }
2083
2084    /**
2085     * @return Returns a reference to <code>this</code> for easy method chaining
2086     */
2087    public HealthcareService setAvailableTime(List<HealthcareServiceAvailableTimeComponent> theAvailableTime) { 
2088      this.availableTime = theAvailableTime;
2089      return this;
2090    }
2091
2092    public boolean hasAvailableTime() { 
2093      if (this.availableTime == null)
2094        return false;
2095      for (HealthcareServiceAvailableTimeComponent item : this.availableTime)
2096        if (!item.isEmpty())
2097          return true;
2098      return false;
2099    }
2100
2101    public HealthcareServiceAvailableTimeComponent addAvailableTime() { //3
2102      HealthcareServiceAvailableTimeComponent t = new HealthcareServiceAvailableTimeComponent();
2103      if (this.availableTime == null)
2104        this.availableTime = new ArrayList<HealthcareServiceAvailableTimeComponent>();
2105      this.availableTime.add(t);
2106      return t;
2107    }
2108
2109    public HealthcareService addAvailableTime(HealthcareServiceAvailableTimeComponent t) { //3
2110      if (t == null)
2111        return this;
2112      if (this.availableTime == null)
2113        this.availableTime = new ArrayList<HealthcareServiceAvailableTimeComponent>();
2114      this.availableTime.add(t);
2115      return this;
2116    }
2117
2118    /**
2119     * @return The first repetition of repeating field {@link #availableTime}, creating it if it does not already exist {3}
2120     */
2121    public HealthcareServiceAvailableTimeComponent getAvailableTimeFirstRep() { 
2122      if (getAvailableTime().isEmpty()) {
2123        addAvailableTime();
2124      }
2125      return getAvailableTime().get(0);
2126    }
2127
2128    /**
2129     * @return {@link #notAvailable} (The HealthcareService is not available during this period of time due to the provided reason.)
2130     */
2131    public List<HealthcareServiceNotAvailableComponent> getNotAvailable() { 
2132      if (this.notAvailable == null)
2133        this.notAvailable = new ArrayList<HealthcareServiceNotAvailableComponent>();
2134      return this.notAvailable;
2135    }
2136
2137    /**
2138     * @return Returns a reference to <code>this</code> for easy method chaining
2139     */
2140    public HealthcareService setNotAvailable(List<HealthcareServiceNotAvailableComponent> theNotAvailable) { 
2141      this.notAvailable = theNotAvailable;
2142      return this;
2143    }
2144
2145    public boolean hasNotAvailable() { 
2146      if (this.notAvailable == null)
2147        return false;
2148      for (HealthcareServiceNotAvailableComponent item : this.notAvailable)
2149        if (!item.isEmpty())
2150          return true;
2151      return false;
2152    }
2153
2154    public HealthcareServiceNotAvailableComponent addNotAvailable() { //3
2155      HealthcareServiceNotAvailableComponent t = new HealthcareServiceNotAvailableComponent();
2156      if (this.notAvailable == null)
2157        this.notAvailable = new ArrayList<HealthcareServiceNotAvailableComponent>();
2158      this.notAvailable.add(t);
2159      return t;
2160    }
2161
2162    public HealthcareService addNotAvailable(HealthcareServiceNotAvailableComponent t) { //3
2163      if (t == null)
2164        return this;
2165      if (this.notAvailable == null)
2166        this.notAvailable = new ArrayList<HealthcareServiceNotAvailableComponent>();
2167      this.notAvailable.add(t);
2168      return this;
2169    }
2170
2171    /**
2172     * @return The first repetition of repeating field {@link #notAvailable}, creating it if it does not already exist {3}
2173     */
2174    public HealthcareServiceNotAvailableComponent getNotAvailableFirstRep() { 
2175      if (getNotAvailable().isEmpty()) {
2176        addNotAvailable();
2177      }
2178      return getNotAvailable().get(0);
2179    }
2180
2181    /**
2182     * @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
2183     */
2184    public StringType getAvailabilityExceptionsElement() { 
2185      if (this.availabilityExceptions == null)
2186        if (Configuration.errorOnAutoCreate())
2187          throw new Error("Attempt to auto-create HealthcareService.availabilityExceptions");
2188        else if (Configuration.doAutoCreate())
2189          this.availabilityExceptions = new StringType(); // bb
2190      return this.availabilityExceptions;
2191    }
2192
2193    public boolean hasAvailabilityExceptionsElement() { 
2194      return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty();
2195    }
2196
2197    public boolean hasAvailabilityExceptions() { 
2198      return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty();
2199    }
2200
2201    /**
2202     * @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
2203     */
2204    public HealthcareService setAvailabilityExceptionsElement(StringType value) { 
2205      this.availabilityExceptions = value;
2206      return this;
2207    }
2208
2209    /**
2210     * @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.
2211     */
2212    public String getAvailabilityExceptions() { 
2213      return this.availabilityExceptions == null ? null : this.availabilityExceptions.getValue();
2214    }
2215
2216    /**
2217     * @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.
2218     */
2219    public HealthcareService setAvailabilityExceptions(String value) { 
2220      if (Utilities.noString(value))
2221        this.availabilityExceptions = null;
2222      else {
2223        if (this.availabilityExceptions == null)
2224          this.availabilityExceptions = new StringType();
2225        this.availabilityExceptions.setValue(value);
2226      }
2227      return this;
2228    }
2229
2230    /**
2231     * @return {@link #endpoint} (Technical endpoints providing access to services operated for the specific healthcare services defined at this resource.)
2232     */
2233    public List<Reference> getEndpoint() { 
2234      if (this.endpoint == null)
2235        this.endpoint = new ArrayList<Reference>();
2236      return this.endpoint;
2237    }
2238
2239    /**
2240     * @return Returns a reference to <code>this</code> for easy method chaining
2241     */
2242    public HealthcareService setEndpoint(List<Reference> theEndpoint) { 
2243      this.endpoint = theEndpoint;
2244      return this;
2245    }
2246
2247    public boolean hasEndpoint() { 
2248      if (this.endpoint == null)
2249        return false;
2250      for (Reference item : this.endpoint)
2251        if (!item.isEmpty())
2252          return true;
2253      return false;
2254    }
2255
2256    public Reference addEndpoint() { //3
2257      Reference t = new Reference();
2258      if (this.endpoint == null)
2259        this.endpoint = new ArrayList<Reference>();
2260      this.endpoint.add(t);
2261      return t;
2262    }
2263
2264    public HealthcareService addEndpoint(Reference t) { //3
2265      if (t == null)
2266        return this;
2267      if (this.endpoint == null)
2268        this.endpoint = new ArrayList<Reference>();
2269      this.endpoint.add(t);
2270      return this;
2271    }
2272
2273    /**
2274     * @return The first repetition of repeating field {@link #endpoint}, creating it if it does not already exist {3}
2275     */
2276    public Reference getEndpointFirstRep() { 
2277      if (getEndpoint().isEmpty()) {
2278        addEndpoint();
2279      }
2280      return getEndpoint().get(0);
2281    }
2282
2283      protected void listChildren(List<Property> children) {
2284        super.listChildren(children);
2285        children.add(new Property("identifier", "Identifier", "External identifiers for this item.", 0, java.lang.Integer.MAX_VALUE, identifier));
2286        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));
2287        children.add(new Property("providedBy", "Reference(Organization)", "The organization that provides this healthcare service.", 0, 1, providedBy));
2288        children.add(new Property("category", "CodeableConcept", "Identifies the broad category of service being performed or delivered.", 0, java.lang.Integer.MAX_VALUE, category));
2289        children.add(new Property("type", "CodeableConcept", "The specific type of service that may be delivered or performed.", 0, java.lang.Integer.MAX_VALUE, type));
2290        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));
2291        children.add(new Property("location", "Reference(Location)", "The location(s) where this healthcare service may be provided.", 0, java.lang.Integer.MAX_VALUE, location));
2292        children.add(new Property("name", "string", "Further description of the service as it would be presented to a consumer while searching.", 0, 1, name));
2293        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));
2294        children.add(new Property("extraDetails", "markdown", "Extra details about the service that can't be placed in the other fields.", 0, 1, extraDetails));
2295        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));
2296        children.add(new Property("telecom", "ContactPoint", "List of contacts related to this specific healthcare service.", 0, java.lang.Integer.MAX_VALUE, telecom));
2297        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));
2298        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));
2299        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));
2300        children.add(new Property("program", "CodeableConcept", "Programs that this service is applicable to.", 0, java.lang.Integer.MAX_VALUE, program));
2301        children.add(new Property("characteristic", "CodeableConcept", "Collection of characteristics (attributes).", 0, java.lang.Integer.MAX_VALUE, characteristic));
2302        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));
2303        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));
2304        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));
2305        children.add(new Property("availableTime", "", "A collection of times that the Service Site is available.", 0, java.lang.Integer.MAX_VALUE, availableTime));
2306        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));
2307        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));
2308        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));
2309      }
2310
2311      @Override
2312      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2313        switch (_hash) {
2314        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "External identifiers for this item.", 0, java.lang.Integer.MAX_VALUE, identifier);
2315        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);
2316        case 205136282: /*providedBy*/  return new Property("providedBy", "Reference(Organization)", "The organization that provides this healthcare service.", 0, 1, providedBy);
2317        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);
2318        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);
2319        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);
2320        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);
2321        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);
2322        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);
2323        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);
2324        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);
2325        case -1429363305: /*telecom*/  return new Property("telecom", "ContactPoint", "List of contacts related to this specific healthcare service.", 0, java.lang.Integer.MAX_VALUE, telecom);
2326        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);
2327        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);
2328        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);
2329        case -309387644: /*program*/  return new Property("program", "CodeableConcept", "Programs that this service is applicable to.", 0, java.lang.Integer.MAX_VALUE, program);
2330        case 366313883: /*characteristic*/  return new Property("characteristic", "CodeableConcept", "Collection of characteristics (attributes).", 0, java.lang.Integer.MAX_VALUE, characteristic);
2331        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);
2332        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);
2333        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);
2334        case 1873069366: /*availableTime*/  return new Property("availableTime", "", "A collection of times that the Service Site is available.", 0, java.lang.Integer.MAX_VALUE, availableTime);
2335        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);
2336        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);
2337        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);
2338        default: return super.getNamedProperty(_hash, _name, _checkValid);
2339        }
2340
2341      }
2342
2343      @Override
2344      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2345        switch (hash) {
2346        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2347        case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType
2348        case 205136282: /*providedBy*/ return this.providedBy == null ? new Base[0] : new Base[] {this.providedBy}; // Reference
2349        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
2350        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
2351        case -1694759682: /*specialty*/ return this.specialty == null ? new Base[0] : this.specialty.toArray(new Base[this.specialty.size()]); // CodeableConcept
2352        case 1901043637: /*location*/ return this.location == null ? new Base[0] : this.location.toArray(new Base[this.location.size()]); // Reference
2353        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
2354        case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType
2355        case -1469168622: /*extraDetails*/ return this.extraDetails == null ? new Base[0] : new Base[] {this.extraDetails}; // MarkdownType
2356        case 106642994: /*photo*/ return this.photo == null ? new Base[0] : new Base[] {this.photo}; // Attachment
2357        case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint
2358        case -1532328299: /*coverageArea*/ return this.coverageArea == null ? new Base[0] : this.coverageArea.toArray(new Base[this.coverageArea.size()]); // Reference
2359        case 1504575405: /*serviceProvisionCode*/ return this.serviceProvisionCode == null ? new Base[0] : this.serviceProvisionCode.toArray(new Base[this.serviceProvisionCode.size()]); // CodeableConcept
2360        case -930847859: /*eligibility*/ return this.eligibility == null ? new Base[0] : this.eligibility.toArray(new Base[this.eligibility.size()]); // HealthcareServiceEligibilityComponent
2361        case -309387644: /*program*/ return this.program == null ? new Base[0] : this.program.toArray(new Base[this.program.size()]); // CodeableConcept
2362        case 366313883: /*characteristic*/ return this.characteristic == null ? new Base[0] : this.characteristic.toArray(new Base[this.characteristic.size()]); // CodeableConcept
2363        case -1035284522: /*communication*/ return this.communication == null ? new Base[0] : this.communication.toArray(new Base[this.communication.size()]); // CodeableConcept
2364        case -2092740898: /*referralMethod*/ return this.referralMethod == null ? new Base[0] : this.referralMethod.toArray(new Base[this.referralMethod.size()]); // CodeableConcept
2365        case 427220062: /*appointmentRequired*/ return this.appointmentRequired == null ? new Base[0] : new Base[] {this.appointmentRequired}; // BooleanType
2366        case 1873069366: /*availableTime*/ return this.availableTime == null ? new Base[0] : this.availableTime.toArray(new Base[this.availableTime.size()]); // HealthcareServiceAvailableTimeComponent
2367        case -629572298: /*notAvailable*/ return this.notAvailable == null ? new Base[0] : this.notAvailable.toArray(new Base[this.notAvailable.size()]); // HealthcareServiceNotAvailableComponent
2368        case -1149143617: /*availabilityExceptions*/ return this.availabilityExceptions == null ? new Base[0] : new Base[] {this.availabilityExceptions}; // StringType
2369        case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : this.endpoint.toArray(new Base[this.endpoint.size()]); // Reference
2370        default: return super.getProperty(hash, name, checkValid);
2371        }
2372
2373      }
2374
2375      @Override
2376      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2377        switch (hash) {
2378        case -1618432855: // identifier
2379          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2380          return value;
2381        case -1422950650: // active
2382          this.active = TypeConvertor.castToBoolean(value); // BooleanType
2383          return value;
2384        case 205136282: // providedBy
2385          this.providedBy = TypeConvertor.castToReference(value); // Reference
2386          return value;
2387        case 50511102: // category
2388          this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2389          return value;
2390        case 3575610: // type
2391          this.getType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2392          return value;
2393        case -1694759682: // specialty
2394          this.getSpecialty().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2395          return value;
2396        case 1901043637: // location
2397          this.getLocation().add(TypeConvertor.castToReference(value)); // Reference
2398          return value;
2399        case 3373707: // name
2400          this.name = TypeConvertor.castToString(value); // StringType
2401          return value;
2402        case 950398559: // comment
2403          this.comment = TypeConvertor.castToString(value); // StringType
2404          return value;
2405        case -1469168622: // extraDetails
2406          this.extraDetails = TypeConvertor.castToMarkdown(value); // MarkdownType
2407          return value;
2408        case 106642994: // photo
2409          this.photo = TypeConvertor.castToAttachment(value); // Attachment
2410          return value;
2411        case -1429363305: // telecom
2412          this.getTelecom().add(TypeConvertor.castToContactPoint(value)); // ContactPoint
2413          return value;
2414        case -1532328299: // coverageArea
2415          this.getCoverageArea().add(TypeConvertor.castToReference(value)); // Reference
2416          return value;
2417        case 1504575405: // serviceProvisionCode
2418          this.getServiceProvisionCode().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2419          return value;
2420        case -930847859: // eligibility
2421          this.getEligibility().add((HealthcareServiceEligibilityComponent) value); // HealthcareServiceEligibilityComponent
2422          return value;
2423        case -309387644: // program
2424          this.getProgram().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2425          return value;
2426        case 366313883: // characteristic
2427          this.getCharacteristic().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2428          return value;
2429        case -1035284522: // communication
2430          this.getCommunication().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2431          return value;
2432        case -2092740898: // referralMethod
2433          this.getReferralMethod().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2434          return value;
2435        case 427220062: // appointmentRequired
2436          this.appointmentRequired = TypeConvertor.castToBoolean(value); // BooleanType
2437          return value;
2438        case 1873069366: // availableTime
2439          this.getAvailableTime().add((HealthcareServiceAvailableTimeComponent) value); // HealthcareServiceAvailableTimeComponent
2440          return value;
2441        case -629572298: // notAvailable
2442          this.getNotAvailable().add((HealthcareServiceNotAvailableComponent) value); // HealthcareServiceNotAvailableComponent
2443          return value;
2444        case -1149143617: // availabilityExceptions
2445          this.availabilityExceptions = TypeConvertor.castToString(value); // StringType
2446          return value;
2447        case 1741102485: // endpoint
2448          this.getEndpoint().add(TypeConvertor.castToReference(value)); // Reference
2449          return value;
2450        default: return super.setProperty(hash, name, value);
2451        }
2452
2453      }
2454
2455      @Override
2456      public Base setProperty(String name, Base value) throws FHIRException {
2457        if (name.equals("identifier")) {
2458          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2459        } else if (name.equals("active")) {
2460          this.active = TypeConvertor.castToBoolean(value); // BooleanType
2461        } else if (name.equals("providedBy")) {
2462          this.providedBy = TypeConvertor.castToReference(value); // Reference
2463        } else if (name.equals("category")) {
2464          this.getCategory().add(TypeConvertor.castToCodeableConcept(value));
2465        } else if (name.equals("type")) {
2466          this.getType().add(TypeConvertor.castToCodeableConcept(value));
2467        } else if (name.equals("specialty")) {
2468          this.getSpecialty().add(TypeConvertor.castToCodeableConcept(value));
2469        } else if (name.equals("location")) {
2470          this.getLocation().add(TypeConvertor.castToReference(value));
2471        } else if (name.equals("name")) {
2472          this.name = TypeConvertor.castToString(value); // StringType
2473        } else if (name.equals("comment")) {
2474          this.comment = TypeConvertor.castToString(value); // StringType
2475        } else if (name.equals("extraDetails")) {
2476          this.extraDetails = TypeConvertor.castToMarkdown(value); // MarkdownType
2477        } else if (name.equals("photo")) {
2478          this.photo = TypeConvertor.castToAttachment(value); // Attachment
2479        } else if (name.equals("telecom")) {
2480          this.getTelecom().add(TypeConvertor.castToContactPoint(value));
2481        } else if (name.equals("coverageArea")) {
2482          this.getCoverageArea().add(TypeConvertor.castToReference(value));
2483        } else if (name.equals("serviceProvisionCode")) {
2484          this.getServiceProvisionCode().add(TypeConvertor.castToCodeableConcept(value));
2485        } else if (name.equals("eligibility")) {
2486          this.getEligibility().add((HealthcareServiceEligibilityComponent) value);
2487        } else if (name.equals("program")) {
2488          this.getProgram().add(TypeConvertor.castToCodeableConcept(value));
2489        } else if (name.equals("characteristic")) {
2490          this.getCharacteristic().add(TypeConvertor.castToCodeableConcept(value));
2491        } else if (name.equals("communication")) {
2492          this.getCommunication().add(TypeConvertor.castToCodeableConcept(value));
2493        } else if (name.equals("referralMethod")) {
2494          this.getReferralMethod().add(TypeConvertor.castToCodeableConcept(value));
2495        } else if (name.equals("appointmentRequired")) {
2496          this.appointmentRequired = TypeConvertor.castToBoolean(value); // BooleanType
2497        } else if (name.equals("availableTime")) {
2498          this.getAvailableTime().add((HealthcareServiceAvailableTimeComponent) value);
2499        } else if (name.equals("notAvailable")) {
2500          this.getNotAvailable().add((HealthcareServiceNotAvailableComponent) value);
2501        } else if (name.equals("availabilityExceptions")) {
2502          this.availabilityExceptions = TypeConvertor.castToString(value); // StringType
2503        } else if (name.equals("endpoint")) {
2504          this.getEndpoint().add(TypeConvertor.castToReference(value));
2505        } else
2506          return super.setProperty(name, value);
2507        return value;
2508      }
2509
2510      @Override
2511      public Base makeProperty(int hash, String name) throws FHIRException {
2512        switch (hash) {
2513        case -1618432855:  return addIdentifier(); 
2514        case -1422950650:  return getActiveElement();
2515        case 205136282:  return getProvidedBy();
2516        case 50511102:  return addCategory(); 
2517        case 3575610:  return addType(); 
2518        case -1694759682:  return addSpecialty(); 
2519        case 1901043637:  return addLocation(); 
2520        case 3373707:  return getNameElement();
2521        case 950398559:  return getCommentElement();
2522        case -1469168622:  return getExtraDetailsElement();
2523        case 106642994:  return getPhoto();
2524        case -1429363305:  return addTelecom(); 
2525        case -1532328299:  return addCoverageArea(); 
2526        case 1504575405:  return addServiceProvisionCode(); 
2527        case -930847859:  return addEligibility(); 
2528        case -309387644:  return addProgram(); 
2529        case 366313883:  return addCharacteristic(); 
2530        case -1035284522:  return addCommunication(); 
2531        case -2092740898:  return addReferralMethod(); 
2532        case 427220062:  return getAppointmentRequiredElement();
2533        case 1873069366:  return addAvailableTime(); 
2534        case -629572298:  return addNotAvailable(); 
2535        case -1149143617:  return getAvailabilityExceptionsElement();
2536        case 1741102485:  return addEndpoint(); 
2537        default: return super.makeProperty(hash, name);
2538        }
2539
2540      }
2541
2542      @Override
2543      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2544        switch (hash) {
2545        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2546        case -1422950650: /*active*/ return new String[] {"boolean"};
2547        case 205136282: /*providedBy*/ return new String[] {"Reference"};
2548        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
2549        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2550        case -1694759682: /*specialty*/ return new String[] {"CodeableConcept"};
2551        case 1901043637: /*location*/ return new String[] {"Reference"};
2552        case 3373707: /*name*/ return new String[] {"string"};
2553        case 950398559: /*comment*/ return new String[] {"string"};
2554        case -1469168622: /*extraDetails*/ return new String[] {"markdown"};
2555        case 106642994: /*photo*/ return new String[] {"Attachment"};
2556        case -1429363305: /*telecom*/ return new String[] {"ContactPoint"};
2557        case -1532328299: /*coverageArea*/ return new String[] {"Reference"};
2558        case 1504575405: /*serviceProvisionCode*/ return new String[] {"CodeableConcept"};
2559        case -930847859: /*eligibility*/ return new String[] {};
2560        case -309387644: /*program*/ return new String[] {"CodeableConcept"};
2561        case 366313883: /*characteristic*/ return new String[] {"CodeableConcept"};
2562        case -1035284522: /*communication*/ return new String[] {"CodeableConcept"};
2563        case -2092740898: /*referralMethod*/ return new String[] {"CodeableConcept"};
2564        case 427220062: /*appointmentRequired*/ return new String[] {"boolean"};
2565        case 1873069366: /*availableTime*/ return new String[] {};
2566        case -629572298: /*notAvailable*/ return new String[] {};
2567        case -1149143617: /*availabilityExceptions*/ return new String[] {"string"};
2568        case 1741102485: /*endpoint*/ return new String[] {"Reference"};
2569        default: return super.getTypesForProperty(hash, name);
2570        }
2571
2572      }
2573
2574      @Override
2575      public Base addChild(String name) throws FHIRException {
2576        if (name.equals("identifier")) {
2577          return addIdentifier();
2578        }
2579        else if (name.equals("active")) {
2580          throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.active");
2581        }
2582        else if (name.equals("providedBy")) {
2583          this.providedBy = new Reference();
2584          return this.providedBy;
2585        }
2586        else if (name.equals("category")) {
2587          return addCategory();
2588        }
2589        else if (name.equals("type")) {
2590          return addType();
2591        }
2592        else if (name.equals("specialty")) {
2593          return addSpecialty();
2594        }
2595        else if (name.equals("location")) {
2596          return addLocation();
2597        }
2598        else if (name.equals("name")) {
2599          throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.name");
2600        }
2601        else if (name.equals("comment")) {
2602          throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.comment");
2603        }
2604        else if (name.equals("extraDetails")) {
2605          throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.extraDetails");
2606        }
2607        else if (name.equals("photo")) {
2608          this.photo = new Attachment();
2609          return this.photo;
2610        }
2611        else if (name.equals("telecom")) {
2612          return addTelecom();
2613        }
2614        else if (name.equals("coverageArea")) {
2615          return addCoverageArea();
2616        }
2617        else if (name.equals("serviceProvisionCode")) {
2618          return addServiceProvisionCode();
2619        }
2620        else if (name.equals("eligibility")) {
2621          return addEligibility();
2622        }
2623        else if (name.equals("program")) {
2624          return addProgram();
2625        }
2626        else if (name.equals("characteristic")) {
2627          return addCharacteristic();
2628        }
2629        else if (name.equals("communication")) {
2630          return addCommunication();
2631        }
2632        else if (name.equals("referralMethod")) {
2633          return addReferralMethod();
2634        }
2635        else if (name.equals("appointmentRequired")) {
2636          throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.appointmentRequired");
2637        }
2638        else if (name.equals("availableTime")) {
2639          return addAvailableTime();
2640        }
2641        else if (name.equals("notAvailable")) {
2642          return addNotAvailable();
2643        }
2644        else if (name.equals("availabilityExceptions")) {
2645          throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.availabilityExceptions");
2646        }
2647        else if (name.equals("endpoint")) {
2648          return addEndpoint();
2649        }
2650        else
2651          return super.addChild(name);
2652      }
2653
2654  public String fhirType() {
2655    return "HealthcareService";
2656
2657  }
2658
2659      public HealthcareService copy() {
2660        HealthcareService dst = new HealthcareService();
2661        copyValues(dst);
2662        return dst;
2663      }
2664
2665      public void copyValues(HealthcareService dst) {
2666        super.copyValues(dst);
2667        if (identifier != null) {
2668          dst.identifier = new ArrayList<Identifier>();
2669          for (Identifier i : identifier)
2670            dst.identifier.add(i.copy());
2671        };
2672        dst.active = active == null ? null : active.copy();
2673        dst.providedBy = providedBy == null ? null : providedBy.copy();
2674        if (category != null) {
2675          dst.category = new ArrayList<CodeableConcept>();
2676          for (CodeableConcept i : category)
2677            dst.category.add(i.copy());
2678        };
2679        if (type != null) {
2680          dst.type = new ArrayList<CodeableConcept>();
2681          for (CodeableConcept i : type)
2682            dst.type.add(i.copy());
2683        };
2684        if (specialty != null) {
2685          dst.specialty = new ArrayList<CodeableConcept>();
2686          for (CodeableConcept i : specialty)
2687            dst.specialty.add(i.copy());
2688        };
2689        if (location != null) {
2690          dst.location = new ArrayList<Reference>();
2691          for (Reference i : location)
2692            dst.location.add(i.copy());
2693        };
2694        dst.name = name == null ? null : name.copy();
2695        dst.comment = comment == null ? null : comment.copy();
2696        dst.extraDetails = extraDetails == null ? null : extraDetails.copy();
2697        dst.photo = photo == null ? null : photo.copy();
2698        if (telecom != null) {
2699          dst.telecom = new ArrayList<ContactPoint>();
2700          for (ContactPoint i : telecom)
2701            dst.telecom.add(i.copy());
2702        };
2703        if (coverageArea != null) {
2704          dst.coverageArea = new ArrayList<Reference>();
2705          for (Reference i : coverageArea)
2706            dst.coverageArea.add(i.copy());
2707        };
2708        if (serviceProvisionCode != null) {
2709          dst.serviceProvisionCode = new ArrayList<CodeableConcept>();
2710          for (CodeableConcept i : serviceProvisionCode)
2711            dst.serviceProvisionCode.add(i.copy());
2712        };
2713        if (eligibility != null) {
2714          dst.eligibility = new ArrayList<HealthcareServiceEligibilityComponent>();
2715          for (HealthcareServiceEligibilityComponent i : eligibility)
2716            dst.eligibility.add(i.copy());
2717        };
2718        if (program != null) {
2719          dst.program = new ArrayList<CodeableConcept>();
2720          for (CodeableConcept i : program)
2721            dst.program.add(i.copy());
2722        };
2723        if (characteristic != null) {
2724          dst.characteristic = new ArrayList<CodeableConcept>();
2725          for (CodeableConcept i : characteristic)
2726            dst.characteristic.add(i.copy());
2727        };
2728        if (communication != null) {
2729          dst.communication = new ArrayList<CodeableConcept>();
2730          for (CodeableConcept i : communication)
2731            dst.communication.add(i.copy());
2732        };
2733        if (referralMethod != null) {
2734          dst.referralMethod = new ArrayList<CodeableConcept>();
2735          for (CodeableConcept i : referralMethod)
2736            dst.referralMethod.add(i.copy());
2737        };
2738        dst.appointmentRequired = appointmentRequired == null ? null : appointmentRequired.copy();
2739        if (availableTime != null) {
2740          dst.availableTime = new ArrayList<HealthcareServiceAvailableTimeComponent>();
2741          for (HealthcareServiceAvailableTimeComponent i : availableTime)
2742            dst.availableTime.add(i.copy());
2743        };
2744        if (notAvailable != null) {
2745          dst.notAvailable = new ArrayList<HealthcareServiceNotAvailableComponent>();
2746          for (HealthcareServiceNotAvailableComponent i : notAvailable)
2747            dst.notAvailable.add(i.copy());
2748        };
2749        dst.availabilityExceptions = availabilityExceptions == null ? null : availabilityExceptions.copy();
2750        if (endpoint != null) {
2751          dst.endpoint = new ArrayList<Reference>();
2752          for (Reference i : endpoint)
2753            dst.endpoint.add(i.copy());
2754        };
2755      }
2756
2757      protected HealthcareService typedCopy() {
2758        return copy();
2759      }
2760
2761      @Override
2762      public boolean equalsDeep(Base other_) {
2763        if (!super.equalsDeep(other_))
2764          return false;
2765        if (!(other_ instanceof HealthcareService))
2766          return false;
2767        HealthcareService o = (HealthcareService) other_;
2768        return compareDeep(identifier, o.identifier, true) && compareDeep(active, o.active, true) && compareDeep(providedBy, o.providedBy, true)
2769           && compareDeep(category, o.category, true) && compareDeep(type, o.type, true) && compareDeep(specialty, o.specialty, true)
2770           && compareDeep(location, o.location, true) && compareDeep(name, o.name, true) && compareDeep(comment, o.comment, true)
2771           && compareDeep(extraDetails, o.extraDetails, true) && compareDeep(photo, o.photo, true) && compareDeep(telecom, o.telecom, true)
2772           && compareDeep(coverageArea, o.coverageArea, true) && compareDeep(serviceProvisionCode, o.serviceProvisionCode, true)
2773           && compareDeep(eligibility, o.eligibility, true) && compareDeep(program, o.program, true) && compareDeep(characteristic, o.characteristic, true)
2774           && compareDeep(communication, o.communication, true) && compareDeep(referralMethod, o.referralMethod, true)
2775           && compareDeep(appointmentRequired, o.appointmentRequired, true) && compareDeep(availableTime, o.availableTime, true)
2776           && compareDeep(notAvailable, o.notAvailable, true) && compareDeep(availabilityExceptions, o.availabilityExceptions, true)
2777           && compareDeep(endpoint, o.endpoint, true);
2778      }
2779
2780      @Override
2781      public boolean equalsShallow(Base other_) {
2782        if (!super.equalsShallow(other_))
2783          return false;
2784        if (!(other_ instanceof HealthcareService))
2785          return false;
2786        HealthcareService o = (HealthcareService) other_;
2787        return compareValues(active, o.active, true) && compareValues(name, o.name, true) && compareValues(comment, o.comment, true)
2788           && compareValues(extraDetails, o.extraDetails, true) && compareValues(appointmentRequired, o.appointmentRequired, true)
2789           && compareValues(availabilityExceptions, o.availabilityExceptions, true);
2790      }
2791
2792      public boolean isEmpty() {
2793        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, active, providedBy
2794          , category, type, specialty, location, name, comment, extraDetails, photo, telecom
2795          , coverageArea, serviceProvisionCode, eligibility, program, characteristic, communication
2796          , referralMethod, appointmentRequired, availableTime, notAvailable, availabilityExceptions
2797          , endpoint);
2798      }
2799
2800  @Override
2801  public ResourceType getResourceType() {
2802    return ResourceType.HealthcareService;
2803   }
2804
2805 /**
2806   * Search parameter: <b>active</b>
2807   * <p>
2808   * Description: <b>The Healthcare Service is currently marked as active</b><br>
2809   * Type: <b>token</b><br>
2810   * Path: <b>HealthcareService.active</b><br>
2811   * </p>
2812   */
2813  @SearchParamDefinition(name="active", path="HealthcareService.active", description="The Healthcare Service is currently marked as active", type="token" )
2814  public static final String SP_ACTIVE = "active";
2815 /**
2816   * <b>Fluent Client</b> search parameter constant for <b>active</b>
2817   * <p>
2818   * Description: <b>The Healthcare Service is currently marked as active</b><br>
2819   * Type: <b>token</b><br>
2820   * Path: <b>HealthcareService.active</b><br>
2821   * </p>
2822   */
2823  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTIVE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTIVE);
2824
2825 /**
2826   * Search parameter: <b>characteristic</b>
2827   * <p>
2828   * Description: <b>One of the HealthcareService's characteristics</b><br>
2829   * Type: <b>token</b><br>
2830   * Path: <b>HealthcareService.characteristic</b><br>
2831   * </p>
2832   */
2833  @SearchParamDefinition(name="characteristic", path="HealthcareService.characteristic", description="One of the HealthcareService's characteristics", type="token" )
2834  public static final String SP_CHARACTERISTIC = "characteristic";
2835 /**
2836   * <b>Fluent Client</b> search parameter constant for <b>characteristic</b>
2837   * <p>
2838   * Description: <b>One of the HealthcareService's characteristics</b><br>
2839   * Type: <b>token</b><br>
2840   * Path: <b>HealthcareService.characteristic</b><br>
2841   * </p>
2842   */
2843  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CHARACTERISTIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CHARACTERISTIC);
2844
2845 /**
2846   * Search parameter: <b>coverage-area</b>
2847   * <p>
2848   * Description: <b>Location(s) service is intended for/available to</b><br>
2849   * Type: <b>reference</b><br>
2850   * Path: <b>HealthcareService.coverageArea</b><br>
2851   * </p>
2852   */
2853  @SearchParamDefinition(name="coverage-area", path="HealthcareService.coverageArea", description="Location(s) service is intended for/available to", type="reference", target={Location.class } )
2854  public static final String SP_COVERAGE_AREA = "coverage-area";
2855 /**
2856   * <b>Fluent Client</b> search parameter constant for <b>coverage-area</b>
2857   * <p>
2858   * Description: <b>Location(s) service is intended for/available to</b><br>
2859   * Type: <b>reference</b><br>
2860   * Path: <b>HealthcareService.coverageArea</b><br>
2861   * </p>
2862   */
2863  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam COVERAGE_AREA = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_COVERAGE_AREA);
2864
2865/**
2866   * Constant for fluent queries to be used to add include statements. Specifies
2867   * the path value of "<b>HealthcareService:coverage-area</b>".
2868   */
2869  public static final ca.uhn.fhir.model.api.Include INCLUDE_COVERAGE_AREA = new ca.uhn.fhir.model.api.Include("HealthcareService:coverage-area").toLocked();
2870
2871 /**
2872   * Search parameter: <b>endpoint</b>
2873   * <p>
2874   * Description: <b>Technical endpoints providing access to electronic services operated for the healthcare service</b><br>
2875   * Type: <b>reference</b><br>
2876   * Path: <b>HealthcareService.endpoint</b><br>
2877   * </p>
2878   */
2879  @SearchParamDefinition(name="endpoint", path="HealthcareService.endpoint", description="Technical endpoints providing access to electronic services operated for the healthcare service", type="reference", target={Endpoint.class } )
2880  public static final String SP_ENDPOINT = "endpoint";
2881 /**
2882   * <b>Fluent Client</b> search parameter constant for <b>endpoint</b>
2883   * <p>
2884   * Description: <b>Technical endpoints providing access to electronic services operated for the healthcare service</b><br>
2885   * Type: <b>reference</b><br>
2886   * Path: <b>HealthcareService.endpoint</b><br>
2887   * </p>
2888   */
2889  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENDPOINT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENDPOINT);
2890
2891/**
2892   * Constant for fluent queries to be used to add include statements. Specifies
2893   * the path value of "<b>HealthcareService:endpoint</b>".
2894   */
2895  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENDPOINT = new ca.uhn.fhir.model.api.Include("HealthcareService:endpoint").toLocked();
2896
2897 /**
2898   * Search parameter: <b>identifier</b>
2899   * <p>
2900   * Description: <b>External identifiers for this item</b><br>
2901   * Type: <b>token</b><br>
2902   * Path: <b>HealthcareService.identifier</b><br>
2903   * </p>
2904   */
2905  @SearchParamDefinition(name="identifier", path="HealthcareService.identifier", description="External identifiers for this item", type="token" )
2906  public static final String SP_IDENTIFIER = "identifier";
2907 /**
2908   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2909   * <p>
2910   * Description: <b>External identifiers for this item</b><br>
2911   * Type: <b>token</b><br>
2912   * Path: <b>HealthcareService.identifier</b><br>
2913   * </p>
2914   */
2915  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2916
2917 /**
2918   * Search parameter: <b>location</b>
2919   * <p>
2920   * Description: <b>The location of the Healthcare Service</b><br>
2921   * Type: <b>reference</b><br>
2922   * Path: <b>HealthcareService.location</b><br>
2923   * </p>
2924   */
2925  @SearchParamDefinition(name="location", path="HealthcareService.location", description="The location of the Healthcare Service", type="reference", target={Location.class } )
2926  public static final String SP_LOCATION = "location";
2927 /**
2928   * <b>Fluent Client</b> search parameter constant for <b>location</b>
2929   * <p>
2930   * Description: <b>The location of the Healthcare Service</b><br>
2931   * Type: <b>reference</b><br>
2932   * Path: <b>HealthcareService.location</b><br>
2933   * </p>
2934   */
2935  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION);
2936
2937/**
2938   * Constant for fluent queries to be used to add include statements. Specifies
2939   * the path value of "<b>HealthcareService:location</b>".
2940   */
2941  public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("HealthcareService:location").toLocked();
2942
2943 /**
2944   * Search parameter: <b>name</b>
2945   * <p>
2946   * Description: <b>A portion of the Healthcare service name</b><br>
2947   * Type: <b>string</b><br>
2948   * Path: <b>HealthcareService.name</b><br>
2949   * </p>
2950   */
2951  @SearchParamDefinition(name="name", path="HealthcareService.name", description="A portion of the Healthcare service name", type="string" )
2952  public static final String SP_NAME = "name";
2953 /**
2954   * <b>Fluent Client</b> search parameter constant for <b>name</b>
2955   * <p>
2956   * Description: <b>A portion of the Healthcare service name</b><br>
2957   * Type: <b>string</b><br>
2958   * Path: <b>HealthcareService.name</b><br>
2959   * </p>
2960   */
2961  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
2962
2963 /**
2964   * Search parameter: <b>organization</b>
2965   * <p>
2966   * Description: <b>The organization that provides this Healthcare Service</b><br>
2967   * Type: <b>reference</b><br>
2968   * Path: <b>HealthcareService.providedBy</b><br>
2969   * </p>
2970   */
2971  @SearchParamDefinition(name="organization", path="HealthcareService.providedBy", description="The organization that provides this Healthcare Service", type="reference", target={Organization.class } )
2972  public static final String SP_ORGANIZATION = "organization";
2973 /**
2974   * <b>Fluent Client</b> search parameter constant for <b>organization</b>
2975   * <p>
2976   * Description: <b>The organization that provides this Healthcare Service</b><br>
2977   * Type: <b>reference</b><br>
2978   * Path: <b>HealthcareService.providedBy</b><br>
2979   * </p>
2980   */
2981  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION);
2982
2983/**
2984   * Constant for fluent queries to be used to add include statements. Specifies
2985   * the path value of "<b>HealthcareService:organization</b>".
2986   */
2987  public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("HealthcareService:organization").toLocked();
2988
2989 /**
2990   * Search parameter: <b>program</b>
2991   * <p>
2992   * Description: <b>One of the Programs supported by this HealthcareService</b><br>
2993   * Type: <b>token</b><br>
2994   * Path: <b>HealthcareService.program</b><br>
2995   * </p>
2996   */
2997  @SearchParamDefinition(name="program", path="HealthcareService.program", description="One of the Programs supported by this HealthcareService", type="token" )
2998  public static final String SP_PROGRAM = "program";
2999 /**
3000   * <b>Fluent Client</b> search parameter constant for <b>program</b>
3001   * <p>
3002   * Description: <b>One of the Programs supported by this HealthcareService</b><br>
3003   * Type: <b>token</b><br>
3004   * Path: <b>HealthcareService.program</b><br>
3005   * </p>
3006   */
3007  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PROGRAM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PROGRAM);
3008
3009 /**
3010   * Search parameter: <b>service-category</b>
3011   * <p>
3012   * Description: <b>Service Category of the Healthcare Service</b><br>
3013   * Type: <b>token</b><br>
3014   * Path: <b>HealthcareService.category</b><br>
3015   * </p>
3016   */
3017  @SearchParamDefinition(name="service-category", path="HealthcareService.category", description="Service Category of the Healthcare Service", type="token" )
3018  public static final String SP_SERVICE_CATEGORY = "service-category";
3019 /**
3020   * <b>Fluent Client</b> search parameter constant for <b>service-category</b>
3021   * <p>
3022   * Description: <b>Service Category of the Healthcare Service</b><br>
3023   * Type: <b>token</b><br>
3024   * Path: <b>HealthcareService.category</b><br>
3025   * </p>
3026   */
3027  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SERVICE_CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SERVICE_CATEGORY);
3028
3029 /**
3030   * Search parameter: <b>service-type</b>
3031   * <p>
3032   * Description: <b>The type of service provided by this healthcare service</b><br>
3033   * Type: <b>token</b><br>
3034   * Path: <b>HealthcareService.type</b><br>
3035   * </p>
3036   */
3037  @SearchParamDefinition(name="service-type", path="HealthcareService.type", description="The type of service provided by this healthcare service", type="token" )
3038  public static final String SP_SERVICE_TYPE = "service-type";
3039 /**
3040   * <b>Fluent Client</b> search parameter constant for <b>service-type</b>
3041   * <p>
3042   * Description: <b>The type of service provided by this healthcare service</b><br>
3043   * Type: <b>token</b><br>
3044   * Path: <b>HealthcareService.type</b><br>
3045   * </p>
3046   */
3047  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SERVICE_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SERVICE_TYPE);
3048
3049 /**
3050   * Search parameter: <b>specialty</b>
3051   * <p>
3052   * Description: <b>The specialty of the service provided by this healthcare service</b><br>
3053   * Type: <b>token</b><br>
3054   * Path: <b>HealthcareService.specialty</b><br>
3055   * </p>
3056   */
3057  @SearchParamDefinition(name="specialty", path="HealthcareService.specialty", description="The specialty of the service provided by this healthcare service", type="token" )
3058  public static final String SP_SPECIALTY = "specialty";
3059 /**
3060   * <b>Fluent Client</b> search parameter constant for <b>specialty</b>
3061   * <p>
3062   * Description: <b>The specialty of the service provided by this healthcare service</b><br>
3063   * Type: <b>token</b><br>
3064   * Path: <b>HealthcareService.specialty</b><br>
3065   * </p>
3066   */
3067  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SPECIALTY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SPECIALTY);
3068
3069
3070}
3071