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