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