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