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