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