001package org.hl7.fhir.dstu3.model;
002
003/*-
004 * #%L
005 * org.hl7.fhir.dstu3
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023/*
024  Copyright (c) 2011+, HL7, Inc.
025  All rights reserved.
026  
027  Redistribution and use in source and binary forms, with or without modification, 
028  are permitted provided that the following conditions are met:
029  
030   * Redistributions of source code must retain the above copyright notice, this 
031     list of conditions and the following disclaimer.
032   * Redistributions in binary form must reproduce the above copyright notice, 
033     this list of conditions and the following disclaimer in the documentation 
034     and/or other materials provided with the distribution.
035   * Neither the name of HL7 nor the names of its contributors may be used to 
036     endorse or promote products derived from this software without specific 
037     prior written permission.
038  
039  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
040  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
041  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
042  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
043  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
044  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
045  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
046  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
047  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
048  POSSIBILITY OF SUCH DAMAGE.
049  
050*/
051
052// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x
053import java.util.ArrayList;
054import java.util.List;
055
056import org.hl7.fhir.exceptions.FHIRException;
057import org.hl7.fhir.utilities.Utilities;
058
059import ca.uhn.fhir.model.api.annotation.Child;
060import ca.uhn.fhir.model.api.annotation.Description;
061import ca.uhn.fhir.model.api.annotation.ResourceDef;
062import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
063/**
064 * Record details about the anatomical location of a specimen or body part.  This resource may be used when a coded concept does not provide the necessary detail needed for the use case.
065 */
066@ResourceDef(name="BodySite", profile="http://hl7.org/fhir/Profile/BodySite")
067public class BodySite extends DomainResource {
068
069    /**
070     * Identifier for this instance of the anatomical location.
071     */
072    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
073    @Description(shortDefinition="Bodysite identifier", formalDefinition="Identifier for this instance of the anatomical location." )
074    protected List<Identifier> identifier;
075
076    /**
077     * Whether this body site is in active use.
078     */
079    @Child(name = "active", type = {BooleanType.class}, order=1, min=0, max=1, modifier=true, summary=true)
080    @Description(shortDefinition="Whether this body site record is in active use", formalDefinition="Whether this body site is in active use." )
081    protected BooleanType active;
082
083    /**
084     * Named anatomical location - ideally coded where possible.
085     */
086    @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
087    @Description(shortDefinition="Named anatomical location", formalDefinition="Named anatomical location - ideally coded where possible." )
088    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/body-site")
089    protected CodeableConcept code;
090
091    /**
092     * Qualifier to refine the anatomical location.  These include qualifiers for laterality, relative location, directionality, number, and plane.
093     */
094    @Child(name = "qualifier", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
095    @Description(shortDefinition="Modification to location code", formalDefinition="Qualifier to refine the anatomical location.  These include qualifiers for laterality, relative location, directionality, number, and plane." )
096    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/bodysite-relative-location")
097    protected List<CodeableConcept> qualifier;
098
099    /**
100     * A summary, charactarization or explanation of the anatomic location.
101     */
102    @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
103    @Description(shortDefinition="Anatomical location description", formalDefinition="A summary, charactarization or explanation of the anatomic location." )
104    protected StringType description;
105
106    /**
107     * Image or images used to identify a location.
108     */
109    @Child(name = "image", type = {Attachment.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
110    @Description(shortDefinition="Attached images", formalDefinition="Image or images used to identify a location." )
111    protected List<Attachment> image;
112
113    /**
114     * The person to which the body site belongs.
115     */
116    @Child(name = "patient", type = {Patient.class}, order=6, min=1, max=1, modifier=false, summary=true)
117    @Description(shortDefinition="Who this is about", formalDefinition="The person to which the body site belongs." )
118    protected Reference patient;
119
120    /**
121     * The actual object that is the target of the reference (The person to which the body site belongs.)
122     */
123    protected Patient patientTarget;
124
125    private static final long serialVersionUID = -871837171L;
126
127  /**
128   * Constructor
129   */
130    public BodySite() {
131      super();
132    }
133
134  /**
135   * Constructor
136   */
137    public BodySite(Reference patient) {
138      super();
139      this.patient = patient;
140    }
141
142    /**
143     * @return {@link #identifier} (Identifier for this instance of the anatomical location.)
144     */
145    public List<Identifier> getIdentifier() { 
146      if (this.identifier == null)
147        this.identifier = new ArrayList<Identifier>();
148      return this.identifier;
149    }
150
151    /**
152     * @return Returns a reference to <code>this</code> for easy method chaining
153     */
154    public BodySite setIdentifier(List<Identifier> theIdentifier) { 
155      this.identifier = theIdentifier;
156      return this;
157    }
158
159    public boolean hasIdentifier() { 
160      if (this.identifier == null)
161        return false;
162      for (Identifier item : this.identifier)
163        if (!item.isEmpty())
164          return true;
165      return false;
166    }
167
168    public Identifier addIdentifier() { //3
169      Identifier t = new Identifier();
170      if (this.identifier == null)
171        this.identifier = new ArrayList<Identifier>();
172      this.identifier.add(t);
173      return t;
174    }
175
176    public BodySite addIdentifier(Identifier t) { //3
177      if (t == null)
178        return this;
179      if (this.identifier == null)
180        this.identifier = new ArrayList<Identifier>();
181      this.identifier.add(t);
182      return this;
183    }
184
185    /**
186     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
187     */
188    public Identifier getIdentifierFirstRep() { 
189      if (getIdentifier().isEmpty()) {
190        addIdentifier();
191      }
192      return getIdentifier().get(0);
193    }
194
195    /**
196     * @return {@link #active} (Whether this body site is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value
197     */
198    public BooleanType getActiveElement() { 
199      if (this.active == null)
200        if (Configuration.errorOnAutoCreate())
201          throw new Error("Attempt to auto-create BodySite.active");
202        else if (Configuration.doAutoCreate())
203          this.active = new BooleanType(); // bb
204      return this.active;
205    }
206
207    public boolean hasActiveElement() { 
208      return this.active != null && !this.active.isEmpty();
209    }
210
211    public boolean hasActive() { 
212      return this.active != null && !this.active.isEmpty();
213    }
214
215    /**
216     * @param value {@link #active} (Whether this body site is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value
217     */
218    public BodySite setActiveElement(BooleanType value) { 
219      this.active = value;
220      return this;
221    }
222
223    /**
224     * @return Whether this body site is in active use.
225     */
226    public boolean getActive() { 
227      return this.active == null || this.active.isEmpty() ? false : this.active.getValue();
228    }
229
230    /**
231     * @param value Whether this body site is in active use.
232     */
233    public BodySite setActive(boolean value) { 
234        if (this.active == null)
235          this.active = new BooleanType();
236        this.active.setValue(value);
237      return this;
238    }
239
240    /**
241     * @return {@link #code} (Named anatomical location - ideally coded where possible.)
242     */
243    public CodeableConcept getCode() { 
244      if (this.code == null)
245        if (Configuration.errorOnAutoCreate())
246          throw new Error("Attempt to auto-create BodySite.code");
247        else if (Configuration.doAutoCreate())
248          this.code = new CodeableConcept(); // cc
249      return this.code;
250    }
251
252    public boolean hasCode() { 
253      return this.code != null && !this.code.isEmpty();
254    }
255
256    /**
257     * @param value {@link #code} (Named anatomical location - ideally coded where possible.)
258     */
259    public BodySite setCode(CodeableConcept value)  { 
260      this.code = value;
261      return this;
262    }
263
264    /**
265     * @return {@link #qualifier} (Qualifier to refine the anatomical location.  These include qualifiers for laterality, relative location, directionality, number, and plane.)
266     */
267    public List<CodeableConcept> getQualifier() { 
268      if (this.qualifier == null)
269        this.qualifier = new ArrayList<CodeableConcept>();
270      return this.qualifier;
271    }
272
273    /**
274     * @return Returns a reference to <code>this</code> for easy method chaining
275     */
276    public BodySite setQualifier(List<CodeableConcept> theQualifier) { 
277      this.qualifier = theQualifier;
278      return this;
279    }
280
281    public boolean hasQualifier() { 
282      if (this.qualifier == null)
283        return false;
284      for (CodeableConcept item : this.qualifier)
285        if (!item.isEmpty())
286          return true;
287      return false;
288    }
289
290    public CodeableConcept addQualifier() { //3
291      CodeableConcept t = new CodeableConcept();
292      if (this.qualifier == null)
293        this.qualifier = new ArrayList<CodeableConcept>();
294      this.qualifier.add(t);
295      return t;
296    }
297
298    public BodySite addQualifier(CodeableConcept t) { //3
299      if (t == null)
300        return this;
301      if (this.qualifier == null)
302        this.qualifier = new ArrayList<CodeableConcept>();
303      this.qualifier.add(t);
304      return this;
305    }
306
307    /**
308     * @return The first repetition of repeating field {@link #qualifier}, creating it if it does not already exist
309     */
310    public CodeableConcept getQualifierFirstRep() { 
311      if (getQualifier().isEmpty()) {
312        addQualifier();
313      }
314      return getQualifier().get(0);
315    }
316
317    /**
318     * @return {@link #description} (A summary, charactarization or explanation of the anatomic location.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
319     */
320    public StringType getDescriptionElement() { 
321      if (this.description == null)
322        if (Configuration.errorOnAutoCreate())
323          throw new Error("Attempt to auto-create BodySite.description");
324        else if (Configuration.doAutoCreate())
325          this.description = new StringType(); // bb
326      return this.description;
327    }
328
329    public boolean hasDescriptionElement() { 
330      return this.description != null && !this.description.isEmpty();
331    }
332
333    public boolean hasDescription() { 
334      return this.description != null && !this.description.isEmpty();
335    }
336
337    /**
338     * @param value {@link #description} (A summary, charactarization or explanation of the anatomic location.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
339     */
340    public BodySite setDescriptionElement(StringType value) { 
341      this.description = value;
342      return this;
343    }
344
345    /**
346     * @return A summary, charactarization or explanation of the anatomic location.
347     */
348    public String getDescription() { 
349      return this.description == null ? null : this.description.getValue();
350    }
351
352    /**
353     * @param value A summary, charactarization or explanation of the anatomic location.
354     */
355    public BodySite setDescription(String value) { 
356      if (Utilities.noString(value))
357        this.description = null;
358      else {
359        if (this.description == null)
360          this.description = new StringType();
361        this.description.setValue(value);
362      }
363      return this;
364    }
365
366    /**
367     * @return {@link #image} (Image or images used to identify a location.)
368     */
369    public List<Attachment> getImage() { 
370      if (this.image == null)
371        this.image = new ArrayList<Attachment>();
372      return this.image;
373    }
374
375    /**
376     * @return Returns a reference to <code>this</code> for easy method chaining
377     */
378    public BodySite setImage(List<Attachment> theImage) { 
379      this.image = theImage;
380      return this;
381    }
382
383    public boolean hasImage() { 
384      if (this.image == null)
385        return false;
386      for (Attachment item : this.image)
387        if (!item.isEmpty())
388          return true;
389      return false;
390    }
391
392    public Attachment addImage() { //3
393      Attachment t = new Attachment();
394      if (this.image == null)
395        this.image = new ArrayList<Attachment>();
396      this.image.add(t);
397      return t;
398    }
399
400    public BodySite addImage(Attachment t) { //3
401      if (t == null)
402        return this;
403      if (this.image == null)
404        this.image = new ArrayList<Attachment>();
405      this.image.add(t);
406      return this;
407    }
408
409    /**
410     * @return The first repetition of repeating field {@link #image}, creating it if it does not already exist
411     */
412    public Attachment getImageFirstRep() { 
413      if (getImage().isEmpty()) {
414        addImage();
415      }
416      return getImage().get(0);
417    }
418
419    /**
420     * @return {@link #patient} (The person to which the body site belongs.)
421     */
422    public Reference getPatient() { 
423      if (this.patient == null)
424        if (Configuration.errorOnAutoCreate())
425          throw new Error("Attempt to auto-create BodySite.patient");
426        else if (Configuration.doAutoCreate())
427          this.patient = new Reference(); // cc
428      return this.patient;
429    }
430
431    public boolean hasPatient() { 
432      return this.patient != null && !this.patient.isEmpty();
433    }
434
435    /**
436     * @param value {@link #patient} (The person to which the body site belongs.)
437     */
438    public BodySite setPatient(Reference value)  { 
439      this.patient = value;
440      return this;
441    }
442
443    /**
444     * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person to which the body site belongs.)
445     */
446    public Patient getPatientTarget() { 
447      if (this.patientTarget == null)
448        if (Configuration.errorOnAutoCreate())
449          throw new Error("Attempt to auto-create BodySite.patient");
450        else if (Configuration.doAutoCreate())
451          this.patientTarget = new Patient(); // aa
452      return this.patientTarget;
453    }
454
455    /**
456     * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person to which the body site belongs.)
457     */
458    public BodySite setPatientTarget(Patient value) { 
459      this.patientTarget = value;
460      return this;
461    }
462
463      protected void listChildren(List<Property> children) {
464        super.listChildren(children);
465        children.add(new Property("identifier", "Identifier", "Identifier for this instance of the anatomical location.", 0, java.lang.Integer.MAX_VALUE, identifier));
466        children.add(new Property("active", "boolean", "Whether this body site is in active use.", 0, 1, active));
467        children.add(new Property("code", "CodeableConcept", "Named anatomical location - ideally coded where possible.", 0, 1, code));
468        children.add(new Property("qualifier", "CodeableConcept", "Qualifier to refine the anatomical location.  These include qualifiers for laterality, relative location, directionality, number, and plane.", 0, java.lang.Integer.MAX_VALUE, qualifier));
469        children.add(new Property("description", "string", "A summary, charactarization or explanation of the anatomic location.", 0, 1, description));
470        children.add(new Property("image", "Attachment", "Image or images used to identify a location.", 0, java.lang.Integer.MAX_VALUE, image));
471        children.add(new Property("patient", "Reference(Patient)", "The person to which the body site belongs.", 0, 1, patient));
472      }
473
474      @Override
475      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
476        switch (_hash) {
477        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifier for this instance of the anatomical location.", 0, java.lang.Integer.MAX_VALUE, identifier);
478        case -1422950650: /*active*/  return new Property("active", "boolean", "Whether this body site is in active use.", 0, 1, active);
479        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "Named anatomical location - ideally coded where possible.", 0, 1, code);
480        case -1247940438: /*qualifier*/  return new Property("qualifier", "CodeableConcept", "Qualifier to refine the anatomical location.  These include qualifiers for laterality, relative location, directionality, number, and plane.", 0, java.lang.Integer.MAX_VALUE, qualifier);
481        case -1724546052: /*description*/  return new Property("description", "string", "A summary, charactarization or explanation of the anatomic location.", 0, 1, description);
482        case 100313435: /*image*/  return new Property("image", "Attachment", "Image or images used to identify a location.", 0, java.lang.Integer.MAX_VALUE, image);
483        case -791418107: /*patient*/  return new Property("patient", "Reference(Patient)", "The person to which the body site belongs.", 0, 1, patient);
484        default: return super.getNamedProperty(_hash, _name, _checkValid);
485        }
486
487      }
488
489      @Override
490      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
491        switch (hash) {
492        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
493        case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType
494        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
495        case -1247940438: /*qualifier*/ return this.qualifier == null ? new Base[0] : this.qualifier.toArray(new Base[this.qualifier.size()]); // CodeableConcept
496        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
497        case 100313435: /*image*/ return this.image == null ? new Base[0] : this.image.toArray(new Base[this.image.size()]); // Attachment
498        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
499        default: return super.getProperty(hash, name, checkValid);
500        }
501
502      }
503
504      @Override
505      public Base setProperty(int hash, String name, Base value) throws FHIRException {
506        switch (hash) {
507        case -1618432855: // identifier
508          this.getIdentifier().add(castToIdentifier(value)); // Identifier
509          return value;
510        case -1422950650: // active
511          this.active = castToBoolean(value); // BooleanType
512          return value;
513        case 3059181: // code
514          this.code = castToCodeableConcept(value); // CodeableConcept
515          return value;
516        case -1247940438: // qualifier
517          this.getQualifier().add(castToCodeableConcept(value)); // CodeableConcept
518          return value;
519        case -1724546052: // description
520          this.description = castToString(value); // StringType
521          return value;
522        case 100313435: // image
523          this.getImage().add(castToAttachment(value)); // Attachment
524          return value;
525        case -791418107: // patient
526          this.patient = castToReference(value); // Reference
527          return value;
528        default: return super.setProperty(hash, name, value);
529        }
530
531      }
532
533      @Override
534      public Base setProperty(String name, Base value) throws FHIRException {
535        if (name.equals("identifier")) {
536          this.getIdentifier().add(castToIdentifier(value));
537        } else if (name.equals("active")) {
538          this.active = castToBoolean(value); // BooleanType
539        } else if (name.equals("code")) {
540          this.code = castToCodeableConcept(value); // CodeableConcept
541        } else if (name.equals("qualifier")) {
542          this.getQualifier().add(castToCodeableConcept(value));
543        } else if (name.equals("description")) {
544          this.description = castToString(value); // StringType
545        } else if (name.equals("image")) {
546          this.getImage().add(castToAttachment(value));
547        } else if (name.equals("patient")) {
548          this.patient = castToReference(value); // Reference
549        } else
550          return super.setProperty(name, value);
551        return value;
552      }
553
554      @Override
555      public Base makeProperty(int hash, String name) throws FHIRException {
556        switch (hash) {
557        case -1618432855:  return addIdentifier(); 
558        case -1422950650:  return getActiveElement();
559        case 3059181:  return getCode(); 
560        case -1247940438:  return addQualifier(); 
561        case -1724546052:  return getDescriptionElement();
562        case 100313435:  return addImage(); 
563        case -791418107:  return getPatient(); 
564        default: return super.makeProperty(hash, name);
565        }
566
567      }
568
569      @Override
570      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
571        switch (hash) {
572        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
573        case -1422950650: /*active*/ return new String[] {"boolean"};
574        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
575        case -1247940438: /*qualifier*/ return new String[] {"CodeableConcept"};
576        case -1724546052: /*description*/ return new String[] {"string"};
577        case 100313435: /*image*/ return new String[] {"Attachment"};
578        case -791418107: /*patient*/ return new String[] {"Reference"};
579        default: return super.getTypesForProperty(hash, name);
580        }
581
582      }
583
584      @Override
585      public Base addChild(String name) throws FHIRException {
586        if (name.equals("identifier")) {
587          return addIdentifier();
588        }
589        else if (name.equals("active")) {
590          throw new FHIRException("Cannot call addChild on a primitive type BodySite.active");
591        }
592        else if (name.equals("code")) {
593          this.code = new CodeableConcept();
594          return this.code;
595        }
596        else if (name.equals("qualifier")) {
597          return addQualifier();
598        }
599        else if (name.equals("description")) {
600          throw new FHIRException("Cannot call addChild on a primitive type BodySite.description");
601        }
602        else if (name.equals("image")) {
603          return addImage();
604        }
605        else if (name.equals("patient")) {
606          this.patient = new Reference();
607          return this.patient;
608        }
609        else
610          return super.addChild(name);
611      }
612
613  public String fhirType() {
614    return "BodySite";
615
616  }
617
618      public BodySite copy() {
619        BodySite dst = new BodySite();
620        copyValues(dst);
621        if (identifier != null) {
622          dst.identifier = new ArrayList<Identifier>();
623          for (Identifier i : identifier)
624            dst.identifier.add(i.copy());
625        };
626        dst.active = active == null ? null : active.copy();
627        dst.code = code == null ? null : code.copy();
628        if (qualifier != null) {
629          dst.qualifier = new ArrayList<CodeableConcept>();
630          for (CodeableConcept i : qualifier)
631            dst.qualifier.add(i.copy());
632        };
633        dst.description = description == null ? null : description.copy();
634        if (image != null) {
635          dst.image = new ArrayList<Attachment>();
636          for (Attachment i : image)
637            dst.image.add(i.copy());
638        };
639        dst.patient = patient == null ? null : patient.copy();
640        return dst;
641      }
642
643      protected BodySite typedCopy() {
644        return copy();
645      }
646
647      @Override
648      public boolean equalsDeep(Base other_) {
649        if (!super.equalsDeep(other_))
650          return false;
651        if (!(other_ instanceof BodySite))
652          return false;
653        BodySite o = (BodySite) other_;
654        return compareDeep(identifier, o.identifier, true) && compareDeep(active, o.active, true) && compareDeep(code, o.code, true)
655           && compareDeep(qualifier, o.qualifier, true) && compareDeep(description, o.description, true) && compareDeep(image, o.image, true)
656           && compareDeep(patient, o.patient, true);
657      }
658
659      @Override
660      public boolean equalsShallow(Base other_) {
661        if (!super.equalsShallow(other_))
662          return false;
663        if (!(other_ instanceof BodySite))
664          return false;
665        BodySite o = (BodySite) other_;
666        return compareValues(active, o.active, true) && compareValues(description, o.description, true);
667      }
668
669      public boolean isEmpty() {
670        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, active, code
671          , qualifier, description, image, patient);
672      }
673
674  @Override
675  public ResourceType getResourceType() {
676    return ResourceType.BodySite;
677   }
678
679 /**
680   * Search parameter: <b>identifier</b>
681   * <p>
682   * Description: <b>Identifier for this instance of the anatomical location</b><br>
683   * Type: <b>token</b><br>
684   * Path: <b>BodySite.identifier</b><br>
685   * </p>
686   */
687  @SearchParamDefinition(name="identifier", path="BodySite.identifier", description="Identifier for this instance of the anatomical location", type="token" )
688  public static final String SP_IDENTIFIER = "identifier";
689 /**
690   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
691   * <p>
692   * Description: <b>Identifier for this instance of the anatomical location</b><br>
693   * Type: <b>token</b><br>
694   * Path: <b>BodySite.identifier</b><br>
695   * </p>
696   */
697  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
698
699 /**
700   * Search parameter: <b>code</b>
701   * <p>
702   * Description: <b>Named anatomical location</b><br>
703   * Type: <b>token</b><br>
704   * Path: <b>BodySite.code</b><br>
705   * </p>
706   */
707  @SearchParamDefinition(name="code", path="BodySite.code", description="Named anatomical location", type="token" )
708  public static final String SP_CODE = "code";
709 /**
710   * <b>Fluent Client</b> search parameter constant for <b>code</b>
711   * <p>
712   * Description: <b>Named anatomical location</b><br>
713   * Type: <b>token</b><br>
714   * Path: <b>BodySite.code</b><br>
715   * </p>
716   */
717  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
718
719 /**
720   * Search parameter: <b>patient</b>
721   * <p>
722   * Description: <b>Patient to whom bodysite belongs</b><br>
723   * Type: <b>reference</b><br>
724   * Path: <b>BodySite.patient</b><br>
725   * </p>
726   */
727  @SearchParamDefinition(name="patient", path="BodySite.patient", description="Patient to whom bodysite belongs", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class } )
728  public static final String SP_PATIENT = "patient";
729 /**
730   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
731   * <p>
732   * Description: <b>Patient to whom bodysite belongs</b><br>
733   * Type: <b>reference</b><br>
734   * Path: <b>BodySite.patient</b><br>
735   * </p>
736   */
737  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
738
739/**
740   * Constant for fluent queries to be used to add include statements. Specifies
741   * the path value of "<b>BodySite:patient</b>".
742   */
743  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("BodySite:patient").toLocked();
744
745
746}
747