001package org.hl7.fhir.r4.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034
035// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
036
037import java.util.*;
038
039import ca.uhn.fhir.model.api.annotation.ResourceDef;
040import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
041import ca.uhn.fhir.model.api.annotation.Child;
042import ca.uhn.fhir.model.api.annotation.ChildOrder;
043import ca.uhn.fhir.model.api.annotation.Description;
044import ca.uhn.fhir.model.api.annotation.Block;
045import org.hl7.fhir.instance.model.api.*;
046import org.hl7.fhir.exceptions.FHIRException;
047/**
048 * The manufactured item as contained in the packaged medicinal product.
049 */
050@ResourceDef(name="MedicinalProductManufactured", profile="http://hl7.org/fhir/StructureDefinition/MedicinalProductManufactured")
051public class MedicinalProductManufactured extends DomainResource {
052
053    /**
054     * Dose form as manufactured and before any transformation into the pharmaceutical product.
055     */
056    @Child(name = "manufacturedDoseForm", type = {CodeableConcept.class}, order=0, min=1, max=1, modifier=false, summary=true)
057    @Description(shortDefinition="Dose form as manufactured and before any transformation into the pharmaceutical product", formalDefinition="Dose form as manufactured and before any transformation into the pharmaceutical product." )
058    protected CodeableConcept manufacturedDoseForm;
059
060    /**
061     * The “real world” units in which the quantity of the manufactured item is described.
062     */
063    @Child(name = "unitOfPresentation", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
064    @Description(shortDefinition="The “real world” units in which the quantity of the manufactured item is described", formalDefinition="The “real world” units in which the quantity of the manufactured item is described." )
065    protected CodeableConcept unitOfPresentation;
066
067    /**
068     * The quantity or "count number" of the manufactured item.
069     */
070    @Child(name = "quantity", type = {Quantity.class}, order=2, min=1, max=1, modifier=false, summary=true)
071    @Description(shortDefinition="The quantity or \"count number\" of the manufactured item", formalDefinition="The quantity or \"count number\" of the manufactured item." )
072    protected Quantity quantity;
073
074    /**
075     * Manufacturer of the item (Note that this should be named "manufacturer" but it currently causes technical issues).
076     */
077    @Child(name = "manufacturer", type = {Organization.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
078    @Description(shortDefinition="Manufacturer of the item (Note that this should be named \"manufacturer\" but it currently causes technical issues)", formalDefinition="Manufacturer of the item (Note that this should be named \"manufacturer\" but it currently causes technical issues)." )
079    protected List<Reference> manufacturer;
080    /**
081     * The actual objects that are the target of the reference (Manufacturer of the item (Note that this should be named "manufacturer" but it currently causes technical issues).)
082     */
083    protected List<Organization> manufacturerTarget;
084
085
086    /**
087     * Ingredient.
088     */
089    @Child(name = "ingredient", type = {MedicinalProductIngredient.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
090    @Description(shortDefinition="Ingredient", formalDefinition="Ingredient." )
091    protected List<Reference> ingredient;
092    /**
093     * The actual objects that are the target of the reference (Ingredient.)
094     */
095    protected List<MedicinalProductIngredient> ingredientTarget;
096
097
098    /**
099     * Dimensions, color etc.
100     */
101    @Child(name = "physicalCharacteristics", type = {ProdCharacteristic.class}, order=5, min=0, max=1, modifier=false, summary=true)
102    @Description(shortDefinition="Dimensions, color etc.", formalDefinition="Dimensions, color etc." )
103    protected ProdCharacteristic physicalCharacteristics;
104
105    /**
106     * Other codeable characteristics.
107     */
108    @Child(name = "otherCharacteristics", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
109    @Description(shortDefinition="Other codeable characteristics", formalDefinition="Other codeable characteristics." )
110    protected List<CodeableConcept> otherCharacteristics;
111
112    private static final long serialVersionUID = 623073384L;
113
114  /**
115   * Constructor
116   */
117    public MedicinalProductManufactured() {
118      super();
119    }
120
121  /**
122   * Constructor
123   */
124    public MedicinalProductManufactured(CodeableConcept manufacturedDoseForm, Quantity quantity) {
125      super();
126      this.manufacturedDoseForm = manufacturedDoseForm;
127      this.quantity = quantity;
128    }
129
130    /**
131     * @return {@link #manufacturedDoseForm} (Dose form as manufactured and before any transformation into the pharmaceutical product.)
132     */
133    public CodeableConcept getManufacturedDoseForm() { 
134      if (this.manufacturedDoseForm == null)
135        if (Configuration.errorOnAutoCreate())
136          throw new Error("Attempt to auto-create MedicinalProductManufactured.manufacturedDoseForm");
137        else if (Configuration.doAutoCreate())
138          this.manufacturedDoseForm = new CodeableConcept(); // cc
139      return this.manufacturedDoseForm;
140    }
141
142    public boolean hasManufacturedDoseForm() { 
143      return this.manufacturedDoseForm != null && !this.manufacturedDoseForm.isEmpty();
144    }
145
146    /**
147     * @param value {@link #manufacturedDoseForm} (Dose form as manufactured and before any transformation into the pharmaceutical product.)
148     */
149    public MedicinalProductManufactured setManufacturedDoseForm(CodeableConcept value) { 
150      this.manufacturedDoseForm = value;
151      return this;
152    }
153
154    /**
155     * @return {@link #unitOfPresentation} (The “real world” units in which the quantity of the manufactured item is described.)
156     */
157    public CodeableConcept getUnitOfPresentation() { 
158      if (this.unitOfPresentation == null)
159        if (Configuration.errorOnAutoCreate())
160          throw new Error("Attempt to auto-create MedicinalProductManufactured.unitOfPresentation");
161        else if (Configuration.doAutoCreate())
162          this.unitOfPresentation = new CodeableConcept(); // cc
163      return this.unitOfPresentation;
164    }
165
166    public boolean hasUnitOfPresentation() { 
167      return this.unitOfPresentation != null && !this.unitOfPresentation.isEmpty();
168    }
169
170    /**
171     * @param value {@link #unitOfPresentation} (The “real world” units in which the quantity of the manufactured item is described.)
172     */
173    public MedicinalProductManufactured setUnitOfPresentation(CodeableConcept value) { 
174      this.unitOfPresentation = value;
175      return this;
176    }
177
178    /**
179     * @return {@link #quantity} (The quantity or "count number" of the manufactured item.)
180     */
181    public Quantity getQuantity() { 
182      if (this.quantity == null)
183        if (Configuration.errorOnAutoCreate())
184          throw new Error("Attempt to auto-create MedicinalProductManufactured.quantity");
185        else if (Configuration.doAutoCreate())
186          this.quantity = new Quantity(); // cc
187      return this.quantity;
188    }
189
190    public boolean hasQuantity() { 
191      return this.quantity != null && !this.quantity.isEmpty();
192    }
193
194    /**
195     * @param value {@link #quantity} (The quantity or "count number" of the manufactured item.)
196     */
197    public MedicinalProductManufactured setQuantity(Quantity value) { 
198      this.quantity = value;
199      return this;
200    }
201
202    /**
203     * @return {@link #manufacturer} (Manufacturer of the item (Note that this should be named "manufacturer" but it currently causes technical issues).)
204     */
205    public List<Reference> getManufacturer() { 
206      if (this.manufacturer == null)
207        this.manufacturer = new ArrayList<Reference>();
208      return this.manufacturer;
209    }
210
211    /**
212     * @return Returns a reference to <code>this</code> for easy method chaining
213     */
214    public MedicinalProductManufactured setManufacturer(List<Reference> theManufacturer) { 
215      this.manufacturer = theManufacturer;
216      return this;
217    }
218
219    public boolean hasManufacturer() { 
220      if (this.manufacturer == null)
221        return false;
222      for (Reference item : this.manufacturer)
223        if (!item.isEmpty())
224          return true;
225      return false;
226    }
227
228    public Reference addManufacturer() { //3
229      Reference t = new Reference();
230      if (this.manufacturer == null)
231        this.manufacturer = new ArrayList<Reference>();
232      this.manufacturer.add(t);
233      return t;
234    }
235
236    public MedicinalProductManufactured addManufacturer(Reference t) { //3
237      if (t == null)
238        return this;
239      if (this.manufacturer == null)
240        this.manufacturer = new ArrayList<Reference>();
241      this.manufacturer.add(t);
242      return this;
243    }
244
245    /**
246     * @return The first repetition of repeating field {@link #manufacturer}, creating it if it does not already exist
247     */
248    public Reference getManufacturerFirstRep() { 
249      if (getManufacturer().isEmpty()) {
250        addManufacturer();
251      }
252      return getManufacturer().get(0);
253    }
254
255    /**
256     * @deprecated Use Reference#setResource(IBaseResource) instead
257     */
258    @Deprecated
259    public List<Organization> getManufacturerTarget() { 
260      if (this.manufacturerTarget == null)
261        this.manufacturerTarget = new ArrayList<Organization>();
262      return this.manufacturerTarget;
263    }
264
265    /**
266     * @deprecated Use Reference#setResource(IBaseResource) instead
267     */
268    @Deprecated
269    public Organization addManufacturerTarget() { 
270      Organization r = new Organization();
271      if (this.manufacturerTarget == null)
272        this.manufacturerTarget = new ArrayList<Organization>();
273      this.manufacturerTarget.add(r);
274      return r;
275    }
276
277    /**
278     * @return {@link #ingredient} (Ingredient.)
279     */
280    public List<Reference> getIngredient() { 
281      if (this.ingredient == null)
282        this.ingredient = new ArrayList<Reference>();
283      return this.ingredient;
284    }
285
286    /**
287     * @return Returns a reference to <code>this</code> for easy method chaining
288     */
289    public MedicinalProductManufactured setIngredient(List<Reference> theIngredient) { 
290      this.ingredient = theIngredient;
291      return this;
292    }
293
294    public boolean hasIngredient() { 
295      if (this.ingredient == null)
296        return false;
297      for (Reference item : this.ingredient)
298        if (!item.isEmpty())
299          return true;
300      return false;
301    }
302
303    public Reference addIngredient() { //3
304      Reference t = new Reference();
305      if (this.ingredient == null)
306        this.ingredient = new ArrayList<Reference>();
307      this.ingredient.add(t);
308      return t;
309    }
310
311    public MedicinalProductManufactured addIngredient(Reference t) { //3
312      if (t == null)
313        return this;
314      if (this.ingredient == null)
315        this.ingredient = new ArrayList<Reference>();
316      this.ingredient.add(t);
317      return this;
318    }
319
320    /**
321     * @return The first repetition of repeating field {@link #ingredient}, creating it if it does not already exist
322     */
323    public Reference getIngredientFirstRep() { 
324      if (getIngredient().isEmpty()) {
325        addIngredient();
326      }
327      return getIngredient().get(0);
328    }
329
330    /**
331     * @deprecated Use Reference#setResource(IBaseResource) instead
332     */
333    @Deprecated
334    public List<MedicinalProductIngredient> getIngredientTarget() { 
335      if (this.ingredientTarget == null)
336        this.ingredientTarget = new ArrayList<MedicinalProductIngredient>();
337      return this.ingredientTarget;
338    }
339
340    /**
341     * @deprecated Use Reference#setResource(IBaseResource) instead
342     */
343    @Deprecated
344    public MedicinalProductIngredient addIngredientTarget() { 
345      MedicinalProductIngredient r = new MedicinalProductIngredient();
346      if (this.ingredientTarget == null)
347        this.ingredientTarget = new ArrayList<MedicinalProductIngredient>();
348      this.ingredientTarget.add(r);
349      return r;
350    }
351
352    /**
353     * @return {@link #physicalCharacteristics} (Dimensions, color etc.)
354     */
355    public ProdCharacteristic getPhysicalCharacteristics() { 
356      if (this.physicalCharacteristics == null)
357        if (Configuration.errorOnAutoCreate())
358          throw new Error("Attempt to auto-create MedicinalProductManufactured.physicalCharacteristics");
359        else if (Configuration.doAutoCreate())
360          this.physicalCharacteristics = new ProdCharacteristic(); // cc
361      return this.physicalCharacteristics;
362    }
363
364    public boolean hasPhysicalCharacteristics() { 
365      return this.physicalCharacteristics != null && !this.physicalCharacteristics.isEmpty();
366    }
367
368    /**
369     * @param value {@link #physicalCharacteristics} (Dimensions, color etc.)
370     */
371    public MedicinalProductManufactured setPhysicalCharacteristics(ProdCharacteristic value) { 
372      this.physicalCharacteristics = value;
373      return this;
374    }
375
376    /**
377     * @return {@link #otherCharacteristics} (Other codeable characteristics.)
378     */
379    public List<CodeableConcept> getOtherCharacteristics() { 
380      if (this.otherCharacteristics == null)
381        this.otherCharacteristics = new ArrayList<CodeableConcept>();
382      return this.otherCharacteristics;
383    }
384
385    /**
386     * @return Returns a reference to <code>this</code> for easy method chaining
387     */
388    public MedicinalProductManufactured setOtherCharacteristics(List<CodeableConcept> theOtherCharacteristics) { 
389      this.otherCharacteristics = theOtherCharacteristics;
390      return this;
391    }
392
393    public boolean hasOtherCharacteristics() { 
394      if (this.otherCharacteristics == null)
395        return false;
396      for (CodeableConcept item : this.otherCharacteristics)
397        if (!item.isEmpty())
398          return true;
399      return false;
400    }
401
402    public CodeableConcept addOtherCharacteristics() { //3
403      CodeableConcept t = new CodeableConcept();
404      if (this.otherCharacteristics == null)
405        this.otherCharacteristics = new ArrayList<CodeableConcept>();
406      this.otherCharacteristics.add(t);
407      return t;
408    }
409
410    public MedicinalProductManufactured addOtherCharacteristics(CodeableConcept t) { //3
411      if (t == null)
412        return this;
413      if (this.otherCharacteristics == null)
414        this.otherCharacteristics = new ArrayList<CodeableConcept>();
415      this.otherCharacteristics.add(t);
416      return this;
417    }
418
419    /**
420     * @return The first repetition of repeating field {@link #otherCharacteristics}, creating it if it does not already exist
421     */
422    public CodeableConcept getOtherCharacteristicsFirstRep() { 
423      if (getOtherCharacteristics().isEmpty()) {
424        addOtherCharacteristics();
425      }
426      return getOtherCharacteristics().get(0);
427    }
428
429      protected void listChildren(List<Property> children) {
430        super.listChildren(children);
431        children.add(new Property("manufacturedDoseForm", "CodeableConcept", "Dose form as manufactured and before any transformation into the pharmaceutical product.", 0, 1, manufacturedDoseForm));
432        children.add(new Property("unitOfPresentation", "CodeableConcept", "The “real world” units in which the quantity of the manufactured item is described.", 0, 1, unitOfPresentation));
433        children.add(new Property("quantity", "Quantity", "The quantity or \"count number\" of the manufactured item.", 0, 1, quantity));
434        children.add(new Property("manufacturer", "Reference(Organization)", "Manufacturer of the item (Note that this should be named \"manufacturer\" but it currently causes technical issues).", 0, java.lang.Integer.MAX_VALUE, manufacturer));
435        children.add(new Property("ingredient", "Reference(MedicinalProductIngredient)", "Ingredient.", 0, java.lang.Integer.MAX_VALUE, ingredient));
436        children.add(new Property("physicalCharacteristics", "ProdCharacteristic", "Dimensions, color etc.", 0, 1, physicalCharacteristics));
437        children.add(new Property("otherCharacteristics", "CodeableConcept", "Other codeable characteristics.", 0, java.lang.Integer.MAX_VALUE, otherCharacteristics));
438      }
439
440      @Override
441      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
442        switch (_hash) {
443        case -1451400348: /*manufacturedDoseForm*/  return new Property("manufacturedDoseForm", "CodeableConcept", "Dose form as manufactured and before any transformation into the pharmaceutical product.", 0, 1, manufacturedDoseForm);
444        case -1427765963: /*unitOfPresentation*/  return new Property("unitOfPresentation", "CodeableConcept", "The “real world” units in which the quantity of the manufactured item is described.", 0, 1, unitOfPresentation);
445        case -1285004149: /*quantity*/  return new Property("quantity", "Quantity", "The quantity or \"count number\" of the manufactured item.", 0, 1, quantity);
446        case -1969347631: /*manufacturer*/  return new Property("manufacturer", "Reference(Organization)", "Manufacturer of the item (Note that this should be named \"manufacturer\" but it currently causes technical issues).", 0, java.lang.Integer.MAX_VALUE, manufacturer);
447        case -206409263: /*ingredient*/  return new Property("ingredient", "Reference(MedicinalProductIngredient)", "Ingredient.", 0, java.lang.Integer.MAX_VALUE, ingredient);
448        case -1599676319: /*physicalCharacteristics*/  return new Property("physicalCharacteristics", "ProdCharacteristic", "Dimensions, color etc.", 0, 1, physicalCharacteristics);
449        case 722135304: /*otherCharacteristics*/  return new Property("otherCharacteristics", "CodeableConcept", "Other codeable characteristics.", 0, java.lang.Integer.MAX_VALUE, otherCharacteristics);
450        default: return super.getNamedProperty(_hash, _name, _checkValid);
451        }
452
453      }
454
455      @Override
456      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
457        switch (hash) {
458        case -1451400348: /*manufacturedDoseForm*/ return this.manufacturedDoseForm == null ? new Base[0] : new Base[] {this.manufacturedDoseForm}; // CodeableConcept
459        case -1427765963: /*unitOfPresentation*/ return this.unitOfPresentation == null ? new Base[0] : new Base[] {this.unitOfPresentation}; // CodeableConcept
460        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity
461        case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : this.manufacturer.toArray(new Base[this.manufacturer.size()]); // Reference
462        case -206409263: /*ingredient*/ return this.ingredient == null ? new Base[0] : this.ingredient.toArray(new Base[this.ingredient.size()]); // Reference
463        case -1599676319: /*physicalCharacteristics*/ return this.physicalCharacteristics == null ? new Base[0] : new Base[] {this.physicalCharacteristics}; // ProdCharacteristic
464        case 722135304: /*otherCharacteristics*/ return this.otherCharacteristics == null ? new Base[0] : this.otherCharacteristics.toArray(new Base[this.otherCharacteristics.size()]); // CodeableConcept
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 -1451400348: // manufacturedDoseForm
474          this.manufacturedDoseForm = castToCodeableConcept(value); // CodeableConcept
475          return value;
476        case -1427765963: // unitOfPresentation
477          this.unitOfPresentation = castToCodeableConcept(value); // CodeableConcept
478          return value;
479        case -1285004149: // quantity
480          this.quantity = castToQuantity(value); // Quantity
481          return value;
482        case -1969347631: // manufacturer
483          this.getManufacturer().add(castToReference(value)); // Reference
484          return value;
485        case -206409263: // ingredient
486          this.getIngredient().add(castToReference(value)); // Reference
487          return value;
488        case -1599676319: // physicalCharacteristics
489          this.physicalCharacteristics = castToProdCharacteristic(value); // ProdCharacteristic
490          return value;
491        case 722135304: // otherCharacteristics
492          this.getOtherCharacteristics().add(castToCodeableConcept(value)); // CodeableConcept
493          return value;
494        default: return super.setProperty(hash, name, value);
495        }
496
497      }
498
499      @Override
500      public Base setProperty(String name, Base value) throws FHIRException {
501        if (name.equals("manufacturedDoseForm")) {
502          this.manufacturedDoseForm = castToCodeableConcept(value); // CodeableConcept
503        } else if (name.equals("unitOfPresentation")) {
504          this.unitOfPresentation = castToCodeableConcept(value); // CodeableConcept
505        } else if (name.equals("quantity")) {
506          this.quantity = castToQuantity(value); // Quantity
507        } else if (name.equals("manufacturer")) {
508          this.getManufacturer().add(castToReference(value));
509        } else if (name.equals("ingredient")) {
510          this.getIngredient().add(castToReference(value));
511        } else if (name.equals("physicalCharacteristics")) {
512          this.physicalCharacteristics = castToProdCharacteristic(value); // ProdCharacteristic
513        } else if (name.equals("otherCharacteristics")) {
514          this.getOtherCharacteristics().add(castToCodeableConcept(value));
515        } else
516          return super.setProperty(name, value);
517        return value;
518      }
519
520      @Override
521      public Base makeProperty(int hash, String name) throws FHIRException {
522        switch (hash) {
523        case -1451400348:  return getManufacturedDoseForm(); 
524        case -1427765963:  return getUnitOfPresentation(); 
525        case -1285004149:  return getQuantity(); 
526        case -1969347631:  return addManufacturer(); 
527        case -206409263:  return addIngredient(); 
528        case -1599676319:  return getPhysicalCharacteristics(); 
529        case 722135304:  return addOtherCharacteristics(); 
530        default: return super.makeProperty(hash, name);
531        }
532
533      }
534
535      @Override
536      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
537        switch (hash) {
538        case -1451400348: /*manufacturedDoseForm*/ return new String[] {"CodeableConcept"};
539        case -1427765963: /*unitOfPresentation*/ return new String[] {"CodeableConcept"};
540        case -1285004149: /*quantity*/ return new String[] {"Quantity"};
541        case -1969347631: /*manufacturer*/ return new String[] {"Reference"};
542        case -206409263: /*ingredient*/ return new String[] {"Reference"};
543        case -1599676319: /*physicalCharacteristics*/ return new String[] {"ProdCharacteristic"};
544        case 722135304: /*otherCharacteristics*/ return new String[] {"CodeableConcept"};
545        default: return super.getTypesForProperty(hash, name);
546        }
547
548      }
549
550      @Override
551      public Base addChild(String name) throws FHIRException {
552        if (name.equals("manufacturedDoseForm")) {
553          this.manufacturedDoseForm = new CodeableConcept();
554          return this.manufacturedDoseForm;
555        }
556        else if (name.equals("unitOfPresentation")) {
557          this.unitOfPresentation = new CodeableConcept();
558          return this.unitOfPresentation;
559        }
560        else if (name.equals("quantity")) {
561          this.quantity = new Quantity();
562          return this.quantity;
563        }
564        else if (name.equals("manufacturer")) {
565          return addManufacturer();
566        }
567        else if (name.equals("ingredient")) {
568          return addIngredient();
569        }
570        else if (name.equals("physicalCharacteristics")) {
571          this.physicalCharacteristics = new ProdCharacteristic();
572          return this.physicalCharacteristics;
573        }
574        else if (name.equals("otherCharacteristics")) {
575          return addOtherCharacteristics();
576        }
577        else
578          return super.addChild(name);
579      }
580
581  public String fhirType() {
582    return "MedicinalProductManufactured";
583
584  }
585
586      public MedicinalProductManufactured copy() {
587        MedicinalProductManufactured dst = new MedicinalProductManufactured();
588        copyValues(dst);
589        return dst;
590      }
591
592      public void copyValues(MedicinalProductManufactured dst) {
593        super.copyValues(dst);
594        dst.manufacturedDoseForm = manufacturedDoseForm == null ? null : manufacturedDoseForm.copy();
595        dst.unitOfPresentation = unitOfPresentation == null ? null : unitOfPresentation.copy();
596        dst.quantity = quantity == null ? null : quantity.copy();
597        if (manufacturer != null) {
598          dst.manufacturer = new ArrayList<Reference>();
599          for (Reference i : manufacturer)
600            dst.manufacturer.add(i.copy());
601        };
602        if (ingredient != null) {
603          dst.ingredient = new ArrayList<Reference>();
604          for (Reference i : ingredient)
605            dst.ingredient.add(i.copy());
606        };
607        dst.physicalCharacteristics = physicalCharacteristics == null ? null : physicalCharacteristics.copy();
608        if (otherCharacteristics != null) {
609          dst.otherCharacteristics = new ArrayList<CodeableConcept>();
610          for (CodeableConcept i : otherCharacteristics)
611            dst.otherCharacteristics.add(i.copy());
612        };
613      }
614
615      protected MedicinalProductManufactured typedCopy() {
616        return copy();
617      }
618
619      @Override
620      public boolean equalsDeep(Base other_) {
621        if (!super.equalsDeep(other_))
622          return false;
623        if (!(other_ instanceof MedicinalProductManufactured))
624          return false;
625        MedicinalProductManufactured o = (MedicinalProductManufactured) other_;
626        return compareDeep(manufacturedDoseForm, o.manufacturedDoseForm, true) && compareDeep(unitOfPresentation, o.unitOfPresentation, true)
627           && compareDeep(quantity, o.quantity, true) && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(ingredient, o.ingredient, true)
628           && compareDeep(physicalCharacteristics, o.physicalCharacteristics, true) && compareDeep(otherCharacteristics, o.otherCharacteristics, true)
629          ;
630      }
631
632      @Override
633      public boolean equalsShallow(Base other_) {
634        if (!super.equalsShallow(other_))
635          return false;
636        if (!(other_ instanceof MedicinalProductManufactured))
637          return false;
638        MedicinalProductManufactured o = (MedicinalProductManufactured) other_;
639        return true;
640      }
641
642      public boolean isEmpty() {
643        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(manufacturedDoseForm, unitOfPresentation
644          , quantity, manufacturer, ingredient, physicalCharacteristics, otherCharacteristics
645          );
646      }
647
648  @Override
649  public ResourceType getResourceType() {
650    return ResourceType.MedicinalProductManufactured;
651   }
652
653
654}