001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Thu, Sep 13, 2018 09:04-0400 for FHIR v3.5.0
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import ca.uhn.fhir.model.api.annotation.ResourceDef;
038import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
039import ca.uhn.fhir.model.api.annotation.Child;
040import ca.uhn.fhir.model.api.annotation.ChildOrder;
041import ca.uhn.fhir.model.api.annotation.Description;
042import ca.uhn.fhir.model.api.annotation.Block;
043import org.hl7.fhir.instance.model.api.*;
044import org.hl7.fhir.exceptions.FHIRException;
045/**
046 * Todo.
047 */
048@ResourceDef(name="SubstancePolymer", profile="http://hl7.org/fhir/StructureDefinition/SubstancePolymer")
049public class SubstancePolymer extends DomainResource {
050
051    @Block()
052    public static class SubstancePolymerMonomerSetComponent extends BackboneElement implements IBaseBackboneElement {
053        /**
054         * Todo.
055         */
056        @Child(name = "ratioType", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
057        @Description(shortDefinition="Todo", formalDefinition="Todo." )
058        protected CodeableConcept ratioType;
059
060        /**
061         * Todo.
062         */
063        @Child(name = "startingMaterial", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
064        @Description(shortDefinition="Todo", formalDefinition="Todo." )
065        protected List<SubstancePolymerMonomerSetStartingMaterialComponent> startingMaterial;
066
067        private static final long serialVersionUID = -933825014L;
068
069    /**
070     * Constructor
071     */
072      public SubstancePolymerMonomerSetComponent() {
073        super();
074      }
075
076        /**
077         * @return {@link #ratioType} (Todo.)
078         */
079        public CodeableConcept getRatioType() { 
080          if (this.ratioType == null)
081            if (Configuration.errorOnAutoCreate())
082              throw new Error("Attempt to auto-create SubstancePolymerMonomerSetComponent.ratioType");
083            else if (Configuration.doAutoCreate())
084              this.ratioType = new CodeableConcept(); // cc
085          return this.ratioType;
086        }
087
088        public boolean hasRatioType() { 
089          return this.ratioType != null && !this.ratioType.isEmpty();
090        }
091
092        /**
093         * @param value {@link #ratioType} (Todo.)
094         */
095        public SubstancePolymerMonomerSetComponent setRatioType(CodeableConcept value) { 
096          this.ratioType = value;
097          return this;
098        }
099
100        /**
101         * @return {@link #startingMaterial} (Todo.)
102         */
103        public List<SubstancePolymerMonomerSetStartingMaterialComponent> getStartingMaterial() { 
104          if (this.startingMaterial == null)
105            this.startingMaterial = new ArrayList<SubstancePolymerMonomerSetStartingMaterialComponent>();
106          return this.startingMaterial;
107        }
108
109        /**
110         * @return Returns a reference to <code>this</code> for easy method chaining
111         */
112        public SubstancePolymerMonomerSetComponent setStartingMaterial(List<SubstancePolymerMonomerSetStartingMaterialComponent> theStartingMaterial) { 
113          this.startingMaterial = theStartingMaterial;
114          return this;
115        }
116
117        public boolean hasStartingMaterial() { 
118          if (this.startingMaterial == null)
119            return false;
120          for (SubstancePolymerMonomerSetStartingMaterialComponent item : this.startingMaterial)
121            if (!item.isEmpty())
122              return true;
123          return false;
124        }
125
126        public SubstancePolymerMonomerSetStartingMaterialComponent addStartingMaterial() { //3
127          SubstancePolymerMonomerSetStartingMaterialComponent t = new SubstancePolymerMonomerSetStartingMaterialComponent();
128          if (this.startingMaterial == null)
129            this.startingMaterial = new ArrayList<SubstancePolymerMonomerSetStartingMaterialComponent>();
130          this.startingMaterial.add(t);
131          return t;
132        }
133
134        public SubstancePolymerMonomerSetComponent addStartingMaterial(SubstancePolymerMonomerSetStartingMaterialComponent t) { //3
135          if (t == null)
136            return this;
137          if (this.startingMaterial == null)
138            this.startingMaterial = new ArrayList<SubstancePolymerMonomerSetStartingMaterialComponent>();
139          this.startingMaterial.add(t);
140          return this;
141        }
142
143        /**
144         * @return The first repetition of repeating field {@link #startingMaterial}, creating it if it does not already exist
145         */
146        public SubstancePolymerMonomerSetStartingMaterialComponent getStartingMaterialFirstRep() { 
147          if (getStartingMaterial().isEmpty()) {
148            addStartingMaterial();
149          }
150          return getStartingMaterial().get(0);
151        }
152
153        protected void listChildren(List<Property> children) {
154          super.listChildren(children);
155          children.add(new Property("ratioType", "CodeableConcept", "Todo.", 0, 1, ratioType));
156          children.add(new Property("startingMaterial", "", "Todo.", 0, java.lang.Integer.MAX_VALUE, startingMaterial));
157        }
158
159        @Override
160        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
161          switch (_hash) {
162          case 344937957: /*ratioType*/  return new Property("ratioType", "CodeableConcept", "Todo.", 0, 1, ratioType);
163          case 442919303: /*startingMaterial*/  return new Property("startingMaterial", "", "Todo.", 0, java.lang.Integer.MAX_VALUE, startingMaterial);
164          default: return super.getNamedProperty(_hash, _name, _checkValid);
165          }
166
167        }
168
169      @Override
170      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
171        switch (hash) {
172        case 344937957: /*ratioType*/ return this.ratioType == null ? new Base[0] : new Base[] {this.ratioType}; // CodeableConcept
173        case 442919303: /*startingMaterial*/ return this.startingMaterial == null ? new Base[0] : this.startingMaterial.toArray(new Base[this.startingMaterial.size()]); // SubstancePolymerMonomerSetStartingMaterialComponent
174        default: return super.getProperty(hash, name, checkValid);
175        }
176
177      }
178
179      @Override
180      public Base setProperty(int hash, String name, Base value) throws FHIRException {
181        switch (hash) {
182        case 344937957: // ratioType
183          this.ratioType = castToCodeableConcept(value); // CodeableConcept
184          return value;
185        case 442919303: // startingMaterial
186          this.getStartingMaterial().add((SubstancePolymerMonomerSetStartingMaterialComponent) value); // SubstancePolymerMonomerSetStartingMaterialComponent
187          return value;
188        default: return super.setProperty(hash, name, value);
189        }
190
191      }
192
193      @Override
194      public Base setProperty(String name, Base value) throws FHIRException {
195        if (name.equals("ratioType")) {
196          this.ratioType = castToCodeableConcept(value); // CodeableConcept
197        } else if (name.equals("startingMaterial")) {
198          this.getStartingMaterial().add((SubstancePolymerMonomerSetStartingMaterialComponent) value);
199        } else
200          return super.setProperty(name, value);
201        return value;
202      }
203
204      @Override
205      public Base makeProperty(int hash, String name) throws FHIRException {
206        switch (hash) {
207        case 344937957:  return getRatioType(); 
208        case 442919303:  return addStartingMaterial(); 
209        default: return super.makeProperty(hash, name);
210        }
211
212      }
213
214      @Override
215      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
216        switch (hash) {
217        case 344937957: /*ratioType*/ return new String[] {"CodeableConcept"};
218        case 442919303: /*startingMaterial*/ return new String[] {};
219        default: return super.getTypesForProperty(hash, name);
220        }
221
222      }
223
224      @Override
225      public Base addChild(String name) throws FHIRException {
226        if (name.equals("ratioType")) {
227          this.ratioType = new CodeableConcept();
228          return this.ratioType;
229        }
230        else if (name.equals("startingMaterial")) {
231          return addStartingMaterial();
232        }
233        else
234          return super.addChild(name);
235      }
236
237      public SubstancePolymerMonomerSetComponent copy() {
238        SubstancePolymerMonomerSetComponent dst = new SubstancePolymerMonomerSetComponent();
239        copyValues(dst);
240        dst.ratioType = ratioType == null ? null : ratioType.copy();
241        if (startingMaterial != null) {
242          dst.startingMaterial = new ArrayList<SubstancePolymerMonomerSetStartingMaterialComponent>();
243          for (SubstancePolymerMonomerSetStartingMaterialComponent i : startingMaterial)
244            dst.startingMaterial.add(i.copy());
245        };
246        return dst;
247      }
248
249      @Override
250      public boolean equalsDeep(Base other_) {
251        if (!super.equalsDeep(other_))
252          return false;
253        if (!(other_ instanceof SubstancePolymerMonomerSetComponent))
254          return false;
255        SubstancePolymerMonomerSetComponent o = (SubstancePolymerMonomerSetComponent) other_;
256        return compareDeep(ratioType, o.ratioType, true) && compareDeep(startingMaterial, o.startingMaterial, true)
257          ;
258      }
259
260      @Override
261      public boolean equalsShallow(Base other_) {
262        if (!super.equalsShallow(other_))
263          return false;
264        if (!(other_ instanceof SubstancePolymerMonomerSetComponent))
265          return false;
266        SubstancePolymerMonomerSetComponent o = (SubstancePolymerMonomerSetComponent) other_;
267        return true;
268      }
269
270      public boolean isEmpty() {
271        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(ratioType, startingMaterial
272          );
273      }
274
275  public String fhirType() {
276    return "SubstancePolymer.monomerSet";
277
278  }
279
280  }
281
282    @Block()
283    public static class SubstancePolymerMonomerSetStartingMaterialComponent extends BackboneElement implements IBaseBackboneElement {
284        /**
285         * Todo.
286         */
287        @Child(name = "material", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
288        @Description(shortDefinition="Todo", formalDefinition="Todo." )
289        protected CodeableConcept material;
290
291        /**
292         * Todo.
293         */
294        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
295        @Description(shortDefinition="Todo", formalDefinition="Todo." )
296        protected CodeableConcept type;
297
298        /**
299         * Todo.
300         */
301        @Child(name = "isDefining", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=true)
302        @Description(shortDefinition="Todo", formalDefinition="Todo." )
303        protected BooleanType isDefining;
304
305        /**
306         * Todo.
307         */
308        @Child(name = "amount", type = {SubstanceAmount.class}, order=4, min=0, max=1, modifier=false, summary=true)
309        @Description(shortDefinition="Todo", formalDefinition="Todo." )
310        protected SubstanceAmount amount;
311
312        private static final long serialVersionUID = 589614045L;
313
314    /**
315     * Constructor
316     */
317      public SubstancePolymerMonomerSetStartingMaterialComponent() {
318        super();
319      }
320
321        /**
322         * @return {@link #material} (Todo.)
323         */
324        public CodeableConcept getMaterial() { 
325          if (this.material == null)
326            if (Configuration.errorOnAutoCreate())
327              throw new Error("Attempt to auto-create SubstancePolymerMonomerSetStartingMaterialComponent.material");
328            else if (Configuration.doAutoCreate())
329              this.material = new CodeableConcept(); // cc
330          return this.material;
331        }
332
333        public boolean hasMaterial() { 
334          return this.material != null && !this.material.isEmpty();
335        }
336
337        /**
338         * @param value {@link #material} (Todo.)
339         */
340        public SubstancePolymerMonomerSetStartingMaterialComponent setMaterial(CodeableConcept value) { 
341          this.material = value;
342          return this;
343        }
344
345        /**
346         * @return {@link #type} (Todo.)
347         */
348        public CodeableConcept getType() { 
349          if (this.type == null)
350            if (Configuration.errorOnAutoCreate())
351              throw new Error("Attempt to auto-create SubstancePolymerMonomerSetStartingMaterialComponent.type");
352            else if (Configuration.doAutoCreate())
353              this.type = new CodeableConcept(); // cc
354          return this.type;
355        }
356
357        public boolean hasType() { 
358          return this.type != null && !this.type.isEmpty();
359        }
360
361        /**
362         * @param value {@link #type} (Todo.)
363         */
364        public SubstancePolymerMonomerSetStartingMaterialComponent setType(CodeableConcept value) { 
365          this.type = value;
366          return this;
367        }
368
369        /**
370         * @return {@link #isDefining} (Todo.). This is the underlying object with id, value and extensions. The accessor "getIsDefining" gives direct access to the value
371         */
372        public BooleanType getIsDefiningElement() { 
373          if (this.isDefining == null)
374            if (Configuration.errorOnAutoCreate())
375              throw new Error("Attempt to auto-create SubstancePolymerMonomerSetStartingMaterialComponent.isDefining");
376            else if (Configuration.doAutoCreate())
377              this.isDefining = new BooleanType(); // bb
378          return this.isDefining;
379        }
380
381        public boolean hasIsDefiningElement() { 
382          return this.isDefining != null && !this.isDefining.isEmpty();
383        }
384
385        public boolean hasIsDefining() { 
386          return this.isDefining != null && !this.isDefining.isEmpty();
387        }
388
389        /**
390         * @param value {@link #isDefining} (Todo.). This is the underlying object with id, value and extensions. The accessor "getIsDefining" gives direct access to the value
391         */
392        public SubstancePolymerMonomerSetStartingMaterialComponent setIsDefiningElement(BooleanType value) { 
393          this.isDefining = value;
394          return this;
395        }
396
397        /**
398         * @return Todo.
399         */
400        public boolean getIsDefining() { 
401          return this.isDefining == null || this.isDefining.isEmpty() ? false : this.isDefining.getValue();
402        }
403
404        /**
405         * @param value Todo.
406         */
407        public SubstancePolymerMonomerSetStartingMaterialComponent setIsDefining(boolean value) { 
408            if (this.isDefining == null)
409              this.isDefining = new BooleanType();
410            this.isDefining.setValue(value);
411          return this;
412        }
413
414        /**
415         * @return {@link #amount} (Todo.)
416         */
417        public SubstanceAmount getAmount() { 
418          if (this.amount == null)
419            if (Configuration.errorOnAutoCreate())
420              throw new Error("Attempt to auto-create SubstancePolymerMonomerSetStartingMaterialComponent.amount");
421            else if (Configuration.doAutoCreate())
422              this.amount = new SubstanceAmount(); // cc
423          return this.amount;
424        }
425
426        public boolean hasAmount() { 
427          return this.amount != null && !this.amount.isEmpty();
428        }
429
430        /**
431         * @param value {@link #amount} (Todo.)
432         */
433        public SubstancePolymerMonomerSetStartingMaterialComponent setAmount(SubstanceAmount value) { 
434          this.amount = value;
435          return this;
436        }
437
438        protected void listChildren(List<Property> children) {
439          super.listChildren(children);
440          children.add(new Property("material", "CodeableConcept", "Todo.", 0, 1, material));
441          children.add(new Property("type", "CodeableConcept", "Todo.", 0, 1, type));
442          children.add(new Property("isDefining", "boolean", "Todo.", 0, 1, isDefining));
443          children.add(new Property("amount", "SubstanceAmount", "Todo.", 0, 1, amount));
444        }
445
446        @Override
447        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
448          switch (_hash) {
449          case 299066663: /*material*/  return new Property("material", "CodeableConcept", "Todo.", 0, 1, material);
450          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Todo.", 0, 1, type);
451          case -141812990: /*isDefining*/  return new Property("isDefining", "boolean", "Todo.", 0, 1, isDefining);
452          case -1413853096: /*amount*/  return new Property("amount", "SubstanceAmount", "Todo.", 0, 1, amount);
453          default: return super.getNamedProperty(_hash, _name, _checkValid);
454          }
455
456        }
457
458      @Override
459      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
460        switch (hash) {
461        case 299066663: /*material*/ return this.material == null ? new Base[0] : new Base[] {this.material}; // CodeableConcept
462        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
463        case -141812990: /*isDefining*/ return this.isDefining == null ? new Base[0] : new Base[] {this.isDefining}; // BooleanType
464        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // SubstanceAmount
465        default: return super.getProperty(hash, name, checkValid);
466        }
467
468      }
469
470      @Override
471      public Base setProperty(int hash, String name, Base value) throws FHIRException {
472        switch (hash) {
473        case 299066663: // material
474          this.material = castToCodeableConcept(value); // CodeableConcept
475          return value;
476        case 3575610: // type
477          this.type = castToCodeableConcept(value); // CodeableConcept
478          return value;
479        case -141812990: // isDefining
480          this.isDefining = castToBoolean(value); // BooleanType
481          return value;
482        case -1413853096: // amount
483          this.amount = castToSubstanceAmount(value); // SubstanceAmount
484          return value;
485        default: return super.setProperty(hash, name, value);
486        }
487
488      }
489
490      @Override
491      public Base setProperty(String name, Base value) throws FHIRException {
492        if (name.equals("material")) {
493          this.material = castToCodeableConcept(value); // CodeableConcept
494        } else if (name.equals("type")) {
495          this.type = castToCodeableConcept(value); // CodeableConcept
496        } else if (name.equals("isDefining")) {
497          this.isDefining = castToBoolean(value); // BooleanType
498        } else if (name.equals("amount")) {
499          this.amount = castToSubstanceAmount(value); // SubstanceAmount
500        } else
501          return super.setProperty(name, value);
502        return value;
503      }
504
505      @Override
506      public Base makeProperty(int hash, String name) throws FHIRException {
507        switch (hash) {
508        case 299066663:  return getMaterial(); 
509        case 3575610:  return getType(); 
510        case -141812990:  return getIsDefiningElement();
511        case -1413853096:  return getAmount(); 
512        default: return super.makeProperty(hash, name);
513        }
514
515      }
516
517      @Override
518      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
519        switch (hash) {
520        case 299066663: /*material*/ return new String[] {"CodeableConcept"};
521        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
522        case -141812990: /*isDefining*/ return new String[] {"boolean"};
523        case -1413853096: /*amount*/ return new String[] {"SubstanceAmount"};
524        default: return super.getTypesForProperty(hash, name);
525        }
526
527      }
528
529      @Override
530      public Base addChild(String name) throws FHIRException {
531        if (name.equals("material")) {
532          this.material = new CodeableConcept();
533          return this.material;
534        }
535        else if (name.equals("type")) {
536          this.type = new CodeableConcept();
537          return this.type;
538        }
539        else if (name.equals("isDefining")) {
540          throw new FHIRException("Cannot call addChild on a primitive type SubstancePolymer.isDefining");
541        }
542        else if (name.equals("amount")) {
543          this.amount = new SubstanceAmount();
544          return this.amount;
545        }
546        else
547          return super.addChild(name);
548      }
549
550      public SubstancePolymerMonomerSetStartingMaterialComponent copy() {
551        SubstancePolymerMonomerSetStartingMaterialComponent dst = new SubstancePolymerMonomerSetStartingMaterialComponent();
552        copyValues(dst);
553        dst.material = material == null ? null : material.copy();
554        dst.type = type == null ? null : type.copy();
555        dst.isDefining = isDefining == null ? null : isDefining.copy();
556        dst.amount = amount == null ? null : amount.copy();
557        return dst;
558      }
559
560      @Override
561      public boolean equalsDeep(Base other_) {
562        if (!super.equalsDeep(other_))
563          return false;
564        if (!(other_ instanceof SubstancePolymerMonomerSetStartingMaterialComponent))
565          return false;
566        SubstancePolymerMonomerSetStartingMaterialComponent o = (SubstancePolymerMonomerSetStartingMaterialComponent) other_;
567        return compareDeep(material, o.material, true) && compareDeep(type, o.type, true) && compareDeep(isDefining, o.isDefining, true)
568           && compareDeep(amount, o.amount, true);
569      }
570
571      @Override
572      public boolean equalsShallow(Base other_) {
573        if (!super.equalsShallow(other_))
574          return false;
575        if (!(other_ instanceof SubstancePolymerMonomerSetStartingMaterialComponent))
576          return false;
577        SubstancePolymerMonomerSetStartingMaterialComponent o = (SubstancePolymerMonomerSetStartingMaterialComponent) other_;
578        return compareValues(isDefining, o.isDefining, true);
579      }
580
581      public boolean isEmpty() {
582        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(material, type, isDefining
583          , amount);
584      }
585
586  public String fhirType() {
587    return "SubstancePolymer.monomerSet.startingMaterial";
588
589  }
590
591  }
592
593    @Block()
594    public static class SubstancePolymerRepeatComponent extends BackboneElement implements IBaseBackboneElement {
595        /**
596         * Todo.
597         */
598        @Child(name = "numberOfUnits", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true)
599        @Description(shortDefinition="Todo", formalDefinition="Todo." )
600        protected IntegerType numberOfUnits;
601
602        /**
603         * Todo.
604         */
605        @Child(name = "averageMolecularFormula", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
606        @Description(shortDefinition="Todo", formalDefinition="Todo." )
607        protected StringType averageMolecularFormula;
608
609        /**
610         * Todo.
611         */
612        @Child(name = "repeatUnitAmountType", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true)
613        @Description(shortDefinition="Todo", formalDefinition="Todo." )
614        protected CodeableConcept repeatUnitAmountType;
615
616        /**
617         * Todo.
618         */
619        @Child(name = "repeatUnit", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
620        @Description(shortDefinition="Todo", formalDefinition="Todo." )
621        protected List<SubstancePolymerRepeatRepeatUnitComponent> repeatUnit;
622
623        private static final long serialVersionUID = -988147059L;
624
625    /**
626     * Constructor
627     */
628      public SubstancePolymerRepeatComponent() {
629        super();
630      }
631
632        /**
633         * @return {@link #numberOfUnits} (Todo.). This is the underlying object with id, value and extensions. The accessor "getNumberOfUnits" gives direct access to the value
634         */
635        public IntegerType getNumberOfUnitsElement() { 
636          if (this.numberOfUnits == null)
637            if (Configuration.errorOnAutoCreate())
638              throw new Error("Attempt to auto-create SubstancePolymerRepeatComponent.numberOfUnits");
639            else if (Configuration.doAutoCreate())
640              this.numberOfUnits = new IntegerType(); // bb
641          return this.numberOfUnits;
642        }
643
644        public boolean hasNumberOfUnitsElement() { 
645          return this.numberOfUnits != null && !this.numberOfUnits.isEmpty();
646        }
647
648        public boolean hasNumberOfUnits() { 
649          return this.numberOfUnits != null && !this.numberOfUnits.isEmpty();
650        }
651
652        /**
653         * @param value {@link #numberOfUnits} (Todo.). This is the underlying object with id, value and extensions. The accessor "getNumberOfUnits" gives direct access to the value
654         */
655        public SubstancePolymerRepeatComponent setNumberOfUnitsElement(IntegerType value) { 
656          this.numberOfUnits = value;
657          return this;
658        }
659
660        /**
661         * @return Todo.
662         */
663        public int getNumberOfUnits() { 
664          return this.numberOfUnits == null || this.numberOfUnits.isEmpty() ? 0 : this.numberOfUnits.getValue();
665        }
666
667        /**
668         * @param value Todo.
669         */
670        public SubstancePolymerRepeatComponent setNumberOfUnits(int value) { 
671            if (this.numberOfUnits == null)
672              this.numberOfUnits = new IntegerType();
673            this.numberOfUnits.setValue(value);
674          return this;
675        }
676
677        /**
678         * @return {@link #averageMolecularFormula} (Todo.). This is the underlying object with id, value and extensions. The accessor "getAverageMolecularFormula" gives direct access to the value
679         */
680        public StringType getAverageMolecularFormulaElement() { 
681          if (this.averageMolecularFormula == null)
682            if (Configuration.errorOnAutoCreate())
683              throw new Error("Attempt to auto-create SubstancePolymerRepeatComponent.averageMolecularFormula");
684            else if (Configuration.doAutoCreate())
685              this.averageMolecularFormula = new StringType(); // bb
686          return this.averageMolecularFormula;
687        }
688
689        public boolean hasAverageMolecularFormulaElement() { 
690          return this.averageMolecularFormula != null && !this.averageMolecularFormula.isEmpty();
691        }
692
693        public boolean hasAverageMolecularFormula() { 
694          return this.averageMolecularFormula != null && !this.averageMolecularFormula.isEmpty();
695        }
696
697        /**
698         * @param value {@link #averageMolecularFormula} (Todo.). This is the underlying object with id, value and extensions. The accessor "getAverageMolecularFormula" gives direct access to the value
699         */
700        public SubstancePolymerRepeatComponent setAverageMolecularFormulaElement(StringType value) { 
701          this.averageMolecularFormula = value;
702          return this;
703        }
704
705        /**
706         * @return Todo.
707         */
708        public String getAverageMolecularFormula() { 
709          return this.averageMolecularFormula == null ? null : this.averageMolecularFormula.getValue();
710        }
711
712        /**
713         * @param value Todo.
714         */
715        public SubstancePolymerRepeatComponent setAverageMolecularFormula(String value) { 
716          if (Utilities.noString(value))
717            this.averageMolecularFormula = null;
718          else {
719            if (this.averageMolecularFormula == null)
720              this.averageMolecularFormula = new StringType();
721            this.averageMolecularFormula.setValue(value);
722          }
723          return this;
724        }
725
726        /**
727         * @return {@link #repeatUnitAmountType} (Todo.)
728         */
729        public CodeableConcept getRepeatUnitAmountType() { 
730          if (this.repeatUnitAmountType == null)
731            if (Configuration.errorOnAutoCreate())
732              throw new Error("Attempt to auto-create SubstancePolymerRepeatComponent.repeatUnitAmountType");
733            else if (Configuration.doAutoCreate())
734              this.repeatUnitAmountType = new CodeableConcept(); // cc
735          return this.repeatUnitAmountType;
736        }
737
738        public boolean hasRepeatUnitAmountType() { 
739          return this.repeatUnitAmountType != null && !this.repeatUnitAmountType.isEmpty();
740        }
741
742        /**
743         * @param value {@link #repeatUnitAmountType} (Todo.)
744         */
745        public SubstancePolymerRepeatComponent setRepeatUnitAmountType(CodeableConcept value) { 
746          this.repeatUnitAmountType = value;
747          return this;
748        }
749
750        /**
751         * @return {@link #repeatUnit} (Todo.)
752         */
753        public List<SubstancePolymerRepeatRepeatUnitComponent> getRepeatUnit() { 
754          if (this.repeatUnit == null)
755            this.repeatUnit = new ArrayList<SubstancePolymerRepeatRepeatUnitComponent>();
756          return this.repeatUnit;
757        }
758
759        /**
760         * @return Returns a reference to <code>this</code> for easy method chaining
761         */
762        public SubstancePolymerRepeatComponent setRepeatUnit(List<SubstancePolymerRepeatRepeatUnitComponent> theRepeatUnit) { 
763          this.repeatUnit = theRepeatUnit;
764          return this;
765        }
766
767        public boolean hasRepeatUnit() { 
768          if (this.repeatUnit == null)
769            return false;
770          for (SubstancePolymerRepeatRepeatUnitComponent item : this.repeatUnit)
771            if (!item.isEmpty())
772              return true;
773          return false;
774        }
775
776        public SubstancePolymerRepeatRepeatUnitComponent addRepeatUnit() { //3
777          SubstancePolymerRepeatRepeatUnitComponent t = new SubstancePolymerRepeatRepeatUnitComponent();
778          if (this.repeatUnit == null)
779            this.repeatUnit = new ArrayList<SubstancePolymerRepeatRepeatUnitComponent>();
780          this.repeatUnit.add(t);
781          return t;
782        }
783
784        public SubstancePolymerRepeatComponent addRepeatUnit(SubstancePolymerRepeatRepeatUnitComponent t) { //3
785          if (t == null)
786            return this;
787          if (this.repeatUnit == null)
788            this.repeatUnit = new ArrayList<SubstancePolymerRepeatRepeatUnitComponent>();
789          this.repeatUnit.add(t);
790          return this;
791        }
792
793        /**
794         * @return The first repetition of repeating field {@link #repeatUnit}, creating it if it does not already exist
795         */
796        public SubstancePolymerRepeatRepeatUnitComponent getRepeatUnitFirstRep() { 
797          if (getRepeatUnit().isEmpty()) {
798            addRepeatUnit();
799          }
800          return getRepeatUnit().get(0);
801        }
802
803        protected void listChildren(List<Property> children) {
804          super.listChildren(children);
805          children.add(new Property("numberOfUnits", "integer", "Todo.", 0, 1, numberOfUnits));
806          children.add(new Property("averageMolecularFormula", "string", "Todo.", 0, 1, averageMolecularFormula));
807          children.add(new Property("repeatUnitAmountType", "CodeableConcept", "Todo.", 0, 1, repeatUnitAmountType));
808          children.add(new Property("repeatUnit", "", "Todo.", 0, java.lang.Integer.MAX_VALUE, repeatUnit));
809        }
810
811        @Override
812        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
813          switch (_hash) {
814          case -1321430961: /*numberOfUnits*/  return new Property("numberOfUnits", "integer", "Todo.", 0, 1, numberOfUnits);
815          case 111461715: /*averageMolecularFormula*/  return new Property("averageMolecularFormula", "string", "Todo.", 0, 1, averageMolecularFormula);
816          case -1994025263: /*repeatUnitAmountType*/  return new Property("repeatUnitAmountType", "CodeableConcept", "Todo.", 0, 1, repeatUnitAmountType);
817          case 1159607743: /*repeatUnit*/  return new Property("repeatUnit", "", "Todo.", 0, java.lang.Integer.MAX_VALUE, repeatUnit);
818          default: return super.getNamedProperty(_hash, _name, _checkValid);
819          }
820
821        }
822
823      @Override
824      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
825        switch (hash) {
826        case -1321430961: /*numberOfUnits*/ return this.numberOfUnits == null ? new Base[0] : new Base[] {this.numberOfUnits}; // IntegerType
827        case 111461715: /*averageMolecularFormula*/ return this.averageMolecularFormula == null ? new Base[0] : new Base[] {this.averageMolecularFormula}; // StringType
828        case -1994025263: /*repeatUnitAmountType*/ return this.repeatUnitAmountType == null ? new Base[0] : new Base[] {this.repeatUnitAmountType}; // CodeableConcept
829        case 1159607743: /*repeatUnit*/ return this.repeatUnit == null ? new Base[0] : this.repeatUnit.toArray(new Base[this.repeatUnit.size()]); // SubstancePolymerRepeatRepeatUnitComponent
830        default: return super.getProperty(hash, name, checkValid);
831        }
832
833      }
834
835      @Override
836      public Base setProperty(int hash, String name, Base value) throws FHIRException {
837        switch (hash) {
838        case -1321430961: // numberOfUnits
839          this.numberOfUnits = castToInteger(value); // IntegerType
840          return value;
841        case 111461715: // averageMolecularFormula
842          this.averageMolecularFormula = castToString(value); // StringType
843          return value;
844        case -1994025263: // repeatUnitAmountType
845          this.repeatUnitAmountType = castToCodeableConcept(value); // CodeableConcept
846          return value;
847        case 1159607743: // repeatUnit
848          this.getRepeatUnit().add((SubstancePolymerRepeatRepeatUnitComponent) value); // SubstancePolymerRepeatRepeatUnitComponent
849          return value;
850        default: return super.setProperty(hash, name, value);
851        }
852
853      }
854
855      @Override
856      public Base setProperty(String name, Base value) throws FHIRException {
857        if (name.equals("numberOfUnits")) {
858          this.numberOfUnits = castToInteger(value); // IntegerType
859        } else if (name.equals("averageMolecularFormula")) {
860          this.averageMolecularFormula = castToString(value); // StringType
861        } else if (name.equals("repeatUnitAmountType")) {
862          this.repeatUnitAmountType = castToCodeableConcept(value); // CodeableConcept
863        } else if (name.equals("repeatUnit")) {
864          this.getRepeatUnit().add((SubstancePolymerRepeatRepeatUnitComponent) value);
865        } else
866          return super.setProperty(name, value);
867        return value;
868      }
869
870      @Override
871      public Base makeProperty(int hash, String name) throws FHIRException {
872        switch (hash) {
873        case -1321430961:  return getNumberOfUnitsElement();
874        case 111461715:  return getAverageMolecularFormulaElement();
875        case -1994025263:  return getRepeatUnitAmountType(); 
876        case 1159607743:  return addRepeatUnit(); 
877        default: return super.makeProperty(hash, name);
878        }
879
880      }
881
882      @Override
883      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
884        switch (hash) {
885        case -1321430961: /*numberOfUnits*/ return new String[] {"integer"};
886        case 111461715: /*averageMolecularFormula*/ return new String[] {"string"};
887        case -1994025263: /*repeatUnitAmountType*/ return new String[] {"CodeableConcept"};
888        case 1159607743: /*repeatUnit*/ return new String[] {};
889        default: return super.getTypesForProperty(hash, name);
890        }
891
892      }
893
894      @Override
895      public Base addChild(String name) throws FHIRException {
896        if (name.equals("numberOfUnits")) {
897          throw new FHIRException("Cannot call addChild on a primitive type SubstancePolymer.numberOfUnits");
898        }
899        else if (name.equals("averageMolecularFormula")) {
900          throw new FHIRException("Cannot call addChild on a primitive type SubstancePolymer.averageMolecularFormula");
901        }
902        else if (name.equals("repeatUnitAmountType")) {
903          this.repeatUnitAmountType = new CodeableConcept();
904          return this.repeatUnitAmountType;
905        }
906        else if (name.equals("repeatUnit")) {
907          return addRepeatUnit();
908        }
909        else
910          return super.addChild(name);
911      }
912
913      public SubstancePolymerRepeatComponent copy() {
914        SubstancePolymerRepeatComponent dst = new SubstancePolymerRepeatComponent();
915        copyValues(dst);
916        dst.numberOfUnits = numberOfUnits == null ? null : numberOfUnits.copy();
917        dst.averageMolecularFormula = averageMolecularFormula == null ? null : averageMolecularFormula.copy();
918        dst.repeatUnitAmountType = repeatUnitAmountType == null ? null : repeatUnitAmountType.copy();
919        if (repeatUnit != null) {
920          dst.repeatUnit = new ArrayList<SubstancePolymerRepeatRepeatUnitComponent>();
921          for (SubstancePolymerRepeatRepeatUnitComponent i : repeatUnit)
922            dst.repeatUnit.add(i.copy());
923        };
924        return dst;
925      }
926
927      @Override
928      public boolean equalsDeep(Base other_) {
929        if (!super.equalsDeep(other_))
930          return false;
931        if (!(other_ instanceof SubstancePolymerRepeatComponent))
932          return false;
933        SubstancePolymerRepeatComponent o = (SubstancePolymerRepeatComponent) other_;
934        return compareDeep(numberOfUnits, o.numberOfUnits, true) && compareDeep(averageMolecularFormula, o.averageMolecularFormula, true)
935           && compareDeep(repeatUnitAmountType, o.repeatUnitAmountType, true) && compareDeep(repeatUnit, o.repeatUnit, true)
936          ;
937      }
938
939      @Override
940      public boolean equalsShallow(Base other_) {
941        if (!super.equalsShallow(other_))
942          return false;
943        if (!(other_ instanceof SubstancePolymerRepeatComponent))
944          return false;
945        SubstancePolymerRepeatComponent o = (SubstancePolymerRepeatComponent) other_;
946        return compareValues(numberOfUnits, o.numberOfUnits, true) && compareValues(averageMolecularFormula, o.averageMolecularFormula, true)
947          ;
948      }
949
950      public boolean isEmpty() {
951        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(numberOfUnits, averageMolecularFormula
952          , repeatUnitAmountType, repeatUnit);
953      }
954
955  public String fhirType() {
956    return "SubstancePolymer.repeat";
957
958  }
959
960  }
961
962    @Block()
963    public static class SubstancePolymerRepeatRepeatUnitComponent extends BackboneElement implements IBaseBackboneElement {
964        /**
965         * Todo.
966         */
967        @Child(name = "orientationOfPolymerisation", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
968        @Description(shortDefinition="Todo", formalDefinition="Todo." )
969        protected CodeableConcept orientationOfPolymerisation;
970
971        /**
972         * Todo.
973         */
974        @Child(name = "repeatUnit", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
975        @Description(shortDefinition="Todo", formalDefinition="Todo." )
976        protected StringType repeatUnit;
977
978        /**
979         * Todo.
980         */
981        @Child(name = "amount", type = {SubstanceAmount.class}, order=3, min=0, max=1, modifier=false, summary=true)
982        @Description(shortDefinition="Todo", formalDefinition="Todo." )
983        protected SubstanceAmount amount;
984
985        /**
986         * Todo.
987         */
988        @Child(name = "degreeOfPolymerisation", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
989        @Description(shortDefinition="Todo", formalDefinition="Todo." )
990        protected List<SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent> degreeOfPolymerisation;
991
992        /**
993         * Todo.
994         */
995        @Child(name = "structuralRepresentation", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
996        @Description(shortDefinition="Todo", formalDefinition="Todo." )
997        protected List<SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent> structuralRepresentation;
998
999        private static final long serialVersionUID = -1823741061L;
1000
1001    /**
1002     * Constructor
1003     */
1004      public SubstancePolymerRepeatRepeatUnitComponent() {
1005        super();
1006      }
1007
1008        /**
1009         * @return {@link #orientationOfPolymerisation} (Todo.)
1010         */
1011        public CodeableConcept getOrientationOfPolymerisation() { 
1012          if (this.orientationOfPolymerisation == null)
1013            if (Configuration.errorOnAutoCreate())
1014              throw new Error("Attempt to auto-create SubstancePolymerRepeatRepeatUnitComponent.orientationOfPolymerisation");
1015            else if (Configuration.doAutoCreate())
1016              this.orientationOfPolymerisation = new CodeableConcept(); // cc
1017          return this.orientationOfPolymerisation;
1018        }
1019
1020        public boolean hasOrientationOfPolymerisation() { 
1021          return this.orientationOfPolymerisation != null && !this.orientationOfPolymerisation.isEmpty();
1022        }
1023
1024        /**
1025         * @param value {@link #orientationOfPolymerisation} (Todo.)
1026         */
1027        public SubstancePolymerRepeatRepeatUnitComponent setOrientationOfPolymerisation(CodeableConcept value) { 
1028          this.orientationOfPolymerisation = value;
1029          return this;
1030        }
1031
1032        /**
1033         * @return {@link #repeatUnit} (Todo.). This is the underlying object with id, value and extensions. The accessor "getRepeatUnit" gives direct access to the value
1034         */
1035        public StringType getRepeatUnitElement() { 
1036          if (this.repeatUnit == null)
1037            if (Configuration.errorOnAutoCreate())
1038              throw new Error("Attempt to auto-create SubstancePolymerRepeatRepeatUnitComponent.repeatUnit");
1039            else if (Configuration.doAutoCreate())
1040              this.repeatUnit = new StringType(); // bb
1041          return this.repeatUnit;
1042        }
1043
1044        public boolean hasRepeatUnitElement() { 
1045          return this.repeatUnit != null && !this.repeatUnit.isEmpty();
1046        }
1047
1048        public boolean hasRepeatUnit() { 
1049          return this.repeatUnit != null && !this.repeatUnit.isEmpty();
1050        }
1051
1052        /**
1053         * @param value {@link #repeatUnit} (Todo.). This is the underlying object with id, value and extensions. The accessor "getRepeatUnit" gives direct access to the value
1054         */
1055        public SubstancePolymerRepeatRepeatUnitComponent setRepeatUnitElement(StringType value) { 
1056          this.repeatUnit = value;
1057          return this;
1058        }
1059
1060        /**
1061         * @return Todo.
1062         */
1063        public String getRepeatUnit() { 
1064          return this.repeatUnit == null ? null : this.repeatUnit.getValue();
1065        }
1066
1067        /**
1068         * @param value Todo.
1069         */
1070        public SubstancePolymerRepeatRepeatUnitComponent setRepeatUnit(String value) { 
1071          if (Utilities.noString(value))
1072            this.repeatUnit = null;
1073          else {
1074            if (this.repeatUnit == null)
1075              this.repeatUnit = new StringType();
1076            this.repeatUnit.setValue(value);
1077          }
1078          return this;
1079        }
1080
1081        /**
1082         * @return {@link #amount} (Todo.)
1083         */
1084        public SubstanceAmount getAmount() { 
1085          if (this.amount == null)
1086            if (Configuration.errorOnAutoCreate())
1087              throw new Error("Attempt to auto-create SubstancePolymerRepeatRepeatUnitComponent.amount");
1088            else if (Configuration.doAutoCreate())
1089              this.amount = new SubstanceAmount(); // cc
1090          return this.amount;
1091        }
1092
1093        public boolean hasAmount() { 
1094          return this.amount != null && !this.amount.isEmpty();
1095        }
1096
1097        /**
1098         * @param value {@link #amount} (Todo.)
1099         */
1100        public SubstancePolymerRepeatRepeatUnitComponent setAmount(SubstanceAmount value) { 
1101          this.amount = value;
1102          return this;
1103        }
1104
1105        /**
1106         * @return {@link #degreeOfPolymerisation} (Todo.)
1107         */
1108        public List<SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent> getDegreeOfPolymerisation() { 
1109          if (this.degreeOfPolymerisation == null)
1110            this.degreeOfPolymerisation = new ArrayList<SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent>();
1111          return this.degreeOfPolymerisation;
1112        }
1113
1114        /**
1115         * @return Returns a reference to <code>this</code> for easy method chaining
1116         */
1117        public SubstancePolymerRepeatRepeatUnitComponent setDegreeOfPolymerisation(List<SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent> theDegreeOfPolymerisation) { 
1118          this.degreeOfPolymerisation = theDegreeOfPolymerisation;
1119          return this;
1120        }
1121
1122        public boolean hasDegreeOfPolymerisation() { 
1123          if (this.degreeOfPolymerisation == null)
1124            return false;
1125          for (SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent item : this.degreeOfPolymerisation)
1126            if (!item.isEmpty())
1127              return true;
1128          return false;
1129        }
1130
1131        public SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent addDegreeOfPolymerisation() { //3
1132          SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent t = new SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent();
1133          if (this.degreeOfPolymerisation == null)
1134            this.degreeOfPolymerisation = new ArrayList<SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent>();
1135          this.degreeOfPolymerisation.add(t);
1136          return t;
1137        }
1138
1139        public SubstancePolymerRepeatRepeatUnitComponent addDegreeOfPolymerisation(SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent t) { //3
1140          if (t == null)
1141            return this;
1142          if (this.degreeOfPolymerisation == null)
1143            this.degreeOfPolymerisation = new ArrayList<SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent>();
1144          this.degreeOfPolymerisation.add(t);
1145          return this;
1146        }
1147
1148        /**
1149         * @return The first repetition of repeating field {@link #degreeOfPolymerisation}, creating it if it does not already exist
1150         */
1151        public SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent getDegreeOfPolymerisationFirstRep() { 
1152          if (getDegreeOfPolymerisation().isEmpty()) {
1153            addDegreeOfPolymerisation();
1154          }
1155          return getDegreeOfPolymerisation().get(0);
1156        }
1157
1158        /**
1159         * @return {@link #structuralRepresentation} (Todo.)
1160         */
1161        public List<SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent> getStructuralRepresentation() { 
1162          if (this.structuralRepresentation == null)
1163            this.structuralRepresentation = new ArrayList<SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent>();
1164          return this.structuralRepresentation;
1165        }
1166
1167        /**
1168         * @return Returns a reference to <code>this</code> for easy method chaining
1169         */
1170        public SubstancePolymerRepeatRepeatUnitComponent setStructuralRepresentation(List<SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent> theStructuralRepresentation) { 
1171          this.structuralRepresentation = theStructuralRepresentation;
1172          return this;
1173        }
1174
1175        public boolean hasStructuralRepresentation() { 
1176          if (this.structuralRepresentation == null)
1177            return false;
1178          for (SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent item : this.structuralRepresentation)
1179            if (!item.isEmpty())
1180              return true;
1181          return false;
1182        }
1183
1184        public SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent addStructuralRepresentation() { //3
1185          SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent t = new SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent();
1186          if (this.structuralRepresentation == null)
1187            this.structuralRepresentation = new ArrayList<SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent>();
1188          this.structuralRepresentation.add(t);
1189          return t;
1190        }
1191
1192        public SubstancePolymerRepeatRepeatUnitComponent addStructuralRepresentation(SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent t) { //3
1193          if (t == null)
1194            return this;
1195          if (this.structuralRepresentation == null)
1196            this.structuralRepresentation = new ArrayList<SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent>();
1197          this.structuralRepresentation.add(t);
1198          return this;
1199        }
1200
1201        /**
1202         * @return The first repetition of repeating field {@link #structuralRepresentation}, creating it if it does not already exist
1203         */
1204        public SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent getStructuralRepresentationFirstRep() { 
1205          if (getStructuralRepresentation().isEmpty()) {
1206            addStructuralRepresentation();
1207          }
1208          return getStructuralRepresentation().get(0);
1209        }
1210
1211        protected void listChildren(List<Property> children) {
1212          super.listChildren(children);
1213          children.add(new Property("orientationOfPolymerisation", "CodeableConcept", "Todo.", 0, 1, orientationOfPolymerisation));
1214          children.add(new Property("repeatUnit", "string", "Todo.", 0, 1, repeatUnit));
1215          children.add(new Property("amount", "SubstanceAmount", "Todo.", 0, 1, amount));
1216          children.add(new Property("degreeOfPolymerisation", "", "Todo.", 0, java.lang.Integer.MAX_VALUE, degreeOfPolymerisation));
1217          children.add(new Property("structuralRepresentation", "", "Todo.", 0, java.lang.Integer.MAX_VALUE, structuralRepresentation));
1218        }
1219
1220        @Override
1221        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1222          switch (_hash) {
1223          case 1795817828: /*orientationOfPolymerisation*/  return new Property("orientationOfPolymerisation", "CodeableConcept", "Todo.", 0, 1, orientationOfPolymerisation);
1224          case 1159607743: /*repeatUnit*/  return new Property("repeatUnit", "string", "Todo.", 0, 1, repeatUnit);
1225          case -1413853096: /*amount*/  return new Property("amount", "SubstanceAmount", "Todo.", 0, 1, amount);
1226          case -159251872: /*degreeOfPolymerisation*/  return new Property("degreeOfPolymerisation", "", "Todo.", 0, java.lang.Integer.MAX_VALUE, degreeOfPolymerisation);
1227          case 14311178: /*structuralRepresentation*/  return new Property("structuralRepresentation", "", "Todo.", 0, java.lang.Integer.MAX_VALUE, structuralRepresentation);
1228          default: return super.getNamedProperty(_hash, _name, _checkValid);
1229          }
1230
1231        }
1232
1233      @Override
1234      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1235        switch (hash) {
1236        case 1795817828: /*orientationOfPolymerisation*/ return this.orientationOfPolymerisation == null ? new Base[0] : new Base[] {this.orientationOfPolymerisation}; // CodeableConcept
1237        case 1159607743: /*repeatUnit*/ return this.repeatUnit == null ? new Base[0] : new Base[] {this.repeatUnit}; // StringType
1238        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // SubstanceAmount
1239        case -159251872: /*degreeOfPolymerisation*/ return this.degreeOfPolymerisation == null ? new Base[0] : this.degreeOfPolymerisation.toArray(new Base[this.degreeOfPolymerisation.size()]); // SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent
1240        case 14311178: /*structuralRepresentation*/ return this.structuralRepresentation == null ? new Base[0] : this.structuralRepresentation.toArray(new Base[this.structuralRepresentation.size()]); // SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent
1241        default: return super.getProperty(hash, name, checkValid);
1242        }
1243
1244      }
1245
1246      @Override
1247      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1248        switch (hash) {
1249        case 1795817828: // orientationOfPolymerisation
1250          this.orientationOfPolymerisation = castToCodeableConcept(value); // CodeableConcept
1251          return value;
1252        case 1159607743: // repeatUnit
1253          this.repeatUnit = castToString(value); // StringType
1254          return value;
1255        case -1413853096: // amount
1256          this.amount = castToSubstanceAmount(value); // SubstanceAmount
1257          return value;
1258        case -159251872: // degreeOfPolymerisation
1259          this.getDegreeOfPolymerisation().add((SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent) value); // SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent
1260          return value;
1261        case 14311178: // structuralRepresentation
1262          this.getStructuralRepresentation().add((SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent) value); // SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent
1263          return value;
1264        default: return super.setProperty(hash, name, value);
1265        }
1266
1267      }
1268
1269      @Override
1270      public Base setProperty(String name, Base value) throws FHIRException {
1271        if (name.equals("orientationOfPolymerisation")) {
1272          this.orientationOfPolymerisation = castToCodeableConcept(value); // CodeableConcept
1273        } else if (name.equals("repeatUnit")) {
1274          this.repeatUnit = castToString(value); // StringType
1275        } else if (name.equals("amount")) {
1276          this.amount = castToSubstanceAmount(value); // SubstanceAmount
1277        } else if (name.equals("degreeOfPolymerisation")) {
1278          this.getDegreeOfPolymerisation().add((SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent) value);
1279        } else if (name.equals("structuralRepresentation")) {
1280          this.getStructuralRepresentation().add((SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent) value);
1281        } else
1282          return super.setProperty(name, value);
1283        return value;
1284      }
1285
1286      @Override
1287      public Base makeProperty(int hash, String name) throws FHIRException {
1288        switch (hash) {
1289        case 1795817828:  return getOrientationOfPolymerisation(); 
1290        case 1159607743:  return getRepeatUnitElement();
1291        case -1413853096:  return getAmount(); 
1292        case -159251872:  return addDegreeOfPolymerisation(); 
1293        case 14311178:  return addStructuralRepresentation(); 
1294        default: return super.makeProperty(hash, name);
1295        }
1296
1297      }
1298
1299      @Override
1300      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1301        switch (hash) {
1302        case 1795817828: /*orientationOfPolymerisation*/ return new String[] {"CodeableConcept"};
1303        case 1159607743: /*repeatUnit*/ return new String[] {"string"};
1304        case -1413853096: /*amount*/ return new String[] {"SubstanceAmount"};
1305        case -159251872: /*degreeOfPolymerisation*/ return new String[] {};
1306        case 14311178: /*structuralRepresentation*/ return new String[] {};
1307        default: return super.getTypesForProperty(hash, name);
1308        }
1309
1310      }
1311
1312      @Override
1313      public Base addChild(String name) throws FHIRException {
1314        if (name.equals("orientationOfPolymerisation")) {
1315          this.orientationOfPolymerisation = new CodeableConcept();
1316          return this.orientationOfPolymerisation;
1317        }
1318        else if (name.equals("repeatUnit")) {
1319          throw new FHIRException("Cannot call addChild on a primitive type SubstancePolymer.repeatUnit");
1320        }
1321        else if (name.equals("amount")) {
1322          this.amount = new SubstanceAmount();
1323          return this.amount;
1324        }
1325        else if (name.equals("degreeOfPolymerisation")) {
1326          return addDegreeOfPolymerisation();
1327        }
1328        else if (name.equals("structuralRepresentation")) {
1329          return addStructuralRepresentation();
1330        }
1331        else
1332          return super.addChild(name);
1333      }
1334
1335      public SubstancePolymerRepeatRepeatUnitComponent copy() {
1336        SubstancePolymerRepeatRepeatUnitComponent dst = new SubstancePolymerRepeatRepeatUnitComponent();
1337        copyValues(dst);
1338        dst.orientationOfPolymerisation = orientationOfPolymerisation == null ? null : orientationOfPolymerisation.copy();
1339        dst.repeatUnit = repeatUnit == null ? null : repeatUnit.copy();
1340        dst.amount = amount == null ? null : amount.copy();
1341        if (degreeOfPolymerisation != null) {
1342          dst.degreeOfPolymerisation = new ArrayList<SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent>();
1343          for (SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent i : degreeOfPolymerisation)
1344            dst.degreeOfPolymerisation.add(i.copy());
1345        };
1346        if (structuralRepresentation != null) {
1347          dst.structuralRepresentation = new ArrayList<SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent>();
1348          for (SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent i : structuralRepresentation)
1349            dst.structuralRepresentation.add(i.copy());
1350        };
1351        return dst;
1352      }
1353
1354      @Override
1355      public boolean equalsDeep(Base other_) {
1356        if (!super.equalsDeep(other_))
1357          return false;
1358        if (!(other_ instanceof SubstancePolymerRepeatRepeatUnitComponent))
1359          return false;
1360        SubstancePolymerRepeatRepeatUnitComponent o = (SubstancePolymerRepeatRepeatUnitComponent) other_;
1361        return compareDeep(orientationOfPolymerisation, o.orientationOfPolymerisation, true) && compareDeep(repeatUnit, o.repeatUnit, true)
1362           && compareDeep(amount, o.amount, true) && compareDeep(degreeOfPolymerisation, o.degreeOfPolymerisation, true)
1363           && compareDeep(structuralRepresentation, o.structuralRepresentation, true);
1364      }
1365
1366      @Override
1367      public boolean equalsShallow(Base other_) {
1368        if (!super.equalsShallow(other_))
1369          return false;
1370        if (!(other_ instanceof SubstancePolymerRepeatRepeatUnitComponent))
1371          return false;
1372        SubstancePolymerRepeatRepeatUnitComponent o = (SubstancePolymerRepeatRepeatUnitComponent) other_;
1373        return compareValues(repeatUnit, o.repeatUnit, true);
1374      }
1375
1376      public boolean isEmpty() {
1377        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(orientationOfPolymerisation
1378          , repeatUnit, amount, degreeOfPolymerisation, structuralRepresentation);
1379      }
1380
1381  public String fhirType() {
1382    return "SubstancePolymer.repeat.repeatUnit";
1383
1384  }
1385
1386  }
1387
1388    @Block()
1389    public static class SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent extends BackboneElement implements IBaseBackboneElement {
1390        /**
1391         * Todo.
1392         */
1393        @Child(name = "degree", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
1394        @Description(shortDefinition="Todo", formalDefinition="Todo." )
1395        protected CodeableConcept degree;
1396
1397        /**
1398         * Todo.
1399         */
1400        @Child(name = "amount", type = {SubstanceAmount.class}, order=2, min=0, max=1, modifier=false, summary=true)
1401        @Description(shortDefinition="Todo", formalDefinition="Todo." )
1402        protected SubstanceAmount amount;
1403
1404        private static final long serialVersionUID = -1487452773L;
1405
1406    /**
1407     * Constructor
1408     */
1409      public SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent() {
1410        super();
1411      }
1412
1413        /**
1414         * @return {@link #degree} (Todo.)
1415         */
1416        public CodeableConcept getDegree() { 
1417          if (this.degree == null)
1418            if (Configuration.errorOnAutoCreate())
1419              throw new Error("Attempt to auto-create SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent.degree");
1420            else if (Configuration.doAutoCreate())
1421              this.degree = new CodeableConcept(); // cc
1422          return this.degree;
1423        }
1424
1425        public boolean hasDegree() { 
1426          return this.degree != null && !this.degree.isEmpty();
1427        }
1428
1429        /**
1430         * @param value {@link #degree} (Todo.)
1431         */
1432        public SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent setDegree(CodeableConcept value) { 
1433          this.degree = value;
1434          return this;
1435        }
1436
1437        /**
1438         * @return {@link #amount} (Todo.)
1439         */
1440        public SubstanceAmount getAmount() { 
1441          if (this.amount == null)
1442            if (Configuration.errorOnAutoCreate())
1443              throw new Error("Attempt to auto-create SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent.amount");
1444            else if (Configuration.doAutoCreate())
1445              this.amount = new SubstanceAmount(); // cc
1446          return this.amount;
1447        }
1448
1449        public boolean hasAmount() { 
1450          return this.amount != null && !this.amount.isEmpty();
1451        }
1452
1453        /**
1454         * @param value {@link #amount} (Todo.)
1455         */
1456        public SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent setAmount(SubstanceAmount value) { 
1457          this.amount = value;
1458          return this;
1459        }
1460
1461        protected void listChildren(List<Property> children) {
1462          super.listChildren(children);
1463          children.add(new Property("degree", "CodeableConcept", "Todo.", 0, 1, degree));
1464          children.add(new Property("amount", "SubstanceAmount", "Todo.", 0, 1, amount));
1465        }
1466
1467        @Override
1468        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1469          switch (_hash) {
1470          case -1335595316: /*degree*/  return new Property("degree", "CodeableConcept", "Todo.", 0, 1, degree);
1471          case -1413853096: /*amount*/  return new Property("amount", "SubstanceAmount", "Todo.", 0, 1, amount);
1472          default: return super.getNamedProperty(_hash, _name, _checkValid);
1473          }
1474
1475        }
1476
1477      @Override
1478      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1479        switch (hash) {
1480        case -1335595316: /*degree*/ return this.degree == null ? new Base[0] : new Base[] {this.degree}; // CodeableConcept
1481        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // SubstanceAmount
1482        default: return super.getProperty(hash, name, checkValid);
1483        }
1484
1485      }
1486
1487      @Override
1488      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1489        switch (hash) {
1490        case -1335595316: // degree
1491          this.degree = castToCodeableConcept(value); // CodeableConcept
1492          return value;
1493        case -1413853096: // amount
1494          this.amount = castToSubstanceAmount(value); // SubstanceAmount
1495          return value;
1496        default: return super.setProperty(hash, name, value);
1497        }
1498
1499      }
1500
1501      @Override
1502      public Base setProperty(String name, Base value) throws FHIRException {
1503        if (name.equals("degree")) {
1504          this.degree = castToCodeableConcept(value); // CodeableConcept
1505        } else if (name.equals("amount")) {
1506          this.amount = castToSubstanceAmount(value); // SubstanceAmount
1507        } else
1508          return super.setProperty(name, value);
1509        return value;
1510      }
1511
1512      @Override
1513      public Base makeProperty(int hash, String name) throws FHIRException {
1514        switch (hash) {
1515        case -1335595316:  return getDegree(); 
1516        case -1413853096:  return getAmount(); 
1517        default: return super.makeProperty(hash, name);
1518        }
1519
1520      }
1521
1522      @Override
1523      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1524        switch (hash) {
1525        case -1335595316: /*degree*/ return new String[] {"CodeableConcept"};
1526        case -1413853096: /*amount*/ return new String[] {"SubstanceAmount"};
1527        default: return super.getTypesForProperty(hash, name);
1528        }
1529
1530      }
1531
1532      @Override
1533      public Base addChild(String name) throws FHIRException {
1534        if (name.equals("degree")) {
1535          this.degree = new CodeableConcept();
1536          return this.degree;
1537        }
1538        else if (name.equals("amount")) {
1539          this.amount = new SubstanceAmount();
1540          return this.amount;
1541        }
1542        else
1543          return super.addChild(name);
1544      }
1545
1546      public SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent copy() {
1547        SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent dst = new SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent();
1548        copyValues(dst);
1549        dst.degree = degree == null ? null : degree.copy();
1550        dst.amount = amount == null ? null : amount.copy();
1551        return dst;
1552      }
1553
1554      @Override
1555      public boolean equalsDeep(Base other_) {
1556        if (!super.equalsDeep(other_))
1557          return false;
1558        if (!(other_ instanceof SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent))
1559          return false;
1560        SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent o = (SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent) other_;
1561        return compareDeep(degree, o.degree, true) && compareDeep(amount, o.amount, true);
1562      }
1563
1564      @Override
1565      public boolean equalsShallow(Base other_) {
1566        if (!super.equalsShallow(other_))
1567          return false;
1568        if (!(other_ instanceof SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent))
1569          return false;
1570        SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent o = (SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationComponent) other_;
1571        return true;
1572      }
1573
1574      public boolean isEmpty() {
1575        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(degree, amount);
1576      }
1577
1578  public String fhirType() {
1579    return "SubstancePolymer.repeat.repeatUnit.degreeOfPolymerisation";
1580
1581  }
1582
1583  }
1584
1585    @Block()
1586    public static class SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent extends BackboneElement implements IBaseBackboneElement {
1587        /**
1588         * Todo.
1589         */
1590        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
1591        @Description(shortDefinition="Todo", formalDefinition="Todo." )
1592        protected CodeableConcept type;
1593
1594        /**
1595         * Todo.
1596         */
1597        @Child(name = "representation", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1598        @Description(shortDefinition="Todo", formalDefinition="Todo." )
1599        protected StringType representation;
1600
1601        /**
1602         * Todo.
1603         */
1604        @Child(name = "attachment", type = {Attachment.class}, order=3, min=0, max=1, modifier=false, summary=true)
1605        @Description(shortDefinition="Todo", formalDefinition="Todo." )
1606        protected Attachment attachment;
1607
1608        private static final long serialVersionUID = 167954495L;
1609
1610    /**
1611     * Constructor
1612     */
1613      public SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent() {
1614        super();
1615      }
1616
1617        /**
1618         * @return {@link #type} (Todo.)
1619         */
1620        public CodeableConcept getType() { 
1621          if (this.type == null)
1622            if (Configuration.errorOnAutoCreate())
1623              throw new Error("Attempt to auto-create SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent.type");
1624            else if (Configuration.doAutoCreate())
1625              this.type = new CodeableConcept(); // cc
1626          return this.type;
1627        }
1628
1629        public boolean hasType() { 
1630          return this.type != null && !this.type.isEmpty();
1631        }
1632
1633        /**
1634         * @param value {@link #type} (Todo.)
1635         */
1636        public SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent setType(CodeableConcept value) { 
1637          this.type = value;
1638          return this;
1639        }
1640
1641        /**
1642         * @return {@link #representation} (Todo.). This is the underlying object with id, value and extensions. The accessor "getRepresentation" gives direct access to the value
1643         */
1644        public StringType getRepresentationElement() { 
1645          if (this.representation == null)
1646            if (Configuration.errorOnAutoCreate())
1647              throw new Error("Attempt to auto-create SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent.representation");
1648            else if (Configuration.doAutoCreate())
1649              this.representation = new StringType(); // bb
1650          return this.representation;
1651        }
1652
1653        public boolean hasRepresentationElement() { 
1654          return this.representation != null && !this.representation.isEmpty();
1655        }
1656
1657        public boolean hasRepresentation() { 
1658          return this.representation != null && !this.representation.isEmpty();
1659        }
1660
1661        /**
1662         * @param value {@link #representation} (Todo.). This is the underlying object with id, value and extensions. The accessor "getRepresentation" gives direct access to the value
1663         */
1664        public SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent setRepresentationElement(StringType value) { 
1665          this.representation = value;
1666          return this;
1667        }
1668
1669        /**
1670         * @return Todo.
1671         */
1672        public String getRepresentation() { 
1673          return this.representation == null ? null : this.representation.getValue();
1674        }
1675
1676        /**
1677         * @param value Todo.
1678         */
1679        public SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent setRepresentation(String value) { 
1680          if (Utilities.noString(value))
1681            this.representation = null;
1682          else {
1683            if (this.representation == null)
1684              this.representation = new StringType();
1685            this.representation.setValue(value);
1686          }
1687          return this;
1688        }
1689
1690        /**
1691         * @return {@link #attachment} (Todo.)
1692         */
1693        public Attachment getAttachment() { 
1694          if (this.attachment == null)
1695            if (Configuration.errorOnAutoCreate())
1696              throw new Error("Attempt to auto-create SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent.attachment");
1697            else if (Configuration.doAutoCreate())
1698              this.attachment = new Attachment(); // cc
1699          return this.attachment;
1700        }
1701
1702        public boolean hasAttachment() { 
1703          return this.attachment != null && !this.attachment.isEmpty();
1704        }
1705
1706        /**
1707         * @param value {@link #attachment} (Todo.)
1708         */
1709        public SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent setAttachment(Attachment value) { 
1710          this.attachment = value;
1711          return this;
1712        }
1713
1714        protected void listChildren(List<Property> children) {
1715          super.listChildren(children);
1716          children.add(new Property("type", "CodeableConcept", "Todo.", 0, 1, type));
1717          children.add(new Property("representation", "string", "Todo.", 0, 1, representation));
1718          children.add(new Property("attachment", "Attachment", "Todo.", 0, 1, attachment));
1719        }
1720
1721        @Override
1722        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1723          switch (_hash) {
1724          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Todo.", 0, 1, type);
1725          case -671065907: /*representation*/  return new Property("representation", "string", "Todo.", 0, 1, representation);
1726          case -1963501277: /*attachment*/  return new Property("attachment", "Attachment", "Todo.", 0, 1, attachment);
1727          default: return super.getNamedProperty(_hash, _name, _checkValid);
1728          }
1729
1730        }
1731
1732      @Override
1733      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1734        switch (hash) {
1735        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1736        case -671065907: /*representation*/ return this.representation == null ? new Base[0] : new Base[] {this.representation}; // StringType
1737        case -1963501277: /*attachment*/ return this.attachment == null ? new Base[0] : new Base[] {this.attachment}; // Attachment
1738        default: return super.getProperty(hash, name, checkValid);
1739        }
1740
1741      }
1742
1743      @Override
1744      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1745        switch (hash) {
1746        case 3575610: // type
1747          this.type = castToCodeableConcept(value); // CodeableConcept
1748          return value;
1749        case -671065907: // representation
1750          this.representation = castToString(value); // StringType
1751          return value;
1752        case -1963501277: // attachment
1753          this.attachment = castToAttachment(value); // Attachment
1754          return value;
1755        default: return super.setProperty(hash, name, value);
1756        }
1757
1758      }
1759
1760      @Override
1761      public Base setProperty(String name, Base value) throws FHIRException {
1762        if (name.equals("type")) {
1763          this.type = castToCodeableConcept(value); // CodeableConcept
1764        } else if (name.equals("representation")) {
1765          this.representation = castToString(value); // StringType
1766        } else if (name.equals("attachment")) {
1767          this.attachment = castToAttachment(value); // Attachment
1768        } else
1769          return super.setProperty(name, value);
1770        return value;
1771      }
1772
1773      @Override
1774      public Base makeProperty(int hash, String name) throws FHIRException {
1775        switch (hash) {
1776        case 3575610:  return getType(); 
1777        case -671065907:  return getRepresentationElement();
1778        case -1963501277:  return getAttachment(); 
1779        default: return super.makeProperty(hash, name);
1780        }
1781
1782      }
1783
1784      @Override
1785      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1786        switch (hash) {
1787        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1788        case -671065907: /*representation*/ return new String[] {"string"};
1789        case -1963501277: /*attachment*/ return new String[] {"Attachment"};
1790        default: return super.getTypesForProperty(hash, name);
1791        }
1792
1793      }
1794
1795      @Override
1796      public Base addChild(String name) throws FHIRException {
1797        if (name.equals("type")) {
1798          this.type = new CodeableConcept();
1799          return this.type;
1800        }
1801        else if (name.equals("representation")) {
1802          throw new FHIRException("Cannot call addChild on a primitive type SubstancePolymer.representation");
1803        }
1804        else if (name.equals("attachment")) {
1805          this.attachment = new Attachment();
1806          return this.attachment;
1807        }
1808        else
1809          return super.addChild(name);
1810      }
1811
1812      public SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent copy() {
1813        SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent dst = new SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent();
1814        copyValues(dst);
1815        dst.type = type == null ? null : type.copy();
1816        dst.representation = representation == null ? null : representation.copy();
1817        dst.attachment = attachment == null ? null : attachment.copy();
1818        return dst;
1819      }
1820
1821      @Override
1822      public boolean equalsDeep(Base other_) {
1823        if (!super.equalsDeep(other_))
1824          return false;
1825        if (!(other_ instanceof SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent))
1826          return false;
1827        SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent o = (SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent) other_;
1828        return compareDeep(type, o.type, true) && compareDeep(representation, o.representation, true) && compareDeep(attachment, o.attachment, true)
1829          ;
1830      }
1831
1832      @Override
1833      public boolean equalsShallow(Base other_) {
1834        if (!super.equalsShallow(other_))
1835          return false;
1836        if (!(other_ instanceof SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent))
1837          return false;
1838        SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent o = (SubstancePolymerRepeatRepeatUnitStructuralRepresentationComponent) other_;
1839        return compareValues(representation, o.representation, true);
1840      }
1841
1842      public boolean isEmpty() {
1843        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, representation, attachment
1844          );
1845      }
1846
1847  public String fhirType() {
1848    return "SubstancePolymer.repeat.repeatUnit.structuralRepresentation";
1849
1850  }
1851
1852  }
1853
1854    /**
1855     * Todo.
1856     */
1857    @Child(name = "class", type = {CodeableConcept.class}, order=0, min=0, max=1, modifier=false, summary=true)
1858    @Description(shortDefinition="Todo", formalDefinition="Todo." )
1859    protected CodeableConcept class_;
1860
1861    /**
1862     * Todo.
1863     */
1864    @Child(name = "geometry", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
1865    @Description(shortDefinition="Todo", formalDefinition="Todo." )
1866    protected CodeableConcept geometry;
1867
1868    /**
1869     * Todo.
1870     */
1871    @Child(name = "copolymerConnectivity", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1872    @Description(shortDefinition="Todo", formalDefinition="Todo." )
1873    protected List<CodeableConcept> copolymerConnectivity;
1874
1875    /**
1876     * Todo.
1877     */
1878    @Child(name = "modification", type = {StringType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1879    @Description(shortDefinition="Todo", formalDefinition="Todo." )
1880    protected List<StringType> modification;
1881
1882    /**
1883     * Todo.
1884     */
1885    @Child(name = "monomerSet", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1886    @Description(shortDefinition="Todo", formalDefinition="Todo." )
1887    protected List<SubstancePolymerMonomerSetComponent> monomerSet;
1888
1889    /**
1890     * Todo.
1891     */
1892    @Child(name = "repeat", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1893    @Description(shortDefinition="Todo", formalDefinition="Todo." )
1894    protected List<SubstancePolymerRepeatComponent> repeat;
1895
1896    private static final long serialVersionUID = -58301650L;
1897
1898  /**
1899   * Constructor
1900   */
1901    public SubstancePolymer() {
1902      super();
1903    }
1904
1905    /**
1906     * @return {@link #class_} (Todo.)
1907     */
1908    public CodeableConcept getClass_() { 
1909      if (this.class_ == null)
1910        if (Configuration.errorOnAutoCreate())
1911          throw new Error("Attempt to auto-create SubstancePolymer.class_");
1912        else if (Configuration.doAutoCreate())
1913          this.class_ = new CodeableConcept(); // cc
1914      return this.class_;
1915    }
1916
1917    public boolean hasClass_() { 
1918      return this.class_ != null && !this.class_.isEmpty();
1919    }
1920
1921    /**
1922     * @param value {@link #class_} (Todo.)
1923     */
1924    public SubstancePolymer setClass_(CodeableConcept value) { 
1925      this.class_ = value;
1926      return this;
1927    }
1928
1929    /**
1930     * @return {@link #geometry} (Todo.)
1931     */
1932    public CodeableConcept getGeometry() { 
1933      if (this.geometry == null)
1934        if (Configuration.errorOnAutoCreate())
1935          throw new Error("Attempt to auto-create SubstancePolymer.geometry");
1936        else if (Configuration.doAutoCreate())
1937          this.geometry = new CodeableConcept(); // cc
1938      return this.geometry;
1939    }
1940
1941    public boolean hasGeometry() { 
1942      return this.geometry != null && !this.geometry.isEmpty();
1943    }
1944
1945    /**
1946     * @param value {@link #geometry} (Todo.)
1947     */
1948    public SubstancePolymer setGeometry(CodeableConcept value) { 
1949      this.geometry = value;
1950      return this;
1951    }
1952
1953    /**
1954     * @return {@link #copolymerConnectivity} (Todo.)
1955     */
1956    public List<CodeableConcept> getCopolymerConnectivity() { 
1957      if (this.copolymerConnectivity == null)
1958        this.copolymerConnectivity = new ArrayList<CodeableConcept>();
1959      return this.copolymerConnectivity;
1960    }
1961
1962    /**
1963     * @return Returns a reference to <code>this</code> for easy method chaining
1964     */
1965    public SubstancePolymer setCopolymerConnectivity(List<CodeableConcept> theCopolymerConnectivity) { 
1966      this.copolymerConnectivity = theCopolymerConnectivity;
1967      return this;
1968    }
1969
1970    public boolean hasCopolymerConnectivity() { 
1971      if (this.copolymerConnectivity == null)
1972        return false;
1973      for (CodeableConcept item : this.copolymerConnectivity)
1974        if (!item.isEmpty())
1975          return true;
1976      return false;
1977    }
1978
1979    public CodeableConcept addCopolymerConnectivity() { //3
1980      CodeableConcept t = new CodeableConcept();
1981      if (this.copolymerConnectivity == null)
1982        this.copolymerConnectivity = new ArrayList<CodeableConcept>();
1983      this.copolymerConnectivity.add(t);
1984      return t;
1985    }
1986
1987    public SubstancePolymer addCopolymerConnectivity(CodeableConcept t) { //3
1988      if (t == null)
1989        return this;
1990      if (this.copolymerConnectivity == null)
1991        this.copolymerConnectivity = new ArrayList<CodeableConcept>();
1992      this.copolymerConnectivity.add(t);
1993      return this;
1994    }
1995
1996    /**
1997     * @return The first repetition of repeating field {@link #copolymerConnectivity}, creating it if it does not already exist
1998     */
1999    public CodeableConcept getCopolymerConnectivityFirstRep() { 
2000      if (getCopolymerConnectivity().isEmpty()) {
2001        addCopolymerConnectivity();
2002      }
2003      return getCopolymerConnectivity().get(0);
2004    }
2005
2006    /**
2007     * @return {@link #modification} (Todo.)
2008     */
2009    public List<StringType> getModification() { 
2010      if (this.modification == null)
2011        this.modification = new ArrayList<StringType>();
2012      return this.modification;
2013    }
2014
2015    /**
2016     * @return Returns a reference to <code>this</code> for easy method chaining
2017     */
2018    public SubstancePolymer setModification(List<StringType> theModification) { 
2019      this.modification = theModification;
2020      return this;
2021    }
2022
2023    public boolean hasModification() { 
2024      if (this.modification == null)
2025        return false;
2026      for (StringType item : this.modification)
2027        if (!item.isEmpty())
2028          return true;
2029      return false;
2030    }
2031
2032    /**
2033     * @return {@link #modification} (Todo.)
2034     */
2035    public StringType addModificationElement() {//2 
2036      StringType t = new StringType();
2037      if (this.modification == null)
2038        this.modification = new ArrayList<StringType>();
2039      this.modification.add(t);
2040      return t;
2041    }
2042
2043    /**
2044     * @param value {@link #modification} (Todo.)
2045     */
2046    public SubstancePolymer addModification(String value) { //1
2047      StringType t = new StringType();
2048      t.setValue(value);
2049      if (this.modification == null)
2050        this.modification = new ArrayList<StringType>();
2051      this.modification.add(t);
2052      return this;
2053    }
2054
2055    /**
2056     * @param value {@link #modification} (Todo.)
2057     */
2058    public boolean hasModification(String value) { 
2059      if (this.modification == null)
2060        return false;
2061      for (StringType v : this.modification)
2062        if (v.getValue().equals(value)) // string
2063          return true;
2064      return false;
2065    }
2066
2067    /**
2068     * @return {@link #monomerSet} (Todo.)
2069     */
2070    public List<SubstancePolymerMonomerSetComponent> getMonomerSet() { 
2071      if (this.monomerSet == null)
2072        this.monomerSet = new ArrayList<SubstancePolymerMonomerSetComponent>();
2073      return this.monomerSet;
2074    }
2075
2076    /**
2077     * @return Returns a reference to <code>this</code> for easy method chaining
2078     */
2079    public SubstancePolymer setMonomerSet(List<SubstancePolymerMonomerSetComponent> theMonomerSet) { 
2080      this.monomerSet = theMonomerSet;
2081      return this;
2082    }
2083
2084    public boolean hasMonomerSet() { 
2085      if (this.monomerSet == null)
2086        return false;
2087      for (SubstancePolymerMonomerSetComponent item : this.monomerSet)
2088        if (!item.isEmpty())
2089          return true;
2090      return false;
2091    }
2092
2093    public SubstancePolymerMonomerSetComponent addMonomerSet() { //3
2094      SubstancePolymerMonomerSetComponent t = new SubstancePolymerMonomerSetComponent();
2095      if (this.monomerSet == null)
2096        this.monomerSet = new ArrayList<SubstancePolymerMonomerSetComponent>();
2097      this.monomerSet.add(t);
2098      return t;
2099    }
2100
2101    public SubstancePolymer addMonomerSet(SubstancePolymerMonomerSetComponent t) { //3
2102      if (t == null)
2103        return this;
2104      if (this.monomerSet == null)
2105        this.monomerSet = new ArrayList<SubstancePolymerMonomerSetComponent>();
2106      this.monomerSet.add(t);
2107      return this;
2108    }
2109
2110    /**
2111     * @return The first repetition of repeating field {@link #monomerSet}, creating it if it does not already exist
2112     */
2113    public SubstancePolymerMonomerSetComponent getMonomerSetFirstRep() { 
2114      if (getMonomerSet().isEmpty()) {
2115        addMonomerSet();
2116      }
2117      return getMonomerSet().get(0);
2118    }
2119
2120    /**
2121     * @return {@link #repeat} (Todo.)
2122     */
2123    public List<SubstancePolymerRepeatComponent> getRepeat() { 
2124      if (this.repeat == null)
2125        this.repeat = new ArrayList<SubstancePolymerRepeatComponent>();
2126      return this.repeat;
2127    }
2128
2129    /**
2130     * @return Returns a reference to <code>this</code> for easy method chaining
2131     */
2132    public SubstancePolymer setRepeat(List<SubstancePolymerRepeatComponent> theRepeat) { 
2133      this.repeat = theRepeat;
2134      return this;
2135    }
2136
2137    public boolean hasRepeat() { 
2138      if (this.repeat == null)
2139        return false;
2140      for (SubstancePolymerRepeatComponent item : this.repeat)
2141        if (!item.isEmpty())
2142          return true;
2143      return false;
2144    }
2145
2146    public SubstancePolymerRepeatComponent addRepeat() { //3
2147      SubstancePolymerRepeatComponent t = new SubstancePolymerRepeatComponent();
2148      if (this.repeat == null)
2149        this.repeat = new ArrayList<SubstancePolymerRepeatComponent>();
2150      this.repeat.add(t);
2151      return t;
2152    }
2153
2154    public SubstancePolymer addRepeat(SubstancePolymerRepeatComponent t) { //3
2155      if (t == null)
2156        return this;
2157      if (this.repeat == null)
2158        this.repeat = new ArrayList<SubstancePolymerRepeatComponent>();
2159      this.repeat.add(t);
2160      return this;
2161    }
2162
2163    /**
2164     * @return The first repetition of repeating field {@link #repeat}, creating it if it does not already exist
2165     */
2166    public SubstancePolymerRepeatComponent getRepeatFirstRep() { 
2167      if (getRepeat().isEmpty()) {
2168        addRepeat();
2169      }
2170      return getRepeat().get(0);
2171    }
2172
2173      protected void listChildren(List<Property> children) {
2174        super.listChildren(children);
2175        children.add(new Property("class", "CodeableConcept", "Todo.", 0, 1, class_));
2176        children.add(new Property("geometry", "CodeableConcept", "Todo.", 0, 1, geometry));
2177        children.add(new Property("copolymerConnectivity", "CodeableConcept", "Todo.", 0, java.lang.Integer.MAX_VALUE, copolymerConnectivity));
2178        children.add(new Property("modification", "string", "Todo.", 0, java.lang.Integer.MAX_VALUE, modification));
2179        children.add(new Property("monomerSet", "", "Todo.", 0, java.lang.Integer.MAX_VALUE, monomerSet));
2180        children.add(new Property("repeat", "", "Todo.", 0, java.lang.Integer.MAX_VALUE, repeat));
2181      }
2182
2183      @Override
2184      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2185        switch (_hash) {
2186        case 94742904: /*class*/  return new Property("class", "CodeableConcept", "Todo.", 0, 1, class_);
2187        case 1846020210: /*geometry*/  return new Property("geometry", "CodeableConcept", "Todo.", 0, 1, geometry);
2188        case 997107577: /*copolymerConnectivity*/  return new Property("copolymerConnectivity", "CodeableConcept", "Todo.", 0, java.lang.Integer.MAX_VALUE, copolymerConnectivity);
2189        case -684600932: /*modification*/  return new Property("modification", "string", "Todo.", 0, java.lang.Integer.MAX_VALUE, modification);
2190        case -1622483765: /*monomerSet*/  return new Property("monomerSet", "", "Todo.", 0, java.lang.Integer.MAX_VALUE, monomerSet);
2191        case -934531685: /*repeat*/  return new Property("repeat", "", "Todo.", 0, java.lang.Integer.MAX_VALUE, repeat);
2192        default: return super.getNamedProperty(_hash, _name, _checkValid);
2193        }
2194
2195      }
2196
2197      @Override
2198      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2199        switch (hash) {
2200        case 94742904: /*class*/ return this.class_ == null ? new Base[0] : new Base[] {this.class_}; // CodeableConcept
2201        case 1846020210: /*geometry*/ return this.geometry == null ? new Base[0] : new Base[] {this.geometry}; // CodeableConcept
2202        case 997107577: /*copolymerConnectivity*/ return this.copolymerConnectivity == null ? new Base[0] : this.copolymerConnectivity.toArray(new Base[this.copolymerConnectivity.size()]); // CodeableConcept
2203        case -684600932: /*modification*/ return this.modification == null ? new Base[0] : this.modification.toArray(new Base[this.modification.size()]); // StringType
2204        case -1622483765: /*monomerSet*/ return this.monomerSet == null ? new Base[0] : this.monomerSet.toArray(new Base[this.monomerSet.size()]); // SubstancePolymerMonomerSetComponent
2205        case -934531685: /*repeat*/ return this.repeat == null ? new Base[0] : this.repeat.toArray(new Base[this.repeat.size()]); // SubstancePolymerRepeatComponent
2206        default: return super.getProperty(hash, name, checkValid);
2207        }
2208
2209      }
2210
2211      @Override
2212      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2213        switch (hash) {
2214        case 94742904: // class
2215          this.class_ = castToCodeableConcept(value); // CodeableConcept
2216          return value;
2217        case 1846020210: // geometry
2218          this.geometry = castToCodeableConcept(value); // CodeableConcept
2219          return value;
2220        case 997107577: // copolymerConnectivity
2221          this.getCopolymerConnectivity().add(castToCodeableConcept(value)); // CodeableConcept
2222          return value;
2223        case -684600932: // modification
2224          this.getModification().add(castToString(value)); // StringType
2225          return value;
2226        case -1622483765: // monomerSet
2227          this.getMonomerSet().add((SubstancePolymerMonomerSetComponent) value); // SubstancePolymerMonomerSetComponent
2228          return value;
2229        case -934531685: // repeat
2230          this.getRepeat().add((SubstancePolymerRepeatComponent) value); // SubstancePolymerRepeatComponent
2231          return value;
2232        default: return super.setProperty(hash, name, value);
2233        }
2234
2235      }
2236
2237      @Override
2238      public Base setProperty(String name, Base value) throws FHIRException {
2239        if (name.equals("class")) {
2240          this.class_ = castToCodeableConcept(value); // CodeableConcept
2241        } else if (name.equals("geometry")) {
2242          this.geometry = castToCodeableConcept(value); // CodeableConcept
2243        } else if (name.equals("copolymerConnectivity")) {
2244          this.getCopolymerConnectivity().add(castToCodeableConcept(value));
2245        } else if (name.equals("modification")) {
2246          this.getModification().add(castToString(value));
2247        } else if (name.equals("monomerSet")) {
2248          this.getMonomerSet().add((SubstancePolymerMonomerSetComponent) value);
2249        } else if (name.equals("repeat")) {
2250          this.getRepeat().add((SubstancePolymerRepeatComponent) value);
2251        } else
2252          return super.setProperty(name, value);
2253        return value;
2254      }
2255
2256      @Override
2257      public Base makeProperty(int hash, String name) throws FHIRException {
2258        switch (hash) {
2259        case 94742904:  return getClass_(); 
2260        case 1846020210:  return getGeometry(); 
2261        case 997107577:  return addCopolymerConnectivity(); 
2262        case -684600932:  return addModificationElement();
2263        case -1622483765:  return addMonomerSet(); 
2264        case -934531685:  return addRepeat(); 
2265        default: return super.makeProperty(hash, name);
2266        }
2267
2268      }
2269
2270      @Override
2271      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2272        switch (hash) {
2273        case 94742904: /*class*/ return new String[] {"CodeableConcept"};
2274        case 1846020210: /*geometry*/ return new String[] {"CodeableConcept"};
2275        case 997107577: /*copolymerConnectivity*/ return new String[] {"CodeableConcept"};
2276        case -684600932: /*modification*/ return new String[] {"string"};
2277        case -1622483765: /*monomerSet*/ return new String[] {};
2278        case -934531685: /*repeat*/ return new String[] {};
2279        default: return super.getTypesForProperty(hash, name);
2280        }
2281
2282      }
2283
2284      @Override
2285      public Base addChild(String name) throws FHIRException {
2286        if (name.equals("class")) {
2287          this.class_ = new CodeableConcept();
2288          return this.class_;
2289        }
2290        else if (name.equals("geometry")) {
2291          this.geometry = new CodeableConcept();
2292          return this.geometry;
2293        }
2294        else if (name.equals("copolymerConnectivity")) {
2295          return addCopolymerConnectivity();
2296        }
2297        else if (name.equals("modification")) {
2298          throw new FHIRException("Cannot call addChild on a primitive type SubstancePolymer.modification");
2299        }
2300        else if (name.equals("monomerSet")) {
2301          return addMonomerSet();
2302        }
2303        else if (name.equals("repeat")) {
2304          return addRepeat();
2305        }
2306        else
2307          return super.addChild(name);
2308      }
2309
2310  public String fhirType() {
2311    return "SubstancePolymer";
2312
2313  }
2314
2315      public SubstancePolymer copy() {
2316        SubstancePolymer dst = new SubstancePolymer();
2317        copyValues(dst);
2318        dst.class_ = class_ == null ? null : class_.copy();
2319        dst.geometry = geometry == null ? null : geometry.copy();
2320        if (copolymerConnectivity != null) {
2321          dst.copolymerConnectivity = new ArrayList<CodeableConcept>();
2322          for (CodeableConcept i : copolymerConnectivity)
2323            dst.copolymerConnectivity.add(i.copy());
2324        };
2325        if (modification != null) {
2326          dst.modification = new ArrayList<StringType>();
2327          for (StringType i : modification)
2328            dst.modification.add(i.copy());
2329        };
2330        if (monomerSet != null) {
2331          dst.monomerSet = new ArrayList<SubstancePolymerMonomerSetComponent>();
2332          for (SubstancePolymerMonomerSetComponent i : monomerSet)
2333            dst.monomerSet.add(i.copy());
2334        };
2335        if (repeat != null) {
2336          dst.repeat = new ArrayList<SubstancePolymerRepeatComponent>();
2337          for (SubstancePolymerRepeatComponent i : repeat)
2338            dst.repeat.add(i.copy());
2339        };
2340        return dst;
2341      }
2342
2343      protected SubstancePolymer typedCopy() {
2344        return copy();
2345      }
2346
2347      @Override
2348      public boolean equalsDeep(Base other_) {
2349        if (!super.equalsDeep(other_))
2350          return false;
2351        if (!(other_ instanceof SubstancePolymer))
2352          return false;
2353        SubstancePolymer o = (SubstancePolymer) other_;
2354        return compareDeep(class_, o.class_, true) && compareDeep(geometry, o.geometry, true) && compareDeep(copolymerConnectivity, o.copolymerConnectivity, true)
2355           && compareDeep(modification, o.modification, true) && compareDeep(monomerSet, o.monomerSet, true)
2356           && compareDeep(repeat, o.repeat, true);
2357      }
2358
2359      @Override
2360      public boolean equalsShallow(Base other_) {
2361        if (!super.equalsShallow(other_))
2362          return false;
2363        if (!(other_ instanceof SubstancePolymer))
2364          return false;
2365        SubstancePolymer o = (SubstancePolymer) other_;
2366        return compareValues(modification, o.modification, true);
2367      }
2368
2369      public boolean isEmpty() {
2370        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(class_, geometry, copolymerConnectivity
2371          , modification, monomerSet, repeat);
2372      }
2373
2374  @Override
2375  public ResourceType getResourceType() {
2376    return ResourceType.SubstancePolymer;
2377   }
2378
2379
2380}
2381