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