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