001package org.hl7.fhir.dstu2.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 Wed, Jul 13, 2016 05:32+1000 for FHIR v1.0.2
035import java.util.ArrayList;
036import java.util.List;
037
038import ca.uhn.fhir.model.api.annotation.Block;
039import ca.uhn.fhir.model.api.annotation.Child;
040import ca.uhn.fhir.model.api.annotation.Description;
041import ca.uhn.fhir.model.api.annotation.ResourceDef;
042import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
043import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
044import org.hl7.fhir.exceptions.FHIRException;
045import org.hl7.fhir.utilities.Utilities;
046
047/**
048 * Details and position information for a physical place where services are
049 * provided and resources and participants may be stored, found, contained or
050 * accommodated.
051 */
052@ResourceDef(name = "Location", profile = "http://hl7.org/fhir/Profile/Location")
053public class Location extends DomainResource {
054
055  public enum LocationStatus {
056    /**
057     * The location is operational.
058     */
059    ACTIVE,
060    /**
061     * The location is temporarily closed.
062     */
063    SUSPENDED,
064    /**
065     * The location is no longer used.
066     */
067    INACTIVE,
068    /**
069     * added to help the parsers
070     */
071    NULL;
072
073    public static LocationStatus fromCode(String codeString) throws FHIRException {
074      if (codeString == null || "".equals(codeString))
075        return null;
076      if ("active".equals(codeString))
077        return ACTIVE;
078      if ("suspended".equals(codeString))
079        return SUSPENDED;
080      if ("inactive".equals(codeString))
081        return INACTIVE;
082      throw new FHIRException("Unknown LocationStatus code '" + codeString + "'");
083    }
084
085    public String toCode() {
086      switch (this) {
087      case ACTIVE:
088        return "active";
089      case SUSPENDED:
090        return "suspended";
091      case INACTIVE:
092        return "inactive";
093      case NULL:
094        return null;
095      default:
096        return "?";
097      }
098    }
099
100    public String getSystem() {
101      switch (this) {
102      case ACTIVE:
103        return "http://hl7.org/fhir/location-status";
104      case SUSPENDED:
105        return "http://hl7.org/fhir/location-status";
106      case INACTIVE:
107        return "http://hl7.org/fhir/location-status";
108      case NULL:
109        return null;
110      default:
111        return "?";
112      }
113    }
114
115    public String getDefinition() {
116      switch (this) {
117      case ACTIVE:
118        return "The location is operational.";
119      case SUSPENDED:
120        return "The location is temporarily closed.";
121      case INACTIVE:
122        return "The location is no longer used.";
123      case NULL:
124        return null;
125      default:
126        return "?";
127      }
128    }
129
130    public String getDisplay() {
131      switch (this) {
132      case ACTIVE:
133        return "Active";
134      case SUSPENDED:
135        return "Suspended";
136      case INACTIVE:
137        return "Inactive";
138      case NULL:
139        return null;
140      default:
141        return "?";
142      }
143    }
144  }
145
146  public static class LocationStatusEnumFactory implements EnumFactory<LocationStatus> {
147    public LocationStatus fromCode(String codeString) throws IllegalArgumentException {
148      if (codeString == null || "".equals(codeString))
149        if (codeString == null || "".equals(codeString))
150          return null;
151      if ("active".equals(codeString))
152        return LocationStatus.ACTIVE;
153      if ("suspended".equals(codeString))
154        return LocationStatus.SUSPENDED;
155      if ("inactive".equals(codeString))
156        return LocationStatus.INACTIVE;
157      throw new IllegalArgumentException("Unknown LocationStatus code '" + codeString + "'");
158    }
159
160    public Enumeration<LocationStatus> fromType(Base code) throws FHIRException {
161      if (code == null || code.isEmpty())
162        return null;
163      String codeString = ((PrimitiveType) code).asStringValue();
164      if (codeString == null || "".equals(codeString))
165        return null;
166      if ("active".equals(codeString))
167        return new Enumeration<LocationStatus>(this, LocationStatus.ACTIVE);
168      if ("suspended".equals(codeString))
169        return new Enumeration<LocationStatus>(this, LocationStatus.SUSPENDED);
170      if ("inactive".equals(codeString))
171        return new Enumeration<LocationStatus>(this, LocationStatus.INACTIVE);
172      throw new FHIRException("Unknown LocationStatus code '" + codeString + "'");
173    }
174
175    public String toCode(LocationStatus code) {
176      if (code == LocationStatus.ACTIVE)
177        return "active";
178      if (code == LocationStatus.SUSPENDED)
179        return "suspended";
180      if (code == LocationStatus.INACTIVE)
181        return "inactive";
182      return "?";
183    }
184  }
185
186  public enum LocationMode {
187    /**
188     * The Location resource represents a specific instance of a location (e.g.
189     * Operating Theatre 1A).
190     */
191    INSTANCE,
192    /**
193     * The Location represents a class of locations (e.g. Any Operating Theatre)
194     * although this class of locations could be constrained within a specific
195     * boundary (such as organization, or parent location, address etc.).
196     */
197    KIND,
198    /**
199     * added to help the parsers
200     */
201    NULL;
202
203    public static LocationMode fromCode(String codeString) throws FHIRException {
204      if (codeString == null || "".equals(codeString))
205        return null;
206      if ("instance".equals(codeString))
207        return INSTANCE;
208      if ("kind".equals(codeString))
209        return KIND;
210      throw new FHIRException("Unknown LocationMode code '" + codeString + "'");
211    }
212
213    public String toCode() {
214      switch (this) {
215      case INSTANCE:
216        return "instance";
217      case KIND:
218        return "kind";
219      case NULL:
220        return null;
221      default:
222        return "?";
223      }
224    }
225
226    public String getSystem() {
227      switch (this) {
228      case INSTANCE:
229        return "http://hl7.org/fhir/location-mode";
230      case KIND:
231        return "http://hl7.org/fhir/location-mode";
232      case NULL:
233        return null;
234      default:
235        return "?";
236      }
237    }
238
239    public String getDefinition() {
240      switch (this) {
241      case INSTANCE:
242        return "The Location resource represents a specific instance of a location (e.g. Operating Theatre 1A).";
243      case KIND:
244        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.).";
245      case NULL:
246        return null;
247      default:
248        return "?";
249      }
250    }
251
252    public String getDisplay() {
253      switch (this) {
254      case INSTANCE:
255        return "Instance";
256      case KIND:
257        return "Kind";
258      case NULL:
259        return null;
260      default:
261        return "?";
262      }
263    }
264  }
265
266  public static class LocationModeEnumFactory implements EnumFactory<LocationMode> {
267    public LocationMode fromCode(String codeString) throws IllegalArgumentException {
268      if (codeString == null || "".equals(codeString))
269        if (codeString == null || "".equals(codeString))
270          return null;
271      if ("instance".equals(codeString))
272        return LocationMode.INSTANCE;
273      if ("kind".equals(codeString))
274        return LocationMode.KIND;
275      throw new IllegalArgumentException("Unknown LocationMode code '" + codeString + "'");
276    }
277
278    public Enumeration<LocationMode> fromType(Base code) throws FHIRException {
279      if (code == null || code.isEmpty())
280        return null;
281      String codeString = ((PrimitiveType) code).asStringValue();
282      if (codeString == null || "".equals(codeString))
283        return null;
284      if ("instance".equals(codeString))
285        return new Enumeration<LocationMode>(this, LocationMode.INSTANCE);
286      if ("kind".equals(codeString))
287        return new Enumeration<LocationMode>(this, LocationMode.KIND);
288      throw new FHIRException("Unknown LocationMode code '" + codeString + "'");
289    }
290
291    public String toCode(LocationMode code) {
292      if (code == LocationMode.INSTANCE)
293        return "instance";
294      if (code == LocationMode.KIND)
295        return "kind";
296      return "?";
297    }
298  }
299
300  @Block()
301  public static class LocationPositionComponent extends BackboneElement implements IBaseBackboneElement {
302    /**
303     * Longitude. The value domain and the interpretation are the same as for the
304     * text of the longitude element in KML (see notes below).
305     */
306    @Child(name = "longitude", type = {
307        DecimalType.class }, order = 1, min = 1, max = 1, modifier = false, summary = false)
308    @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).")
309    protected DecimalType longitude;
310
311    /**
312     * Latitude. The value domain and the interpretation are the same as for the
313     * text of the latitude element in KML (see notes below).
314     */
315    @Child(name = "latitude", type = {
316        DecimalType.class }, order = 2, min = 1, max = 1, modifier = false, summary = false)
317    @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).")
318    protected DecimalType latitude;
319
320    /**
321     * Altitude. The value domain and the interpretation are the same as for the
322     * text of the altitude element in KML (see notes below).
323     */
324    @Child(name = "altitude", type = {
325        DecimalType.class }, order = 3, min = 0, max = 1, modifier = false, summary = false)
326    @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).")
327    protected DecimalType altitude;
328
329    private static final long serialVersionUID = -74276134L;
330
331    /*
332     * Constructor
333     */
334    public LocationPositionComponent() {
335      super();
336    }
337
338    /*
339     * Constructor
340     */
341    public LocationPositionComponent(DecimalType longitude, DecimalType latitude) {
342      super();
343      this.longitude = longitude;
344      this.latitude = latitude;
345    }
346
347    /**
348     * @return {@link #longitude} (Longitude. The value domain and the
349     *         interpretation are the same as for the text of the longitude element
350     *         in KML (see notes below).). This is the underlying object with id,
351     *         value and extensions. The accessor "getLongitude" gives direct access
352     *         to the value
353     */
354    public DecimalType getLongitudeElement() {
355      if (this.longitude == null)
356        if (Configuration.errorOnAutoCreate())
357          throw new Error("Attempt to auto-create LocationPositionComponent.longitude");
358        else if (Configuration.doAutoCreate())
359          this.longitude = new DecimalType(); // bb
360      return this.longitude;
361    }
362
363    public boolean hasLongitudeElement() {
364      return this.longitude != null && !this.longitude.isEmpty();
365    }
366
367    public boolean hasLongitude() {
368      return this.longitude != null && !this.longitude.isEmpty();
369    }
370
371    /**
372     * @param value {@link #longitude} (Longitude. The value domain and the
373     *              interpretation are the same as for the text of the longitude
374     *              element in KML (see notes below).). This is the underlying
375     *              object with id, value and extensions. The accessor
376     *              "getLongitude" gives direct access to the value
377     */
378    public LocationPositionComponent setLongitudeElement(DecimalType value) {
379      this.longitude = value;
380      return this;
381    }
382
383    /**
384     * @return Longitude. The value domain and the interpretation are the same as
385     *         for the text of the longitude element in KML (see notes below).
386     */
387    public BigDecimal getLongitude() {
388      return this.longitude == null ? null : this.longitude.getValue();
389    }
390
391    /**
392     * @param value Longitude. The value domain and the interpretation are the same
393     *              as for the text of the longitude element in KML (see notes
394     *              below).
395     */
396    public LocationPositionComponent setLongitude(BigDecimal value) {
397      if (this.longitude == null)
398        this.longitude = new DecimalType();
399      this.longitude.setValue(value);
400      return this;
401    }
402
403    /**
404     * @return {@link #latitude} (Latitude. The value domain and the interpretation
405     *         are the same as for the text of the latitude element in KML (see
406     *         notes below).). This is the underlying object with id, value and
407     *         extensions. The accessor "getLatitude" gives direct access to the
408     *         value
409     */
410    public DecimalType getLatitudeElement() {
411      if (this.latitude == null)
412        if (Configuration.errorOnAutoCreate())
413          throw new Error("Attempt to auto-create LocationPositionComponent.latitude");
414        else if (Configuration.doAutoCreate())
415          this.latitude = new DecimalType(); // bb
416      return this.latitude;
417    }
418
419    public boolean hasLatitudeElement() {
420      return this.latitude != null && !this.latitude.isEmpty();
421    }
422
423    public boolean hasLatitude() {
424      return this.latitude != null && !this.latitude.isEmpty();
425    }
426
427    /**
428     * @param value {@link #latitude} (Latitude. The value domain and the
429     *              interpretation are the same as for the text of the latitude
430     *              element in KML (see notes below).). This is the underlying
431     *              object with id, value and extensions. The accessor "getLatitude"
432     *              gives direct access to the value
433     */
434    public LocationPositionComponent setLatitudeElement(DecimalType value) {
435      this.latitude = value;
436      return this;
437    }
438
439    /**
440     * @return Latitude. The value domain and the interpretation are the same as for
441     *         the text of the latitude element in KML (see notes below).
442     */
443    public BigDecimal getLatitude() {
444      return this.latitude == null ? null : this.latitude.getValue();
445    }
446
447    /**
448     * @param value Latitude. The value domain and the interpretation are the same
449     *              as for the text of the latitude element in KML (see notes
450     *              below).
451     */
452    public LocationPositionComponent setLatitude(BigDecimal value) {
453      if (this.latitude == null)
454        this.latitude = new DecimalType();
455      this.latitude.setValue(value);
456      return this;
457    }
458
459    /**
460     * @return {@link #altitude} (Altitude. The value domain and the interpretation
461     *         are the same as for the text of the altitude element in KML (see
462     *         notes below).). This is the underlying object with id, value and
463     *         extensions. The accessor "getAltitude" gives direct access to the
464     *         value
465     */
466    public DecimalType getAltitudeElement() {
467      if (this.altitude == null)
468        if (Configuration.errorOnAutoCreate())
469          throw new Error("Attempt to auto-create LocationPositionComponent.altitude");
470        else if (Configuration.doAutoCreate())
471          this.altitude = new DecimalType(); // bb
472      return this.altitude;
473    }
474
475    public boolean hasAltitudeElement() {
476      return this.altitude != null && !this.altitude.isEmpty();
477    }
478
479    public boolean hasAltitude() {
480      return this.altitude != null && !this.altitude.isEmpty();
481    }
482
483    /**
484     * @param value {@link #altitude} (Altitude. The value domain and the
485     *              interpretation are the same as for the text of the altitude
486     *              element in KML (see notes below).). This is the underlying
487     *              object with id, value and extensions. The accessor "getAltitude"
488     *              gives direct access to the value
489     */
490    public LocationPositionComponent setAltitudeElement(DecimalType value) {
491      this.altitude = value;
492      return this;
493    }
494
495    /**
496     * @return Altitude. The value domain and the interpretation are the same as for
497     *         the text of the altitude element in KML (see notes below).
498     */
499    public BigDecimal getAltitude() {
500      return this.altitude == null ? null : this.altitude.getValue();
501    }
502
503    /**
504     * @param value Altitude. The value domain and the interpretation are the same
505     *              as for the text of the altitude element in KML (see notes
506     *              below).
507     */
508    public LocationPositionComponent setAltitude(BigDecimal value) {
509      if (value == null)
510        this.altitude = null;
511      else {
512        if (this.altitude == null)
513          this.altitude = new DecimalType();
514        this.altitude.setValue(value);
515      }
516      return this;
517    }
518
519    protected void listChildren(List<Property> childrenList) {
520      super.listChildren(childrenList);
521      childrenList.add(new Property("longitude", "decimal",
522          "Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).",
523          0, java.lang.Integer.MAX_VALUE, longitude));
524      childrenList.add(new Property("latitude", "decimal",
525          "Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).",
526          0, java.lang.Integer.MAX_VALUE, latitude));
527      childrenList.add(new Property("altitude", "decimal",
528          "Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).",
529          0, java.lang.Integer.MAX_VALUE, altitude));
530    }
531
532    @Override
533    public void setProperty(String name, Base value) throws FHIRException {
534      if (name.equals("longitude"))
535        this.longitude = castToDecimal(value); // DecimalType
536      else if (name.equals("latitude"))
537        this.latitude = castToDecimal(value); // DecimalType
538      else if (name.equals("altitude"))
539        this.altitude = castToDecimal(value); // DecimalType
540      else
541        super.setProperty(name, value);
542    }
543
544    @Override
545    public Base addChild(String name) throws FHIRException {
546      if (name.equals("longitude")) {
547        throw new FHIRException("Cannot call addChild on a singleton property Location.longitude");
548      } else if (name.equals("latitude")) {
549        throw new FHIRException("Cannot call addChild on a singleton property Location.latitude");
550      } else if (name.equals("altitude")) {
551        throw new FHIRException("Cannot call addChild on a singleton property Location.altitude");
552      } else
553        return super.addChild(name);
554    }
555
556    public LocationPositionComponent copy() {
557      LocationPositionComponent dst = new LocationPositionComponent();
558      copyValues(dst);
559      dst.longitude = longitude == null ? null : longitude.copy();
560      dst.latitude = latitude == null ? null : latitude.copy();
561      dst.altitude = altitude == null ? null : altitude.copy();
562      return dst;
563    }
564
565    @Override
566    public boolean equalsDeep(Base other) {
567      if (!super.equalsDeep(other))
568        return false;
569      if (!(other instanceof LocationPositionComponent))
570        return false;
571      LocationPositionComponent o = (LocationPositionComponent) other;
572      return compareDeep(longitude, o.longitude, true) && compareDeep(latitude, o.latitude, true)
573          && compareDeep(altitude, o.altitude, true);
574    }
575
576    @Override
577    public boolean equalsShallow(Base other) {
578      if (!super.equalsShallow(other))
579        return false;
580      if (!(other instanceof LocationPositionComponent))
581        return false;
582      LocationPositionComponent o = (LocationPositionComponent) other;
583      return compareValues(longitude, o.longitude, true) && compareValues(latitude, o.latitude, true)
584          && compareValues(altitude, o.altitude, true);
585    }
586
587    public boolean isEmpty() {
588      return super.isEmpty() && (longitude == null || longitude.isEmpty()) && (latitude == null || latitude.isEmpty())
589          && (altitude == null || altitude.isEmpty());
590    }
591
592    public String fhirType() {
593      return "Location.position";
594
595    }
596
597  }
598
599  /**
600   * Unique code or number identifying the location to its users.
601   */
602  @Child(name = "identifier", type = {
603      Identifier.class }, order = 0, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
604  @Description(shortDefinition = "Unique code or number identifying the location to its users", formalDefinition = "Unique code or number identifying the location to its users.")
605  protected List<Identifier> identifier;
606
607  /**
608   * active | suspended | inactive.
609   */
610  @Child(name = "status", type = { CodeType.class }, order = 1, min = 0, max = 1, modifier = true, summary = true)
611  @Description(shortDefinition = "active | suspended | inactive", formalDefinition = "active | suspended | inactive.")
612  protected Enumeration<LocationStatus> status;
613
614  /**
615   * Name of the location as used by humans. Does not need to be unique.
616   */
617  @Child(name = "name", type = { StringType.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
618  @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.")
619  protected StringType name;
620
621  /**
622   * Description of the Location, which helps in finding or referencing the place.
623   */
624  @Child(name = "description", type = {
625      StringType.class }, order = 3, min = 0, max = 1, modifier = false, summary = true)
626  @Description(shortDefinition = "Description of the location", formalDefinition = "Description of the Location, which helps in finding or referencing the place.")
627  protected StringType description;
628
629  /**
630   * Indicates whether a resource instance represents a specific location or a
631   * class of locations.
632   */
633  @Child(name = "mode", type = { CodeType.class }, order = 4, min = 0, max = 1, modifier = true, summary = true)
634  @Description(shortDefinition = "instance | kind", formalDefinition = "Indicates whether a resource instance represents a specific location or a class of locations.")
635  protected Enumeration<LocationMode> mode;
636
637  /**
638   * Indicates the type of function performed at the location.
639   */
640  @Child(name = "type", type = { CodeableConcept.class }, order = 5, min = 0, max = 1, modifier = false, summary = true)
641  @Description(shortDefinition = "Type of function performed", formalDefinition = "Indicates the type of function performed at the location.")
642  protected CodeableConcept type;
643
644  /**
645   * The contact details of communication devices available at the location. This
646   * can include phone numbers, fax numbers, mobile numbers, email addresses and
647   * web sites.
648   */
649  @Child(name = "telecom", type = {
650      ContactPoint.class }, order = 6, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
651  @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.")
652  protected List<ContactPoint> telecom;
653
654  /**
655   * Physical location.
656   */
657  @Child(name = "address", type = { Address.class }, order = 7, min = 0, max = 1, modifier = false, summary = false)
658  @Description(shortDefinition = "Physical location", formalDefinition = "Physical location.")
659  protected Address address;
660
661  /**
662   * Physical form of the location, e.g. building, room, vehicle, road.
663   */
664  @Child(name = "physicalType", type = {
665      CodeableConcept.class }, order = 8, min = 0, max = 1, modifier = false, summary = true)
666  @Description(shortDefinition = "Physical form of the location", formalDefinition = "Physical form of the location, e.g. building, room, vehicle, road.")
667  protected CodeableConcept physicalType;
668
669  /**
670   * The absolute geographic location of the Location, expressed using the WGS84
671   * datum (This is the same co-ordinate system used in KML).
672   */
673  @Child(name = "position", type = {}, order = 9, min = 0, max = 1, modifier = false, summary = false)
674  @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).")
675  protected LocationPositionComponent position;
676
677  /**
678   * The organization responsible for the provisioning and upkeep of the location.
679   */
680  @Child(name = "managingOrganization", type = {
681      Organization.class }, order = 10, min = 0, max = 1, modifier = false, summary = true)
682  @Description(shortDefinition = "Organization responsible for provisioning and upkeep", formalDefinition = "The organization responsible for the provisioning and upkeep of the location.")
683  protected Reference managingOrganization;
684
685  /**
686   * The actual object that is the target of the reference (The organization
687   * responsible for the provisioning and upkeep of the location.)
688   */
689  protected Organization managingOrganizationTarget;
690
691  /**
692   * Another Location which this Location is physically part of.
693   */
694  @Child(name = "partOf", type = { Location.class }, order = 11, min = 0, max = 1, modifier = false, summary = false)
695  @Description(shortDefinition = "Another Location this one is physically part of", formalDefinition = "Another Location which this Location is physically part of.")
696  protected Reference partOf;
697
698  /**
699   * The actual object that is the target of the reference (Another Location which
700   * this Location is physically part of.)
701   */
702  protected Location partOfTarget;
703
704  private static final long serialVersionUID = -2100435761L;
705
706  /*
707   * Constructor
708   */
709  public Location() {
710    super();
711  }
712
713  /**
714   * @return {@link #identifier} (Unique code or number identifying the location
715   *         to its users.)
716   */
717  public List<Identifier> getIdentifier() {
718    if (this.identifier == null)
719      this.identifier = new ArrayList<Identifier>();
720    return this.identifier;
721  }
722
723  public boolean hasIdentifier() {
724    if (this.identifier == null)
725      return false;
726    for (Identifier item : this.identifier)
727      if (!item.isEmpty())
728        return true;
729    return false;
730  }
731
732  /**
733   * @return {@link #identifier} (Unique code or number identifying the location
734   *         to its users.)
735   */
736  // syntactic sugar
737  public Identifier addIdentifier() { // 3
738    Identifier t = new Identifier();
739    if (this.identifier == null)
740      this.identifier = new ArrayList<Identifier>();
741    this.identifier.add(t);
742    return t;
743  }
744
745  // syntactic sugar
746  public Location addIdentifier(Identifier t) { // 3
747    if (t == null)
748      return this;
749    if (this.identifier == null)
750      this.identifier = new ArrayList<Identifier>();
751    this.identifier.add(t);
752    return this;
753  }
754
755  /**
756   * @return {@link #status} (active | suspended | inactive.). This is the
757   *         underlying object with id, value and extensions. The accessor
758   *         "getStatus" gives direct access to the value
759   */
760  public Enumeration<LocationStatus> getStatusElement() {
761    if (this.status == null)
762      if (Configuration.errorOnAutoCreate())
763        throw new Error("Attempt to auto-create Location.status");
764      else if (Configuration.doAutoCreate())
765        this.status = new Enumeration<LocationStatus>(new LocationStatusEnumFactory()); // bb
766    return this.status;
767  }
768
769  public boolean hasStatusElement() {
770    return this.status != null && !this.status.isEmpty();
771  }
772
773  public boolean hasStatus() {
774    return this.status != null && !this.status.isEmpty();
775  }
776
777  /**
778   * @param value {@link #status} (active | suspended | inactive.). This is the
779   *              underlying object with id, value and extensions. The accessor
780   *              "getStatus" gives direct access to the value
781   */
782  public Location setStatusElement(Enumeration<LocationStatus> value) {
783    this.status = value;
784    return this;
785  }
786
787  /**
788   * @return active | suspended | inactive.
789   */
790  public LocationStatus getStatus() {
791    return this.status == null ? null : this.status.getValue();
792  }
793
794  /**
795   * @param value active | suspended | inactive.
796   */
797  public Location setStatus(LocationStatus value) {
798    if (value == null)
799      this.status = null;
800    else {
801      if (this.status == null)
802        this.status = new Enumeration<LocationStatus>(new LocationStatusEnumFactory());
803      this.status.setValue(value);
804    }
805    return this;
806  }
807
808  /**
809   * @return {@link #name} (Name of the location as used by humans. Does not need
810   *         to be unique.). This is the underlying object with id, value and
811   *         extensions. The accessor "getName" gives direct access to the value
812   */
813  public StringType getNameElement() {
814    if (this.name == null)
815      if (Configuration.errorOnAutoCreate())
816        throw new Error("Attempt to auto-create Location.name");
817      else if (Configuration.doAutoCreate())
818        this.name = new StringType(); // bb
819    return this.name;
820  }
821
822  public boolean hasNameElement() {
823    return this.name != null && !this.name.isEmpty();
824  }
825
826  public boolean hasName() {
827    return this.name != null && !this.name.isEmpty();
828  }
829
830  /**
831   * @param value {@link #name} (Name of the location as used by humans. Does not
832   *              need to be unique.). This is the underlying object with id,
833   *              value and extensions. The accessor "getName" gives direct access
834   *              to the value
835   */
836  public Location setNameElement(StringType value) {
837    this.name = value;
838    return this;
839  }
840
841  /**
842   * @return Name of the location as used by humans. Does not need to be unique.
843   */
844  public String getName() {
845    return this.name == null ? null : this.name.getValue();
846  }
847
848  /**
849   * @param value Name of the location as used by humans. Does not need to be
850   *              unique.
851   */
852  public Location setName(String value) {
853    if (Utilities.noString(value))
854      this.name = null;
855    else {
856      if (this.name == null)
857        this.name = new StringType();
858      this.name.setValue(value);
859    }
860    return this;
861  }
862
863  /**
864   * @return {@link #description} (Description of the Location, which helps in
865   *         finding or referencing the place.). This is the underlying object
866   *         with id, value and extensions. The accessor "getDescription" gives
867   *         direct access to the value
868   */
869  public StringType getDescriptionElement() {
870    if (this.description == null)
871      if (Configuration.errorOnAutoCreate())
872        throw new Error("Attempt to auto-create Location.description");
873      else if (Configuration.doAutoCreate())
874        this.description = new StringType(); // bb
875    return this.description;
876  }
877
878  public boolean hasDescriptionElement() {
879    return this.description != null && !this.description.isEmpty();
880  }
881
882  public boolean hasDescription() {
883    return this.description != null && !this.description.isEmpty();
884  }
885
886  /**
887   * @param value {@link #description} (Description of the Location, which helps
888   *              in finding or referencing the place.). This is the underlying
889   *              object with id, value and extensions. The accessor
890   *              "getDescription" gives direct access to the value
891   */
892  public Location setDescriptionElement(StringType value) {
893    this.description = value;
894    return this;
895  }
896
897  /**
898   * @return Description of the Location, which helps in finding or referencing
899   *         the place.
900   */
901  public String getDescription() {
902    return this.description == null ? null : this.description.getValue();
903  }
904
905  /**
906   * @param value Description of the Location, which helps in finding or
907   *              referencing the place.
908   */
909  public Location setDescription(String value) {
910    if (Utilities.noString(value))
911      this.description = null;
912    else {
913      if (this.description == null)
914        this.description = new StringType();
915      this.description.setValue(value);
916    }
917    return this;
918  }
919
920  /**
921   * @return {@link #mode} (Indicates whether a resource instance represents a
922   *         specific location or a class of locations.). This is the underlying
923   *         object with id, value and extensions. The accessor "getMode" gives
924   *         direct access to the value
925   */
926  public Enumeration<LocationMode> getModeElement() {
927    if (this.mode == null)
928      if (Configuration.errorOnAutoCreate())
929        throw new Error("Attempt to auto-create Location.mode");
930      else if (Configuration.doAutoCreate())
931        this.mode = new Enumeration<LocationMode>(new LocationModeEnumFactory()); // bb
932    return this.mode;
933  }
934
935  public boolean hasModeElement() {
936    return this.mode != null && !this.mode.isEmpty();
937  }
938
939  public boolean hasMode() {
940    return this.mode != null && !this.mode.isEmpty();
941  }
942
943  /**
944   * @param value {@link #mode} (Indicates whether a resource instance represents
945   *              a specific location or a class of locations.). This is the
946   *              underlying object with id, value and extensions. The accessor
947   *              "getMode" gives direct access to the value
948   */
949  public Location setModeElement(Enumeration<LocationMode> value) {
950    this.mode = value;
951    return this;
952  }
953
954  /**
955   * @return Indicates whether a resource instance represents a specific location
956   *         or a class of locations.
957   */
958  public LocationMode getMode() {
959    return this.mode == null ? null : this.mode.getValue();
960  }
961
962  /**
963   * @param value Indicates whether a resource instance represents a specific
964   *              location or a class of locations.
965   */
966  public Location setMode(LocationMode value) {
967    if (value == null)
968      this.mode = null;
969    else {
970      if (this.mode == null)
971        this.mode = new Enumeration<LocationMode>(new LocationModeEnumFactory());
972      this.mode.setValue(value);
973    }
974    return this;
975  }
976
977  /**
978   * @return {@link #type} (Indicates the type of function performed at the
979   *         location.)
980   */
981  public CodeableConcept getType() {
982    if (this.type == null)
983      if (Configuration.errorOnAutoCreate())
984        throw new Error("Attempt to auto-create Location.type");
985      else if (Configuration.doAutoCreate())
986        this.type = new CodeableConcept(); // cc
987    return this.type;
988  }
989
990  public boolean hasType() {
991    return this.type != null && !this.type.isEmpty();
992  }
993
994  /**
995   * @param value {@link #type} (Indicates the type of function performed at the
996   *              location.)
997   */
998  public Location setType(CodeableConcept value) {
999    this.type = value;
1000    return this;
1001  }
1002
1003  /**
1004   * @return {@link #telecom} (The contact details of communication devices
1005   *         available at the location. This can include phone numbers, fax
1006   *         numbers, mobile numbers, email addresses and web sites.)
1007   */
1008  public List<ContactPoint> getTelecom() {
1009    if (this.telecom == null)
1010      this.telecom = new ArrayList<ContactPoint>();
1011    return this.telecom;
1012  }
1013
1014  public boolean hasTelecom() {
1015    if (this.telecom == null)
1016      return false;
1017    for (ContactPoint item : this.telecom)
1018      if (!item.isEmpty())
1019        return true;
1020    return false;
1021  }
1022
1023  /**
1024   * @return {@link #telecom} (The contact details of communication devices
1025   *         available at the location. This can include phone numbers, fax
1026   *         numbers, mobile numbers, email addresses and web sites.)
1027   */
1028  // syntactic sugar
1029  public ContactPoint addTelecom() { // 3
1030    ContactPoint t = new ContactPoint();
1031    if (this.telecom == null)
1032      this.telecom = new ArrayList<ContactPoint>();
1033    this.telecom.add(t);
1034    return t;
1035  }
1036
1037  // syntactic sugar
1038  public Location addTelecom(ContactPoint t) { // 3
1039    if (t == null)
1040      return this;
1041    if (this.telecom == null)
1042      this.telecom = new ArrayList<ContactPoint>();
1043    this.telecom.add(t);
1044    return this;
1045  }
1046
1047  /**
1048   * @return {@link #address} (Physical location.)
1049   */
1050  public Address getAddress() {
1051    if (this.address == null)
1052      if (Configuration.errorOnAutoCreate())
1053        throw new Error("Attempt to auto-create Location.address");
1054      else if (Configuration.doAutoCreate())
1055        this.address = new Address(); // cc
1056    return this.address;
1057  }
1058
1059  public boolean hasAddress() {
1060    return this.address != null && !this.address.isEmpty();
1061  }
1062
1063  /**
1064   * @param value {@link #address} (Physical location.)
1065   */
1066  public Location setAddress(Address value) {
1067    this.address = value;
1068    return this;
1069  }
1070
1071  /**
1072   * @return {@link #physicalType} (Physical form of the location, e.g. building,
1073   *         room, vehicle, road.)
1074   */
1075  public CodeableConcept getPhysicalType() {
1076    if (this.physicalType == null)
1077      if (Configuration.errorOnAutoCreate())
1078        throw new Error("Attempt to auto-create Location.physicalType");
1079      else if (Configuration.doAutoCreate())
1080        this.physicalType = new CodeableConcept(); // cc
1081    return this.physicalType;
1082  }
1083
1084  public boolean hasPhysicalType() {
1085    return this.physicalType != null && !this.physicalType.isEmpty();
1086  }
1087
1088  /**
1089   * @param value {@link #physicalType} (Physical form of the location, e.g.
1090   *              building, room, vehicle, road.)
1091   */
1092  public Location setPhysicalType(CodeableConcept value) {
1093    this.physicalType = value;
1094    return this;
1095  }
1096
1097  /**
1098   * @return {@link #position} (The absolute geographic location of the Location,
1099   *         expressed using the WGS84 datum (This is the same co-ordinate system
1100   *         used in KML).)
1101   */
1102  public LocationPositionComponent getPosition() {
1103    if (this.position == null)
1104      if (Configuration.errorOnAutoCreate())
1105        throw new Error("Attempt to auto-create Location.position");
1106      else if (Configuration.doAutoCreate())
1107        this.position = new LocationPositionComponent(); // cc
1108    return this.position;
1109  }
1110
1111  public boolean hasPosition() {
1112    return this.position != null && !this.position.isEmpty();
1113  }
1114
1115  /**
1116   * @param value {@link #position} (The absolute geographic location of the
1117   *              Location, expressed using the WGS84 datum (This is the same
1118   *              co-ordinate system used in KML).)
1119   */
1120  public Location setPosition(LocationPositionComponent value) {
1121    this.position = value;
1122    return this;
1123  }
1124
1125  /**
1126   * @return {@link #managingOrganization} (The organization responsible for the
1127   *         provisioning and upkeep of the location.)
1128   */
1129  public Reference getManagingOrganization() {
1130    if (this.managingOrganization == null)
1131      if (Configuration.errorOnAutoCreate())
1132        throw new Error("Attempt to auto-create Location.managingOrganization");
1133      else if (Configuration.doAutoCreate())
1134        this.managingOrganization = new Reference(); // cc
1135    return this.managingOrganization;
1136  }
1137
1138  public boolean hasManagingOrganization() {
1139    return this.managingOrganization != null && !this.managingOrganization.isEmpty();
1140  }
1141
1142  /**
1143   * @param value {@link #managingOrganization} (The organization responsible for
1144   *              the provisioning and upkeep of the location.)
1145   */
1146  public Location setManagingOrganization(Reference value) {
1147    this.managingOrganization = value;
1148    return this;
1149  }
1150
1151  /**
1152   * @return {@link #managingOrganization} The actual object that is the target of
1153   *         the reference. The reference library doesn't populate this, but you
1154   *         can use it to hold the resource if you resolve it. (The organization
1155   *         responsible for the provisioning and upkeep of the location.)
1156   */
1157  public Organization getManagingOrganizationTarget() {
1158    if (this.managingOrganizationTarget == null)
1159      if (Configuration.errorOnAutoCreate())
1160        throw new Error("Attempt to auto-create Location.managingOrganization");
1161      else if (Configuration.doAutoCreate())
1162        this.managingOrganizationTarget = new Organization(); // aa
1163    return this.managingOrganizationTarget;
1164  }
1165
1166  /**
1167   * @param value {@link #managingOrganization} The actual object that is the
1168   *              target of the reference. The reference library doesn't use
1169   *              these, but you can use it to hold the resource if you resolve
1170   *              it. (The organization responsible for the provisioning and
1171   *              upkeep of the location.)
1172   */
1173  public Location setManagingOrganizationTarget(Organization value) {
1174    this.managingOrganizationTarget = value;
1175    return this;
1176  }
1177
1178  /**
1179   * @return {@link #partOf} (Another Location which this Location is physically
1180   *         part of.)
1181   */
1182  public Reference getPartOf() {
1183    if (this.partOf == null)
1184      if (Configuration.errorOnAutoCreate())
1185        throw new Error("Attempt to auto-create Location.partOf");
1186      else if (Configuration.doAutoCreate())
1187        this.partOf = new Reference(); // cc
1188    return this.partOf;
1189  }
1190
1191  public boolean hasPartOf() {
1192    return this.partOf != null && !this.partOf.isEmpty();
1193  }
1194
1195  /**
1196   * @param value {@link #partOf} (Another Location which this Location is
1197   *              physically part of.)
1198   */
1199  public Location setPartOf(Reference value) {
1200    this.partOf = value;
1201    return this;
1202  }
1203
1204  /**
1205   * @return {@link #partOf} The actual object that is the target of the
1206   *         reference. The reference library doesn't populate this, but you can
1207   *         use it to hold the resource if you resolve it. (Another Location
1208   *         which this Location is physically part of.)
1209   */
1210  public Location getPartOfTarget() {
1211    if (this.partOfTarget == null)
1212      if (Configuration.errorOnAutoCreate())
1213        throw new Error("Attempt to auto-create Location.partOf");
1214      else if (Configuration.doAutoCreate())
1215        this.partOfTarget = new Location(); // aa
1216    return this.partOfTarget;
1217  }
1218
1219  /**
1220   * @param value {@link #partOf} The actual object that is the target of the
1221   *              reference. The reference library doesn't use these, but you can
1222   *              use it to hold the resource if you resolve it. (Another Location
1223   *              which this Location is physically part of.)
1224   */
1225  public Location setPartOfTarget(Location value) {
1226    this.partOfTarget = value;
1227    return this;
1228  }
1229
1230  protected void listChildren(List<Property> childrenList) {
1231    super.listChildren(childrenList);
1232    childrenList.add(new Property("identifier", "Identifier",
1233        "Unique code or number identifying the location to its users.", 0, java.lang.Integer.MAX_VALUE, identifier));
1234    childrenList
1235        .add(new Property("status", "code", "active | suspended | inactive.", 0, java.lang.Integer.MAX_VALUE, status));
1236    childrenList.add(new Property("name", "string",
1237        "Name of the location as used by humans. Does not need to be unique.", 0, java.lang.Integer.MAX_VALUE, name));
1238    childrenList.add(new Property("description", "string",
1239        "Description of the Location, which helps in finding or referencing the place.", 0, java.lang.Integer.MAX_VALUE,
1240        description));
1241    childrenList.add(new Property("mode", "code",
1242        "Indicates whether a resource instance represents a specific location or a class of locations.", 0,
1243        java.lang.Integer.MAX_VALUE, mode));
1244    childrenList.add(new Property("type", "CodeableConcept",
1245        "Indicates the type of function performed at the location.", 0, java.lang.Integer.MAX_VALUE, type));
1246    childrenList.add(new Property("telecom", "ContactPoint",
1247        "The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.",
1248        0, java.lang.Integer.MAX_VALUE, telecom));
1249    childrenList.add(new Property("address", "Address", "Physical location.", 0, java.lang.Integer.MAX_VALUE, address));
1250    childrenList.add(new Property("physicalType", "CodeableConcept",
1251        "Physical form of the location, e.g. building, room, vehicle, road.", 0, java.lang.Integer.MAX_VALUE,
1252        physicalType));
1253    childrenList.add(new Property("position", "",
1254        "The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML).",
1255        0, java.lang.Integer.MAX_VALUE, position));
1256    childrenList.add(new Property("managingOrganization", "Reference(Organization)",
1257        "The organization responsible for the provisioning and upkeep of the location.", 0, java.lang.Integer.MAX_VALUE,
1258        managingOrganization));
1259    childrenList.add(new Property("partOf", "Reference(Location)",
1260        "Another Location which this Location is physically part of.", 0, java.lang.Integer.MAX_VALUE, partOf));
1261  }
1262
1263  @Override
1264  public void setProperty(String name, Base value) throws FHIRException {
1265    if (name.equals("identifier"))
1266      this.getIdentifier().add(castToIdentifier(value));
1267    else if (name.equals("status"))
1268      this.status = new LocationStatusEnumFactory().fromType(value); // Enumeration<LocationStatus>
1269    else if (name.equals("name"))
1270      this.name = castToString(value); // StringType
1271    else if (name.equals("description"))
1272      this.description = castToString(value); // StringType
1273    else if (name.equals("mode"))
1274      this.mode = new LocationModeEnumFactory().fromType(value); // Enumeration<LocationMode>
1275    else if (name.equals("type"))
1276      this.type = castToCodeableConcept(value); // CodeableConcept
1277    else if (name.equals("telecom"))
1278      this.getTelecom().add(castToContactPoint(value));
1279    else if (name.equals("address"))
1280      this.address = castToAddress(value); // Address
1281    else if (name.equals("physicalType"))
1282      this.physicalType = castToCodeableConcept(value); // CodeableConcept
1283    else if (name.equals("position"))
1284      this.position = (LocationPositionComponent) value; // LocationPositionComponent
1285    else if (name.equals("managingOrganization"))
1286      this.managingOrganization = castToReference(value); // Reference
1287    else if (name.equals("partOf"))
1288      this.partOf = castToReference(value); // Reference
1289    else
1290      super.setProperty(name, value);
1291  }
1292
1293  @Override
1294  public Base addChild(String name) throws FHIRException {
1295    if (name.equals("identifier")) {
1296      return addIdentifier();
1297    } else if (name.equals("status")) {
1298      throw new FHIRException("Cannot call addChild on a singleton property Location.status");
1299    } else if (name.equals("name")) {
1300      throw new FHIRException("Cannot call addChild on a singleton property Location.name");
1301    } else if (name.equals("description")) {
1302      throw new FHIRException("Cannot call addChild on a singleton property Location.description");
1303    } else if (name.equals("mode")) {
1304      throw new FHIRException("Cannot call addChild on a singleton property Location.mode");
1305    } else if (name.equals("type")) {
1306      this.type = new CodeableConcept();
1307      return this.type;
1308    } else if (name.equals("telecom")) {
1309      return addTelecom();
1310    } else if (name.equals("address")) {
1311      this.address = new Address();
1312      return this.address;
1313    } else if (name.equals("physicalType")) {
1314      this.physicalType = new CodeableConcept();
1315      return this.physicalType;
1316    } else if (name.equals("position")) {
1317      this.position = new LocationPositionComponent();
1318      return this.position;
1319    } else if (name.equals("managingOrganization")) {
1320      this.managingOrganization = new Reference();
1321      return this.managingOrganization;
1322    } else if (name.equals("partOf")) {
1323      this.partOf = new Reference();
1324      return this.partOf;
1325    } else
1326      return super.addChild(name);
1327  }
1328
1329  public String fhirType() {
1330    return "Location";
1331
1332  }
1333
1334  public Location copy() {
1335    Location dst = new Location();
1336    copyValues(dst);
1337    if (identifier != null) {
1338      dst.identifier = new ArrayList<Identifier>();
1339      for (Identifier i : identifier)
1340        dst.identifier.add(i.copy());
1341    }
1342    ;
1343    dst.status = status == null ? null : status.copy();
1344    dst.name = name == null ? null : name.copy();
1345    dst.description = description == null ? null : description.copy();
1346    dst.mode = mode == null ? null : mode.copy();
1347    dst.type = type == null ? null : type.copy();
1348    if (telecom != null) {
1349      dst.telecom = new ArrayList<ContactPoint>();
1350      for (ContactPoint i : telecom)
1351        dst.telecom.add(i.copy());
1352    }
1353    ;
1354    dst.address = address == null ? null : address.copy();
1355    dst.physicalType = physicalType == null ? null : physicalType.copy();
1356    dst.position = position == null ? null : position.copy();
1357    dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy();
1358    dst.partOf = partOf == null ? null : partOf.copy();
1359    return dst;
1360  }
1361
1362  protected Location typedCopy() {
1363    return copy();
1364  }
1365
1366  @Override
1367  public boolean equalsDeep(Base other) {
1368    if (!super.equalsDeep(other))
1369      return false;
1370    if (!(other instanceof Location))
1371      return false;
1372    Location o = (Location) other;
1373    return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true)
1374        && compareDeep(name, o.name, true) && compareDeep(description, o.description, true)
1375        && compareDeep(mode, o.mode, true) && compareDeep(type, o.type, true) && compareDeep(telecom, o.telecom, true)
1376        && compareDeep(address, o.address, true) && compareDeep(physicalType, o.physicalType, true)
1377        && compareDeep(position, o.position, true) && compareDeep(managingOrganization, o.managingOrganization, true)
1378        && compareDeep(partOf, o.partOf, true);
1379  }
1380
1381  @Override
1382  public boolean equalsShallow(Base other) {
1383    if (!super.equalsShallow(other))
1384      return false;
1385    if (!(other instanceof Location))
1386      return false;
1387    Location o = (Location) other;
1388    return compareValues(status, o.status, true) && compareValues(name, o.name, true)
1389        && compareValues(description, o.description, true) && compareValues(mode, o.mode, true);
1390  }
1391
1392  public boolean isEmpty() {
1393    return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty())
1394        && (name == null || name.isEmpty()) && (description == null || description.isEmpty())
1395        && (mode == null || mode.isEmpty()) && (type == null || type.isEmpty())
1396        && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty())
1397        && (physicalType == null || physicalType.isEmpty()) && (position == null || position.isEmpty())
1398        && (managingOrganization == null || managingOrganization.isEmpty()) && (partOf == null || partOf.isEmpty());
1399  }
1400
1401  @Override
1402  public ResourceType getResourceType() {
1403    return ResourceType.Location;
1404  }
1405
1406  @SearchParamDefinition(name = "identifier", path = "Location.identifier", description = "Unique code or number identifying the location to its users", type = "token")
1407  public static final String SP_IDENTIFIER = "identifier";
1408  @SearchParamDefinition(name = "partof", path = "Location.partOf", description = "The location of which this location is a part", type = "reference")
1409  public static final String SP_PARTOF = "partof";
1410  @SearchParamDefinition(name = "near-distance", path = "Location.position", description = "A distance quantity to limit the near search to locations within a specific distance", type = "token")
1411  public static final String SP_NEARDISTANCE = "near-distance";
1412  @SearchParamDefinition(name = "address", path = "Location.address", description = "A (part of the) address of the location", type = "string")
1413  public static final String SP_ADDRESS = "address";
1414  @SearchParamDefinition(name = "address-state", path = "Location.address.state", description = "A state specified in an address", type = "string")
1415  public static final String SP_ADDRESSSTATE = "address-state";
1416  @SearchParamDefinition(name = "type", path = "Location.type", description = "A code for the type of location", type = "token")
1417  public static final String SP_TYPE = "type";
1418  @SearchParamDefinition(name = "address-postalcode", path = "Location.address.postalCode", description = "A postal code specified in an address", type = "string")
1419  public static final String SP_ADDRESSPOSTALCODE = "address-postalcode";
1420  @SearchParamDefinition(name = "address-country", path = "Location.address.country", description = "A country specified in an address", type = "string")
1421  public static final String SP_ADDRESSCOUNTRY = "address-country";
1422  @SearchParamDefinition(name = "organization", path = "Location.managingOrganization", description = "Searches for locations that are managed by the provided organization", type = "reference")
1423  public static final String SP_ORGANIZATION = "organization";
1424  @SearchParamDefinition(name = "name", path = "Location.name", description = "A (portion of the) name of the location", type = "string")
1425  public static final String SP_NAME = "name";
1426  @SearchParamDefinition(name = "address-use", path = "Location.address.use", description = "A use code specified in an address", type = "token")
1427  public static final String SP_ADDRESSUSE = "address-use";
1428  @SearchParamDefinition(name = "near", path = "Location.position", description = "The coordinates expressed as [lat],[long] (using the WGS84 datum, see notes) to find locations near to (servers may search using a square rather than a circle for efficiency)", type = "token")
1429  public static final String SP_NEAR = "near";
1430  @SearchParamDefinition(name = "address-city", path = "Location.address.city", description = "A city specified in an address", type = "string")
1431  public static final String SP_ADDRESSCITY = "address-city";
1432  @SearchParamDefinition(name = "status", path = "Location.status", description = "Searches for locations with a specific kind of status", type = "token")
1433  public static final String SP_STATUS = "status";
1434
1435}