001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Fri, Jul 15, 2022 11:20+1000 for FHIR v5.0.0-snapshot2
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex.
052 */
053@ResourceDef(name="SubstanceSourceMaterial", profile="http://hl7.org/fhir/StructureDefinition/SubstanceSourceMaterial")
054public class SubstanceSourceMaterial extends DomainResource {
055
056    @Block()
057    public static class SubstanceSourceMaterialFractionDescriptionComponent extends BackboneElement implements IBaseBackboneElement {
058        /**
059         * This element is capturing information about the fraction of a plant part, or human plasma for fractionation.
060         */
061        @Child(name = "fraction", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true)
062        @Description(shortDefinition="This element is capturing information about the fraction of a plant part, or human plasma for fractionation", formalDefinition="This element is capturing information about the fraction of a plant part, or human plasma for fractionation." )
063        protected StringType fraction;
064
065        /**
066         * The specific type of the material constituting the component. For Herbal preparations the particulars of the extracts (liquid/dry) is described in Specified Substance Group 1.
067         */
068        @Child(name = "materialType", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
069        @Description(shortDefinition="The specific type of the material constituting the component. For Herbal preparations the particulars of the extracts (liquid/dry) is described in Specified Substance Group 1", formalDefinition="The specific type of the material constituting the component. For Herbal preparations the particulars of the extracts (liquid/dry) is described in Specified Substance Group 1." )
070        protected CodeableConcept materialType;
071
072        private static final long serialVersionUID = -1118226733L;
073
074    /**
075     * Constructor
076     */
077      public SubstanceSourceMaterialFractionDescriptionComponent() {
078        super();
079      }
080
081        /**
082         * @return {@link #fraction} (This element is capturing information about the fraction of a plant part, or human plasma for fractionation.). This is the underlying object with id, value and extensions. The accessor "getFraction" gives direct access to the value
083         */
084        public StringType getFractionElement() { 
085          if (this.fraction == null)
086            if (Configuration.errorOnAutoCreate())
087              throw new Error("Attempt to auto-create SubstanceSourceMaterialFractionDescriptionComponent.fraction");
088            else if (Configuration.doAutoCreate())
089              this.fraction = new StringType(); // bb
090          return this.fraction;
091        }
092
093        public boolean hasFractionElement() { 
094          return this.fraction != null && !this.fraction.isEmpty();
095        }
096
097        public boolean hasFraction() { 
098          return this.fraction != null && !this.fraction.isEmpty();
099        }
100
101        /**
102         * @param value {@link #fraction} (This element is capturing information about the fraction of a plant part, or human plasma for fractionation.). This is the underlying object with id, value and extensions. The accessor "getFraction" gives direct access to the value
103         */
104        public SubstanceSourceMaterialFractionDescriptionComponent setFractionElement(StringType value) { 
105          this.fraction = value;
106          return this;
107        }
108
109        /**
110         * @return This element is capturing information about the fraction of a plant part, or human plasma for fractionation.
111         */
112        public String getFraction() { 
113          return this.fraction == null ? null : this.fraction.getValue();
114        }
115
116        /**
117         * @param value This element is capturing information about the fraction of a plant part, or human plasma for fractionation.
118         */
119        public SubstanceSourceMaterialFractionDescriptionComponent setFraction(String value) { 
120          if (Utilities.noString(value))
121            this.fraction = null;
122          else {
123            if (this.fraction == null)
124              this.fraction = new StringType();
125            this.fraction.setValue(value);
126          }
127          return this;
128        }
129
130        /**
131         * @return {@link #materialType} (The specific type of the material constituting the component. For Herbal preparations the particulars of the extracts (liquid/dry) is described in Specified Substance Group 1.)
132         */
133        public CodeableConcept getMaterialType() { 
134          if (this.materialType == null)
135            if (Configuration.errorOnAutoCreate())
136              throw new Error("Attempt to auto-create SubstanceSourceMaterialFractionDescriptionComponent.materialType");
137            else if (Configuration.doAutoCreate())
138              this.materialType = new CodeableConcept(); // cc
139          return this.materialType;
140        }
141
142        public boolean hasMaterialType() { 
143          return this.materialType != null && !this.materialType.isEmpty();
144        }
145
146        /**
147         * @param value {@link #materialType} (The specific type of the material constituting the component. For Herbal preparations the particulars of the extracts (liquid/dry) is described in Specified Substance Group 1.)
148         */
149        public SubstanceSourceMaterialFractionDescriptionComponent setMaterialType(CodeableConcept value) { 
150          this.materialType = value;
151          return this;
152        }
153
154        protected void listChildren(List<Property> children) {
155          super.listChildren(children);
156          children.add(new Property("fraction", "string", "This element is capturing information about the fraction of a plant part, or human plasma for fractionation.", 0, 1, fraction));
157          children.add(new Property("materialType", "CodeableConcept", "The specific type of the material constituting the component. For Herbal preparations the particulars of the extracts (liquid/dry) is described in Specified Substance Group 1.", 0, 1, materialType));
158        }
159
160        @Override
161        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
162          switch (_hash) {
163          case -1653751294: /*fraction*/  return new Property("fraction", "string", "This element is capturing information about the fraction of a plant part, or human plasma for fractionation.", 0, 1, fraction);
164          case -2115601151: /*materialType*/  return new Property("materialType", "CodeableConcept", "The specific type of the material constituting the component. For Herbal preparations the particulars of the extracts (liquid/dry) is described in Specified Substance Group 1.", 0, 1, materialType);
165          default: return super.getNamedProperty(_hash, _name, _checkValid);
166          }
167
168        }
169
170      @Override
171      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
172        switch (hash) {
173        case -1653751294: /*fraction*/ return this.fraction == null ? new Base[0] : new Base[] {this.fraction}; // StringType
174        case -2115601151: /*materialType*/ return this.materialType == null ? new Base[0] : new Base[] {this.materialType}; // CodeableConcept
175        default: return super.getProperty(hash, name, checkValid);
176        }
177
178      }
179
180      @Override
181      public Base setProperty(int hash, String name, Base value) throws FHIRException {
182        switch (hash) {
183        case -1653751294: // fraction
184          this.fraction = TypeConvertor.castToString(value); // StringType
185          return value;
186        case -2115601151: // materialType
187          this.materialType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
188          return value;
189        default: return super.setProperty(hash, name, value);
190        }
191
192      }
193
194      @Override
195      public Base setProperty(String name, Base value) throws FHIRException {
196        if (name.equals("fraction")) {
197          this.fraction = TypeConvertor.castToString(value); // StringType
198        } else if (name.equals("materialType")) {
199          this.materialType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
200        } else
201          return super.setProperty(name, value);
202        return value;
203      }
204
205      @Override
206      public Base makeProperty(int hash, String name) throws FHIRException {
207        switch (hash) {
208        case -1653751294:  return getFractionElement();
209        case -2115601151:  return getMaterialType();
210        default: return super.makeProperty(hash, name);
211        }
212
213      }
214
215      @Override
216      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
217        switch (hash) {
218        case -1653751294: /*fraction*/ return new String[] {"string"};
219        case -2115601151: /*materialType*/ return new String[] {"CodeableConcept"};
220        default: return super.getTypesForProperty(hash, name);
221        }
222
223      }
224
225      @Override
226      public Base addChild(String name) throws FHIRException {
227        if (name.equals("fraction")) {
228          throw new FHIRException("Cannot call addChild on a primitive type SubstanceSourceMaterial.fractionDescription.fraction");
229        }
230        else if (name.equals("materialType")) {
231          this.materialType = new CodeableConcept();
232          return this.materialType;
233        }
234        else
235          return super.addChild(name);
236      }
237
238      public SubstanceSourceMaterialFractionDescriptionComponent copy() {
239        SubstanceSourceMaterialFractionDescriptionComponent dst = new SubstanceSourceMaterialFractionDescriptionComponent();
240        copyValues(dst);
241        return dst;
242      }
243
244      public void copyValues(SubstanceSourceMaterialFractionDescriptionComponent dst) {
245        super.copyValues(dst);
246        dst.fraction = fraction == null ? null : fraction.copy();
247        dst.materialType = materialType == null ? null : materialType.copy();
248      }
249
250      @Override
251      public boolean equalsDeep(Base other_) {
252        if (!super.equalsDeep(other_))
253          return false;
254        if (!(other_ instanceof SubstanceSourceMaterialFractionDescriptionComponent))
255          return false;
256        SubstanceSourceMaterialFractionDescriptionComponent o = (SubstanceSourceMaterialFractionDescriptionComponent) other_;
257        return compareDeep(fraction, o.fraction, true) && compareDeep(materialType, o.materialType, true)
258          ;
259      }
260
261      @Override
262      public boolean equalsShallow(Base other_) {
263        if (!super.equalsShallow(other_))
264          return false;
265        if (!(other_ instanceof SubstanceSourceMaterialFractionDescriptionComponent))
266          return false;
267        SubstanceSourceMaterialFractionDescriptionComponent o = (SubstanceSourceMaterialFractionDescriptionComponent) other_;
268        return compareValues(fraction, o.fraction, true);
269      }
270
271      public boolean isEmpty() {
272        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(fraction, materialType);
273      }
274
275  public String fhirType() {
276    return "SubstanceSourceMaterial.fractionDescription";
277
278  }
279
280  }
281
282    @Block()
283    public static class SubstanceSourceMaterialOrganismComponent extends BackboneElement implements IBaseBackboneElement {
284        /**
285         * The family of an organism shall be specified.
286         */
287        @Child(name = "family", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
288        @Description(shortDefinition="The family of an organism shall be specified", formalDefinition="The family of an organism shall be specified." )
289        protected CodeableConcept family;
290
291        /**
292         * The genus of an organism shall be specified; refers to the Latin epithet of the genus element of the plant/animal scientific name; it is present in names for genera, species and infraspecies.
293         */
294        @Child(name = "genus", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
295        @Description(shortDefinition="The genus of an organism shall be specified; refers to the Latin epithet of the genus element of the plant/animal scientific name; it is present in names for genera, species and infraspecies", formalDefinition="The genus of an organism shall be specified; refers to the Latin epithet of the genus element of the plant/animal scientific name; it is present in names for genera, species and infraspecies." )
296        protected CodeableConcept genus;
297
298        /**
299         * The species of an organism shall be specified; refers to the Latin epithet of the species of the plant/animal; it is present in names for species and infraspecies.
300         */
301        @Child(name = "species", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true)
302        @Description(shortDefinition="The species of an organism shall be specified; refers to the Latin epithet of the species of the plant/animal; it is present in names for species and infraspecies", formalDefinition="The species of an organism shall be specified; refers to the Latin epithet of the species of the plant/animal; it is present in names for species and infraspecies." )
303        protected CodeableConcept species;
304
305        /**
306         * The Intraspecific type of an organism shall be specified.
307         */
308        @Child(name = "intraspecificType", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true)
309        @Description(shortDefinition="The Intraspecific type of an organism shall be specified", formalDefinition="The Intraspecific type of an organism shall be specified." )
310        protected CodeableConcept intraspecificType;
311
312        /**
313         * The intraspecific description of an organism shall be specified based on a controlled vocabulary. For Influenza Vaccine, the intraspecific description shall contain the syntax of the antigen in line with the WHO convention.
314         */
315        @Child(name = "intraspecificDescription", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
316        @Description(shortDefinition="The intraspecific description of an organism shall be specified based on a controlled vocabulary. For Influenza Vaccine, the intraspecific description shall contain the syntax of the antigen in line with the WHO convention", formalDefinition="The intraspecific description of an organism shall be specified based on a controlled vocabulary. For Influenza Vaccine, the intraspecific description shall contain the syntax of the antigen in line with the WHO convention." )
317        protected StringType intraspecificDescription;
318
319        /**
320         * 4.9.13.6.1 Author type (Conditional).
321         */
322        @Child(name = "author", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
323        @Description(shortDefinition="4.9.13.6.1 Author type (Conditional)", formalDefinition="4.9.13.6.1 Author type (Conditional)." )
324        protected List<SubstanceSourceMaterialOrganismAuthorComponent> author;
325
326        /**
327         * 4.9.13.8.1 Hybrid species maternal organism ID (Optional).
328         */
329        @Child(name = "hybrid", type = {}, order=7, min=0, max=1, modifier=false, summary=true)
330        @Description(shortDefinition="4.9.13.8.1 Hybrid species maternal organism ID (Optional)", formalDefinition="4.9.13.8.1 Hybrid species maternal organism ID (Optional)." )
331        protected SubstanceSourceMaterialOrganismHybridComponent hybrid;
332
333        /**
334         * 4.9.13.7.1 Kingdom (Conditional).
335         */
336        @Child(name = "organismGeneral", type = {}, order=8, min=0, max=1, modifier=false, summary=true)
337        @Description(shortDefinition="4.9.13.7.1 Kingdom (Conditional)", formalDefinition="4.9.13.7.1 Kingdom (Conditional)." )
338        protected SubstanceSourceMaterialOrganismOrganismGeneralComponent organismGeneral;
339
340        private static final long serialVersionUID = 941648312L;
341
342    /**
343     * Constructor
344     */
345      public SubstanceSourceMaterialOrganismComponent() {
346        super();
347      }
348
349        /**
350         * @return {@link #family} (The family of an organism shall be specified.)
351         */
352        public CodeableConcept getFamily() { 
353          if (this.family == null)
354            if (Configuration.errorOnAutoCreate())
355              throw new Error("Attempt to auto-create SubstanceSourceMaterialOrganismComponent.family");
356            else if (Configuration.doAutoCreate())
357              this.family = new CodeableConcept(); // cc
358          return this.family;
359        }
360
361        public boolean hasFamily() { 
362          return this.family != null && !this.family.isEmpty();
363        }
364
365        /**
366         * @param value {@link #family} (The family of an organism shall be specified.)
367         */
368        public SubstanceSourceMaterialOrganismComponent setFamily(CodeableConcept value) { 
369          this.family = value;
370          return this;
371        }
372
373        /**
374         * @return {@link #genus} (The genus of an organism shall be specified; refers to the Latin epithet of the genus element of the plant/animal scientific name; it is present in names for genera, species and infraspecies.)
375         */
376        public CodeableConcept getGenus() { 
377          if (this.genus == null)
378            if (Configuration.errorOnAutoCreate())
379              throw new Error("Attempt to auto-create SubstanceSourceMaterialOrganismComponent.genus");
380            else if (Configuration.doAutoCreate())
381              this.genus = new CodeableConcept(); // cc
382          return this.genus;
383        }
384
385        public boolean hasGenus() { 
386          return this.genus != null && !this.genus.isEmpty();
387        }
388
389        /**
390         * @param value {@link #genus} (The genus of an organism shall be specified; refers to the Latin epithet of the genus element of the plant/animal scientific name; it is present in names for genera, species and infraspecies.)
391         */
392        public SubstanceSourceMaterialOrganismComponent setGenus(CodeableConcept value) { 
393          this.genus = value;
394          return this;
395        }
396
397        /**
398         * @return {@link #species} (The species of an organism shall be specified; refers to the Latin epithet of the species of the plant/animal; it is present in names for species and infraspecies.)
399         */
400        public CodeableConcept getSpecies() { 
401          if (this.species == null)
402            if (Configuration.errorOnAutoCreate())
403              throw new Error("Attempt to auto-create SubstanceSourceMaterialOrganismComponent.species");
404            else if (Configuration.doAutoCreate())
405              this.species = new CodeableConcept(); // cc
406          return this.species;
407        }
408
409        public boolean hasSpecies() { 
410          return this.species != null && !this.species.isEmpty();
411        }
412
413        /**
414         * @param value {@link #species} (The species of an organism shall be specified; refers to the Latin epithet of the species of the plant/animal; it is present in names for species and infraspecies.)
415         */
416        public SubstanceSourceMaterialOrganismComponent setSpecies(CodeableConcept value) { 
417          this.species = value;
418          return this;
419        }
420
421        /**
422         * @return {@link #intraspecificType} (The Intraspecific type of an organism shall be specified.)
423         */
424        public CodeableConcept getIntraspecificType() { 
425          if (this.intraspecificType == null)
426            if (Configuration.errorOnAutoCreate())
427              throw new Error("Attempt to auto-create SubstanceSourceMaterialOrganismComponent.intraspecificType");
428            else if (Configuration.doAutoCreate())
429              this.intraspecificType = new CodeableConcept(); // cc
430          return this.intraspecificType;
431        }
432
433        public boolean hasIntraspecificType() { 
434          return this.intraspecificType != null && !this.intraspecificType.isEmpty();
435        }
436
437        /**
438         * @param value {@link #intraspecificType} (The Intraspecific type of an organism shall be specified.)
439         */
440        public SubstanceSourceMaterialOrganismComponent setIntraspecificType(CodeableConcept value) { 
441          this.intraspecificType = value;
442          return this;
443        }
444
445        /**
446         * @return {@link #intraspecificDescription} (The intraspecific description of an organism shall be specified based on a controlled vocabulary. For Influenza Vaccine, the intraspecific description shall contain the syntax of the antigen in line with the WHO convention.). This is the underlying object with id, value and extensions. The accessor "getIntraspecificDescription" gives direct access to the value
447         */
448        public StringType getIntraspecificDescriptionElement() { 
449          if (this.intraspecificDescription == null)
450            if (Configuration.errorOnAutoCreate())
451              throw new Error("Attempt to auto-create SubstanceSourceMaterialOrganismComponent.intraspecificDescription");
452            else if (Configuration.doAutoCreate())
453              this.intraspecificDescription = new StringType(); // bb
454          return this.intraspecificDescription;
455        }
456
457        public boolean hasIntraspecificDescriptionElement() { 
458          return this.intraspecificDescription != null && !this.intraspecificDescription.isEmpty();
459        }
460
461        public boolean hasIntraspecificDescription() { 
462          return this.intraspecificDescription != null && !this.intraspecificDescription.isEmpty();
463        }
464
465        /**
466         * @param value {@link #intraspecificDescription} (The intraspecific description of an organism shall be specified based on a controlled vocabulary. For Influenza Vaccine, the intraspecific description shall contain the syntax of the antigen in line with the WHO convention.). This is the underlying object with id, value and extensions. The accessor "getIntraspecificDescription" gives direct access to the value
467         */
468        public SubstanceSourceMaterialOrganismComponent setIntraspecificDescriptionElement(StringType value) { 
469          this.intraspecificDescription = value;
470          return this;
471        }
472
473        /**
474         * @return The intraspecific description of an organism shall be specified based on a controlled vocabulary. For Influenza Vaccine, the intraspecific description shall contain the syntax of the antigen in line with the WHO convention.
475         */
476        public String getIntraspecificDescription() { 
477          return this.intraspecificDescription == null ? null : this.intraspecificDescription.getValue();
478        }
479
480        /**
481         * @param value The intraspecific description of an organism shall be specified based on a controlled vocabulary. For Influenza Vaccine, the intraspecific description shall contain the syntax of the antigen in line with the WHO convention.
482         */
483        public SubstanceSourceMaterialOrganismComponent setIntraspecificDescription(String value) { 
484          if (Utilities.noString(value))
485            this.intraspecificDescription = null;
486          else {
487            if (this.intraspecificDescription == null)
488              this.intraspecificDescription = new StringType();
489            this.intraspecificDescription.setValue(value);
490          }
491          return this;
492        }
493
494        /**
495         * @return {@link #author} (4.9.13.6.1 Author type (Conditional).)
496         */
497        public List<SubstanceSourceMaterialOrganismAuthorComponent> getAuthor() { 
498          if (this.author == null)
499            this.author = new ArrayList<SubstanceSourceMaterialOrganismAuthorComponent>();
500          return this.author;
501        }
502
503        /**
504         * @return Returns a reference to <code>this</code> for easy method chaining
505         */
506        public SubstanceSourceMaterialOrganismComponent setAuthor(List<SubstanceSourceMaterialOrganismAuthorComponent> theAuthor) { 
507          this.author = theAuthor;
508          return this;
509        }
510
511        public boolean hasAuthor() { 
512          if (this.author == null)
513            return false;
514          for (SubstanceSourceMaterialOrganismAuthorComponent item : this.author)
515            if (!item.isEmpty())
516              return true;
517          return false;
518        }
519
520        public SubstanceSourceMaterialOrganismAuthorComponent addAuthor() { //3
521          SubstanceSourceMaterialOrganismAuthorComponent t = new SubstanceSourceMaterialOrganismAuthorComponent();
522          if (this.author == null)
523            this.author = new ArrayList<SubstanceSourceMaterialOrganismAuthorComponent>();
524          this.author.add(t);
525          return t;
526        }
527
528        public SubstanceSourceMaterialOrganismComponent addAuthor(SubstanceSourceMaterialOrganismAuthorComponent t) { //3
529          if (t == null)
530            return this;
531          if (this.author == null)
532            this.author = new ArrayList<SubstanceSourceMaterialOrganismAuthorComponent>();
533          this.author.add(t);
534          return this;
535        }
536
537        /**
538         * @return The first repetition of repeating field {@link #author}, creating it if it does not already exist {3}
539         */
540        public SubstanceSourceMaterialOrganismAuthorComponent getAuthorFirstRep() { 
541          if (getAuthor().isEmpty()) {
542            addAuthor();
543          }
544          return getAuthor().get(0);
545        }
546
547        /**
548         * @return {@link #hybrid} (4.9.13.8.1 Hybrid species maternal organism ID (Optional).)
549         */
550        public SubstanceSourceMaterialOrganismHybridComponent getHybrid() { 
551          if (this.hybrid == null)
552            if (Configuration.errorOnAutoCreate())
553              throw new Error("Attempt to auto-create SubstanceSourceMaterialOrganismComponent.hybrid");
554            else if (Configuration.doAutoCreate())
555              this.hybrid = new SubstanceSourceMaterialOrganismHybridComponent(); // cc
556          return this.hybrid;
557        }
558
559        public boolean hasHybrid() { 
560          return this.hybrid != null && !this.hybrid.isEmpty();
561        }
562
563        /**
564         * @param value {@link #hybrid} (4.9.13.8.1 Hybrid species maternal organism ID (Optional).)
565         */
566        public SubstanceSourceMaterialOrganismComponent setHybrid(SubstanceSourceMaterialOrganismHybridComponent value) { 
567          this.hybrid = value;
568          return this;
569        }
570
571        /**
572         * @return {@link #organismGeneral} (4.9.13.7.1 Kingdom (Conditional).)
573         */
574        public SubstanceSourceMaterialOrganismOrganismGeneralComponent getOrganismGeneral() { 
575          if (this.organismGeneral == null)
576            if (Configuration.errorOnAutoCreate())
577              throw new Error("Attempt to auto-create SubstanceSourceMaterialOrganismComponent.organismGeneral");
578            else if (Configuration.doAutoCreate())
579              this.organismGeneral = new SubstanceSourceMaterialOrganismOrganismGeneralComponent(); // cc
580          return this.organismGeneral;
581        }
582
583        public boolean hasOrganismGeneral() { 
584          return this.organismGeneral != null && !this.organismGeneral.isEmpty();
585        }
586
587        /**
588         * @param value {@link #organismGeneral} (4.9.13.7.1 Kingdom (Conditional).)
589         */
590        public SubstanceSourceMaterialOrganismComponent setOrganismGeneral(SubstanceSourceMaterialOrganismOrganismGeneralComponent value) { 
591          this.organismGeneral = value;
592          return this;
593        }
594
595        protected void listChildren(List<Property> children) {
596          super.listChildren(children);
597          children.add(new Property("family", "CodeableConcept", "The family of an organism shall be specified.", 0, 1, family));
598          children.add(new Property("genus", "CodeableConcept", "The genus of an organism shall be specified; refers to the Latin epithet of the genus element of the plant/animal scientific name; it is present in names for genera, species and infraspecies.", 0, 1, genus));
599          children.add(new Property("species", "CodeableConcept", "The species of an organism shall be specified; refers to the Latin epithet of the species of the plant/animal; it is present in names for species and infraspecies.", 0, 1, species));
600          children.add(new Property("intraspecificType", "CodeableConcept", "The Intraspecific type of an organism shall be specified.", 0, 1, intraspecificType));
601          children.add(new Property("intraspecificDescription", "string", "The intraspecific description of an organism shall be specified based on a controlled vocabulary. For Influenza Vaccine, the intraspecific description shall contain the syntax of the antigen in line with the WHO convention.", 0, 1, intraspecificDescription));
602          children.add(new Property("author", "", "4.9.13.6.1 Author type (Conditional).", 0, java.lang.Integer.MAX_VALUE, author));
603          children.add(new Property("hybrid", "", "4.9.13.8.1 Hybrid species maternal organism ID (Optional).", 0, 1, hybrid));
604          children.add(new Property("organismGeneral", "", "4.9.13.7.1 Kingdom (Conditional).", 0, 1, organismGeneral));
605        }
606
607        @Override
608        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
609          switch (_hash) {
610          case -1281860764: /*family*/  return new Property("family", "CodeableConcept", "The family of an organism shall be specified.", 0, 1, family);
611          case 98241006: /*genus*/  return new Property("genus", "CodeableConcept", "The genus of an organism shall be specified; refers to the Latin epithet of the genus element of the plant/animal scientific name; it is present in names for genera, species and infraspecies.", 0, 1, genus);
612          case -2008465092: /*species*/  return new Property("species", "CodeableConcept", "The species of an organism shall be specified; refers to the Latin epithet of the species of the plant/animal; it is present in names for species and infraspecies.", 0, 1, species);
613          case 1717161194: /*intraspecificType*/  return new Property("intraspecificType", "CodeableConcept", "The Intraspecific type of an organism shall be specified.", 0, 1, intraspecificType);
614          case -1473085364: /*intraspecificDescription*/  return new Property("intraspecificDescription", "string", "The intraspecific description of an organism shall be specified based on a controlled vocabulary. For Influenza Vaccine, the intraspecific description shall contain the syntax of the antigen in line with the WHO convention.", 0, 1, intraspecificDescription);
615          case -1406328437: /*author*/  return new Property("author", "", "4.9.13.6.1 Author type (Conditional).", 0, java.lang.Integer.MAX_VALUE, author);
616          case -1202757124: /*hybrid*/  return new Property("hybrid", "", "4.9.13.8.1 Hybrid species maternal organism ID (Optional).", 0, 1, hybrid);
617          case -865996874: /*organismGeneral*/  return new Property("organismGeneral", "", "4.9.13.7.1 Kingdom (Conditional).", 0, 1, organismGeneral);
618          default: return super.getNamedProperty(_hash, _name, _checkValid);
619          }
620
621        }
622
623      @Override
624      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
625        switch (hash) {
626        case -1281860764: /*family*/ return this.family == null ? new Base[0] : new Base[] {this.family}; // CodeableConcept
627        case 98241006: /*genus*/ return this.genus == null ? new Base[0] : new Base[] {this.genus}; // CodeableConcept
628        case -2008465092: /*species*/ return this.species == null ? new Base[0] : new Base[] {this.species}; // CodeableConcept
629        case 1717161194: /*intraspecificType*/ return this.intraspecificType == null ? new Base[0] : new Base[] {this.intraspecificType}; // CodeableConcept
630        case -1473085364: /*intraspecificDescription*/ return this.intraspecificDescription == null ? new Base[0] : new Base[] {this.intraspecificDescription}; // StringType
631        case -1406328437: /*author*/ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // SubstanceSourceMaterialOrganismAuthorComponent
632        case -1202757124: /*hybrid*/ return this.hybrid == null ? new Base[0] : new Base[] {this.hybrid}; // SubstanceSourceMaterialOrganismHybridComponent
633        case -865996874: /*organismGeneral*/ return this.organismGeneral == null ? new Base[0] : new Base[] {this.organismGeneral}; // SubstanceSourceMaterialOrganismOrganismGeneralComponent
634        default: return super.getProperty(hash, name, checkValid);
635        }
636
637      }
638
639      @Override
640      public Base setProperty(int hash, String name, Base value) throws FHIRException {
641        switch (hash) {
642        case -1281860764: // family
643          this.family = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
644          return value;
645        case 98241006: // genus
646          this.genus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
647          return value;
648        case -2008465092: // species
649          this.species = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
650          return value;
651        case 1717161194: // intraspecificType
652          this.intraspecificType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
653          return value;
654        case -1473085364: // intraspecificDescription
655          this.intraspecificDescription = TypeConvertor.castToString(value); // StringType
656          return value;
657        case -1406328437: // author
658          this.getAuthor().add((SubstanceSourceMaterialOrganismAuthorComponent) value); // SubstanceSourceMaterialOrganismAuthorComponent
659          return value;
660        case -1202757124: // hybrid
661          this.hybrid = (SubstanceSourceMaterialOrganismHybridComponent) value; // SubstanceSourceMaterialOrganismHybridComponent
662          return value;
663        case -865996874: // organismGeneral
664          this.organismGeneral = (SubstanceSourceMaterialOrganismOrganismGeneralComponent) value; // SubstanceSourceMaterialOrganismOrganismGeneralComponent
665          return value;
666        default: return super.setProperty(hash, name, value);
667        }
668
669      }
670
671      @Override
672      public Base setProperty(String name, Base value) throws FHIRException {
673        if (name.equals("family")) {
674          this.family = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
675        } else if (name.equals("genus")) {
676          this.genus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
677        } else if (name.equals("species")) {
678          this.species = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
679        } else if (name.equals("intraspecificType")) {
680          this.intraspecificType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
681        } else if (name.equals("intraspecificDescription")) {
682          this.intraspecificDescription = TypeConvertor.castToString(value); // StringType
683        } else if (name.equals("author")) {
684          this.getAuthor().add((SubstanceSourceMaterialOrganismAuthorComponent) value);
685        } else if (name.equals("hybrid")) {
686          this.hybrid = (SubstanceSourceMaterialOrganismHybridComponent) value; // SubstanceSourceMaterialOrganismHybridComponent
687        } else if (name.equals("organismGeneral")) {
688          this.organismGeneral = (SubstanceSourceMaterialOrganismOrganismGeneralComponent) value; // SubstanceSourceMaterialOrganismOrganismGeneralComponent
689        } else
690          return super.setProperty(name, value);
691        return value;
692      }
693
694      @Override
695      public Base makeProperty(int hash, String name) throws FHIRException {
696        switch (hash) {
697        case -1281860764:  return getFamily();
698        case 98241006:  return getGenus();
699        case -2008465092:  return getSpecies();
700        case 1717161194:  return getIntraspecificType();
701        case -1473085364:  return getIntraspecificDescriptionElement();
702        case -1406328437:  return addAuthor(); 
703        case -1202757124:  return getHybrid();
704        case -865996874:  return getOrganismGeneral();
705        default: return super.makeProperty(hash, name);
706        }
707
708      }
709
710      @Override
711      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
712        switch (hash) {
713        case -1281860764: /*family*/ return new String[] {"CodeableConcept"};
714        case 98241006: /*genus*/ return new String[] {"CodeableConcept"};
715        case -2008465092: /*species*/ return new String[] {"CodeableConcept"};
716        case 1717161194: /*intraspecificType*/ return new String[] {"CodeableConcept"};
717        case -1473085364: /*intraspecificDescription*/ return new String[] {"string"};
718        case -1406328437: /*author*/ return new String[] {};
719        case -1202757124: /*hybrid*/ return new String[] {};
720        case -865996874: /*organismGeneral*/ return new String[] {};
721        default: return super.getTypesForProperty(hash, name);
722        }
723
724      }
725
726      @Override
727      public Base addChild(String name) throws FHIRException {
728        if (name.equals("family")) {
729          this.family = new CodeableConcept();
730          return this.family;
731        }
732        else if (name.equals("genus")) {
733          this.genus = new CodeableConcept();
734          return this.genus;
735        }
736        else if (name.equals("species")) {
737          this.species = new CodeableConcept();
738          return this.species;
739        }
740        else if (name.equals("intraspecificType")) {
741          this.intraspecificType = new CodeableConcept();
742          return this.intraspecificType;
743        }
744        else if (name.equals("intraspecificDescription")) {
745          throw new FHIRException("Cannot call addChild on a primitive type SubstanceSourceMaterial.organism.intraspecificDescription");
746        }
747        else if (name.equals("author")) {
748          return addAuthor();
749        }
750        else if (name.equals("hybrid")) {
751          this.hybrid = new SubstanceSourceMaterialOrganismHybridComponent();
752          return this.hybrid;
753        }
754        else if (name.equals("organismGeneral")) {
755          this.organismGeneral = new SubstanceSourceMaterialOrganismOrganismGeneralComponent();
756          return this.organismGeneral;
757        }
758        else
759          return super.addChild(name);
760      }
761
762      public SubstanceSourceMaterialOrganismComponent copy() {
763        SubstanceSourceMaterialOrganismComponent dst = new SubstanceSourceMaterialOrganismComponent();
764        copyValues(dst);
765        return dst;
766      }
767
768      public void copyValues(SubstanceSourceMaterialOrganismComponent dst) {
769        super.copyValues(dst);
770        dst.family = family == null ? null : family.copy();
771        dst.genus = genus == null ? null : genus.copy();
772        dst.species = species == null ? null : species.copy();
773        dst.intraspecificType = intraspecificType == null ? null : intraspecificType.copy();
774        dst.intraspecificDescription = intraspecificDescription == null ? null : intraspecificDescription.copy();
775        if (author != null) {
776          dst.author = new ArrayList<SubstanceSourceMaterialOrganismAuthorComponent>();
777          for (SubstanceSourceMaterialOrganismAuthorComponent i : author)
778            dst.author.add(i.copy());
779        };
780        dst.hybrid = hybrid == null ? null : hybrid.copy();
781        dst.organismGeneral = organismGeneral == null ? null : organismGeneral.copy();
782      }
783
784      @Override
785      public boolean equalsDeep(Base other_) {
786        if (!super.equalsDeep(other_))
787          return false;
788        if (!(other_ instanceof SubstanceSourceMaterialOrganismComponent))
789          return false;
790        SubstanceSourceMaterialOrganismComponent o = (SubstanceSourceMaterialOrganismComponent) other_;
791        return compareDeep(family, o.family, true) && compareDeep(genus, o.genus, true) && compareDeep(species, o.species, true)
792           && compareDeep(intraspecificType, o.intraspecificType, true) && compareDeep(intraspecificDescription, o.intraspecificDescription, true)
793           && compareDeep(author, o.author, true) && compareDeep(hybrid, o.hybrid, true) && compareDeep(organismGeneral, o.organismGeneral, true)
794          ;
795      }
796
797      @Override
798      public boolean equalsShallow(Base other_) {
799        if (!super.equalsShallow(other_))
800          return false;
801        if (!(other_ instanceof SubstanceSourceMaterialOrganismComponent))
802          return false;
803        SubstanceSourceMaterialOrganismComponent o = (SubstanceSourceMaterialOrganismComponent) other_;
804        return compareValues(intraspecificDescription, o.intraspecificDescription, true);
805      }
806
807      public boolean isEmpty() {
808        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(family, genus, species, intraspecificType
809          , intraspecificDescription, author, hybrid, organismGeneral);
810      }
811
812  public String fhirType() {
813    return "SubstanceSourceMaterial.organism";
814
815  }
816
817  }
818
819    @Block()
820    public static class SubstanceSourceMaterialOrganismAuthorComponent extends BackboneElement implements IBaseBackboneElement {
821        /**
822         * The type of author of an organism species shall be specified. The parenthetical author of an organism species refers to the first author who published the plant/animal name (of any rank). The primary author of an organism species refers to the first author(s), who validly published the plant/animal name.
823         */
824        @Child(name = "authorType", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
825        @Description(shortDefinition="The type of author of an organism species shall be specified. The parenthetical author of an organism species refers to the first author who published the plant/animal name (of any rank). The primary author of an organism species refers to the first author(s), who validly published the plant/animal name", formalDefinition="The type of author of an organism species shall be specified. The parenthetical author of an organism species refers to the first author who published the plant/animal name (of any rank). The primary author of an organism species refers to the first author(s), who validly published the plant/animal name." )
826        protected CodeableConcept authorType;
827
828        /**
829         * The author of an organism species shall be specified. The author year of an organism shall also be specified when applicable; refers to the year in which the first author(s) published the infraspecific plant/animal name (of any rank).
830         */
831        @Child(name = "authorDescription", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
832        @Description(shortDefinition="The author of an organism species shall be specified. The author year of an organism shall also be specified when applicable; refers to the year in which the first author(s) published the infraspecific plant/animal name (of any rank)", formalDefinition="The author of an organism species shall be specified. The author year of an organism shall also be specified when applicable; refers to the year in which the first author(s) published the infraspecific plant/animal name (of any rank)." )
833        protected StringType authorDescription;
834
835        private static final long serialVersionUID = 1429770120L;
836
837    /**
838     * Constructor
839     */
840      public SubstanceSourceMaterialOrganismAuthorComponent() {
841        super();
842      }
843
844        /**
845         * @return {@link #authorType} (The type of author of an organism species shall be specified. The parenthetical author of an organism species refers to the first author who published the plant/animal name (of any rank). The primary author of an organism species refers to the first author(s), who validly published the plant/animal name.)
846         */
847        public CodeableConcept getAuthorType() { 
848          if (this.authorType == null)
849            if (Configuration.errorOnAutoCreate())
850              throw new Error("Attempt to auto-create SubstanceSourceMaterialOrganismAuthorComponent.authorType");
851            else if (Configuration.doAutoCreate())
852              this.authorType = new CodeableConcept(); // cc
853          return this.authorType;
854        }
855
856        public boolean hasAuthorType() { 
857          return this.authorType != null && !this.authorType.isEmpty();
858        }
859
860        /**
861         * @param value {@link #authorType} (The type of author of an organism species shall be specified. The parenthetical author of an organism species refers to the first author who published the plant/animal name (of any rank). The primary author of an organism species refers to the first author(s), who validly published the plant/animal name.)
862         */
863        public SubstanceSourceMaterialOrganismAuthorComponent setAuthorType(CodeableConcept value) { 
864          this.authorType = value;
865          return this;
866        }
867
868        /**
869         * @return {@link #authorDescription} (The author of an organism species shall be specified. The author year of an organism shall also be specified when applicable; refers to the year in which the first author(s) published the infraspecific plant/animal name (of any rank).). This is the underlying object with id, value and extensions. The accessor "getAuthorDescription" gives direct access to the value
870         */
871        public StringType getAuthorDescriptionElement() { 
872          if (this.authorDescription == null)
873            if (Configuration.errorOnAutoCreate())
874              throw new Error("Attempt to auto-create SubstanceSourceMaterialOrganismAuthorComponent.authorDescription");
875            else if (Configuration.doAutoCreate())
876              this.authorDescription = new StringType(); // bb
877          return this.authorDescription;
878        }
879
880        public boolean hasAuthorDescriptionElement() { 
881          return this.authorDescription != null && !this.authorDescription.isEmpty();
882        }
883
884        public boolean hasAuthorDescription() { 
885          return this.authorDescription != null && !this.authorDescription.isEmpty();
886        }
887
888        /**
889         * @param value {@link #authorDescription} (The author of an organism species shall be specified. The author year of an organism shall also be specified when applicable; refers to the year in which the first author(s) published the infraspecific plant/animal name (of any rank).). This is the underlying object with id, value and extensions. The accessor "getAuthorDescription" gives direct access to the value
890         */
891        public SubstanceSourceMaterialOrganismAuthorComponent setAuthorDescriptionElement(StringType value) { 
892          this.authorDescription = value;
893          return this;
894        }
895
896        /**
897         * @return The author of an organism species shall be specified. The author year of an organism shall also be specified when applicable; refers to the year in which the first author(s) published the infraspecific plant/animal name (of any rank).
898         */
899        public String getAuthorDescription() { 
900          return this.authorDescription == null ? null : this.authorDescription.getValue();
901        }
902
903        /**
904         * @param value The author of an organism species shall be specified. The author year of an organism shall also be specified when applicable; refers to the year in which the first author(s) published the infraspecific plant/animal name (of any rank).
905         */
906        public SubstanceSourceMaterialOrganismAuthorComponent setAuthorDescription(String value) { 
907          if (Utilities.noString(value))
908            this.authorDescription = null;
909          else {
910            if (this.authorDescription == null)
911              this.authorDescription = new StringType();
912            this.authorDescription.setValue(value);
913          }
914          return this;
915        }
916
917        protected void listChildren(List<Property> children) {
918          super.listChildren(children);
919          children.add(new Property("authorType", "CodeableConcept", "The type of author of an organism species shall be specified. The parenthetical author of an organism species refers to the first author who published the plant/animal name (of any rank). The primary author of an organism species refers to the first author(s), who validly published the plant/animal name.", 0, 1, authorType));
920          children.add(new Property("authorDescription", "string", "The author of an organism species shall be specified. The author year of an organism shall also be specified when applicable; refers to the year in which the first author(s) published the infraspecific plant/animal name (of any rank).", 0, 1, authorDescription));
921        }
922
923        @Override
924        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
925          switch (_hash) {
926          case -1501337755: /*authorType*/  return new Property("authorType", "CodeableConcept", "The type of author of an organism species shall be specified. The parenthetical author of an organism species refers to the first author who published the plant/animal name (of any rank). The primary author of an organism species refers to the first author(s), who validly published the plant/animal name.", 0, 1, authorType);
927          case -166185615: /*authorDescription*/  return new Property("authorDescription", "string", "The author of an organism species shall be specified. The author year of an organism shall also be specified when applicable; refers to the year in which the first author(s) published the infraspecific plant/animal name (of any rank).", 0, 1, authorDescription);
928          default: return super.getNamedProperty(_hash, _name, _checkValid);
929          }
930
931        }
932
933      @Override
934      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
935        switch (hash) {
936        case -1501337755: /*authorType*/ return this.authorType == null ? new Base[0] : new Base[] {this.authorType}; // CodeableConcept
937        case -166185615: /*authorDescription*/ return this.authorDescription == null ? new Base[0] : new Base[] {this.authorDescription}; // StringType
938        default: return super.getProperty(hash, name, checkValid);
939        }
940
941      }
942
943      @Override
944      public Base setProperty(int hash, String name, Base value) throws FHIRException {
945        switch (hash) {
946        case -1501337755: // authorType
947          this.authorType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
948          return value;
949        case -166185615: // authorDescription
950          this.authorDescription = TypeConvertor.castToString(value); // StringType
951          return value;
952        default: return super.setProperty(hash, name, value);
953        }
954
955      }
956
957      @Override
958      public Base setProperty(String name, Base value) throws FHIRException {
959        if (name.equals("authorType")) {
960          this.authorType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
961        } else if (name.equals("authorDescription")) {
962          this.authorDescription = TypeConvertor.castToString(value); // StringType
963        } else
964          return super.setProperty(name, value);
965        return value;
966      }
967
968      @Override
969      public Base makeProperty(int hash, String name) throws FHIRException {
970        switch (hash) {
971        case -1501337755:  return getAuthorType();
972        case -166185615:  return getAuthorDescriptionElement();
973        default: return super.makeProperty(hash, name);
974        }
975
976      }
977
978      @Override
979      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
980        switch (hash) {
981        case -1501337755: /*authorType*/ return new String[] {"CodeableConcept"};
982        case -166185615: /*authorDescription*/ return new String[] {"string"};
983        default: return super.getTypesForProperty(hash, name);
984        }
985
986      }
987
988      @Override
989      public Base addChild(String name) throws FHIRException {
990        if (name.equals("authorType")) {
991          this.authorType = new CodeableConcept();
992          return this.authorType;
993        }
994        else if (name.equals("authorDescription")) {
995          throw new FHIRException("Cannot call addChild on a primitive type SubstanceSourceMaterial.organism.author.authorDescription");
996        }
997        else
998          return super.addChild(name);
999      }
1000
1001      public SubstanceSourceMaterialOrganismAuthorComponent copy() {
1002        SubstanceSourceMaterialOrganismAuthorComponent dst = new SubstanceSourceMaterialOrganismAuthorComponent();
1003        copyValues(dst);
1004        return dst;
1005      }
1006
1007      public void copyValues(SubstanceSourceMaterialOrganismAuthorComponent dst) {
1008        super.copyValues(dst);
1009        dst.authorType = authorType == null ? null : authorType.copy();
1010        dst.authorDescription = authorDescription == null ? null : authorDescription.copy();
1011      }
1012
1013      @Override
1014      public boolean equalsDeep(Base other_) {
1015        if (!super.equalsDeep(other_))
1016          return false;
1017        if (!(other_ instanceof SubstanceSourceMaterialOrganismAuthorComponent))
1018          return false;
1019        SubstanceSourceMaterialOrganismAuthorComponent o = (SubstanceSourceMaterialOrganismAuthorComponent) other_;
1020        return compareDeep(authorType, o.authorType, true) && compareDeep(authorDescription, o.authorDescription, true)
1021          ;
1022      }
1023
1024      @Override
1025      public boolean equalsShallow(Base other_) {
1026        if (!super.equalsShallow(other_))
1027          return false;
1028        if (!(other_ instanceof SubstanceSourceMaterialOrganismAuthorComponent))
1029          return false;
1030        SubstanceSourceMaterialOrganismAuthorComponent o = (SubstanceSourceMaterialOrganismAuthorComponent) other_;
1031        return compareValues(authorDescription, o.authorDescription, true);
1032      }
1033
1034      public boolean isEmpty() {
1035        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(authorType, authorDescription
1036          );
1037      }
1038
1039  public String fhirType() {
1040    return "SubstanceSourceMaterial.organism.author";
1041
1042  }
1043
1044  }
1045
1046    @Block()
1047    public static class SubstanceSourceMaterialOrganismHybridComponent extends BackboneElement implements IBaseBackboneElement {
1048        /**
1049         * The identifier of the maternal species constituting the hybrid organism shall be specified based on a controlled vocabulary. For plants, the parents aren?t always known, and it is unlikely that it will be known which is maternal and which is paternal.
1050         */
1051        @Child(name = "maternalOrganismId", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true)
1052        @Description(shortDefinition="The identifier of the maternal species constituting the hybrid organism shall be specified based on a controlled vocabulary. For plants, the parents aren?t always known, and it is unlikely that it will be known which is maternal and which is paternal", formalDefinition="The identifier of the maternal species constituting the hybrid organism shall be specified based on a controlled vocabulary. For plants, the parents aren?t always known, and it is unlikely that it will be known which is maternal and which is paternal." )
1053        protected StringType maternalOrganismId;
1054
1055        /**
1056         * The name of the maternal species constituting the hybrid organism shall be specified. For plants, the parents aren?t always known, and it is unlikely that it will be known which is maternal and which is paternal.
1057         */
1058        @Child(name = "maternalOrganismName", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1059        @Description(shortDefinition="The name of the maternal species constituting the hybrid organism shall be specified. For plants, the parents aren?t always known, and it is unlikely that it will be known which is maternal and which is paternal", formalDefinition="The name of the maternal species constituting the hybrid organism shall be specified. For plants, the parents aren?t always known, and it is unlikely that it will be known which is maternal and which is paternal." )
1060        protected StringType maternalOrganismName;
1061
1062        /**
1063         * The identifier of the paternal species constituting the hybrid organism shall be specified based on a controlled vocabulary.
1064         */
1065        @Child(name = "paternalOrganismId", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1066        @Description(shortDefinition="The identifier of the paternal species constituting the hybrid organism shall be specified based on a controlled vocabulary", formalDefinition="The identifier of the paternal species constituting the hybrid organism shall be specified based on a controlled vocabulary." )
1067        protected StringType paternalOrganismId;
1068
1069        /**
1070         * The name of the paternal species constituting the hybrid organism shall be specified.
1071         */
1072        @Child(name = "paternalOrganismName", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
1073        @Description(shortDefinition="The name of the paternal species constituting the hybrid organism shall be specified", formalDefinition="The name of the paternal species constituting the hybrid organism shall be specified." )
1074        protected StringType paternalOrganismName;
1075
1076        /**
1077         * The hybrid type of an organism shall be specified.
1078         */
1079        @Child(name = "hybridType", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true)
1080        @Description(shortDefinition="The hybrid type of an organism shall be specified", formalDefinition="The hybrid type of an organism shall be specified." )
1081        protected CodeableConcept hybridType;
1082
1083        private static final long serialVersionUID = 1981189787L;
1084
1085    /**
1086     * Constructor
1087     */
1088      public SubstanceSourceMaterialOrganismHybridComponent() {
1089        super();
1090      }
1091
1092        /**
1093         * @return {@link #maternalOrganismId} (The identifier of the maternal species constituting the hybrid organism shall be specified based on a controlled vocabulary. For plants, the parents aren?t always known, and it is unlikely that it will be known which is maternal and which is paternal.). This is the underlying object with id, value and extensions. The accessor "getMaternalOrganismId" gives direct access to the value
1094         */
1095        public StringType getMaternalOrganismIdElement() { 
1096          if (this.maternalOrganismId == null)
1097            if (Configuration.errorOnAutoCreate())
1098              throw new Error("Attempt to auto-create SubstanceSourceMaterialOrganismHybridComponent.maternalOrganismId");
1099            else if (Configuration.doAutoCreate())
1100              this.maternalOrganismId = new StringType(); // bb
1101          return this.maternalOrganismId;
1102        }
1103
1104        public boolean hasMaternalOrganismIdElement() { 
1105          return this.maternalOrganismId != null && !this.maternalOrganismId.isEmpty();
1106        }
1107
1108        public boolean hasMaternalOrganismId() { 
1109          return this.maternalOrganismId != null && !this.maternalOrganismId.isEmpty();
1110        }
1111
1112        /**
1113         * @param value {@link #maternalOrganismId} (The identifier of the maternal species constituting the hybrid organism shall be specified based on a controlled vocabulary. For plants, the parents aren?t always known, and it is unlikely that it will be known which is maternal and which is paternal.). This is the underlying object with id, value and extensions. The accessor "getMaternalOrganismId" gives direct access to the value
1114         */
1115        public SubstanceSourceMaterialOrganismHybridComponent setMaternalOrganismIdElement(StringType value) { 
1116          this.maternalOrganismId = value;
1117          return this;
1118        }
1119
1120        /**
1121         * @return The identifier of the maternal species constituting the hybrid organism shall be specified based on a controlled vocabulary. For plants, the parents aren?t always known, and it is unlikely that it will be known which is maternal and which is paternal.
1122         */
1123        public String getMaternalOrganismId() { 
1124          return this.maternalOrganismId == null ? null : this.maternalOrganismId.getValue();
1125        }
1126
1127        /**
1128         * @param value The identifier of the maternal species constituting the hybrid organism shall be specified based on a controlled vocabulary. For plants, the parents aren?t always known, and it is unlikely that it will be known which is maternal and which is paternal.
1129         */
1130        public SubstanceSourceMaterialOrganismHybridComponent setMaternalOrganismId(String value) { 
1131          if (Utilities.noString(value))
1132            this.maternalOrganismId = null;
1133          else {
1134            if (this.maternalOrganismId == null)
1135              this.maternalOrganismId = new StringType();
1136            this.maternalOrganismId.setValue(value);
1137          }
1138          return this;
1139        }
1140
1141        /**
1142         * @return {@link #maternalOrganismName} (The name of the maternal species constituting the hybrid organism shall be specified. For plants, the parents aren?t always known, and it is unlikely that it will be known which is maternal and which is paternal.). This is the underlying object with id, value and extensions. The accessor "getMaternalOrganismName" gives direct access to the value
1143         */
1144        public StringType getMaternalOrganismNameElement() { 
1145          if (this.maternalOrganismName == null)
1146            if (Configuration.errorOnAutoCreate())
1147              throw new Error("Attempt to auto-create SubstanceSourceMaterialOrganismHybridComponent.maternalOrganismName");
1148            else if (Configuration.doAutoCreate())
1149              this.maternalOrganismName = new StringType(); // bb
1150          return this.maternalOrganismName;
1151        }
1152
1153        public boolean hasMaternalOrganismNameElement() { 
1154          return this.maternalOrganismName != null && !this.maternalOrganismName.isEmpty();
1155        }
1156
1157        public boolean hasMaternalOrganismName() { 
1158          return this.maternalOrganismName != null && !this.maternalOrganismName.isEmpty();
1159        }
1160
1161        /**
1162         * @param value {@link #maternalOrganismName} (The name of the maternal species constituting the hybrid organism shall be specified. For plants, the parents aren?t always known, and it is unlikely that it will be known which is maternal and which is paternal.). This is the underlying object with id, value and extensions. The accessor "getMaternalOrganismName" gives direct access to the value
1163         */
1164        public SubstanceSourceMaterialOrganismHybridComponent setMaternalOrganismNameElement(StringType value) { 
1165          this.maternalOrganismName = value;
1166          return this;
1167        }
1168
1169        /**
1170         * @return The name of the maternal species constituting the hybrid organism shall be specified. For plants, the parents aren?t always known, and it is unlikely that it will be known which is maternal and which is paternal.
1171         */
1172        public String getMaternalOrganismName() { 
1173          return this.maternalOrganismName == null ? null : this.maternalOrganismName.getValue();
1174        }
1175
1176        /**
1177         * @param value The name of the maternal species constituting the hybrid organism shall be specified. For plants, the parents aren?t always known, and it is unlikely that it will be known which is maternal and which is paternal.
1178         */
1179        public SubstanceSourceMaterialOrganismHybridComponent setMaternalOrganismName(String value) { 
1180          if (Utilities.noString(value))
1181            this.maternalOrganismName = null;
1182          else {
1183            if (this.maternalOrganismName == null)
1184              this.maternalOrganismName = new StringType();
1185            this.maternalOrganismName.setValue(value);
1186          }
1187          return this;
1188        }
1189
1190        /**
1191         * @return {@link #paternalOrganismId} (The identifier of the paternal species constituting the hybrid organism shall be specified based on a controlled vocabulary.). This is the underlying object with id, value and extensions. The accessor "getPaternalOrganismId" gives direct access to the value
1192         */
1193        public StringType getPaternalOrganismIdElement() { 
1194          if (this.paternalOrganismId == null)
1195            if (Configuration.errorOnAutoCreate())
1196              throw new Error("Attempt to auto-create SubstanceSourceMaterialOrganismHybridComponent.paternalOrganismId");
1197            else if (Configuration.doAutoCreate())
1198              this.paternalOrganismId = new StringType(); // bb
1199          return this.paternalOrganismId;
1200        }
1201
1202        public boolean hasPaternalOrganismIdElement() { 
1203          return this.paternalOrganismId != null && !this.paternalOrganismId.isEmpty();
1204        }
1205
1206        public boolean hasPaternalOrganismId() { 
1207          return this.paternalOrganismId != null && !this.paternalOrganismId.isEmpty();
1208        }
1209
1210        /**
1211         * @param value {@link #paternalOrganismId} (The identifier of the paternal species constituting the hybrid organism shall be specified based on a controlled vocabulary.). This is the underlying object with id, value and extensions. The accessor "getPaternalOrganismId" gives direct access to the value
1212         */
1213        public SubstanceSourceMaterialOrganismHybridComponent setPaternalOrganismIdElement(StringType value) { 
1214          this.paternalOrganismId = value;
1215          return this;
1216        }
1217
1218        /**
1219         * @return The identifier of the paternal species constituting the hybrid organism shall be specified based on a controlled vocabulary.
1220         */
1221        public String getPaternalOrganismId() { 
1222          return this.paternalOrganismId == null ? null : this.paternalOrganismId.getValue();
1223        }
1224
1225        /**
1226         * @param value The identifier of the paternal species constituting the hybrid organism shall be specified based on a controlled vocabulary.
1227         */
1228        public SubstanceSourceMaterialOrganismHybridComponent setPaternalOrganismId(String value) { 
1229          if (Utilities.noString(value))
1230            this.paternalOrganismId = null;
1231          else {
1232            if (this.paternalOrganismId == null)
1233              this.paternalOrganismId = new StringType();
1234            this.paternalOrganismId.setValue(value);
1235          }
1236          return this;
1237        }
1238
1239        /**
1240         * @return {@link #paternalOrganismName} (The name of the paternal species constituting the hybrid organism shall be specified.). This is the underlying object with id, value and extensions. The accessor "getPaternalOrganismName" gives direct access to the value
1241         */
1242        public StringType getPaternalOrganismNameElement() { 
1243          if (this.paternalOrganismName == null)
1244            if (Configuration.errorOnAutoCreate())
1245              throw new Error("Attempt to auto-create SubstanceSourceMaterialOrganismHybridComponent.paternalOrganismName");
1246            else if (Configuration.doAutoCreate())
1247              this.paternalOrganismName = new StringType(); // bb
1248          return this.paternalOrganismName;
1249        }
1250
1251        public boolean hasPaternalOrganismNameElement() { 
1252          return this.paternalOrganismName != null && !this.paternalOrganismName.isEmpty();
1253        }
1254
1255        public boolean hasPaternalOrganismName() { 
1256          return this.paternalOrganismName != null && !this.paternalOrganismName.isEmpty();
1257        }
1258
1259        /**
1260         * @param value {@link #paternalOrganismName} (The name of the paternal species constituting the hybrid organism shall be specified.). This is the underlying object with id, value and extensions. The accessor "getPaternalOrganismName" gives direct access to the value
1261         */
1262        public SubstanceSourceMaterialOrganismHybridComponent setPaternalOrganismNameElement(StringType value) { 
1263          this.paternalOrganismName = value;
1264          return this;
1265        }
1266
1267        /**
1268         * @return The name of the paternal species constituting the hybrid organism shall be specified.
1269         */
1270        public String getPaternalOrganismName() { 
1271          return this.paternalOrganismName == null ? null : this.paternalOrganismName.getValue();
1272        }
1273
1274        /**
1275         * @param value The name of the paternal species constituting the hybrid organism shall be specified.
1276         */
1277        public SubstanceSourceMaterialOrganismHybridComponent setPaternalOrganismName(String value) { 
1278          if (Utilities.noString(value))
1279            this.paternalOrganismName = null;
1280          else {
1281            if (this.paternalOrganismName == null)
1282              this.paternalOrganismName = new StringType();
1283            this.paternalOrganismName.setValue(value);
1284          }
1285          return this;
1286        }
1287
1288        /**
1289         * @return {@link #hybridType} (The hybrid type of an organism shall be specified.)
1290         */
1291        public CodeableConcept getHybridType() { 
1292          if (this.hybridType == null)
1293            if (Configuration.errorOnAutoCreate())
1294              throw new Error("Attempt to auto-create SubstanceSourceMaterialOrganismHybridComponent.hybridType");
1295            else if (Configuration.doAutoCreate())
1296              this.hybridType = new CodeableConcept(); // cc
1297          return this.hybridType;
1298        }
1299
1300        public boolean hasHybridType() { 
1301          return this.hybridType != null && !this.hybridType.isEmpty();
1302        }
1303
1304        /**
1305         * @param value {@link #hybridType} (The hybrid type of an organism shall be specified.)
1306         */
1307        public SubstanceSourceMaterialOrganismHybridComponent setHybridType(CodeableConcept value) { 
1308          this.hybridType = value;
1309          return this;
1310        }
1311
1312        protected void listChildren(List<Property> children) {
1313          super.listChildren(children);
1314          children.add(new Property("maternalOrganismId", "string", "The identifier of the maternal species constituting the hybrid organism shall be specified based on a controlled vocabulary. For plants, the parents aren?t always known, and it is unlikely that it will be known which is maternal and which is paternal.", 0, 1, maternalOrganismId));
1315          children.add(new Property("maternalOrganismName", "string", "The name of the maternal species constituting the hybrid organism shall be specified. For plants, the parents aren?t always known, and it is unlikely that it will be known which is maternal and which is paternal.", 0, 1, maternalOrganismName));
1316          children.add(new Property("paternalOrganismId", "string", "The identifier of the paternal species constituting the hybrid organism shall be specified based on a controlled vocabulary.", 0, 1, paternalOrganismId));
1317          children.add(new Property("paternalOrganismName", "string", "The name of the paternal species constituting the hybrid organism shall be specified.", 0, 1, paternalOrganismName));
1318          children.add(new Property("hybridType", "CodeableConcept", "The hybrid type of an organism shall be specified.", 0, 1, hybridType));
1319        }
1320
1321        @Override
1322        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1323          switch (_hash) {
1324          case -1179977063: /*maternalOrganismId*/  return new Property("maternalOrganismId", "string", "The identifier of the maternal species constituting the hybrid organism shall be specified based on a controlled vocabulary. For plants, the parents aren?t always known, and it is unlikely that it will be known which is maternal and which is paternal.", 0, 1, maternalOrganismId);
1325          case -86441847: /*maternalOrganismName*/  return new Property("maternalOrganismName", "string", "The name of the maternal species constituting the hybrid organism shall be specified. For plants, the parents aren?t always known, and it is unlikely that it will be known which is maternal and which is paternal.", 0, 1, maternalOrganismName);
1326          case 123773174: /*paternalOrganismId*/  return new Property("paternalOrganismId", "string", "The identifier of the paternal species constituting the hybrid organism shall be specified based on a controlled vocabulary.", 0, 1, paternalOrganismId);
1327          case -1312914522: /*paternalOrganismName*/  return new Property("paternalOrganismName", "string", "The name of the paternal species constituting the hybrid organism shall be specified.", 0, 1, paternalOrganismName);
1328          case 1572734806: /*hybridType*/  return new Property("hybridType", "CodeableConcept", "The hybrid type of an organism shall be specified.", 0, 1, hybridType);
1329          default: return super.getNamedProperty(_hash, _name, _checkValid);
1330          }
1331
1332        }
1333
1334      @Override
1335      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1336        switch (hash) {
1337        case -1179977063: /*maternalOrganismId*/ return this.maternalOrganismId == null ? new Base[0] : new Base[] {this.maternalOrganismId}; // StringType
1338        case -86441847: /*maternalOrganismName*/ return this.maternalOrganismName == null ? new Base[0] : new Base[] {this.maternalOrganismName}; // StringType
1339        case 123773174: /*paternalOrganismId*/ return this.paternalOrganismId == null ? new Base[0] : new Base[] {this.paternalOrganismId}; // StringType
1340        case -1312914522: /*paternalOrganismName*/ return this.paternalOrganismName == null ? new Base[0] : new Base[] {this.paternalOrganismName}; // StringType
1341        case 1572734806: /*hybridType*/ return this.hybridType == null ? new Base[0] : new Base[] {this.hybridType}; // CodeableConcept
1342        default: return super.getProperty(hash, name, checkValid);
1343        }
1344
1345      }
1346
1347      @Override
1348      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1349        switch (hash) {
1350        case -1179977063: // maternalOrganismId
1351          this.maternalOrganismId = TypeConvertor.castToString(value); // StringType
1352          return value;
1353        case -86441847: // maternalOrganismName
1354          this.maternalOrganismName = TypeConvertor.castToString(value); // StringType
1355          return value;
1356        case 123773174: // paternalOrganismId
1357          this.paternalOrganismId = TypeConvertor.castToString(value); // StringType
1358          return value;
1359        case -1312914522: // paternalOrganismName
1360          this.paternalOrganismName = TypeConvertor.castToString(value); // StringType
1361          return value;
1362        case 1572734806: // hybridType
1363          this.hybridType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1364          return value;
1365        default: return super.setProperty(hash, name, value);
1366        }
1367
1368      }
1369
1370      @Override
1371      public Base setProperty(String name, Base value) throws FHIRException {
1372        if (name.equals("maternalOrganismId")) {
1373          this.maternalOrganismId = TypeConvertor.castToString(value); // StringType
1374        } else if (name.equals("maternalOrganismName")) {
1375          this.maternalOrganismName = TypeConvertor.castToString(value); // StringType
1376        } else if (name.equals("paternalOrganismId")) {
1377          this.paternalOrganismId = TypeConvertor.castToString(value); // StringType
1378        } else if (name.equals("paternalOrganismName")) {
1379          this.paternalOrganismName = TypeConvertor.castToString(value); // StringType
1380        } else if (name.equals("hybridType")) {
1381          this.hybridType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1382        } else
1383          return super.setProperty(name, value);
1384        return value;
1385      }
1386
1387      @Override
1388      public Base makeProperty(int hash, String name) throws FHIRException {
1389        switch (hash) {
1390        case -1179977063:  return getMaternalOrganismIdElement();
1391        case -86441847:  return getMaternalOrganismNameElement();
1392        case 123773174:  return getPaternalOrganismIdElement();
1393        case -1312914522:  return getPaternalOrganismNameElement();
1394        case 1572734806:  return getHybridType();
1395        default: return super.makeProperty(hash, name);
1396        }
1397
1398      }
1399
1400      @Override
1401      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1402        switch (hash) {
1403        case -1179977063: /*maternalOrganismId*/ return new String[] {"string"};
1404        case -86441847: /*maternalOrganismName*/ return new String[] {"string"};
1405        case 123773174: /*paternalOrganismId*/ return new String[] {"string"};
1406        case -1312914522: /*paternalOrganismName*/ return new String[] {"string"};
1407        case 1572734806: /*hybridType*/ return new String[] {"CodeableConcept"};
1408        default: return super.getTypesForProperty(hash, name);
1409        }
1410
1411      }
1412
1413      @Override
1414      public Base addChild(String name) throws FHIRException {
1415        if (name.equals("maternalOrganismId")) {
1416          throw new FHIRException("Cannot call addChild on a primitive type SubstanceSourceMaterial.organism.hybrid.maternalOrganismId");
1417        }
1418        else if (name.equals("maternalOrganismName")) {
1419          throw new FHIRException("Cannot call addChild on a primitive type SubstanceSourceMaterial.organism.hybrid.maternalOrganismName");
1420        }
1421        else if (name.equals("paternalOrganismId")) {
1422          throw new FHIRException("Cannot call addChild on a primitive type SubstanceSourceMaterial.organism.hybrid.paternalOrganismId");
1423        }
1424        else if (name.equals("paternalOrganismName")) {
1425          throw new FHIRException("Cannot call addChild on a primitive type SubstanceSourceMaterial.organism.hybrid.paternalOrganismName");
1426        }
1427        else if (name.equals("hybridType")) {
1428          this.hybridType = new CodeableConcept();
1429          return this.hybridType;
1430        }
1431        else
1432          return super.addChild(name);
1433      }
1434
1435      public SubstanceSourceMaterialOrganismHybridComponent copy() {
1436        SubstanceSourceMaterialOrganismHybridComponent dst = new SubstanceSourceMaterialOrganismHybridComponent();
1437        copyValues(dst);
1438        return dst;
1439      }
1440
1441      public void copyValues(SubstanceSourceMaterialOrganismHybridComponent dst) {
1442        super.copyValues(dst);
1443        dst.maternalOrganismId = maternalOrganismId == null ? null : maternalOrganismId.copy();
1444        dst.maternalOrganismName = maternalOrganismName == null ? null : maternalOrganismName.copy();
1445        dst.paternalOrganismId = paternalOrganismId == null ? null : paternalOrganismId.copy();
1446        dst.paternalOrganismName = paternalOrganismName == null ? null : paternalOrganismName.copy();
1447        dst.hybridType = hybridType == null ? null : hybridType.copy();
1448      }
1449
1450      @Override
1451      public boolean equalsDeep(Base other_) {
1452        if (!super.equalsDeep(other_))
1453          return false;
1454        if (!(other_ instanceof SubstanceSourceMaterialOrganismHybridComponent))
1455          return false;
1456        SubstanceSourceMaterialOrganismHybridComponent o = (SubstanceSourceMaterialOrganismHybridComponent) other_;
1457        return compareDeep(maternalOrganismId, o.maternalOrganismId, true) && compareDeep(maternalOrganismName, o.maternalOrganismName, true)
1458           && compareDeep(paternalOrganismId, o.paternalOrganismId, true) && compareDeep(paternalOrganismName, o.paternalOrganismName, true)
1459           && compareDeep(hybridType, o.hybridType, true);
1460      }
1461
1462      @Override
1463      public boolean equalsShallow(Base other_) {
1464        if (!super.equalsShallow(other_))
1465          return false;
1466        if (!(other_ instanceof SubstanceSourceMaterialOrganismHybridComponent))
1467          return false;
1468        SubstanceSourceMaterialOrganismHybridComponent o = (SubstanceSourceMaterialOrganismHybridComponent) other_;
1469        return compareValues(maternalOrganismId, o.maternalOrganismId, true) && compareValues(maternalOrganismName, o.maternalOrganismName, true)
1470           && compareValues(paternalOrganismId, o.paternalOrganismId, true) && compareValues(paternalOrganismName, o.paternalOrganismName, true)
1471          ;
1472      }
1473
1474      public boolean isEmpty() {
1475        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(maternalOrganismId, maternalOrganismName
1476          , paternalOrganismId, paternalOrganismName, hybridType);
1477      }
1478
1479  public String fhirType() {
1480    return "SubstanceSourceMaterial.organism.hybrid";
1481
1482  }
1483
1484  }
1485
1486    @Block()
1487    public static class SubstanceSourceMaterialOrganismOrganismGeneralComponent extends BackboneElement implements IBaseBackboneElement {
1488        /**
1489         * The kingdom of an organism shall be specified.
1490         */
1491        @Child(name = "kingdom", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
1492        @Description(shortDefinition="The kingdom of an organism shall be specified", formalDefinition="The kingdom of an organism shall be specified." )
1493        protected CodeableConcept kingdom;
1494
1495        /**
1496         * The phylum of an organism shall be specified.
1497         */
1498        @Child(name = "phylum", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
1499        @Description(shortDefinition="The phylum of an organism shall be specified", formalDefinition="The phylum of an organism shall be specified." )
1500        protected CodeableConcept phylum;
1501
1502        /**
1503         * The class of an organism shall be specified.
1504         */
1505        @Child(name = "class", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true)
1506        @Description(shortDefinition="The class of an organism shall be specified", formalDefinition="The class of an organism shall be specified." )
1507        protected CodeableConcept class_;
1508
1509        /**
1510         * The order of an organism shall be specified,.
1511         */
1512        @Child(name = "order", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true)
1513        @Description(shortDefinition="The order of an organism shall be specified,", formalDefinition="The order of an organism shall be specified,." )
1514        protected CodeableConcept order;
1515
1516        private static final long serialVersionUID = 659838613L;
1517
1518    /**
1519     * Constructor
1520     */
1521      public SubstanceSourceMaterialOrganismOrganismGeneralComponent() {
1522        super();
1523      }
1524
1525        /**
1526         * @return {@link #kingdom} (The kingdom of an organism shall be specified.)
1527         */
1528        public CodeableConcept getKingdom() { 
1529          if (this.kingdom == null)
1530            if (Configuration.errorOnAutoCreate())
1531              throw new Error("Attempt to auto-create SubstanceSourceMaterialOrganismOrganismGeneralComponent.kingdom");
1532            else if (Configuration.doAutoCreate())
1533              this.kingdom = new CodeableConcept(); // cc
1534          return this.kingdom;
1535        }
1536
1537        public boolean hasKingdom() { 
1538          return this.kingdom != null && !this.kingdom.isEmpty();
1539        }
1540
1541        /**
1542         * @param value {@link #kingdom} (The kingdom of an organism shall be specified.)
1543         */
1544        public SubstanceSourceMaterialOrganismOrganismGeneralComponent setKingdom(CodeableConcept value) { 
1545          this.kingdom = value;
1546          return this;
1547        }
1548
1549        /**
1550         * @return {@link #phylum} (The phylum of an organism shall be specified.)
1551         */
1552        public CodeableConcept getPhylum() { 
1553          if (this.phylum == null)
1554            if (Configuration.errorOnAutoCreate())
1555              throw new Error("Attempt to auto-create SubstanceSourceMaterialOrganismOrganismGeneralComponent.phylum");
1556            else if (Configuration.doAutoCreate())
1557              this.phylum = new CodeableConcept(); // cc
1558          return this.phylum;
1559        }
1560
1561        public boolean hasPhylum() { 
1562          return this.phylum != null && !this.phylum.isEmpty();
1563        }
1564
1565        /**
1566         * @param value {@link #phylum} (The phylum of an organism shall be specified.)
1567         */
1568        public SubstanceSourceMaterialOrganismOrganismGeneralComponent setPhylum(CodeableConcept value) { 
1569          this.phylum = value;
1570          return this;
1571        }
1572
1573        /**
1574         * @return {@link #class_} (The class of an organism shall be specified.)
1575         */
1576        public CodeableConcept getClass_() { 
1577          if (this.class_ == null)
1578            if (Configuration.errorOnAutoCreate())
1579              throw new Error("Attempt to auto-create SubstanceSourceMaterialOrganismOrganismGeneralComponent.class_");
1580            else if (Configuration.doAutoCreate())
1581              this.class_ = new CodeableConcept(); // cc
1582          return this.class_;
1583        }
1584
1585        public boolean hasClass_() { 
1586          return this.class_ != null && !this.class_.isEmpty();
1587        }
1588
1589        /**
1590         * @param value {@link #class_} (The class of an organism shall be specified.)
1591         */
1592        public SubstanceSourceMaterialOrganismOrganismGeneralComponent setClass_(CodeableConcept value) { 
1593          this.class_ = value;
1594          return this;
1595        }
1596
1597        /**
1598         * @return {@link #order} (The order of an organism shall be specified,.)
1599         */
1600        public CodeableConcept getOrder() { 
1601          if (this.order == null)
1602            if (Configuration.errorOnAutoCreate())
1603              throw new Error("Attempt to auto-create SubstanceSourceMaterialOrganismOrganismGeneralComponent.order");
1604            else if (Configuration.doAutoCreate())
1605              this.order = new CodeableConcept(); // cc
1606          return this.order;
1607        }
1608
1609        public boolean hasOrder() { 
1610          return this.order != null && !this.order.isEmpty();
1611        }
1612
1613        /**
1614         * @param value {@link #order} (The order of an organism shall be specified,.)
1615         */
1616        public SubstanceSourceMaterialOrganismOrganismGeneralComponent setOrder(CodeableConcept value) { 
1617          this.order = value;
1618          return this;
1619        }
1620
1621        protected void listChildren(List<Property> children) {
1622          super.listChildren(children);
1623          children.add(new Property("kingdom", "CodeableConcept", "The kingdom of an organism shall be specified.", 0, 1, kingdom));
1624          children.add(new Property("phylum", "CodeableConcept", "The phylum of an organism shall be specified.", 0, 1, phylum));
1625          children.add(new Property("class", "CodeableConcept", "The class of an organism shall be specified.", 0, 1, class_));
1626          children.add(new Property("order", "CodeableConcept", "The order of an organism shall be specified,.", 0, 1, order));
1627        }
1628
1629        @Override
1630        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1631          switch (_hash) {
1632          case -710537653: /*kingdom*/  return new Property("kingdom", "CodeableConcept", "The kingdom of an organism shall be specified.", 0, 1, kingdom);
1633          case -988743965: /*phylum*/  return new Property("phylum", "CodeableConcept", "The phylum of an organism shall be specified.", 0, 1, phylum);
1634          case 94742904: /*class*/  return new Property("class", "CodeableConcept", "The class of an organism shall be specified.", 0, 1, class_);
1635          case 106006350: /*order*/  return new Property("order", "CodeableConcept", "The order of an organism shall be specified,.", 0, 1, order);
1636          default: return super.getNamedProperty(_hash, _name, _checkValid);
1637          }
1638
1639        }
1640
1641      @Override
1642      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1643        switch (hash) {
1644        case -710537653: /*kingdom*/ return this.kingdom == null ? new Base[0] : new Base[] {this.kingdom}; // CodeableConcept
1645        case -988743965: /*phylum*/ return this.phylum == null ? new Base[0] : new Base[] {this.phylum}; // CodeableConcept
1646        case 94742904: /*class*/ return this.class_ == null ? new Base[0] : new Base[] {this.class_}; // CodeableConcept
1647        case 106006350: /*order*/ return this.order == null ? new Base[0] : new Base[] {this.order}; // CodeableConcept
1648        default: return super.getProperty(hash, name, checkValid);
1649        }
1650
1651      }
1652
1653      @Override
1654      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1655        switch (hash) {
1656        case -710537653: // kingdom
1657          this.kingdom = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1658          return value;
1659        case -988743965: // phylum
1660          this.phylum = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1661          return value;
1662        case 94742904: // class
1663          this.class_ = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1664          return value;
1665        case 106006350: // order
1666          this.order = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1667          return value;
1668        default: return super.setProperty(hash, name, value);
1669        }
1670
1671      }
1672
1673      @Override
1674      public Base setProperty(String name, Base value) throws FHIRException {
1675        if (name.equals("kingdom")) {
1676          this.kingdom = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1677        } else if (name.equals("phylum")) {
1678          this.phylum = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1679        } else if (name.equals("class")) {
1680          this.class_ = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1681        } else if (name.equals("order")) {
1682          this.order = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1683        } else
1684          return super.setProperty(name, value);
1685        return value;
1686      }
1687
1688      @Override
1689      public Base makeProperty(int hash, String name) throws FHIRException {
1690        switch (hash) {
1691        case -710537653:  return getKingdom();
1692        case -988743965:  return getPhylum();
1693        case 94742904:  return getClass_();
1694        case 106006350:  return getOrder();
1695        default: return super.makeProperty(hash, name);
1696        }
1697
1698      }
1699
1700      @Override
1701      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1702        switch (hash) {
1703        case -710537653: /*kingdom*/ return new String[] {"CodeableConcept"};
1704        case -988743965: /*phylum*/ return new String[] {"CodeableConcept"};
1705        case 94742904: /*class*/ return new String[] {"CodeableConcept"};
1706        case 106006350: /*order*/ return new String[] {"CodeableConcept"};
1707        default: return super.getTypesForProperty(hash, name);
1708        }
1709
1710      }
1711
1712      @Override
1713      public Base addChild(String name) throws FHIRException {
1714        if (name.equals("kingdom")) {
1715          this.kingdom = new CodeableConcept();
1716          return this.kingdom;
1717        }
1718        else if (name.equals("phylum")) {
1719          this.phylum = new CodeableConcept();
1720          return this.phylum;
1721        }
1722        else if (name.equals("class")) {
1723          this.class_ = new CodeableConcept();
1724          return this.class_;
1725        }
1726        else if (name.equals("order")) {
1727          this.order = new CodeableConcept();
1728          return this.order;
1729        }
1730        else
1731          return super.addChild(name);
1732      }
1733
1734      public SubstanceSourceMaterialOrganismOrganismGeneralComponent copy() {
1735        SubstanceSourceMaterialOrganismOrganismGeneralComponent dst = new SubstanceSourceMaterialOrganismOrganismGeneralComponent();
1736        copyValues(dst);
1737        return dst;
1738      }
1739
1740      public void copyValues(SubstanceSourceMaterialOrganismOrganismGeneralComponent dst) {
1741        super.copyValues(dst);
1742        dst.kingdom = kingdom == null ? null : kingdom.copy();
1743        dst.phylum = phylum == null ? null : phylum.copy();
1744        dst.class_ = class_ == null ? null : class_.copy();
1745        dst.order = order == null ? null : order.copy();
1746      }
1747
1748      @Override
1749      public boolean equalsDeep(Base other_) {
1750        if (!super.equalsDeep(other_))
1751          return false;
1752        if (!(other_ instanceof SubstanceSourceMaterialOrganismOrganismGeneralComponent))
1753          return false;
1754        SubstanceSourceMaterialOrganismOrganismGeneralComponent o = (SubstanceSourceMaterialOrganismOrganismGeneralComponent) other_;
1755        return compareDeep(kingdom, o.kingdom, true) && compareDeep(phylum, o.phylum, true) && compareDeep(class_, o.class_, true)
1756           && compareDeep(order, o.order, true);
1757      }
1758
1759      @Override
1760      public boolean equalsShallow(Base other_) {
1761        if (!super.equalsShallow(other_))
1762          return false;
1763        if (!(other_ instanceof SubstanceSourceMaterialOrganismOrganismGeneralComponent))
1764          return false;
1765        SubstanceSourceMaterialOrganismOrganismGeneralComponent o = (SubstanceSourceMaterialOrganismOrganismGeneralComponent) other_;
1766        return true;
1767      }
1768
1769      public boolean isEmpty() {
1770        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(kingdom, phylum, class_
1771          , order);
1772      }
1773
1774  public String fhirType() {
1775    return "SubstanceSourceMaterial.organism.organismGeneral";
1776
1777  }
1778
1779  }
1780
1781    @Block()
1782    public static class SubstanceSourceMaterialPartDescriptionComponent extends BackboneElement implements IBaseBackboneElement {
1783        /**
1784         * Entity of anatomical origin of source material within an organism.
1785         */
1786        @Child(name = "part", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
1787        @Description(shortDefinition="Entity of anatomical origin of source material within an organism", formalDefinition="Entity of anatomical origin of source material within an organism." )
1788        protected CodeableConcept part;
1789
1790        /**
1791         * The detailed anatomic location when the part can be extracted from different anatomical locations of the organism. Multiple alternative locations may apply.
1792         */
1793        @Child(name = "partLocation", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
1794        @Description(shortDefinition="The detailed anatomic location when the part can be extracted from different anatomical locations of the organism. Multiple alternative locations may apply", formalDefinition="The detailed anatomic location when the part can be extracted from different anatomical locations of the organism. Multiple alternative locations may apply." )
1795        protected CodeableConcept partLocation;
1796
1797        private static final long serialVersionUID = 308875915L;
1798
1799    /**
1800     * Constructor
1801     */
1802      public SubstanceSourceMaterialPartDescriptionComponent() {
1803        super();
1804      }
1805
1806        /**
1807         * @return {@link #part} (Entity of anatomical origin of source material within an organism.)
1808         */
1809        public CodeableConcept getPart() { 
1810          if (this.part == null)
1811            if (Configuration.errorOnAutoCreate())
1812              throw new Error("Attempt to auto-create SubstanceSourceMaterialPartDescriptionComponent.part");
1813            else if (Configuration.doAutoCreate())
1814              this.part = new CodeableConcept(); // cc
1815          return this.part;
1816        }
1817
1818        public boolean hasPart() { 
1819          return this.part != null && !this.part.isEmpty();
1820        }
1821
1822        /**
1823         * @param value {@link #part} (Entity of anatomical origin of source material within an organism.)
1824         */
1825        public SubstanceSourceMaterialPartDescriptionComponent setPart(CodeableConcept value) { 
1826          this.part = value;
1827          return this;
1828        }
1829
1830        /**
1831         * @return {@link #partLocation} (The detailed anatomic location when the part can be extracted from different anatomical locations of the organism. Multiple alternative locations may apply.)
1832         */
1833        public CodeableConcept getPartLocation() { 
1834          if (this.partLocation == null)
1835            if (Configuration.errorOnAutoCreate())
1836              throw new Error("Attempt to auto-create SubstanceSourceMaterialPartDescriptionComponent.partLocation");
1837            else if (Configuration.doAutoCreate())
1838              this.partLocation = new CodeableConcept(); // cc
1839          return this.partLocation;
1840        }
1841
1842        public boolean hasPartLocation() { 
1843          return this.partLocation != null && !this.partLocation.isEmpty();
1844        }
1845
1846        /**
1847         * @param value {@link #partLocation} (The detailed anatomic location when the part can be extracted from different anatomical locations of the organism. Multiple alternative locations may apply.)
1848         */
1849        public SubstanceSourceMaterialPartDescriptionComponent setPartLocation(CodeableConcept value) { 
1850          this.partLocation = value;
1851          return this;
1852        }
1853
1854        protected void listChildren(List<Property> children) {
1855          super.listChildren(children);
1856          children.add(new Property("part", "CodeableConcept", "Entity of anatomical origin of source material within an organism.", 0, 1, part));
1857          children.add(new Property("partLocation", "CodeableConcept", "The detailed anatomic location when the part can be extracted from different anatomical locations of the organism. Multiple alternative locations may apply.", 0, 1, partLocation));
1858        }
1859
1860        @Override
1861        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1862          switch (_hash) {
1863          case 3433459: /*part*/  return new Property("part", "CodeableConcept", "Entity of anatomical origin of source material within an organism.", 0, 1, part);
1864          case 893437128: /*partLocation*/  return new Property("partLocation", "CodeableConcept", "The detailed anatomic location when the part can be extracted from different anatomical locations of the organism. Multiple alternative locations may apply.", 0, 1, partLocation);
1865          default: return super.getNamedProperty(_hash, _name, _checkValid);
1866          }
1867
1868        }
1869
1870      @Override
1871      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1872        switch (hash) {
1873        case 3433459: /*part*/ return this.part == null ? new Base[0] : new Base[] {this.part}; // CodeableConcept
1874        case 893437128: /*partLocation*/ return this.partLocation == null ? new Base[0] : new Base[] {this.partLocation}; // CodeableConcept
1875        default: return super.getProperty(hash, name, checkValid);
1876        }
1877
1878      }
1879
1880      @Override
1881      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1882        switch (hash) {
1883        case 3433459: // part
1884          this.part = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1885          return value;
1886        case 893437128: // partLocation
1887          this.partLocation = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1888          return value;
1889        default: return super.setProperty(hash, name, value);
1890        }
1891
1892      }
1893
1894      @Override
1895      public Base setProperty(String name, Base value) throws FHIRException {
1896        if (name.equals("part")) {
1897          this.part = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1898        } else if (name.equals("partLocation")) {
1899          this.partLocation = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1900        } else
1901          return super.setProperty(name, value);
1902        return value;
1903      }
1904
1905      @Override
1906      public Base makeProperty(int hash, String name) throws FHIRException {
1907        switch (hash) {
1908        case 3433459:  return getPart();
1909        case 893437128:  return getPartLocation();
1910        default: return super.makeProperty(hash, name);
1911        }
1912
1913      }
1914
1915      @Override
1916      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1917        switch (hash) {
1918        case 3433459: /*part*/ return new String[] {"CodeableConcept"};
1919        case 893437128: /*partLocation*/ return new String[] {"CodeableConcept"};
1920        default: return super.getTypesForProperty(hash, name);
1921        }
1922
1923      }
1924
1925      @Override
1926      public Base addChild(String name) throws FHIRException {
1927        if (name.equals("part")) {
1928          this.part = new CodeableConcept();
1929          return this.part;
1930        }
1931        else if (name.equals("partLocation")) {
1932          this.partLocation = new CodeableConcept();
1933          return this.partLocation;
1934        }
1935        else
1936          return super.addChild(name);
1937      }
1938
1939      public SubstanceSourceMaterialPartDescriptionComponent copy() {
1940        SubstanceSourceMaterialPartDescriptionComponent dst = new SubstanceSourceMaterialPartDescriptionComponent();
1941        copyValues(dst);
1942        return dst;
1943      }
1944
1945      public void copyValues(SubstanceSourceMaterialPartDescriptionComponent dst) {
1946        super.copyValues(dst);
1947        dst.part = part == null ? null : part.copy();
1948        dst.partLocation = partLocation == null ? null : partLocation.copy();
1949      }
1950
1951      @Override
1952      public boolean equalsDeep(Base other_) {
1953        if (!super.equalsDeep(other_))
1954          return false;
1955        if (!(other_ instanceof SubstanceSourceMaterialPartDescriptionComponent))
1956          return false;
1957        SubstanceSourceMaterialPartDescriptionComponent o = (SubstanceSourceMaterialPartDescriptionComponent) other_;
1958        return compareDeep(part, o.part, true) && compareDeep(partLocation, o.partLocation, true);
1959      }
1960
1961      @Override
1962      public boolean equalsShallow(Base other_) {
1963        if (!super.equalsShallow(other_))
1964          return false;
1965        if (!(other_ instanceof SubstanceSourceMaterialPartDescriptionComponent))
1966          return false;
1967        SubstanceSourceMaterialPartDescriptionComponent o = (SubstanceSourceMaterialPartDescriptionComponent) other_;
1968        return true;
1969      }
1970
1971      public boolean isEmpty() {
1972        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(part, partLocation);
1973      }
1974
1975  public String fhirType() {
1976    return "SubstanceSourceMaterial.partDescription";
1977
1978  }
1979
1980  }
1981
1982    /**
1983     * General high level classification of the source material specific to the origin of the material.
1984     */
1985    @Child(name = "sourceMaterialClass", type = {CodeableConcept.class}, order=0, min=0, max=1, modifier=false, summary=true)
1986    @Description(shortDefinition="General high level classification of the source material specific to the origin of the material", formalDefinition="General high level classification of the source material specific to the origin of the material." )
1987    protected CodeableConcept sourceMaterialClass;
1988
1989    /**
1990     * The type of the source material shall be specified based on a controlled vocabulary. For vaccines, this subclause refers to the class of infectious agent.
1991     */
1992    @Child(name = "sourceMaterialType", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
1993    @Description(shortDefinition="The type of the source material shall be specified based on a controlled vocabulary. For vaccines, this subclause refers to the class of infectious agent", formalDefinition="The type of the source material shall be specified based on a controlled vocabulary. For vaccines, this subclause refers to the class of infectious agent." )
1994    protected CodeableConcept sourceMaterialType;
1995
1996    /**
1997     * The state of the source material when extracted.
1998     */
1999    @Child(name = "sourceMaterialState", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
2000    @Description(shortDefinition="The state of the source material when extracted", formalDefinition="The state of the source material when extracted." )
2001    protected CodeableConcept sourceMaterialState;
2002
2003    /**
2004     * The unique identifier associated with the source material parent organism shall be specified.
2005     */
2006    @Child(name = "organismId", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true)
2007    @Description(shortDefinition="The unique identifier associated with the source material parent organism shall be specified", formalDefinition="The unique identifier associated with the source material parent organism shall be specified." )
2008    protected Identifier organismId;
2009
2010    /**
2011     * The organism accepted Scientific name shall be provided based on the organism taxonomy.
2012     */
2013    @Child(name = "organismName", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
2014    @Description(shortDefinition="The organism accepted Scientific name shall be provided based on the organism taxonomy", formalDefinition="The organism accepted Scientific name shall be provided based on the organism taxonomy." )
2015    protected StringType organismName;
2016
2017    /**
2018     * The parent of the herbal drug Ginkgo biloba, Leaf is the substance ID of the substance (fresh) of Ginkgo biloba L. or Ginkgo biloba L. (Whole plant).
2019     */
2020    @Child(name = "parentSubstanceId", type = {Identifier.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2021    @Description(shortDefinition="The parent of the herbal drug Ginkgo biloba, Leaf is the substance ID of the substance (fresh) of Ginkgo biloba L. or Ginkgo biloba L. (Whole plant)", formalDefinition="The parent of the herbal drug Ginkgo biloba, Leaf is the substance ID of the substance (fresh) of Ginkgo biloba L. or Ginkgo biloba L. (Whole plant)." )
2022    protected List<Identifier> parentSubstanceId;
2023
2024    /**
2025     * The parent substance of the Herbal Drug, or Herbal preparation.
2026     */
2027    @Child(name = "parentSubstanceName", type = {StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2028    @Description(shortDefinition="The parent substance of the Herbal Drug, or Herbal preparation", formalDefinition="The parent substance of the Herbal Drug, or Herbal preparation." )
2029    protected List<StringType> parentSubstanceName;
2030
2031    /**
2032     * The country where the plant material is harvested or the countries where the plasma is sourced from as laid down in accordance with the Plasma Master File. For ?Plasma-derived substances? the attribute country of origin provides information about the countries used for the manufacturing of the Cryopoor plama or Crioprecipitate.
2033     */
2034    @Child(name = "countryOfOrigin", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2035    @Description(shortDefinition="The country where the plant material is harvested or the countries where the plasma is sourced from as laid down in accordance with the Plasma Master File. For ?Plasma-derived substances? the attribute country of origin provides information about the countries used for the manufacturing of the Cryopoor plama or Crioprecipitate", formalDefinition="The country where the plant material is harvested or the countries where the plasma is sourced from as laid down in accordance with the Plasma Master File. For ?Plasma-derived substances? the attribute country of origin provides information about the countries used for the manufacturing of the Cryopoor plama or Crioprecipitate." )
2036    protected List<CodeableConcept> countryOfOrigin;
2037
2038    /**
2039     * The place/region where the plant is harvested or the places/regions where the animal source material has its habitat.
2040     */
2041    @Child(name = "geographicalLocation", type = {StringType.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2042    @Description(shortDefinition="The place/region where the plant is harvested or the places/regions where the animal source material has its habitat", formalDefinition="The place/region where the plant is harvested or the places/regions where the animal source material has its habitat." )
2043    protected List<StringType> geographicalLocation;
2044
2045    /**
2046     * Stage of life for animals, plants, insects and microorganisms. This information shall be provided only when the substance is significantly different in these stages (e.g. foetal bovine serum).
2047     */
2048    @Child(name = "developmentStage", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=true)
2049    @Description(shortDefinition="Stage of life for animals, plants, insects and microorganisms. This information shall be provided only when the substance is significantly different in these stages (e.g. foetal bovine serum)", formalDefinition="Stage of life for animals, plants, insects and microorganisms. This information shall be provided only when the substance is significantly different in these stages (e.g. foetal bovine serum)." )
2050    protected CodeableConcept developmentStage;
2051
2052    /**
2053     * Many complex materials are fractions of parts of plants, animals, or minerals. Fraction elements are often necessary to define both Substances and Specified Group 1 Substances. For substances derived from Plants, fraction information will be captured at the Substance information level ( . Oils, Juices and Exudates). Additional information for Extracts, such as extraction solvent composition, will be captured at the Specified Substance Group 1 information level. For plasma-derived products fraction information will be captured at the Substance and the Specified Substance Group 1 levels.
2054     */
2055    @Child(name = "fractionDescription", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2056    @Description(shortDefinition="Many complex materials are fractions of parts of plants, animals, or minerals. Fraction elements are often necessary to define both Substances and Specified Group 1 Substances. For substances derived from Plants, fraction information will be captured at the Substance information level ( . Oils, Juices and Exudates). Additional information for Extracts, such as extraction solvent composition, will be captured at the Specified Substance Group 1 information level. For plasma-derived products fraction information will be captured at the Substance and the Specified Substance Group 1 levels", formalDefinition="Many complex materials are fractions of parts of plants, animals, or minerals. Fraction elements are often necessary to define both Substances and Specified Group 1 Substances. For substances derived from Plants, fraction information will be captured at the Substance information level ( . Oils, Juices and Exudates). Additional information for Extracts, such as extraction solvent composition, will be captured at the Specified Substance Group 1 information level. For plasma-derived products fraction information will be captured at the Substance and the Specified Substance Group 1 levels." )
2057    protected List<SubstanceSourceMaterialFractionDescriptionComponent> fractionDescription;
2058
2059    /**
2060     * This subclause describes the organism which the substance is derived from. For vaccines, the parent organism shall be specified based on these subclause elements. As an example, full taxonomy will be described for the Substance Name: ., Leaf.
2061     */
2062    @Child(name = "organism", type = {}, order=11, min=0, max=1, modifier=false, summary=true)
2063    @Description(shortDefinition="This subclause describes the organism which the substance is derived from. For vaccines, the parent organism shall be specified based on these subclause elements. As an example, full taxonomy will be described for the Substance Name: ., Leaf", formalDefinition="This subclause describes the organism which the substance is derived from. For vaccines, the parent organism shall be specified based on these subclause elements. As an example, full taxonomy will be described for the Substance Name: ., Leaf." )
2064    protected SubstanceSourceMaterialOrganismComponent organism;
2065
2066    /**
2067     * To do.
2068     */
2069    @Child(name = "partDescription", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2070    @Description(shortDefinition="To do", formalDefinition="To do." )
2071    protected List<SubstanceSourceMaterialPartDescriptionComponent> partDescription;
2072
2073    private static final long serialVersionUID = 442657667L;
2074
2075  /**
2076   * Constructor
2077   */
2078    public SubstanceSourceMaterial() {
2079      super();
2080    }
2081
2082    /**
2083     * @return {@link #sourceMaterialClass} (General high level classification of the source material specific to the origin of the material.)
2084     */
2085    public CodeableConcept getSourceMaterialClass() { 
2086      if (this.sourceMaterialClass == null)
2087        if (Configuration.errorOnAutoCreate())
2088          throw new Error("Attempt to auto-create SubstanceSourceMaterial.sourceMaterialClass");
2089        else if (Configuration.doAutoCreate())
2090          this.sourceMaterialClass = new CodeableConcept(); // cc
2091      return this.sourceMaterialClass;
2092    }
2093
2094    public boolean hasSourceMaterialClass() { 
2095      return this.sourceMaterialClass != null && !this.sourceMaterialClass.isEmpty();
2096    }
2097
2098    /**
2099     * @param value {@link #sourceMaterialClass} (General high level classification of the source material specific to the origin of the material.)
2100     */
2101    public SubstanceSourceMaterial setSourceMaterialClass(CodeableConcept value) { 
2102      this.sourceMaterialClass = value;
2103      return this;
2104    }
2105
2106    /**
2107     * @return {@link #sourceMaterialType} (The type of the source material shall be specified based on a controlled vocabulary. For vaccines, this subclause refers to the class of infectious agent.)
2108     */
2109    public CodeableConcept getSourceMaterialType() { 
2110      if (this.sourceMaterialType == null)
2111        if (Configuration.errorOnAutoCreate())
2112          throw new Error("Attempt to auto-create SubstanceSourceMaterial.sourceMaterialType");
2113        else if (Configuration.doAutoCreate())
2114          this.sourceMaterialType = new CodeableConcept(); // cc
2115      return this.sourceMaterialType;
2116    }
2117
2118    public boolean hasSourceMaterialType() { 
2119      return this.sourceMaterialType != null && !this.sourceMaterialType.isEmpty();
2120    }
2121
2122    /**
2123     * @param value {@link #sourceMaterialType} (The type of the source material shall be specified based on a controlled vocabulary. For vaccines, this subclause refers to the class of infectious agent.)
2124     */
2125    public SubstanceSourceMaterial setSourceMaterialType(CodeableConcept value) { 
2126      this.sourceMaterialType = value;
2127      return this;
2128    }
2129
2130    /**
2131     * @return {@link #sourceMaterialState} (The state of the source material when extracted.)
2132     */
2133    public CodeableConcept getSourceMaterialState() { 
2134      if (this.sourceMaterialState == null)
2135        if (Configuration.errorOnAutoCreate())
2136          throw new Error("Attempt to auto-create SubstanceSourceMaterial.sourceMaterialState");
2137        else if (Configuration.doAutoCreate())
2138          this.sourceMaterialState = new CodeableConcept(); // cc
2139      return this.sourceMaterialState;
2140    }
2141
2142    public boolean hasSourceMaterialState() { 
2143      return this.sourceMaterialState != null && !this.sourceMaterialState.isEmpty();
2144    }
2145
2146    /**
2147     * @param value {@link #sourceMaterialState} (The state of the source material when extracted.)
2148     */
2149    public SubstanceSourceMaterial setSourceMaterialState(CodeableConcept value) { 
2150      this.sourceMaterialState = value;
2151      return this;
2152    }
2153
2154    /**
2155     * @return {@link #organismId} (The unique identifier associated with the source material parent organism shall be specified.)
2156     */
2157    public Identifier getOrganismId() { 
2158      if (this.organismId == null)
2159        if (Configuration.errorOnAutoCreate())
2160          throw new Error("Attempt to auto-create SubstanceSourceMaterial.organismId");
2161        else if (Configuration.doAutoCreate())
2162          this.organismId = new Identifier(); // cc
2163      return this.organismId;
2164    }
2165
2166    public boolean hasOrganismId() { 
2167      return this.organismId != null && !this.organismId.isEmpty();
2168    }
2169
2170    /**
2171     * @param value {@link #organismId} (The unique identifier associated with the source material parent organism shall be specified.)
2172     */
2173    public SubstanceSourceMaterial setOrganismId(Identifier value) { 
2174      this.organismId = value;
2175      return this;
2176    }
2177
2178    /**
2179     * @return {@link #organismName} (The organism accepted Scientific name shall be provided based on the organism taxonomy.). This is the underlying object with id, value and extensions. The accessor "getOrganismName" gives direct access to the value
2180     */
2181    public StringType getOrganismNameElement() { 
2182      if (this.organismName == null)
2183        if (Configuration.errorOnAutoCreate())
2184          throw new Error("Attempt to auto-create SubstanceSourceMaterial.organismName");
2185        else if (Configuration.doAutoCreate())
2186          this.organismName = new StringType(); // bb
2187      return this.organismName;
2188    }
2189
2190    public boolean hasOrganismNameElement() { 
2191      return this.organismName != null && !this.organismName.isEmpty();
2192    }
2193
2194    public boolean hasOrganismName() { 
2195      return this.organismName != null && !this.organismName.isEmpty();
2196    }
2197
2198    /**
2199     * @param value {@link #organismName} (The organism accepted Scientific name shall be provided based on the organism taxonomy.). This is the underlying object with id, value and extensions. The accessor "getOrganismName" gives direct access to the value
2200     */
2201    public SubstanceSourceMaterial setOrganismNameElement(StringType value) { 
2202      this.organismName = value;
2203      return this;
2204    }
2205
2206    /**
2207     * @return The organism accepted Scientific name shall be provided based on the organism taxonomy.
2208     */
2209    public String getOrganismName() { 
2210      return this.organismName == null ? null : this.organismName.getValue();
2211    }
2212
2213    /**
2214     * @param value The organism accepted Scientific name shall be provided based on the organism taxonomy.
2215     */
2216    public SubstanceSourceMaterial setOrganismName(String value) { 
2217      if (Utilities.noString(value))
2218        this.organismName = null;
2219      else {
2220        if (this.organismName == null)
2221          this.organismName = new StringType();
2222        this.organismName.setValue(value);
2223      }
2224      return this;
2225    }
2226
2227    /**
2228     * @return {@link #parentSubstanceId} (The parent of the herbal drug Ginkgo biloba, Leaf is the substance ID of the substance (fresh) of Ginkgo biloba L. or Ginkgo biloba L. (Whole plant).)
2229     */
2230    public List<Identifier> getParentSubstanceId() { 
2231      if (this.parentSubstanceId == null)
2232        this.parentSubstanceId = new ArrayList<Identifier>();
2233      return this.parentSubstanceId;
2234    }
2235
2236    /**
2237     * @return Returns a reference to <code>this</code> for easy method chaining
2238     */
2239    public SubstanceSourceMaterial setParentSubstanceId(List<Identifier> theParentSubstanceId) { 
2240      this.parentSubstanceId = theParentSubstanceId;
2241      return this;
2242    }
2243
2244    public boolean hasParentSubstanceId() { 
2245      if (this.parentSubstanceId == null)
2246        return false;
2247      for (Identifier item : this.parentSubstanceId)
2248        if (!item.isEmpty())
2249          return true;
2250      return false;
2251    }
2252
2253    public Identifier addParentSubstanceId() { //3
2254      Identifier t = new Identifier();
2255      if (this.parentSubstanceId == null)
2256        this.parentSubstanceId = new ArrayList<Identifier>();
2257      this.parentSubstanceId.add(t);
2258      return t;
2259    }
2260
2261    public SubstanceSourceMaterial addParentSubstanceId(Identifier t) { //3
2262      if (t == null)
2263        return this;
2264      if (this.parentSubstanceId == null)
2265        this.parentSubstanceId = new ArrayList<Identifier>();
2266      this.parentSubstanceId.add(t);
2267      return this;
2268    }
2269
2270    /**
2271     * @return The first repetition of repeating field {@link #parentSubstanceId}, creating it if it does not already exist {3}
2272     */
2273    public Identifier getParentSubstanceIdFirstRep() { 
2274      if (getParentSubstanceId().isEmpty()) {
2275        addParentSubstanceId();
2276      }
2277      return getParentSubstanceId().get(0);
2278    }
2279
2280    /**
2281     * @return {@link #parentSubstanceName} (The parent substance of the Herbal Drug, or Herbal preparation.)
2282     */
2283    public List<StringType> getParentSubstanceName() { 
2284      if (this.parentSubstanceName == null)
2285        this.parentSubstanceName = new ArrayList<StringType>();
2286      return this.parentSubstanceName;
2287    }
2288
2289    /**
2290     * @return Returns a reference to <code>this</code> for easy method chaining
2291     */
2292    public SubstanceSourceMaterial setParentSubstanceName(List<StringType> theParentSubstanceName) { 
2293      this.parentSubstanceName = theParentSubstanceName;
2294      return this;
2295    }
2296
2297    public boolean hasParentSubstanceName() { 
2298      if (this.parentSubstanceName == null)
2299        return false;
2300      for (StringType item : this.parentSubstanceName)
2301        if (!item.isEmpty())
2302          return true;
2303      return false;
2304    }
2305
2306    /**
2307     * @return {@link #parentSubstanceName} (The parent substance of the Herbal Drug, or Herbal preparation.)
2308     */
2309    public StringType addParentSubstanceNameElement() {//2 
2310      StringType t = new StringType();
2311      if (this.parentSubstanceName == null)
2312        this.parentSubstanceName = new ArrayList<StringType>();
2313      this.parentSubstanceName.add(t);
2314      return t;
2315    }
2316
2317    /**
2318     * @param value {@link #parentSubstanceName} (The parent substance of the Herbal Drug, or Herbal preparation.)
2319     */
2320    public SubstanceSourceMaterial addParentSubstanceName(String value) { //1
2321      StringType t = new StringType();
2322      t.setValue(value);
2323      if (this.parentSubstanceName == null)
2324        this.parentSubstanceName = new ArrayList<StringType>();
2325      this.parentSubstanceName.add(t);
2326      return this;
2327    }
2328
2329    /**
2330     * @param value {@link #parentSubstanceName} (The parent substance of the Herbal Drug, or Herbal preparation.)
2331     */
2332    public boolean hasParentSubstanceName(String value) { 
2333      if (this.parentSubstanceName == null)
2334        return false;
2335      for (StringType v : this.parentSubstanceName)
2336        if (v.getValue().equals(value)) // string
2337          return true;
2338      return false;
2339    }
2340
2341    /**
2342     * @return {@link #countryOfOrigin} (The country where the plant material is harvested or the countries where the plasma is sourced from as laid down in accordance with the Plasma Master File. For ?Plasma-derived substances? the attribute country of origin provides information about the countries used for the manufacturing of the Cryopoor plama or Crioprecipitate.)
2343     */
2344    public List<CodeableConcept> getCountryOfOrigin() { 
2345      if (this.countryOfOrigin == null)
2346        this.countryOfOrigin = new ArrayList<CodeableConcept>();
2347      return this.countryOfOrigin;
2348    }
2349
2350    /**
2351     * @return Returns a reference to <code>this</code> for easy method chaining
2352     */
2353    public SubstanceSourceMaterial setCountryOfOrigin(List<CodeableConcept> theCountryOfOrigin) { 
2354      this.countryOfOrigin = theCountryOfOrigin;
2355      return this;
2356    }
2357
2358    public boolean hasCountryOfOrigin() { 
2359      if (this.countryOfOrigin == null)
2360        return false;
2361      for (CodeableConcept item : this.countryOfOrigin)
2362        if (!item.isEmpty())
2363          return true;
2364      return false;
2365    }
2366
2367    public CodeableConcept addCountryOfOrigin() { //3
2368      CodeableConcept t = new CodeableConcept();
2369      if (this.countryOfOrigin == null)
2370        this.countryOfOrigin = new ArrayList<CodeableConcept>();
2371      this.countryOfOrigin.add(t);
2372      return t;
2373    }
2374
2375    public SubstanceSourceMaterial addCountryOfOrigin(CodeableConcept t) { //3
2376      if (t == null)
2377        return this;
2378      if (this.countryOfOrigin == null)
2379        this.countryOfOrigin = new ArrayList<CodeableConcept>();
2380      this.countryOfOrigin.add(t);
2381      return this;
2382    }
2383
2384    /**
2385     * @return The first repetition of repeating field {@link #countryOfOrigin}, creating it if it does not already exist {3}
2386     */
2387    public CodeableConcept getCountryOfOriginFirstRep() { 
2388      if (getCountryOfOrigin().isEmpty()) {
2389        addCountryOfOrigin();
2390      }
2391      return getCountryOfOrigin().get(0);
2392    }
2393
2394    /**
2395     * @return {@link #geographicalLocation} (The place/region where the plant is harvested or the places/regions where the animal source material has its habitat.)
2396     */
2397    public List<StringType> getGeographicalLocation() { 
2398      if (this.geographicalLocation == null)
2399        this.geographicalLocation = new ArrayList<StringType>();
2400      return this.geographicalLocation;
2401    }
2402
2403    /**
2404     * @return Returns a reference to <code>this</code> for easy method chaining
2405     */
2406    public SubstanceSourceMaterial setGeographicalLocation(List<StringType> theGeographicalLocation) { 
2407      this.geographicalLocation = theGeographicalLocation;
2408      return this;
2409    }
2410
2411    public boolean hasGeographicalLocation() { 
2412      if (this.geographicalLocation == null)
2413        return false;
2414      for (StringType item : this.geographicalLocation)
2415        if (!item.isEmpty())
2416          return true;
2417      return false;
2418    }
2419
2420    /**
2421     * @return {@link #geographicalLocation} (The place/region where the plant is harvested or the places/regions where the animal source material has its habitat.)
2422     */
2423    public StringType addGeographicalLocationElement() {//2 
2424      StringType t = new StringType();
2425      if (this.geographicalLocation == null)
2426        this.geographicalLocation = new ArrayList<StringType>();
2427      this.geographicalLocation.add(t);
2428      return t;
2429    }
2430
2431    /**
2432     * @param value {@link #geographicalLocation} (The place/region where the plant is harvested or the places/regions where the animal source material has its habitat.)
2433     */
2434    public SubstanceSourceMaterial addGeographicalLocation(String value) { //1
2435      StringType t = new StringType();
2436      t.setValue(value);
2437      if (this.geographicalLocation == null)
2438        this.geographicalLocation = new ArrayList<StringType>();
2439      this.geographicalLocation.add(t);
2440      return this;
2441    }
2442
2443    /**
2444     * @param value {@link #geographicalLocation} (The place/region where the plant is harvested or the places/regions where the animal source material has its habitat.)
2445     */
2446    public boolean hasGeographicalLocation(String value) { 
2447      if (this.geographicalLocation == null)
2448        return false;
2449      for (StringType v : this.geographicalLocation)
2450        if (v.getValue().equals(value)) // string
2451          return true;
2452      return false;
2453    }
2454
2455    /**
2456     * @return {@link #developmentStage} (Stage of life for animals, plants, insects and microorganisms. This information shall be provided only when the substance is significantly different in these stages (e.g. foetal bovine serum).)
2457     */
2458    public CodeableConcept getDevelopmentStage() { 
2459      if (this.developmentStage == null)
2460        if (Configuration.errorOnAutoCreate())
2461          throw new Error("Attempt to auto-create SubstanceSourceMaterial.developmentStage");
2462        else if (Configuration.doAutoCreate())
2463          this.developmentStage = new CodeableConcept(); // cc
2464      return this.developmentStage;
2465    }
2466
2467    public boolean hasDevelopmentStage() { 
2468      return this.developmentStage != null && !this.developmentStage.isEmpty();
2469    }
2470
2471    /**
2472     * @param value {@link #developmentStage} (Stage of life for animals, plants, insects and microorganisms. This information shall be provided only when the substance is significantly different in these stages (e.g. foetal bovine serum).)
2473     */
2474    public SubstanceSourceMaterial setDevelopmentStage(CodeableConcept value) { 
2475      this.developmentStage = value;
2476      return this;
2477    }
2478
2479    /**
2480     * @return {@link #fractionDescription} (Many complex materials are fractions of parts of plants, animals, or minerals. Fraction elements are often necessary to define both Substances and Specified Group 1 Substances. For substances derived from Plants, fraction information will be captured at the Substance information level ( . Oils, Juices and Exudates). Additional information for Extracts, such as extraction solvent composition, will be captured at the Specified Substance Group 1 information level. For plasma-derived products fraction information will be captured at the Substance and the Specified Substance Group 1 levels.)
2481     */
2482    public List<SubstanceSourceMaterialFractionDescriptionComponent> getFractionDescription() { 
2483      if (this.fractionDescription == null)
2484        this.fractionDescription = new ArrayList<SubstanceSourceMaterialFractionDescriptionComponent>();
2485      return this.fractionDescription;
2486    }
2487
2488    /**
2489     * @return Returns a reference to <code>this</code> for easy method chaining
2490     */
2491    public SubstanceSourceMaterial setFractionDescription(List<SubstanceSourceMaterialFractionDescriptionComponent> theFractionDescription) { 
2492      this.fractionDescription = theFractionDescription;
2493      return this;
2494    }
2495
2496    public boolean hasFractionDescription() { 
2497      if (this.fractionDescription == null)
2498        return false;
2499      for (SubstanceSourceMaterialFractionDescriptionComponent item : this.fractionDescription)
2500        if (!item.isEmpty())
2501          return true;
2502      return false;
2503    }
2504
2505    public SubstanceSourceMaterialFractionDescriptionComponent addFractionDescription() { //3
2506      SubstanceSourceMaterialFractionDescriptionComponent t = new SubstanceSourceMaterialFractionDescriptionComponent();
2507      if (this.fractionDescription == null)
2508        this.fractionDescription = new ArrayList<SubstanceSourceMaterialFractionDescriptionComponent>();
2509      this.fractionDescription.add(t);
2510      return t;
2511    }
2512
2513    public SubstanceSourceMaterial addFractionDescription(SubstanceSourceMaterialFractionDescriptionComponent t) { //3
2514      if (t == null)
2515        return this;
2516      if (this.fractionDescription == null)
2517        this.fractionDescription = new ArrayList<SubstanceSourceMaterialFractionDescriptionComponent>();
2518      this.fractionDescription.add(t);
2519      return this;
2520    }
2521
2522    /**
2523     * @return The first repetition of repeating field {@link #fractionDescription}, creating it if it does not already exist {3}
2524     */
2525    public SubstanceSourceMaterialFractionDescriptionComponent getFractionDescriptionFirstRep() { 
2526      if (getFractionDescription().isEmpty()) {
2527        addFractionDescription();
2528      }
2529      return getFractionDescription().get(0);
2530    }
2531
2532    /**
2533     * @return {@link #organism} (This subclause describes the organism which the substance is derived from. For vaccines, the parent organism shall be specified based on these subclause elements. As an example, full taxonomy will be described for the Substance Name: ., Leaf.)
2534     */
2535    public SubstanceSourceMaterialOrganismComponent getOrganism() { 
2536      if (this.organism == null)
2537        if (Configuration.errorOnAutoCreate())
2538          throw new Error("Attempt to auto-create SubstanceSourceMaterial.organism");
2539        else if (Configuration.doAutoCreate())
2540          this.organism = new SubstanceSourceMaterialOrganismComponent(); // cc
2541      return this.organism;
2542    }
2543
2544    public boolean hasOrganism() { 
2545      return this.organism != null && !this.organism.isEmpty();
2546    }
2547
2548    /**
2549     * @param value {@link #organism} (This subclause describes the organism which the substance is derived from. For vaccines, the parent organism shall be specified based on these subclause elements. As an example, full taxonomy will be described for the Substance Name: ., Leaf.)
2550     */
2551    public SubstanceSourceMaterial setOrganism(SubstanceSourceMaterialOrganismComponent value) { 
2552      this.organism = value;
2553      return this;
2554    }
2555
2556    /**
2557     * @return {@link #partDescription} (To do.)
2558     */
2559    public List<SubstanceSourceMaterialPartDescriptionComponent> getPartDescription() { 
2560      if (this.partDescription == null)
2561        this.partDescription = new ArrayList<SubstanceSourceMaterialPartDescriptionComponent>();
2562      return this.partDescription;
2563    }
2564
2565    /**
2566     * @return Returns a reference to <code>this</code> for easy method chaining
2567     */
2568    public SubstanceSourceMaterial setPartDescription(List<SubstanceSourceMaterialPartDescriptionComponent> thePartDescription) { 
2569      this.partDescription = thePartDescription;
2570      return this;
2571    }
2572
2573    public boolean hasPartDescription() { 
2574      if (this.partDescription == null)
2575        return false;
2576      for (SubstanceSourceMaterialPartDescriptionComponent item : this.partDescription)
2577        if (!item.isEmpty())
2578          return true;
2579      return false;
2580    }
2581
2582    public SubstanceSourceMaterialPartDescriptionComponent addPartDescription() { //3
2583      SubstanceSourceMaterialPartDescriptionComponent t = new SubstanceSourceMaterialPartDescriptionComponent();
2584      if (this.partDescription == null)
2585        this.partDescription = new ArrayList<SubstanceSourceMaterialPartDescriptionComponent>();
2586      this.partDescription.add(t);
2587      return t;
2588    }
2589
2590    public SubstanceSourceMaterial addPartDescription(SubstanceSourceMaterialPartDescriptionComponent t) { //3
2591      if (t == null)
2592        return this;
2593      if (this.partDescription == null)
2594        this.partDescription = new ArrayList<SubstanceSourceMaterialPartDescriptionComponent>();
2595      this.partDescription.add(t);
2596      return this;
2597    }
2598
2599    /**
2600     * @return The first repetition of repeating field {@link #partDescription}, creating it if it does not already exist {3}
2601     */
2602    public SubstanceSourceMaterialPartDescriptionComponent getPartDescriptionFirstRep() { 
2603      if (getPartDescription().isEmpty()) {
2604        addPartDescription();
2605      }
2606      return getPartDescription().get(0);
2607    }
2608
2609      protected void listChildren(List<Property> children) {
2610        super.listChildren(children);
2611        children.add(new Property("sourceMaterialClass", "CodeableConcept", "General high level classification of the source material specific to the origin of the material.", 0, 1, sourceMaterialClass));
2612        children.add(new Property("sourceMaterialType", "CodeableConcept", "The type of the source material shall be specified based on a controlled vocabulary. For vaccines, this subclause refers to the class of infectious agent.", 0, 1, sourceMaterialType));
2613        children.add(new Property("sourceMaterialState", "CodeableConcept", "The state of the source material when extracted.", 0, 1, sourceMaterialState));
2614        children.add(new Property("organismId", "Identifier", "The unique identifier associated with the source material parent organism shall be specified.", 0, 1, organismId));
2615        children.add(new Property("organismName", "string", "The organism accepted Scientific name shall be provided based on the organism taxonomy.", 0, 1, organismName));
2616        children.add(new Property("parentSubstanceId", "Identifier", "The parent of the herbal drug Ginkgo biloba, Leaf is the substance ID of the substance (fresh) of Ginkgo biloba L. or Ginkgo biloba L. (Whole plant).", 0, java.lang.Integer.MAX_VALUE, parentSubstanceId));
2617        children.add(new Property("parentSubstanceName", "string", "The parent substance of the Herbal Drug, or Herbal preparation.", 0, java.lang.Integer.MAX_VALUE, parentSubstanceName));
2618        children.add(new Property("countryOfOrigin", "CodeableConcept", "The country where the plant material is harvested or the countries where the plasma is sourced from as laid down in accordance with the Plasma Master File. For ?Plasma-derived substances? the attribute country of origin provides information about the countries used for the manufacturing of the Cryopoor plama or Crioprecipitate.", 0, java.lang.Integer.MAX_VALUE, countryOfOrigin));
2619        children.add(new Property("geographicalLocation", "string", "The place/region where the plant is harvested or the places/regions where the animal source material has its habitat.", 0, java.lang.Integer.MAX_VALUE, geographicalLocation));
2620        children.add(new Property("developmentStage", "CodeableConcept", "Stage of life for animals, plants, insects and microorganisms. This information shall be provided only when the substance is significantly different in these stages (e.g. foetal bovine serum).", 0, 1, developmentStage));
2621        children.add(new Property("fractionDescription", "", "Many complex materials are fractions of parts of plants, animals, or minerals. Fraction elements are often necessary to define both Substances and Specified Group 1 Substances. For substances derived from Plants, fraction information will be captured at the Substance information level ( . Oils, Juices and Exudates). Additional information for Extracts, such as extraction solvent composition, will be captured at the Specified Substance Group 1 information level. For plasma-derived products fraction information will be captured at the Substance and the Specified Substance Group 1 levels.", 0, java.lang.Integer.MAX_VALUE, fractionDescription));
2622        children.add(new Property("organism", "", "This subclause describes the organism which the substance is derived from. For vaccines, the parent organism shall be specified based on these subclause elements. As an example, full taxonomy will be described for the Substance Name: ., Leaf.", 0, 1, organism));
2623        children.add(new Property("partDescription", "", "To do.", 0, java.lang.Integer.MAX_VALUE, partDescription));
2624      }
2625
2626      @Override
2627      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2628        switch (_hash) {
2629        case -1253081034: /*sourceMaterialClass*/  return new Property("sourceMaterialClass", "CodeableConcept", "General high level classification of the source material specific to the origin of the material.", 0, 1, sourceMaterialClass);
2630        case 1622665404: /*sourceMaterialType*/  return new Property("sourceMaterialType", "CodeableConcept", "The type of the source material shall be specified based on a controlled vocabulary. For vaccines, this subclause refers to the class of infectious agent.", 0, 1, sourceMaterialType);
2631        case -1238066353: /*sourceMaterialState*/  return new Property("sourceMaterialState", "CodeableConcept", "The state of the source material when extracted.", 0, 1, sourceMaterialState);
2632        case -1965449843: /*organismId*/  return new Property("organismId", "Identifier", "The unique identifier associated with the source material parent organism shall be specified.", 0, 1, organismId);
2633        case 988460669: /*organismName*/  return new Property("organismName", "string", "The organism accepted Scientific name shall be provided based on the organism taxonomy.", 0, 1, organismName);
2634        case -675437663: /*parentSubstanceId*/  return new Property("parentSubstanceId", "Identifier", "The parent of the herbal drug Ginkgo biloba, Leaf is the substance ID of the substance (fresh) of Ginkgo biloba L. or Ginkgo biloba L. (Whole plant).", 0, java.lang.Integer.MAX_VALUE, parentSubstanceId);
2635        case -555382895: /*parentSubstanceName*/  return new Property("parentSubstanceName", "string", "The parent substance of the Herbal Drug, or Herbal preparation.", 0, java.lang.Integer.MAX_VALUE, parentSubstanceName);
2636        case 57176467: /*countryOfOrigin*/  return new Property("countryOfOrigin", "CodeableConcept", "The country where the plant material is harvested or the countries where the plasma is sourced from as laid down in accordance with the Plasma Master File. For ?Plasma-derived substances? the attribute country of origin provides information about the countries used for the manufacturing of the Cryopoor plama or Crioprecipitate.", 0, java.lang.Integer.MAX_VALUE, countryOfOrigin);
2637        case -1988836681: /*geographicalLocation*/  return new Property("geographicalLocation", "string", "The place/region where the plant is harvested or the places/regions where the animal source material has its habitat.", 0, java.lang.Integer.MAX_VALUE, geographicalLocation);
2638        case 391529091: /*developmentStage*/  return new Property("developmentStage", "CodeableConcept", "Stage of life for animals, plants, insects and microorganisms. This information shall be provided only when the substance is significantly different in these stages (e.g. foetal bovine serum).", 0, 1, developmentStage);
2639        case 1472689306: /*fractionDescription*/  return new Property("fractionDescription", "", "Many complex materials are fractions of parts of plants, animals, or minerals. Fraction elements are often necessary to define both Substances and Specified Group 1 Substances. For substances derived from Plants, fraction information will be captured at the Substance information level ( . Oils, Juices and Exudates). Additional information for Extracts, such as extraction solvent composition, will be captured at the Specified Substance Group 1 information level. For plasma-derived products fraction information will be captured at the Substance and the Specified Substance Group 1 levels.", 0, java.lang.Integer.MAX_VALUE, fractionDescription);
2640        case 1316389074: /*organism*/  return new Property("organism", "", "This subclause describes the organism which the substance is derived from. For vaccines, the parent organism shall be specified based on these subclause elements. As an example, full taxonomy will be described for the Substance Name: ., Leaf.", 0, 1, organism);
2641        case -1803623927: /*partDescription*/  return new Property("partDescription", "", "To do.", 0, java.lang.Integer.MAX_VALUE, partDescription);
2642        default: return super.getNamedProperty(_hash, _name, _checkValid);
2643        }
2644
2645      }
2646
2647      @Override
2648      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2649        switch (hash) {
2650        case -1253081034: /*sourceMaterialClass*/ return this.sourceMaterialClass == null ? new Base[0] : new Base[] {this.sourceMaterialClass}; // CodeableConcept
2651        case 1622665404: /*sourceMaterialType*/ return this.sourceMaterialType == null ? new Base[0] : new Base[] {this.sourceMaterialType}; // CodeableConcept
2652        case -1238066353: /*sourceMaterialState*/ return this.sourceMaterialState == null ? new Base[0] : new Base[] {this.sourceMaterialState}; // CodeableConcept
2653        case -1965449843: /*organismId*/ return this.organismId == null ? new Base[0] : new Base[] {this.organismId}; // Identifier
2654        case 988460669: /*organismName*/ return this.organismName == null ? new Base[0] : new Base[] {this.organismName}; // StringType
2655        case -675437663: /*parentSubstanceId*/ return this.parentSubstanceId == null ? new Base[0] : this.parentSubstanceId.toArray(new Base[this.parentSubstanceId.size()]); // Identifier
2656        case -555382895: /*parentSubstanceName*/ return this.parentSubstanceName == null ? new Base[0] : this.parentSubstanceName.toArray(new Base[this.parentSubstanceName.size()]); // StringType
2657        case 57176467: /*countryOfOrigin*/ return this.countryOfOrigin == null ? new Base[0] : this.countryOfOrigin.toArray(new Base[this.countryOfOrigin.size()]); // CodeableConcept
2658        case -1988836681: /*geographicalLocation*/ return this.geographicalLocation == null ? new Base[0] : this.geographicalLocation.toArray(new Base[this.geographicalLocation.size()]); // StringType
2659        case 391529091: /*developmentStage*/ return this.developmentStage == null ? new Base[0] : new Base[] {this.developmentStage}; // CodeableConcept
2660        case 1472689306: /*fractionDescription*/ return this.fractionDescription == null ? new Base[0] : this.fractionDescription.toArray(new Base[this.fractionDescription.size()]); // SubstanceSourceMaterialFractionDescriptionComponent
2661        case 1316389074: /*organism*/ return this.organism == null ? new Base[0] : new Base[] {this.organism}; // SubstanceSourceMaterialOrganismComponent
2662        case -1803623927: /*partDescription*/ return this.partDescription == null ? new Base[0] : this.partDescription.toArray(new Base[this.partDescription.size()]); // SubstanceSourceMaterialPartDescriptionComponent
2663        default: return super.getProperty(hash, name, checkValid);
2664        }
2665
2666      }
2667
2668      @Override
2669      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2670        switch (hash) {
2671        case -1253081034: // sourceMaterialClass
2672          this.sourceMaterialClass = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2673          return value;
2674        case 1622665404: // sourceMaterialType
2675          this.sourceMaterialType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2676          return value;
2677        case -1238066353: // sourceMaterialState
2678          this.sourceMaterialState = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2679          return value;
2680        case -1965449843: // organismId
2681          this.organismId = TypeConvertor.castToIdentifier(value); // Identifier
2682          return value;
2683        case 988460669: // organismName
2684          this.organismName = TypeConvertor.castToString(value); // StringType
2685          return value;
2686        case -675437663: // parentSubstanceId
2687          this.getParentSubstanceId().add(TypeConvertor.castToIdentifier(value)); // Identifier
2688          return value;
2689        case -555382895: // parentSubstanceName
2690          this.getParentSubstanceName().add(TypeConvertor.castToString(value)); // StringType
2691          return value;
2692        case 57176467: // countryOfOrigin
2693          this.getCountryOfOrigin().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2694          return value;
2695        case -1988836681: // geographicalLocation
2696          this.getGeographicalLocation().add(TypeConvertor.castToString(value)); // StringType
2697          return value;
2698        case 391529091: // developmentStage
2699          this.developmentStage = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2700          return value;
2701        case 1472689306: // fractionDescription
2702          this.getFractionDescription().add((SubstanceSourceMaterialFractionDescriptionComponent) value); // SubstanceSourceMaterialFractionDescriptionComponent
2703          return value;
2704        case 1316389074: // organism
2705          this.organism = (SubstanceSourceMaterialOrganismComponent) value; // SubstanceSourceMaterialOrganismComponent
2706          return value;
2707        case -1803623927: // partDescription
2708          this.getPartDescription().add((SubstanceSourceMaterialPartDescriptionComponent) value); // SubstanceSourceMaterialPartDescriptionComponent
2709          return value;
2710        default: return super.setProperty(hash, name, value);
2711        }
2712
2713      }
2714
2715      @Override
2716      public Base setProperty(String name, Base value) throws FHIRException {
2717        if (name.equals("sourceMaterialClass")) {
2718          this.sourceMaterialClass = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2719        } else if (name.equals("sourceMaterialType")) {
2720          this.sourceMaterialType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2721        } else if (name.equals("sourceMaterialState")) {
2722          this.sourceMaterialState = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2723        } else if (name.equals("organismId")) {
2724          this.organismId = TypeConvertor.castToIdentifier(value); // Identifier
2725        } else if (name.equals("organismName")) {
2726          this.organismName = TypeConvertor.castToString(value); // StringType
2727        } else if (name.equals("parentSubstanceId")) {
2728          this.getParentSubstanceId().add(TypeConvertor.castToIdentifier(value));
2729        } else if (name.equals("parentSubstanceName")) {
2730          this.getParentSubstanceName().add(TypeConvertor.castToString(value));
2731        } else if (name.equals("countryOfOrigin")) {
2732          this.getCountryOfOrigin().add(TypeConvertor.castToCodeableConcept(value));
2733        } else if (name.equals("geographicalLocation")) {
2734          this.getGeographicalLocation().add(TypeConvertor.castToString(value));
2735        } else if (name.equals("developmentStage")) {
2736          this.developmentStage = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2737        } else if (name.equals("fractionDescription")) {
2738          this.getFractionDescription().add((SubstanceSourceMaterialFractionDescriptionComponent) value);
2739        } else if (name.equals("organism")) {
2740          this.organism = (SubstanceSourceMaterialOrganismComponent) value; // SubstanceSourceMaterialOrganismComponent
2741        } else if (name.equals("partDescription")) {
2742          this.getPartDescription().add((SubstanceSourceMaterialPartDescriptionComponent) value);
2743        } else
2744          return super.setProperty(name, value);
2745        return value;
2746      }
2747
2748      @Override
2749      public Base makeProperty(int hash, String name) throws FHIRException {
2750        switch (hash) {
2751        case -1253081034:  return getSourceMaterialClass();
2752        case 1622665404:  return getSourceMaterialType();
2753        case -1238066353:  return getSourceMaterialState();
2754        case -1965449843:  return getOrganismId();
2755        case 988460669:  return getOrganismNameElement();
2756        case -675437663:  return addParentSubstanceId(); 
2757        case -555382895:  return addParentSubstanceNameElement();
2758        case 57176467:  return addCountryOfOrigin(); 
2759        case -1988836681:  return addGeographicalLocationElement();
2760        case 391529091:  return getDevelopmentStage();
2761        case 1472689306:  return addFractionDescription(); 
2762        case 1316389074:  return getOrganism();
2763        case -1803623927:  return addPartDescription(); 
2764        default: return super.makeProperty(hash, name);
2765        }
2766
2767      }
2768
2769      @Override
2770      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2771        switch (hash) {
2772        case -1253081034: /*sourceMaterialClass*/ return new String[] {"CodeableConcept"};
2773        case 1622665404: /*sourceMaterialType*/ return new String[] {"CodeableConcept"};
2774        case -1238066353: /*sourceMaterialState*/ return new String[] {"CodeableConcept"};
2775        case -1965449843: /*organismId*/ return new String[] {"Identifier"};
2776        case 988460669: /*organismName*/ return new String[] {"string"};
2777        case -675437663: /*parentSubstanceId*/ return new String[] {"Identifier"};
2778        case -555382895: /*parentSubstanceName*/ return new String[] {"string"};
2779        case 57176467: /*countryOfOrigin*/ return new String[] {"CodeableConcept"};
2780        case -1988836681: /*geographicalLocation*/ return new String[] {"string"};
2781        case 391529091: /*developmentStage*/ return new String[] {"CodeableConcept"};
2782        case 1472689306: /*fractionDescription*/ return new String[] {};
2783        case 1316389074: /*organism*/ return new String[] {};
2784        case -1803623927: /*partDescription*/ return new String[] {};
2785        default: return super.getTypesForProperty(hash, name);
2786        }
2787
2788      }
2789
2790      @Override
2791      public Base addChild(String name) throws FHIRException {
2792        if (name.equals("sourceMaterialClass")) {
2793          this.sourceMaterialClass = new CodeableConcept();
2794          return this.sourceMaterialClass;
2795        }
2796        else if (name.equals("sourceMaterialType")) {
2797          this.sourceMaterialType = new CodeableConcept();
2798          return this.sourceMaterialType;
2799        }
2800        else if (name.equals("sourceMaterialState")) {
2801          this.sourceMaterialState = new CodeableConcept();
2802          return this.sourceMaterialState;
2803        }
2804        else if (name.equals("organismId")) {
2805          this.organismId = new Identifier();
2806          return this.organismId;
2807        }
2808        else if (name.equals("organismName")) {
2809          throw new FHIRException("Cannot call addChild on a primitive type SubstanceSourceMaterial.organismName");
2810        }
2811        else if (name.equals("parentSubstanceId")) {
2812          return addParentSubstanceId();
2813        }
2814        else if (name.equals("parentSubstanceName")) {
2815          throw new FHIRException("Cannot call addChild on a primitive type SubstanceSourceMaterial.parentSubstanceName");
2816        }
2817        else if (name.equals("countryOfOrigin")) {
2818          return addCountryOfOrigin();
2819        }
2820        else if (name.equals("geographicalLocation")) {
2821          throw new FHIRException("Cannot call addChild on a primitive type SubstanceSourceMaterial.geographicalLocation");
2822        }
2823        else if (name.equals("developmentStage")) {
2824          this.developmentStage = new CodeableConcept();
2825          return this.developmentStage;
2826        }
2827        else if (name.equals("fractionDescription")) {
2828          return addFractionDescription();
2829        }
2830        else if (name.equals("organism")) {
2831          this.organism = new SubstanceSourceMaterialOrganismComponent();
2832          return this.organism;
2833        }
2834        else if (name.equals("partDescription")) {
2835          return addPartDescription();
2836        }
2837        else
2838          return super.addChild(name);
2839      }
2840
2841  public String fhirType() {
2842    return "SubstanceSourceMaterial";
2843
2844  }
2845
2846      public SubstanceSourceMaterial copy() {
2847        SubstanceSourceMaterial dst = new SubstanceSourceMaterial();
2848        copyValues(dst);
2849        return dst;
2850      }
2851
2852      public void copyValues(SubstanceSourceMaterial dst) {
2853        super.copyValues(dst);
2854        dst.sourceMaterialClass = sourceMaterialClass == null ? null : sourceMaterialClass.copy();
2855        dst.sourceMaterialType = sourceMaterialType == null ? null : sourceMaterialType.copy();
2856        dst.sourceMaterialState = sourceMaterialState == null ? null : sourceMaterialState.copy();
2857        dst.organismId = organismId == null ? null : organismId.copy();
2858        dst.organismName = organismName == null ? null : organismName.copy();
2859        if (parentSubstanceId != null) {
2860          dst.parentSubstanceId = new ArrayList<Identifier>();
2861          for (Identifier i : parentSubstanceId)
2862            dst.parentSubstanceId.add(i.copy());
2863        };
2864        if (parentSubstanceName != null) {
2865          dst.parentSubstanceName = new ArrayList<StringType>();
2866          for (StringType i : parentSubstanceName)
2867            dst.parentSubstanceName.add(i.copy());
2868        };
2869        if (countryOfOrigin != null) {
2870          dst.countryOfOrigin = new ArrayList<CodeableConcept>();
2871          for (CodeableConcept i : countryOfOrigin)
2872            dst.countryOfOrigin.add(i.copy());
2873        };
2874        if (geographicalLocation != null) {
2875          dst.geographicalLocation = new ArrayList<StringType>();
2876          for (StringType i : geographicalLocation)
2877            dst.geographicalLocation.add(i.copy());
2878        };
2879        dst.developmentStage = developmentStage == null ? null : developmentStage.copy();
2880        if (fractionDescription != null) {
2881          dst.fractionDescription = new ArrayList<SubstanceSourceMaterialFractionDescriptionComponent>();
2882          for (SubstanceSourceMaterialFractionDescriptionComponent i : fractionDescription)
2883            dst.fractionDescription.add(i.copy());
2884        };
2885        dst.organism = organism == null ? null : organism.copy();
2886        if (partDescription != null) {
2887          dst.partDescription = new ArrayList<SubstanceSourceMaterialPartDescriptionComponent>();
2888          for (SubstanceSourceMaterialPartDescriptionComponent i : partDescription)
2889            dst.partDescription.add(i.copy());
2890        };
2891      }
2892
2893      protected SubstanceSourceMaterial typedCopy() {
2894        return copy();
2895      }
2896
2897      @Override
2898      public boolean equalsDeep(Base other_) {
2899        if (!super.equalsDeep(other_))
2900          return false;
2901        if (!(other_ instanceof SubstanceSourceMaterial))
2902          return false;
2903        SubstanceSourceMaterial o = (SubstanceSourceMaterial) other_;
2904        return compareDeep(sourceMaterialClass, o.sourceMaterialClass, true) && compareDeep(sourceMaterialType, o.sourceMaterialType, true)
2905           && compareDeep(sourceMaterialState, o.sourceMaterialState, true) && compareDeep(organismId, o.organismId, true)
2906           && compareDeep(organismName, o.organismName, true) && compareDeep(parentSubstanceId, o.parentSubstanceId, true)
2907           && compareDeep(parentSubstanceName, o.parentSubstanceName, true) && compareDeep(countryOfOrigin, o.countryOfOrigin, true)
2908           && compareDeep(geographicalLocation, o.geographicalLocation, true) && compareDeep(developmentStage, o.developmentStage, true)
2909           && compareDeep(fractionDescription, o.fractionDescription, true) && compareDeep(organism, o.organism, true)
2910           && compareDeep(partDescription, o.partDescription, true);
2911      }
2912
2913      @Override
2914      public boolean equalsShallow(Base other_) {
2915        if (!super.equalsShallow(other_))
2916          return false;
2917        if (!(other_ instanceof SubstanceSourceMaterial))
2918          return false;
2919        SubstanceSourceMaterial o = (SubstanceSourceMaterial) other_;
2920        return compareValues(organismName, o.organismName, true) && compareValues(parentSubstanceName, o.parentSubstanceName, true)
2921           && compareValues(geographicalLocation, o.geographicalLocation, true);
2922      }
2923
2924      public boolean isEmpty() {
2925        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sourceMaterialClass, sourceMaterialType
2926          , sourceMaterialState, organismId, organismName, parentSubstanceId, parentSubstanceName
2927          , countryOfOrigin, geographicalLocation, developmentStage, fractionDescription, organism
2928          , partDescription);
2929      }
2930
2931  @Override
2932  public ResourceType getResourceType() {
2933    return ResourceType.SubstanceSourceMaterial;
2934   }
2935
2936
2937}
2938