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