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