001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Fri, Jul 15, 2022 11:20+1000 for FHIR v5.0.0-snapshot2
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * A medically related item or items, in a container or package.
052 */
053@ResourceDef(name="PackagedProductDefinition", profile="http://hl7.org/fhir/StructureDefinition/PackagedProductDefinition")
054public class PackagedProductDefinition extends DomainResource {
055
056    @Block()
057    public static class PackagedProductDefinitionLegalStatusOfSupplyComponent extends BackboneElement implements IBaseBackboneElement {
058        /**
059         * The actual status of supply. Conveys in what situation this package type may be supplied for use.
060         */
061        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
062        @Description(shortDefinition="The actual status of supply. In what situation this package type may be supplied for use", formalDefinition="The actual status of supply. Conveys in what situation this package type may be supplied for use." )
063        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/legal-status-of-supply")
064        protected CodeableConcept code;
065
066        /**
067         * The place where the legal status of supply applies. When not specified, this indicates it is unknown in this context.
068         */
069        @Child(name = "jurisdiction", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
070        @Description(shortDefinition="The place where the legal status of supply applies", formalDefinition="The place where the legal status of supply applies. When not specified, this indicates it is unknown in this context." )
071        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/jurisdiction")
072        protected CodeableConcept jurisdiction;
073
074        private static final long serialVersionUID = 1072410156L;
075
076    /**
077     * Constructor
078     */
079      public PackagedProductDefinitionLegalStatusOfSupplyComponent() {
080        super();
081      }
082
083        /**
084         * @return {@link #code} (The actual status of supply. Conveys in what situation this package type may be supplied for use.)
085         */
086        public CodeableConcept getCode() { 
087          if (this.code == null)
088            if (Configuration.errorOnAutoCreate())
089              throw new Error("Attempt to auto-create PackagedProductDefinitionLegalStatusOfSupplyComponent.code");
090            else if (Configuration.doAutoCreate())
091              this.code = new CodeableConcept(); // cc
092          return this.code;
093        }
094
095        public boolean hasCode() { 
096          return this.code != null && !this.code.isEmpty();
097        }
098
099        /**
100         * @param value {@link #code} (The actual status of supply. Conveys in what situation this package type may be supplied for use.)
101         */
102        public PackagedProductDefinitionLegalStatusOfSupplyComponent setCode(CodeableConcept value) { 
103          this.code = value;
104          return this;
105        }
106
107        /**
108         * @return {@link #jurisdiction} (The place where the legal status of supply applies. When not specified, this indicates it is unknown in this context.)
109         */
110        public CodeableConcept getJurisdiction() { 
111          if (this.jurisdiction == null)
112            if (Configuration.errorOnAutoCreate())
113              throw new Error("Attempt to auto-create PackagedProductDefinitionLegalStatusOfSupplyComponent.jurisdiction");
114            else if (Configuration.doAutoCreate())
115              this.jurisdiction = new CodeableConcept(); // cc
116          return this.jurisdiction;
117        }
118
119        public boolean hasJurisdiction() { 
120          return this.jurisdiction != null && !this.jurisdiction.isEmpty();
121        }
122
123        /**
124         * @param value {@link #jurisdiction} (The place where the legal status of supply applies. When not specified, this indicates it is unknown in this context.)
125         */
126        public PackagedProductDefinitionLegalStatusOfSupplyComponent setJurisdiction(CodeableConcept value) { 
127          this.jurisdiction = value;
128          return this;
129        }
130
131        protected void listChildren(List<Property> children) {
132          super.listChildren(children);
133          children.add(new Property("code", "CodeableConcept", "The actual status of supply. Conveys in what situation this package type may be supplied for use.", 0, 1, code));
134          children.add(new Property("jurisdiction", "CodeableConcept", "The place where the legal status of supply applies. When not specified, this indicates it is unknown in this context.", 0, 1, jurisdiction));
135        }
136
137        @Override
138        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
139          switch (_hash) {
140          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "The actual status of supply. Conveys in what situation this package type may be supplied for use.", 0, 1, code);
141          case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "The place where the legal status of supply applies. When not specified, this indicates it is unknown in this context.", 0, 1, jurisdiction);
142          default: return super.getNamedProperty(_hash, _name, _checkValid);
143          }
144
145        }
146
147      @Override
148      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
149        switch (hash) {
150        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
151        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : new Base[] {this.jurisdiction}; // CodeableConcept
152        default: return super.getProperty(hash, name, checkValid);
153        }
154
155      }
156
157      @Override
158      public Base setProperty(int hash, String name, Base value) throws FHIRException {
159        switch (hash) {
160        case 3059181: // code
161          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
162          return value;
163        case -507075711: // jurisdiction
164          this.jurisdiction = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
165          return value;
166        default: return super.setProperty(hash, name, value);
167        }
168
169      }
170
171      @Override
172      public Base setProperty(String name, Base value) throws FHIRException {
173        if (name.equals("code")) {
174          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
175        } else if (name.equals("jurisdiction")) {
176          this.jurisdiction = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
177        } else
178          return super.setProperty(name, value);
179        return value;
180      }
181
182      @Override
183      public Base makeProperty(int hash, String name) throws FHIRException {
184        switch (hash) {
185        case 3059181:  return getCode();
186        case -507075711:  return getJurisdiction();
187        default: return super.makeProperty(hash, name);
188        }
189
190      }
191
192      @Override
193      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
194        switch (hash) {
195        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
196        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
197        default: return super.getTypesForProperty(hash, name);
198        }
199
200      }
201
202      @Override
203      public Base addChild(String name) throws FHIRException {
204        if (name.equals("code")) {
205          this.code = new CodeableConcept();
206          return this.code;
207        }
208        else if (name.equals("jurisdiction")) {
209          this.jurisdiction = new CodeableConcept();
210          return this.jurisdiction;
211        }
212        else
213          return super.addChild(name);
214      }
215
216      public PackagedProductDefinitionLegalStatusOfSupplyComponent copy() {
217        PackagedProductDefinitionLegalStatusOfSupplyComponent dst = new PackagedProductDefinitionLegalStatusOfSupplyComponent();
218        copyValues(dst);
219        return dst;
220      }
221
222      public void copyValues(PackagedProductDefinitionLegalStatusOfSupplyComponent dst) {
223        super.copyValues(dst);
224        dst.code = code == null ? null : code.copy();
225        dst.jurisdiction = jurisdiction == null ? null : jurisdiction.copy();
226      }
227
228      @Override
229      public boolean equalsDeep(Base other_) {
230        if (!super.equalsDeep(other_))
231          return false;
232        if (!(other_ instanceof PackagedProductDefinitionLegalStatusOfSupplyComponent))
233          return false;
234        PackagedProductDefinitionLegalStatusOfSupplyComponent o = (PackagedProductDefinitionLegalStatusOfSupplyComponent) other_;
235        return compareDeep(code, o.code, true) && compareDeep(jurisdiction, o.jurisdiction, true);
236      }
237
238      @Override
239      public boolean equalsShallow(Base other_) {
240        if (!super.equalsShallow(other_))
241          return false;
242        if (!(other_ instanceof PackagedProductDefinitionLegalStatusOfSupplyComponent))
243          return false;
244        PackagedProductDefinitionLegalStatusOfSupplyComponent o = (PackagedProductDefinitionLegalStatusOfSupplyComponent) other_;
245        return true;
246      }
247
248      public boolean isEmpty() {
249        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, jurisdiction);
250      }
251
252  public String fhirType() {
253    return "PackagedProductDefinition.legalStatusOfSupply";
254
255  }
256
257  }
258
259    @Block()
260    public static class PackagedProductDefinitionPackagingComponent extends BackboneElement implements IBaseBackboneElement {
261        /**
262         * A business identifier that is specific to this particular part of the packaging, often assigned by the manufacturer. Including possibly Data Carrier Identifier (a GS1 barcode).
263         */
264        @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
265        @Description(shortDefinition="An identifier that is specific to this particular part of the packaging. Including possibly a Data Carrier Identifier", formalDefinition="A business identifier that is specific to this particular part of the packaging, often assigned by the manufacturer. Including possibly Data Carrier Identifier (a GS1 barcode)." )
266        protected List<Identifier> identifier;
267
268        /**
269         * The physical type of the container of the items.
270         */
271        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
272        @Description(shortDefinition="The physical type of the container of the items", formalDefinition="The physical type of the container of the items." )
273        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/packaging-type")
274        protected CodeableConcept type;
275
276        /**
277         * The quantity of packaging items contained at this layer of the package. This does not relate to the number of contained items but relates solely to the number of packaging items. When looking at the outermost layer it is always 1. If there are two boxes within, at the next layer it would be 2.
278         */
279        @Child(name = "quantity", type = {IntegerType.class}, order=3, min=0, max=1, modifier=false, summary=true)
280        @Description(shortDefinition="The quantity of this level of packaging in the package that contains it (with the outermost level being 1)", formalDefinition="The quantity of packaging items contained at this layer of the package. This does not relate to the number of contained items but relates solely to the number of packaging items. When looking at the outermost layer it is always 1. If there are two boxes within, at the next layer it would be 2." )
281        protected IntegerType quantity;
282
283        /**
284         * Material type of the package item.
285         */
286        @Child(name = "material", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
287        @Description(shortDefinition="Material type of the package item", formalDefinition="Material type of the package item." )
288        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/package-material")
289        protected List<CodeableConcept> material;
290
291        /**
292         * A possible alternate material for this part of the packaging, that is allowed to be used instead of the usual material (e.g. different types of plastic for a blister sleeve).
293         */
294        @Child(name = "alternateMaterial", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
295        @Description(shortDefinition="A possible alternate material for this part of the packaging, that is allowed to be used instead of the usual material", formalDefinition="A possible alternate material for this part of the packaging, that is allowed to be used instead of the usual material (e.g. different types of plastic for a blister sleeve)." )
296        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/package-material")
297        protected List<CodeableConcept> alternateMaterial;
298
299        /**
300         * Shelf Life and storage information.
301         */
302        @Child(name = "shelfLifeStorage", type = {ProductShelfLife.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
303        @Description(shortDefinition="Shelf Life and storage information", formalDefinition="Shelf Life and storage information." )
304        protected List<ProductShelfLife> shelfLifeStorage;
305
306        /**
307         * Manufacturer of this packaging item. When there are multiple values each one is a potential manufacturer of this packaging item.
308         */
309        @Child(name = "manufacturer", type = {Organization.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
310        @Description(shortDefinition="Manufacturer of this packaging item (multiple means these are all potential manufacturers)", formalDefinition="Manufacturer of this packaging item. When there are multiple values each one is a potential manufacturer of this packaging item." )
311        protected List<Reference> manufacturer;
312
313        /**
314         * General characteristics of this item.
315         */
316        @Child(name = "property", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
317        @Description(shortDefinition="General characteristics of this item", formalDefinition="General characteristics of this item." )
318        protected List<PackagedProductDefinitionPackagingPropertyComponent> property;
319
320        /**
321         * The item(s) within the packaging.
322         */
323        @Child(name = "containedItem", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
324        @Description(shortDefinition="The item(s) within the packaging", formalDefinition="The item(s) within the packaging." )
325        protected List<PackagedProductDefinitionPackagingContainedItemComponent> containedItem;
326
327        /**
328         * Allows containers (and parts of containers) parwithin containers, still a single packaged product.  See also PackagedProductDefinition.packaging.containedItem.item(PackagedProductDefinition).
329         */
330        @Child(name = "packaging", type = {PackagedProductDefinitionPackagingComponent.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
331        @Description(shortDefinition="Allows containers (and parts of containers) within containers, still a single packaged product", formalDefinition="Allows containers (and parts of containers) parwithin containers, still a single packaged product.  See also PackagedProductDefinition.packaging.containedItem.item(PackagedProductDefinition)." )
332        protected List<PackagedProductDefinitionPackagingComponent> packaging;
333
334        private static final long serialVersionUID = -1920019015L;
335
336    /**
337     * Constructor
338     */
339      public PackagedProductDefinitionPackagingComponent() {
340        super();
341      }
342
343        /**
344         * @return {@link #identifier} (A business identifier that is specific to this particular part of the packaging, often assigned by the manufacturer. Including possibly Data Carrier Identifier (a GS1 barcode).)
345         */
346        public List<Identifier> getIdentifier() { 
347          if (this.identifier == null)
348            this.identifier = new ArrayList<Identifier>();
349          return this.identifier;
350        }
351
352        /**
353         * @return Returns a reference to <code>this</code> for easy method chaining
354         */
355        public PackagedProductDefinitionPackagingComponent setIdentifier(List<Identifier> theIdentifier) { 
356          this.identifier = theIdentifier;
357          return this;
358        }
359
360        public boolean hasIdentifier() { 
361          if (this.identifier == null)
362            return false;
363          for (Identifier item : this.identifier)
364            if (!item.isEmpty())
365              return true;
366          return false;
367        }
368
369        public Identifier addIdentifier() { //3
370          Identifier t = new Identifier();
371          if (this.identifier == null)
372            this.identifier = new ArrayList<Identifier>();
373          this.identifier.add(t);
374          return t;
375        }
376
377        public PackagedProductDefinitionPackagingComponent addIdentifier(Identifier t) { //3
378          if (t == null)
379            return this;
380          if (this.identifier == null)
381            this.identifier = new ArrayList<Identifier>();
382          this.identifier.add(t);
383          return this;
384        }
385
386        /**
387         * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
388         */
389        public Identifier getIdentifierFirstRep() { 
390          if (getIdentifier().isEmpty()) {
391            addIdentifier();
392          }
393          return getIdentifier().get(0);
394        }
395
396        /**
397         * @return {@link #type} (The physical type of the container of the items.)
398         */
399        public CodeableConcept getType() { 
400          if (this.type == null)
401            if (Configuration.errorOnAutoCreate())
402              throw new Error("Attempt to auto-create PackagedProductDefinitionPackagingComponent.type");
403            else if (Configuration.doAutoCreate())
404              this.type = new CodeableConcept(); // cc
405          return this.type;
406        }
407
408        public boolean hasType() { 
409          return this.type != null && !this.type.isEmpty();
410        }
411
412        /**
413         * @param value {@link #type} (The physical type of the container of the items.)
414         */
415        public PackagedProductDefinitionPackagingComponent setType(CodeableConcept value) { 
416          this.type = value;
417          return this;
418        }
419
420        /**
421         * @return {@link #quantity} (The quantity of packaging items contained at this layer of the package. This does not relate to the number of contained items but relates solely to the number of packaging items. When looking at the outermost layer it is always 1. If there are two boxes within, at the next layer it would be 2.). This is the underlying object with id, value and extensions. The accessor "getQuantity" gives direct access to the value
422         */
423        public IntegerType getQuantityElement() { 
424          if (this.quantity == null)
425            if (Configuration.errorOnAutoCreate())
426              throw new Error("Attempt to auto-create PackagedProductDefinitionPackagingComponent.quantity");
427            else if (Configuration.doAutoCreate())
428              this.quantity = new IntegerType(); // bb
429          return this.quantity;
430        }
431
432        public boolean hasQuantityElement() { 
433          return this.quantity != null && !this.quantity.isEmpty();
434        }
435
436        public boolean hasQuantity() { 
437          return this.quantity != null && !this.quantity.isEmpty();
438        }
439
440        /**
441         * @param value {@link #quantity} (The quantity of packaging items contained at this layer of the package. This does not relate to the number of contained items but relates solely to the number of packaging items. When looking at the outermost layer it is always 1. If there are two boxes within, at the next layer it would be 2.). This is the underlying object with id, value and extensions. The accessor "getQuantity" gives direct access to the value
442         */
443        public PackagedProductDefinitionPackagingComponent setQuantityElement(IntegerType value) { 
444          this.quantity = value;
445          return this;
446        }
447
448        /**
449         * @return The quantity of packaging items contained at this layer of the package. This does not relate to the number of contained items but relates solely to the number of packaging items. When looking at the outermost layer it is always 1. If there are two boxes within, at the next layer it would be 2.
450         */
451        public int getQuantity() { 
452          return this.quantity == null || this.quantity.isEmpty() ? 0 : this.quantity.getValue();
453        }
454
455        /**
456         * @param value The quantity of packaging items contained at this layer of the package. This does not relate to the number of contained items but relates solely to the number of packaging items. When looking at the outermost layer it is always 1. If there are two boxes within, at the next layer it would be 2.
457         */
458        public PackagedProductDefinitionPackagingComponent setQuantity(int value) { 
459            if (this.quantity == null)
460              this.quantity = new IntegerType();
461            this.quantity.setValue(value);
462          return this;
463        }
464
465        /**
466         * @return {@link #material} (Material type of the package item.)
467         */
468        public List<CodeableConcept> getMaterial() { 
469          if (this.material == null)
470            this.material = new ArrayList<CodeableConcept>();
471          return this.material;
472        }
473
474        /**
475         * @return Returns a reference to <code>this</code> for easy method chaining
476         */
477        public PackagedProductDefinitionPackagingComponent setMaterial(List<CodeableConcept> theMaterial) { 
478          this.material = theMaterial;
479          return this;
480        }
481
482        public boolean hasMaterial() { 
483          if (this.material == null)
484            return false;
485          for (CodeableConcept item : this.material)
486            if (!item.isEmpty())
487              return true;
488          return false;
489        }
490
491        public CodeableConcept addMaterial() { //3
492          CodeableConcept t = new CodeableConcept();
493          if (this.material == null)
494            this.material = new ArrayList<CodeableConcept>();
495          this.material.add(t);
496          return t;
497        }
498
499        public PackagedProductDefinitionPackagingComponent addMaterial(CodeableConcept t) { //3
500          if (t == null)
501            return this;
502          if (this.material == null)
503            this.material = new ArrayList<CodeableConcept>();
504          this.material.add(t);
505          return this;
506        }
507
508        /**
509         * @return The first repetition of repeating field {@link #material}, creating it if it does not already exist {3}
510         */
511        public CodeableConcept getMaterialFirstRep() { 
512          if (getMaterial().isEmpty()) {
513            addMaterial();
514          }
515          return getMaterial().get(0);
516        }
517
518        /**
519         * @return {@link #alternateMaterial} (A possible alternate material for this part of the packaging, that is allowed to be used instead of the usual material (e.g. different types of plastic for a blister sleeve).)
520         */
521        public List<CodeableConcept> getAlternateMaterial() { 
522          if (this.alternateMaterial == null)
523            this.alternateMaterial = new ArrayList<CodeableConcept>();
524          return this.alternateMaterial;
525        }
526
527        /**
528         * @return Returns a reference to <code>this</code> for easy method chaining
529         */
530        public PackagedProductDefinitionPackagingComponent setAlternateMaterial(List<CodeableConcept> theAlternateMaterial) { 
531          this.alternateMaterial = theAlternateMaterial;
532          return this;
533        }
534
535        public boolean hasAlternateMaterial() { 
536          if (this.alternateMaterial == null)
537            return false;
538          for (CodeableConcept item : this.alternateMaterial)
539            if (!item.isEmpty())
540              return true;
541          return false;
542        }
543
544        public CodeableConcept addAlternateMaterial() { //3
545          CodeableConcept t = new CodeableConcept();
546          if (this.alternateMaterial == null)
547            this.alternateMaterial = new ArrayList<CodeableConcept>();
548          this.alternateMaterial.add(t);
549          return t;
550        }
551
552        public PackagedProductDefinitionPackagingComponent addAlternateMaterial(CodeableConcept t) { //3
553          if (t == null)
554            return this;
555          if (this.alternateMaterial == null)
556            this.alternateMaterial = new ArrayList<CodeableConcept>();
557          this.alternateMaterial.add(t);
558          return this;
559        }
560
561        /**
562         * @return The first repetition of repeating field {@link #alternateMaterial}, creating it if it does not already exist {3}
563         */
564        public CodeableConcept getAlternateMaterialFirstRep() { 
565          if (getAlternateMaterial().isEmpty()) {
566            addAlternateMaterial();
567          }
568          return getAlternateMaterial().get(0);
569        }
570
571        /**
572         * @return {@link #shelfLifeStorage} (Shelf Life and storage information.)
573         */
574        public List<ProductShelfLife> getShelfLifeStorage() { 
575          if (this.shelfLifeStorage == null)
576            this.shelfLifeStorage = new ArrayList<ProductShelfLife>();
577          return this.shelfLifeStorage;
578        }
579
580        /**
581         * @return Returns a reference to <code>this</code> for easy method chaining
582         */
583        public PackagedProductDefinitionPackagingComponent setShelfLifeStorage(List<ProductShelfLife> theShelfLifeStorage) { 
584          this.shelfLifeStorage = theShelfLifeStorage;
585          return this;
586        }
587
588        public boolean hasShelfLifeStorage() { 
589          if (this.shelfLifeStorage == null)
590            return false;
591          for (ProductShelfLife item : this.shelfLifeStorage)
592            if (!item.isEmpty())
593              return true;
594          return false;
595        }
596
597        public ProductShelfLife addShelfLifeStorage() { //3
598          ProductShelfLife t = new ProductShelfLife();
599          if (this.shelfLifeStorage == null)
600            this.shelfLifeStorage = new ArrayList<ProductShelfLife>();
601          this.shelfLifeStorage.add(t);
602          return t;
603        }
604
605        public PackagedProductDefinitionPackagingComponent addShelfLifeStorage(ProductShelfLife t) { //3
606          if (t == null)
607            return this;
608          if (this.shelfLifeStorage == null)
609            this.shelfLifeStorage = new ArrayList<ProductShelfLife>();
610          this.shelfLifeStorage.add(t);
611          return this;
612        }
613
614        /**
615         * @return The first repetition of repeating field {@link #shelfLifeStorage}, creating it if it does not already exist {3}
616         */
617        public ProductShelfLife getShelfLifeStorageFirstRep() { 
618          if (getShelfLifeStorage().isEmpty()) {
619            addShelfLifeStorage();
620          }
621          return getShelfLifeStorage().get(0);
622        }
623
624        /**
625         * @return {@link #manufacturer} (Manufacturer of this packaging item. When there are multiple values each one is a potential manufacturer of this packaging item.)
626         */
627        public List<Reference> getManufacturer() { 
628          if (this.manufacturer == null)
629            this.manufacturer = new ArrayList<Reference>();
630          return this.manufacturer;
631        }
632
633        /**
634         * @return Returns a reference to <code>this</code> for easy method chaining
635         */
636        public PackagedProductDefinitionPackagingComponent setManufacturer(List<Reference> theManufacturer) { 
637          this.manufacturer = theManufacturer;
638          return this;
639        }
640
641        public boolean hasManufacturer() { 
642          if (this.manufacturer == null)
643            return false;
644          for (Reference item : this.manufacturer)
645            if (!item.isEmpty())
646              return true;
647          return false;
648        }
649
650        public Reference addManufacturer() { //3
651          Reference t = new Reference();
652          if (this.manufacturer == null)
653            this.manufacturer = new ArrayList<Reference>();
654          this.manufacturer.add(t);
655          return t;
656        }
657
658        public PackagedProductDefinitionPackagingComponent addManufacturer(Reference t) { //3
659          if (t == null)
660            return this;
661          if (this.manufacturer == null)
662            this.manufacturer = new ArrayList<Reference>();
663          this.manufacturer.add(t);
664          return this;
665        }
666
667        /**
668         * @return The first repetition of repeating field {@link #manufacturer}, creating it if it does not already exist {3}
669         */
670        public Reference getManufacturerFirstRep() { 
671          if (getManufacturer().isEmpty()) {
672            addManufacturer();
673          }
674          return getManufacturer().get(0);
675        }
676
677        /**
678         * @return {@link #property} (General characteristics of this item.)
679         */
680        public List<PackagedProductDefinitionPackagingPropertyComponent> getProperty() { 
681          if (this.property == null)
682            this.property = new ArrayList<PackagedProductDefinitionPackagingPropertyComponent>();
683          return this.property;
684        }
685
686        /**
687         * @return Returns a reference to <code>this</code> for easy method chaining
688         */
689        public PackagedProductDefinitionPackagingComponent setProperty(List<PackagedProductDefinitionPackagingPropertyComponent> theProperty) { 
690          this.property = theProperty;
691          return this;
692        }
693
694        public boolean hasProperty() { 
695          if (this.property == null)
696            return false;
697          for (PackagedProductDefinitionPackagingPropertyComponent item : this.property)
698            if (!item.isEmpty())
699              return true;
700          return false;
701        }
702
703        public PackagedProductDefinitionPackagingPropertyComponent addProperty() { //3
704          PackagedProductDefinitionPackagingPropertyComponent t = new PackagedProductDefinitionPackagingPropertyComponent();
705          if (this.property == null)
706            this.property = new ArrayList<PackagedProductDefinitionPackagingPropertyComponent>();
707          this.property.add(t);
708          return t;
709        }
710
711        public PackagedProductDefinitionPackagingComponent addProperty(PackagedProductDefinitionPackagingPropertyComponent t) { //3
712          if (t == null)
713            return this;
714          if (this.property == null)
715            this.property = new ArrayList<PackagedProductDefinitionPackagingPropertyComponent>();
716          this.property.add(t);
717          return this;
718        }
719
720        /**
721         * @return The first repetition of repeating field {@link #property}, creating it if it does not already exist {3}
722         */
723        public PackagedProductDefinitionPackagingPropertyComponent getPropertyFirstRep() { 
724          if (getProperty().isEmpty()) {
725            addProperty();
726          }
727          return getProperty().get(0);
728        }
729
730        /**
731         * @return {@link #containedItem} (The item(s) within the packaging.)
732         */
733        public List<PackagedProductDefinitionPackagingContainedItemComponent> getContainedItem() { 
734          if (this.containedItem == null)
735            this.containedItem = new ArrayList<PackagedProductDefinitionPackagingContainedItemComponent>();
736          return this.containedItem;
737        }
738
739        /**
740         * @return Returns a reference to <code>this</code> for easy method chaining
741         */
742        public PackagedProductDefinitionPackagingComponent setContainedItem(List<PackagedProductDefinitionPackagingContainedItemComponent> theContainedItem) { 
743          this.containedItem = theContainedItem;
744          return this;
745        }
746
747        public boolean hasContainedItem() { 
748          if (this.containedItem == null)
749            return false;
750          for (PackagedProductDefinitionPackagingContainedItemComponent item : this.containedItem)
751            if (!item.isEmpty())
752              return true;
753          return false;
754        }
755
756        public PackagedProductDefinitionPackagingContainedItemComponent addContainedItem() { //3
757          PackagedProductDefinitionPackagingContainedItemComponent t = new PackagedProductDefinitionPackagingContainedItemComponent();
758          if (this.containedItem == null)
759            this.containedItem = new ArrayList<PackagedProductDefinitionPackagingContainedItemComponent>();
760          this.containedItem.add(t);
761          return t;
762        }
763
764        public PackagedProductDefinitionPackagingComponent addContainedItem(PackagedProductDefinitionPackagingContainedItemComponent t) { //3
765          if (t == null)
766            return this;
767          if (this.containedItem == null)
768            this.containedItem = new ArrayList<PackagedProductDefinitionPackagingContainedItemComponent>();
769          this.containedItem.add(t);
770          return this;
771        }
772
773        /**
774         * @return The first repetition of repeating field {@link #containedItem}, creating it if it does not already exist {3}
775         */
776        public PackagedProductDefinitionPackagingContainedItemComponent getContainedItemFirstRep() { 
777          if (getContainedItem().isEmpty()) {
778            addContainedItem();
779          }
780          return getContainedItem().get(0);
781        }
782
783        /**
784         * @return {@link #packaging} (Allows containers (and parts of containers) parwithin containers, still a single packaged product.  See also PackagedProductDefinition.packaging.containedItem.item(PackagedProductDefinition).)
785         */
786        public List<PackagedProductDefinitionPackagingComponent> getPackaging() { 
787          if (this.packaging == null)
788            this.packaging = new ArrayList<PackagedProductDefinitionPackagingComponent>();
789          return this.packaging;
790        }
791
792        /**
793         * @return Returns a reference to <code>this</code> for easy method chaining
794         */
795        public PackagedProductDefinitionPackagingComponent setPackaging(List<PackagedProductDefinitionPackagingComponent> thePackaging) { 
796          this.packaging = thePackaging;
797          return this;
798        }
799
800        public boolean hasPackaging() { 
801          if (this.packaging == null)
802            return false;
803          for (PackagedProductDefinitionPackagingComponent item : this.packaging)
804            if (!item.isEmpty())
805              return true;
806          return false;
807        }
808
809        public PackagedProductDefinitionPackagingComponent addPackaging() { //3
810          PackagedProductDefinitionPackagingComponent t = new PackagedProductDefinitionPackagingComponent();
811          if (this.packaging == null)
812            this.packaging = new ArrayList<PackagedProductDefinitionPackagingComponent>();
813          this.packaging.add(t);
814          return t;
815        }
816
817        public PackagedProductDefinitionPackagingComponent addPackaging(PackagedProductDefinitionPackagingComponent t) { //3
818          if (t == null)
819            return this;
820          if (this.packaging == null)
821            this.packaging = new ArrayList<PackagedProductDefinitionPackagingComponent>();
822          this.packaging.add(t);
823          return this;
824        }
825
826        /**
827         * @return The first repetition of repeating field {@link #packaging}, creating it if it does not already exist {3}
828         */
829        public PackagedProductDefinitionPackagingComponent getPackagingFirstRep() { 
830          if (getPackaging().isEmpty()) {
831            addPackaging();
832          }
833          return getPackaging().get(0);
834        }
835
836        protected void listChildren(List<Property> children) {
837          super.listChildren(children);
838          children.add(new Property("identifier", "Identifier", "A business identifier that is specific to this particular part of the packaging, often assigned by the manufacturer. Including possibly Data Carrier Identifier (a GS1 barcode).", 0, java.lang.Integer.MAX_VALUE, identifier));
839          children.add(new Property("type", "CodeableConcept", "The physical type of the container of the items.", 0, 1, type));
840          children.add(new Property("quantity", "integer", "The quantity of packaging items contained at this layer of the package. This does not relate to the number of contained items but relates solely to the number of packaging items. When looking at the outermost layer it is always 1. If there are two boxes within, at the next layer it would be 2.", 0, 1, quantity));
841          children.add(new Property("material", "CodeableConcept", "Material type of the package item.", 0, java.lang.Integer.MAX_VALUE, material));
842          children.add(new Property("alternateMaterial", "CodeableConcept", "A possible alternate material for this part of the packaging, that is allowed to be used instead of the usual material (e.g. different types of plastic for a blister sleeve).", 0, java.lang.Integer.MAX_VALUE, alternateMaterial));
843          children.add(new Property("shelfLifeStorage", "ProductShelfLife", "Shelf Life and storage information.", 0, java.lang.Integer.MAX_VALUE, shelfLifeStorage));
844          children.add(new Property("manufacturer", "Reference(Organization)", "Manufacturer of this packaging item. When there are multiple values each one is a potential manufacturer of this packaging item.", 0, java.lang.Integer.MAX_VALUE, manufacturer));
845          children.add(new Property("property", "", "General characteristics of this item.", 0, java.lang.Integer.MAX_VALUE, property));
846          children.add(new Property("containedItem", "", "The item(s) within the packaging.", 0, java.lang.Integer.MAX_VALUE, containedItem));
847          children.add(new Property("packaging", "@PackagedProductDefinition.packaging", "Allows containers (and parts of containers) parwithin containers, still a single packaged product.  See also PackagedProductDefinition.packaging.containedItem.item(PackagedProductDefinition).", 0, java.lang.Integer.MAX_VALUE, packaging));
848        }
849
850        @Override
851        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
852          switch (_hash) {
853          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A business identifier that is specific to this particular part of the packaging, often assigned by the manufacturer. Including possibly Data Carrier Identifier (a GS1 barcode).", 0, java.lang.Integer.MAX_VALUE, identifier);
854          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The physical type of the container of the items.", 0, 1, type);
855          case -1285004149: /*quantity*/  return new Property("quantity", "integer", "The quantity of packaging items contained at this layer of the package. This does not relate to the number of contained items but relates solely to the number of packaging items. When looking at the outermost layer it is always 1. If there are two boxes within, at the next layer it would be 2.", 0, 1, quantity);
856          case 299066663: /*material*/  return new Property("material", "CodeableConcept", "Material type of the package item.", 0, java.lang.Integer.MAX_VALUE, material);
857          case -1021448255: /*alternateMaterial*/  return new Property("alternateMaterial", "CodeableConcept", "A possible alternate material for this part of the packaging, that is allowed to be used instead of the usual material (e.g. different types of plastic for a blister sleeve).", 0, java.lang.Integer.MAX_VALUE, alternateMaterial);
858          case 172049237: /*shelfLifeStorage*/  return new Property("shelfLifeStorage", "ProductShelfLife", "Shelf Life and storage information.", 0, java.lang.Integer.MAX_VALUE, shelfLifeStorage);
859          case -1969347631: /*manufacturer*/  return new Property("manufacturer", "Reference(Organization)", "Manufacturer of this packaging item. When there are multiple values each one is a potential manufacturer of this packaging item.", 0, java.lang.Integer.MAX_VALUE, manufacturer);
860          case -993141291: /*property*/  return new Property("property", "", "General characteristics of this item.", 0, java.lang.Integer.MAX_VALUE, property);
861          case 1953679910: /*containedItem*/  return new Property("containedItem", "", "The item(s) within the packaging.", 0, java.lang.Integer.MAX_VALUE, containedItem);
862          case 1802065795: /*packaging*/  return new Property("packaging", "@PackagedProductDefinition.packaging", "Allows containers (and parts of containers) parwithin containers, still a single packaged product.  See also PackagedProductDefinition.packaging.containedItem.item(PackagedProductDefinition).", 0, java.lang.Integer.MAX_VALUE, packaging);
863          default: return super.getNamedProperty(_hash, _name, _checkValid);
864          }
865
866        }
867
868      @Override
869      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
870        switch (hash) {
871        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
872        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
873        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // IntegerType
874        case 299066663: /*material*/ return this.material == null ? new Base[0] : this.material.toArray(new Base[this.material.size()]); // CodeableConcept
875        case -1021448255: /*alternateMaterial*/ return this.alternateMaterial == null ? new Base[0] : this.alternateMaterial.toArray(new Base[this.alternateMaterial.size()]); // CodeableConcept
876        case 172049237: /*shelfLifeStorage*/ return this.shelfLifeStorage == null ? new Base[0] : this.shelfLifeStorage.toArray(new Base[this.shelfLifeStorage.size()]); // ProductShelfLife
877        case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : this.manufacturer.toArray(new Base[this.manufacturer.size()]); // Reference
878        case -993141291: /*property*/ return this.property == null ? new Base[0] : this.property.toArray(new Base[this.property.size()]); // PackagedProductDefinitionPackagingPropertyComponent
879        case 1953679910: /*containedItem*/ return this.containedItem == null ? new Base[0] : this.containedItem.toArray(new Base[this.containedItem.size()]); // PackagedProductDefinitionPackagingContainedItemComponent
880        case 1802065795: /*packaging*/ return this.packaging == null ? new Base[0] : this.packaging.toArray(new Base[this.packaging.size()]); // PackagedProductDefinitionPackagingComponent
881        default: return super.getProperty(hash, name, checkValid);
882        }
883
884      }
885
886      @Override
887      public Base setProperty(int hash, String name, Base value) throws FHIRException {
888        switch (hash) {
889        case -1618432855: // identifier
890          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
891          return value;
892        case 3575610: // type
893          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
894          return value;
895        case -1285004149: // quantity
896          this.quantity = TypeConvertor.castToInteger(value); // IntegerType
897          return value;
898        case 299066663: // material
899          this.getMaterial().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
900          return value;
901        case -1021448255: // alternateMaterial
902          this.getAlternateMaterial().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
903          return value;
904        case 172049237: // shelfLifeStorage
905          this.getShelfLifeStorage().add(TypeConvertor.castToProductShelfLife(value)); // ProductShelfLife
906          return value;
907        case -1969347631: // manufacturer
908          this.getManufacturer().add(TypeConvertor.castToReference(value)); // Reference
909          return value;
910        case -993141291: // property
911          this.getProperty().add((PackagedProductDefinitionPackagingPropertyComponent) value); // PackagedProductDefinitionPackagingPropertyComponent
912          return value;
913        case 1953679910: // containedItem
914          this.getContainedItem().add((PackagedProductDefinitionPackagingContainedItemComponent) value); // PackagedProductDefinitionPackagingContainedItemComponent
915          return value;
916        case 1802065795: // packaging
917          this.getPackaging().add((PackagedProductDefinitionPackagingComponent) value); // PackagedProductDefinitionPackagingComponent
918          return value;
919        default: return super.setProperty(hash, name, value);
920        }
921
922      }
923
924      @Override
925      public Base setProperty(String name, Base value) throws FHIRException {
926        if (name.equals("identifier")) {
927          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
928        } else if (name.equals("type")) {
929          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
930        } else if (name.equals("quantity")) {
931          this.quantity = TypeConvertor.castToInteger(value); // IntegerType
932        } else if (name.equals("material")) {
933          this.getMaterial().add(TypeConvertor.castToCodeableConcept(value));
934        } else if (name.equals("alternateMaterial")) {
935          this.getAlternateMaterial().add(TypeConvertor.castToCodeableConcept(value));
936        } else if (name.equals("shelfLifeStorage")) {
937          this.getShelfLifeStorage().add(TypeConvertor.castToProductShelfLife(value));
938        } else if (name.equals("manufacturer")) {
939          this.getManufacturer().add(TypeConvertor.castToReference(value));
940        } else if (name.equals("property")) {
941          this.getProperty().add((PackagedProductDefinitionPackagingPropertyComponent) value);
942        } else if (name.equals("containedItem")) {
943          this.getContainedItem().add((PackagedProductDefinitionPackagingContainedItemComponent) value);
944        } else if (name.equals("packaging")) {
945          this.getPackaging().add((PackagedProductDefinitionPackagingComponent) value);
946        } else
947          return super.setProperty(name, value);
948        return value;
949      }
950
951      @Override
952      public Base makeProperty(int hash, String name) throws FHIRException {
953        switch (hash) {
954        case -1618432855:  return addIdentifier(); 
955        case 3575610:  return getType();
956        case -1285004149:  return getQuantityElement();
957        case 299066663:  return addMaterial(); 
958        case -1021448255:  return addAlternateMaterial(); 
959        case 172049237:  return addShelfLifeStorage(); 
960        case -1969347631:  return addManufacturer(); 
961        case -993141291:  return addProperty(); 
962        case 1953679910:  return addContainedItem(); 
963        case 1802065795:  return addPackaging(); 
964        default: return super.makeProperty(hash, name);
965        }
966
967      }
968
969      @Override
970      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
971        switch (hash) {
972        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
973        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
974        case -1285004149: /*quantity*/ return new String[] {"integer"};
975        case 299066663: /*material*/ return new String[] {"CodeableConcept"};
976        case -1021448255: /*alternateMaterial*/ return new String[] {"CodeableConcept"};
977        case 172049237: /*shelfLifeStorage*/ return new String[] {"ProductShelfLife"};
978        case -1969347631: /*manufacturer*/ return new String[] {"Reference"};
979        case -993141291: /*property*/ return new String[] {};
980        case 1953679910: /*containedItem*/ return new String[] {};
981        case 1802065795: /*packaging*/ return new String[] {"@PackagedProductDefinition.packaging"};
982        default: return super.getTypesForProperty(hash, name);
983        }
984
985      }
986
987      @Override
988      public Base addChild(String name) throws FHIRException {
989        if (name.equals("identifier")) {
990          return addIdentifier();
991        }
992        else if (name.equals("type")) {
993          this.type = new CodeableConcept();
994          return this.type;
995        }
996        else if (name.equals("quantity")) {
997          throw new FHIRException("Cannot call addChild on a primitive type PackagedProductDefinition.packaging.quantity");
998        }
999        else if (name.equals("material")) {
1000          return addMaterial();
1001        }
1002        else if (name.equals("alternateMaterial")) {
1003          return addAlternateMaterial();
1004        }
1005        else if (name.equals("shelfLifeStorage")) {
1006          return addShelfLifeStorage();
1007        }
1008        else if (name.equals("manufacturer")) {
1009          return addManufacturer();
1010        }
1011        else if (name.equals("property")) {
1012          return addProperty();
1013        }
1014        else if (name.equals("containedItem")) {
1015          return addContainedItem();
1016        }
1017        else if (name.equals("packaging")) {
1018          return addPackaging();
1019        }
1020        else
1021          return super.addChild(name);
1022      }
1023
1024      public PackagedProductDefinitionPackagingComponent copy() {
1025        PackagedProductDefinitionPackagingComponent dst = new PackagedProductDefinitionPackagingComponent();
1026        copyValues(dst);
1027        return dst;
1028      }
1029
1030      public void copyValues(PackagedProductDefinitionPackagingComponent dst) {
1031        super.copyValues(dst);
1032        if (identifier != null) {
1033          dst.identifier = new ArrayList<Identifier>();
1034          for (Identifier i : identifier)
1035            dst.identifier.add(i.copy());
1036        };
1037        dst.type = type == null ? null : type.copy();
1038        dst.quantity = quantity == null ? null : quantity.copy();
1039        if (material != null) {
1040          dst.material = new ArrayList<CodeableConcept>();
1041          for (CodeableConcept i : material)
1042            dst.material.add(i.copy());
1043        };
1044        if (alternateMaterial != null) {
1045          dst.alternateMaterial = new ArrayList<CodeableConcept>();
1046          for (CodeableConcept i : alternateMaterial)
1047            dst.alternateMaterial.add(i.copy());
1048        };
1049        if (shelfLifeStorage != null) {
1050          dst.shelfLifeStorage = new ArrayList<ProductShelfLife>();
1051          for (ProductShelfLife i : shelfLifeStorage)
1052            dst.shelfLifeStorage.add(i.copy());
1053        };
1054        if (manufacturer != null) {
1055          dst.manufacturer = new ArrayList<Reference>();
1056          for (Reference i : manufacturer)
1057            dst.manufacturer.add(i.copy());
1058        };
1059        if (property != null) {
1060          dst.property = new ArrayList<PackagedProductDefinitionPackagingPropertyComponent>();
1061          for (PackagedProductDefinitionPackagingPropertyComponent i : property)
1062            dst.property.add(i.copy());
1063        };
1064        if (containedItem != null) {
1065          dst.containedItem = new ArrayList<PackagedProductDefinitionPackagingContainedItemComponent>();
1066          for (PackagedProductDefinitionPackagingContainedItemComponent i : containedItem)
1067            dst.containedItem.add(i.copy());
1068        };
1069        if (packaging != null) {
1070          dst.packaging = new ArrayList<PackagedProductDefinitionPackagingComponent>();
1071          for (PackagedProductDefinitionPackagingComponent i : packaging)
1072            dst.packaging.add(i.copy());
1073        };
1074      }
1075
1076      @Override
1077      public boolean equalsDeep(Base other_) {
1078        if (!super.equalsDeep(other_))
1079          return false;
1080        if (!(other_ instanceof PackagedProductDefinitionPackagingComponent))
1081          return false;
1082        PackagedProductDefinitionPackagingComponent o = (PackagedProductDefinitionPackagingComponent) other_;
1083        return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(quantity, o.quantity, true)
1084           && compareDeep(material, o.material, true) && compareDeep(alternateMaterial, o.alternateMaterial, true)
1085           && compareDeep(shelfLifeStorage, o.shelfLifeStorage, true) && compareDeep(manufacturer, o.manufacturer, true)
1086           && compareDeep(property, o.property, true) && compareDeep(containedItem, o.containedItem, true)
1087           && compareDeep(packaging, o.packaging, true);
1088      }
1089
1090      @Override
1091      public boolean equalsShallow(Base other_) {
1092        if (!super.equalsShallow(other_))
1093          return false;
1094        if (!(other_ instanceof PackagedProductDefinitionPackagingComponent))
1095          return false;
1096        PackagedProductDefinitionPackagingComponent o = (PackagedProductDefinitionPackagingComponent) other_;
1097        return compareValues(quantity, o.quantity, true);
1098      }
1099
1100      public boolean isEmpty() {
1101        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, type, quantity
1102          , material, alternateMaterial, shelfLifeStorage, manufacturer, property, containedItem
1103          , packaging);
1104      }
1105
1106  public String fhirType() {
1107    return "PackagedProductDefinition.packaging";
1108
1109  }
1110
1111  }
1112
1113    @Block()
1114    public static class PackagedProductDefinitionPackagingPropertyComponent extends BackboneElement implements IBaseBackboneElement {
1115        /**
1116         * A code expressing the type of characteristic.
1117         */
1118        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
1119        @Description(shortDefinition="A code expressing the type of characteristic", formalDefinition="A code expressing the type of characteristic." )
1120        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/product-characteristic-codes")
1121        protected CodeableConcept type;
1122
1123        /**
1124         * A value for the characteristic.
1125         */
1126        @Child(name = "value", type = {CodeableConcept.class, Quantity.class, DateType.class, BooleanType.class, Attachment.class}, order=2, min=0, max=1, modifier=false, summary=true)
1127        @Description(shortDefinition="A value for the characteristic", formalDefinition="A value for the characteristic." )
1128        protected DataType value;
1129
1130        private static final long serialVersionUID = -1659186716L;
1131
1132    /**
1133     * Constructor
1134     */
1135      public PackagedProductDefinitionPackagingPropertyComponent() {
1136        super();
1137      }
1138
1139    /**
1140     * Constructor
1141     */
1142      public PackagedProductDefinitionPackagingPropertyComponent(CodeableConcept type) {
1143        super();
1144        this.setType(type);
1145      }
1146
1147        /**
1148         * @return {@link #type} (A code expressing the type of characteristic.)
1149         */
1150        public CodeableConcept getType() { 
1151          if (this.type == null)
1152            if (Configuration.errorOnAutoCreate())
1153              throw new Error("Attempt to auto-create PackagedProductDefinitionPackagingPropertyComponent.type");
1154            else if (Configuration.doAutoCreate())
1155              this.type = new CodeableConcept(); // cc
1156          return this.type;
1157        }
1158
1159        public boolean hasType() { 
1160          return this.type != null && !this.type.isEmpty();
1161        }
1162
1163        /**
1164         * @param value {@link #type} (A code expressing the type of characteristic.)
1165         */
1166        public PackagedProductDefinitionPackagingPropertyComponent setType(CodeableConcept value) { 
1167          this.type = value;
1168          return this;
1169        }
1170
1171        /**
1172         * @return {@link #value} (A value for the characteristic.)
1173         */
1174        public DataType getValue() { 
1175          return this.value;
1176        }
1177
1178        /**
1179         * @return {@link #value} (A value for the characteristic.)
1180         */
1181        public CodeableConcept getValueCodeableConcept() throws FHIRException { 
1182          if (this.value == null)
1183            this.value = new CodeableConcept();
1184          if (!(this.value instanceof CodeableConcept))
1185            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered");
1186          return (CodeableConcept) this.value;
1187        }
1188
1189        public boolean hasValueCodeableConcept() { 
1190          return this != null && this.value instanceof CodeableConcept;
1191        }
1192
1193        /**
1194         * @return {@link #value} (A value for the characteristic.)
1195         */
1196        public Quantity getValueQuantity() throws FHIRException { 
1197          if (this.value == null)
1198            this.value = new Quantity();
1199          if (!(this.value instanceof Quantity))
1200            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
1201          return (Quantity) this.value;
1202        }
1203
1204        public boolean hasValueQuantity() { 
1205          return this != null && this.value instanceof Quantity;
1206        }
1207
1208        /**
1209         * @return {@link #value} (A value for the characteristic.)
1210         */
1211        public DateType getValueDateType() throws FHIRException { 
1212          if (this.value == null)
1213            this.value = new DateType();
1214          if (!(this.value instanceof DateType))
1215            throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered");
1216          return (DateType) this.value;
1217        }
1218
1219        public boolean hasValueDateType() { 
1220          return this != null && this.value instanceof DateType;
1221        }
1222
1223        /**
1224         * @return {@link #value} (A value for the characteristic.)
1225         */
1226        public BooleanType getValueBooleanType() throws FHIRException { 
1227          if (this.value == null)
1228            this.value = new BooleanType();
1229          if (!(this.value instanceof BooleanType))
1230            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
1231          return (BooleanType) this.value;
1232        }
1233
1234        public boolean hasValueBooleanType() { 
1235          return this != null && this.value instanceof BooleanType;
1236        }
1237
1238        /**
1239         * @return {@link #value} (A value for the characteristic.)
1240         */
1241        public Attachment getValueAttachment() throws FHIRException { 
1242          if (this.value == null)
1243            this.value = new Attachment();
1244          if (!(this.value instanceof Attachment))
1245            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered");
1246          return (Attachment) this.value;
1247        }
1248
1249        public boolean hasValueAttachment() { 
1250          return this != null && this.value instanceof Attachment;
1251        }
1252
1253        public boolean hasValue() { 
1254          return this.value != null && !this.value.isEmpty();
1255        }
1256
1257        /**
1258         * @param value {@link #value} (A value for the characteristic.)
1259         */
1260        public PackagedProductDefinitionPackagingPropertyComponent setValue(DataType value) { 
1261          if (value != null && !(value instanceof CodeableConcept || value instanceof Quantity || value instanceof DateType || value instanceof BooleanType || value instanceof Attachment))
1262            throw new Error("Not the right type for PackagedProductDefinition.packaging.property.value[x]: "+value.fhirType());
1263          this.value = value;
1264          return this;
1265        }
1266
1267        protected void listChildren(List<Property> children) {
1268          super.listChildren(children);
1269          children.add(new Property("type", "CodeableConcept", "A code expressing the type of characteristic.", 0, 1, type));
1270          children.add(new Property("value[x]", "CodeableConcept|Quantity|date|boolean|Attachment", "A value for the characteristic.", 0, 1, value));
1271        }
1272
1273        @Override
1274        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1275          switch (_hash) {
1276          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "A code expressing the type of characteristic.", 0, 1, type);
1277          case -1410166417: /*value[x]*/  return new Property("value[x]", "CodeableConcept|Quantity|date|boolean|Attachment", "A value for the characteristic.", 0, 1, value);
1278          case 111972721: /*value*/  return new Property("value[x]", "CodeableConcept|Quantity|date|boolean|Attachment", "A value for the characteristic.", 0, 1, value);
1279          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "CodeableConcept", "A value for the characteristic.", 0, 1, value);
1280          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "Quantity", "A value for the characteristic.", 0, 1, value);
1281          case -766192449: /*valueDate*/  return new Property("value[x]", "date", "A value for the characteristic.", 0, 1, value);
1282          case 733421943: /*valueBoolean*/  return new Property("value[x]", "boolean", "A value for the characteristic.", 0, 1, value);
1283          case -475566732: /*valueAttachment*/  return new Property("value[x]", "Attachment", "A value for the characteristic.", 0, 1, value);
1284          default: return super.getNamedProperty(_hash, _name, _checkValid);
1285          }
1286
1287        }
1288
1289      @Override
1290      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1291        switch (hash) {
1292        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1293        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType
1294        default: return super.getProperty(hash, name, checkValid);
1295        }
1296
1297      }
1298
1299      @Override
1300      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1301        switch (hash) {
1302        case 3575610: // type
1303          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1304          return value;
1305        case 111972721: // value
1306          this.value = TypeConvertor.castToType(value); // DataType
1307          return value;
1308        default: return super.setProperty(hash, name, value);
1309        }
1310
1311      }
1312
1313      @Override
1314      public Base setProperty(String name, Base value) throws FHIRException {
1315        if (name.equals("type")) {
1316          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1317        } else if (name.equals("value[x]")) {
1318          this.value = TypeConvertor.castToType(value); // DataType
1319        } else
1320          return super.setProperty(name, value);
1321        return value;
1322      }
1323
1324      @Override
1325      public Base makeProperty(int hash, String name) throws FHIRException {
1326        switch (hash) {
1327        case 3575610:  return getType();
1328        case -1410166417:  return getValue();
1329        case 111972721:  return getValue();
1330        default: return super.makeProperty(hash, name);
1331        }
1332
1333      }
1334
1335      @Override
1336      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1337        switch (hash) {
1338        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1339        case 111972721: /*value*/ return new String[] {"CodeableConcept", "Quantity", "date", "boolean", "Attachment"};
1340        default: return super.getTypesForProperty(hash, name);
1341        }
1342
1343      }
1344
1345      @Override
1346      public Base addChild(String name) throws FHIRException {
1347        if (name.equals("type")) {
1348          this.type = new CodeableConcept();
1349          return this.type;
1350        }
1351        else if (name.equals("valueCodeableConcept")) {
1352          this.value = new CodeableConcept();
1353          return this.value;
1354        }
1355        else if (name.equals("valueQuantity")) {
1356          this.value = new Quantity();
1357          return this.value;
1358        }
1359        else if (name.equals("valueDate")) {
1360          this.value = new DateType();
1361          return this.value;
1362        }
1363        else if (name.equals("valueBoolean")) {
1364          this.value = new BooleanType();
1365          return this.value;
1366        }
1367        else if (name.equals("valueAttachment")) {
1368          this.value = new Attachment();
1369          return this.value;
1370        }
1371        else
1372          return super.addChild(name);
1373      }
1374
1375      public PackagedProductDefinitionPackagingPropertyComponent copy() {
1376        PackagedProductDefinitionPackagingPropertyComponent dst = new PackagedProductDefinitionPackagingPropertyComponent();
1377        copyValues(dst);
1378        return dst;
1379      }
1380
1381      public void copyValues(PackagedProductDefinitionPackagingPropertyComponent dst) {
1382        super.copyValues(dst);
1383        dst.type = type == null ? null : type.copy();
1384        dst.value = value == null ? null : value.copy();
1385      }
1386
1387      @Override
1388      public boolean equalsDeep(Base other_) {
1389        if (!super.equalsDeep(other_))
1390          return false;
1391        if (!(other_ instanceof PackagedProductDefinitionPackagingPropertyComponent))
1392          return false;
1393        PackagedProductDefinitionPackagingPropertyComponent o = (PackagedProductDefinitionPackagingPropertyComponent) other_;
1394        return compareDeep(type, o.type, true) && compareDeep(value, o.value, true);
1395      }
1396
1397      @Override
1398      public boolean equalsShallow(Base other_) {
1399        if (!super.equalsShallow(other_))
1400          return false;
1401        if (!(other_ instanceof PackagedProductDefinitionPackagingPropertyComponent))
1402          return false;
1403        PackagedProductDefinitionPackagingPropertyComponent o = (PackagedProductDefinitionPackagingPropertyComponent) other_;
1404        return true;
1405      }
1406
1407      public boolean isEmpty() {
1408        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, value);
1409      }
1410
1411  public String fhirType() {
1412    return "PackagedProductDefinition.packaging.property";
1413
1414  }
1415
1416  }
1417
1418    @Block()
1419    public static class PackagedProductDefinitionPackagingContainedItemComponent extends BackboneElement implements IBaseBackboneElement {
1420        /**
1421         * The actual item(s) of medication, as manufactured, or a device (typically, but not necessarily, a co-packaged one), or other medically related item (such as food, biologicals, raw materials, medical fluids, gases etc.), as contained in the package. This also allows another whole packaged product to be included, which is solely for the case where a package of other entire packages is wanted - such as a wholesale or distribution pack (for layers within one package, use PackagedProductDefinition.packaging.packaging).
1422         */
1423        @Child(name = "item", type = {CodeableReference.class}, order=1, min=1, max=1, modifier=false, summary=true)
1424        @Description(shortDefinition="The actual item(s) of medication, as manufactured, or a device, or other medically related item (food, biologicals, raw materials, medical fluids, gases etc.), as contained in the package", formalDefinition="The actual item(s) of medication, as manufactured, or a device (typically, but not necessarily, a co-packaged one), or other medically related item (such as food, biologicals, raw materials, medical fluids, gases etc.), as contained in the package. This also allows another whole packaged product to be included, which is solely for the case where a package of other entire packages is wanted - such as a wholesale or distribution pack (for layers within one package, use PackagedProductDefinition.packaging.packaging)." )
1425        protected CodeableReference item;
1426
1427        /**
1428         * The number of this type of item within this packaging.
1429         */
1430        @Child(name = "amount", type = {Quantity.class}, order=2, min=0, max=1, modifier=false, summary=true)
1431        @Description(shortDefinition="The number of this type of item within this packaging", formalDefinition="The number of this type of item within this packaging." )
1432        protected Quantity amount;
1433
1434        private static final long serialVersionUID = 443863028L;
1435
1436    /**
1437     * Constructor
1438     */
1439      public PackagedProductDefinitionPackagingContainedItemComponent() {
1440        super();
1441      }
1442
1443    /**
1444     * Constructor
1445     */
1446      public PackagedProductDefinitionPackagingContainedItemComponent(CodeableReference item) {
1447        super();
1448        this.setItem(item);
1449      }
1450
1451        /**
1452         * @return {@link #item} (The actual item(s) of medication, as manufactured, or a device (typically, but not necessarily, a co-packaged one), or other medically related item (such as food, biologicals, raw materials, medical fluids, gases etc.), as contained in the package. This also allows another whole packaged product to be included, which is solely for the case where a package of other entire packages is wanted - such as a wholesale or distribution pack (for layers within one package, use PackagedProductDefinition.packaging.packaging).)
1453         */
1454        public CodeableReference getItem() { 
1455          if (this.item == null)
1456            if (Configuration.errorOnAutoCreate())
1457              throw new Error("Attempt to auto-create PackagedProductDefinitionPackagingContainedItemComponent.item");
1458            else if (Configuration.doAutoCreate())
1459              this.item = new CodeableReference(); // cc
1460          return this.item;
1461        }
1462
1463        public boolean hasItem() { 
1464          return this.item != null && !this.item.isEmpty();
1465        }
1466
1467        /**
1468         * @param value {@link #item} (The actual item(s) of medication, as manufactured, or a device (typically, but not necessarily, a co-packaged one), or other medically related item (such as food, biologicals, raw materials, medical fluids, gases etc.), as contained in the package. This also allows another whole packaged product to be included, which is solely for the case where a package of other entire packages is wanted - such as a wholesale or distribution pack (for layers within one package, use PackagedProductDefinition.packaging.packaging).)
1469         */
1470        public PackagedProductDefinitionPackagingContainedItemComponent setItem(CodeableReference value) { 
1471          this.item = value;
1472          return this;
1473        }
1474
1475        /**
1476         * @return {@link #amount} (The number of this type of item within this packaging.)
1477         */
1478        public Quantity getAmount() { 
1479          if (this.amount == null)
1480            if (Configuration.errorOnAutoCreate())
1481              throw new Error("Attempt to auto-create PackagedProductDefinitionPackagingContainedItemComponent.amount");
1482            else if (Configuration.doAutoCreate())
1483              this.amount = new Quantity(); // cc
1484          return this.amount;
1485        }
1486
1487        public boolean hasAmount() { 
1488          return this.amount != null && !this.amount.isEmpty();
1489        }
1490
1491        /**
1492         * @param value {@link #amount} (The number of this type of item within this packaging.)
1493         */
1494        public PackagedProductDefinitionPackagingContainedItemComponent setAmount(Quantity value) { 
1495          this.amount = value;
1496          return this;
1497        }
1498
1499        protected void listChildren(List<Property> children) {
1500          super.listChildren(children);
1501          children.add(new Property("item", "CodeableReference(ManufacturedItemDefinition|DeviceDefinition|PackagedProductDefinition|BiologicallyDerivedProduct|NutritionProduct)", "The actual item(s) of medication, as manufactured, or a device (typically, but not necessarily, a co-packaged one), or other medically related item (such as food, biologicals, raw materials, medical fluids, gases etc.), as contained in the package. This also allows another whole packaged product to be included, which is solely for the case where a package of other entire packages is wanted - such as a wholesale or distribution pack (for layers within one package, use PackagedProductDefinition.packaging.packaging).", 0, 1, item));
1502          children.add(new Property("amount", "Quantity", "The number of this type of item within this packaging.", 0, 1, amount));
1503        }
1504
1505        @Override
1506        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1507          switch (_hash) {
1508          case 3242771: /*item*/  return new Property("item", "CodeableReference(ManufacturedItemDefinition|DeviceDefinition|PackagedProductDefinition|BiologicallyDerivedProduct|NutritionProduct)", "The actual item(s) of medication, as manufactured, or a device (typically, but not necessarily, a co-packaged one), or other medically related item (such as food, biologicals, raw materials, medical fluids, gases etc.), as contained in the package. This also allows another whole packaged product to be included, which is solely for the case where a package of other entire packages is wanted - such as a wholesale or distribution pack (for layers within one package, use PackagedProductDefinition.packaging.packaging).", 0, 1, item);
1509          case -1413853096: /*amount*/  return new Property("amount", "Quantity", "The number of this type of item within this packaging.", 0, 1, amount);
1510          default: return super.getNamedProperty(_hash, _name, _checkValid);
1511          }
1512
1513        }
1514
1515      @Override
1516      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1517        switch (hash) {
1518        case 3242771: /*item*/ return this.item == null ? new Base[0] : new Base[] {this.item}; // CodeableReference
1519        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Quantity
1520        default: return super.getProperty(hash, name, checkValid);
1521        }
1522
1523      }
1524
1525      @Override
1526      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1527        switch (hash) {
1528        case 3242771: // item
1529          this.item = TypeConvertor.castToCodeableReference(value); // CodeableReference
1530          return value;
1531        case -1413853096: // amount
1532          this.amount = TypeConvertor.castToQuantity(value); // Quantity
1533          return value;
1534        default: return super.setProperty(hash, name, value);
1535        }
1536
1537      }
1538
1539      @Override
1540      public Base setProperty(String name, Base value) throws FHIRException {
1541        if (name.equals("item")) {
1542          this.item = TypeConvertor.castToCodeableReference(value); // CodeableReference
1543        } else if (name.equals("amount")) {
1544          this.amount = TypeConvertor.castToQuantity(value); // Quantity
1545        } else
1546          return super.setProperty(name, value);
1547        return value;
1548      }
1549
1550      @Override
1551      public Base makeProperty(int hash, String name) throws FHIRException {
1552        switch (hash) {
1553        case 3242771:  return getItem();
1554        case -1413853096:  return getAmount();
1555        default: return super.makeProperty(hash, name);
1556        }
1557
1558      }
1559
1560      @Override
1561      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1562        switch (hash) {
1563        case 3242771: /*item*/ return new String[] {"CodeableReference"};
1564        case -1413853096: /*amount*/ return new String[] {"Quantity"};
1565        default: return super.getTypesForProperty(hash, name);
1566        }
1567
1568      }
1569
1570      @Override
1571      public Base addChild(String name) throws FHIRException {
1572        if (name.equals("item")) {
1573          this.item = new CodeableReference();
1574          return this.item;
1575        }
1576        else if (name.equals("amount")) {
1577          this.amount = new Quantity();
1578          return this.amount;
1579        }
1580        else
1581          return super.addChild(name);
1582      }
1583
1584      public PackagedProductDefinitionPackagingContainedItemComponent copy() {
1585        PackagedProductDefinitionPackagingContainedItemComponent dst = new PackagedProductDefinitionPackagingContainedItemComponent();
1586        copyValues(dst);
1587        return dst;
1588      }
1589
1590      public void copyValues(PackagedProductDefinitionPackagingContainedItemComponent dst) {
1591        super.copyValues(dst);
1592        dst.item = item == null ? null : item.copy();
1593        dst.amount = amount == null ? null : amount.copy();
1594      }
1595
1596      @Override
1597      public boolean equalsDeep(Base other_) {
1598        if (!super.equalsDeep(other_))
1599          return false;
1600        if (!(other_ instanceof PackagedProductDefinitionPackagingContainedItemComponent))
1601          return false;
1602        PackagedProductDefinitionPackagingContainedItemComponent o = (PackagedProductDefinitionPackagingContainedItemComponent) other_;
1603        return compareDeep(item, o.item, true) && compareDeep(amount, o.amount, true);
1604      }
1605
1606      @Override
1607      public boolean equalsShallow(Base other_) {
1608        if (!super.equalsShallow(other_))
1609          return false;
1610        if (!(other_ instanceof PackagedProductDefinitionPackagingContainedItemComponent))
1611          return false;
1612        PackagedProductDefinitionPackagingContainedItemComponent o = (PackagedProductDefinitionPackagingContainedItemComponent) other_;
1613        return true;
1614      }
1615
1616      public boolean isEmpty() {
1617        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(item, amount);
1618      }
1619
1620  public String fhirType() {
1621    return "PackagedProductDefinition.packaging.containedItem";
1622
1623  }
1624
1625  }
1626
1627    /**
1628     * A unique identifier for this package as whole - not the the content of the package. Unique instance identifiers assigned to a package by manufacturers, regulators, drug catalogue custodians or other organizations.
1629     */
1630    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1631    @Description(shortDefinition="A unique identifier for this package as whole - not for the content of the package", formalDefinition="A unique identifier for this package as whole - not the the content of the package. Unique instance identifiers assigned to a package by manufacturers, regulators, drug catalogue custodians or other organizations." )
1632    protected List<Identifier> identifier;
1633
1634    /**
1635     * A name for this package. Typically what it would be listed as in a drug formulary or catalogue, inventory etc.
1636     */
1637    @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true)
1638    @Description(shortDefinition="A name for this package. Typically as listed in a drug formulary, catalogue, inventory etc", formalDefinition="A name for this package. Typically what it would be listed as in a drug formulary or catalogue, inventory etc." )
1639    protected StringType name;
1640
1641    /**
1642     * A high level category e.g. medicinal product, raw material, shipping/transport container, etc.
1643     */
1644    @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
1645    @Description(shortDefinition="A high level category e.g. medicinal product, raw material, shipping container etc", formalDefinition="A high level category e.g. medicinal product, raw material, shipping/transport container, etc." )
1646    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/package-type")
1647    protected CodeableConcept type;
1648
1649    /**
1650     * The product this package model relates to, not the contents of the package (for which see package.containedItem).
1651     */
1652    @Child(name = "packageFor", type = {MedicinalProductDefinition.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1653    @Description(shortDefinition="The product that this is a pack for", formalDefinition="The product this package model relates to, not the contents of the package (for which see package.containedItem)." )
1654    protected List<Reference> packageFor;
1655
1656    /**
1657     * The status within the lifecycle of this item. A high level status, this is not intended to duplicate details carried elsewhere such as legal status, or authorization or marketing status.
1658     */
1659    @Child(name = "status", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=true, summary=true)
1660    @Description(shortDefinition="The status within the lifecycle of this item. High level - not intended to duplicate details elsewhere e.g. legal status, or authorization/marketing status", formalDefinition="The status within the lifecycle of this item. A high level status, this is not intended to duplicate details carried elsewhere such as legal status, or authorization or marketing status." )
1661    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status")
1662    protected CodeableConcept status;
1663
1664    /**
1665     * The date at which the given status became applicable.
1666     */
1667    @Child(name = "statusDate", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=true)
1668    @Description(shortDefinition="The date at which the given status became applicable", formalDefinition="The date at which the given status became applicable." )
1669    protected DateTimeType statusDate;
1670
1671    /**
1672     * A total of the complete count of contained items of a particular type/form, independent of sub-packaging or organization. This can be considered as the pack size. This attribute differs from containedItem.amount in that it can give a single aggregated count of all tablet types in a pack, even when these are different manufactured items. For example a pill pack of 21 tablets plus 7 sugar tablets, can be denoted here as '28 tablets'. This attribute is repeatable so that the different item types in one pack type can be counted (e.g. a count of vials and count of syringes). Each repeat must have different units, so that it is clear what the different sets of counted items are, and it is not intended to allow different counts of similar items (e.g. not '2 tubes and 3 tubes'). Repeats are not to be used to represent different pack sizes (e.g. 20 pack vs. 50 pack) - which would be different instances of this resource.
1673     */
1674    @Child(name = "containedItemQuantity", type = {Quantity.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1675    @Description(shortDefinition="A total of the complete count of contained items of a particular type/form, independent of sub-packaging or organization. This can be considered as the pack size", formalDefinition="A total of the complete count of contained items of a particular type/form, independent of sub-packaging or organization. This can be considered as the pack size. This attribute differs from containedItem.amount in that it can give a single aggregated count of all tablet types in a pack, even when these are different manufactured items. For example a pill pack of 21 tablets plus 7 sugar tablets, can be denoted here as '28 tablets'. This attribute is repeatable so that the different item types in one pack type can be counted (e.g. a count of vials and count of syringes). Each repeat must have different units, so that it is clear what the different sets of counted items are, and it is not intended to allow different counts of similar items (e.g. not '2 tubes and 3 tubes'). Repeats are not to be used to represent different pack sizes (e.g. 20 pack vs. 50 pack) - which would be different instances of this resource." )
1676    protected List<Quantity> containedItemQuantity;
1677
1678    /**
1679     * Textual description. Note that this is not the name of the package or product.
1680     */
1681    @Child(name = "description", type = {MarkdownType.class}, order=7, min=0, max=1, modifier=false, summary=true)
1682    @Description(shortDefinition="Textual description. Note that this is not the name of the package or product", formalDefinition="Textual description. Note that this is not the name of the package or product." )
1683    protected MarkdownType description;
1684
1685    /**
1686     * The legal status of supply of the packaged item as classified by the regulator.
1687     */
1688    @Child(name = "legalStatusOfSupply", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1689    @Description(shortDefinition="The legal status of supply of the packaged item as classified by the regulator", formalDefinition="The legal status of supply of the packaged item as classified by the regulator." )
1690    protected List<PackagedProductDefinitionLegalStatusOfSupplyComponent> legalStatusOfSupply;
1691
1692    /**
1693     * Allows specifying that an item is on the market for sale, or that it is not available, and the dates and locations associated.
1694     */
1695    @Child(name = "marketingStatus", type = {MarketingStatus.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1696    @Description(shortDefinition="Allows specifying that an item is on the market for sale, or that it is not available, and the dates and locations associated", formalDefinition="Allows specifying that an item is on the market for sale, or that it is not available, and the dates and locations associated." )
1697    protected List<MarketingStatus> marketingStatus;
1698
1699    /**
1700     * Allows the key features to be recorded, such as "hospital pack", "nurse prescribable", "calendar pack".
1701     */
1702    @Child(name = "characteristic", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1703    @Description(shortDefinition="Allows the key features to be recorded, such as \"hospital pack\", \"nurse prescribable\"", formalDefinition="Allows the key features to be recorded, such as \"hospital pack\", \"nurse prescribable\", \"calendar pack\"." )
1704    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/package-characteristic")
1705    protected List<CodeableConcept> characteristic;
1706
1707    /**
1708     * Identifies if the package contains different items, such as when a drug product is supplied with another item e.g. a diluent or adjuvant.
1709     */
1710    @Child(name = "copackagedIndicator", type = {BooleanType.class}, order=11, min=0, max=1, modifier=false, summary=true)
1711    @Description(shortDefinition="Identifies if the drug product is supplied with another item such as a diluent or adjuvant", formalDefinition="Identifies if the package contains different items, such as when a drug product is supplied with another item e.g. a diluent or adjuvant." )
1712    protected BooleanType copackagedIndicator;
1713
1714    /**
1715     * Manufacturer of this package type. When there are multiple it means these are all possible manufacturers.
1716     */
1717    @Child(name = "manufacturer", type = {Organization.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1718    @Description(shortDefinition="Manufacturer of this package type (multiple means these are all possible manufacturers)", formalDefinition="Manufacturer of this package type. When there are multiple it means these are all possible manufacturers." )
1719    protected List<Reference> manufacturer;
1720
1721    /**
1722     * Additional information or supporting documentation about the packaged product.
1723     */
1724    @Child(name = "attachedDocument", type = {DocumentReference.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1725    @Description(shortDefinition="Additional information or supporting documentation about the packaged product", formalDefinition="Additional information or supporting documentation about the packaged product." )
1726    protected List<Reference> attachedDocument;
1727
1728    /**
1729     * A packaging item, as a container for medically related items, possibly with other packaging items within, or a packaging component, such as bottle cap (which is not a device or a medication manufactured item).
1730     */
1731    @Child(name = "packaging", type = {}, order=14, min=0, max=1, modifier=false, summary=true)
1732    @Description(shortDefinition="A packaging item, as a container for medically related items, possibly with other packaging items within, or a packaging component, such as bottle cap", formalDefinition="A packaging item, as a container for medically related items, possibly with other packaging items within, or a packaging component, such as bottle cap (which is not a device or a medication manufactured item)." )
1733    protected PackagedProductDefinitionPackagingComponent packaging;
1734
1735    private static final long serialVersionUID = 1842561437L;
1736
1737  /**
1738   * Constructor
1739   */
1740    public PackagedProductDefinition() {
1741      super();
1742    }
1743
1744    /**
1745     * @return {@link #identifier} (A unique identifier for this package as whole - not the the content of the package. Unique instance identifiers assigned to a package by manufacturers, regulators, drug catalogue custodians or other organizations.)
1746     */
1747    public List<Identifier> getIdentifier() { 
1748      if (this.identifier == null)
1749        this.identifier = new ArrayList<Identifier>();
1750      return this.identifier;
1751    }
1752
1753    /**
1754     * @return Returns a reference to <code>this</code> for easy method chaining
1755     */
1756    public PackagedProductDefinition setIdentifier(List<Identifier> theIdentifier) { 
1757      this.identifier = theIdentifier;
1758      return this;
1759    }
1760
1761    public boolean hasIdentifier() { 
1762      if (this.identifier == null)
1763        return false;
1764      for (Identifier item : this.identifier)
1765        if (!item.isEmpty())
1766          return true;
1767      return false;
1768    }
1769
1770    public Identifier addIdentifier() { //3
1771      Identifier t = new Identifier();
1772      if (this.identifier == null)
1773        this.identifier = new ArrayList<Identifier>();
1774      this.identifier.add(t);
1775      return t;
1776    }
1777
1778    public PackagedProductDefinition addIdentifier(Identifier t) { //3
1779      if (t == null)
1780        return this;
1781      if (this.identifier == null)
1782        this.identifier = new ArrayList<Identifier>();
1783      this.identifier.add(t);
1784      return this;
1785    }
1786
1787    /**
1788     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1789     */
1790    public Identifier getIdentifierFirstRep() { 
1791      if (getIdentifier().isEmpty()) {
1792        addIdentifier();
1793      }
1794      return getIdentifier().get(0);
1795    }
1796
1797    /**
1798     * @return {@link #name} (A name for this package. Typically what it would be listed as in a drug formulary or catalogue, inventory etc.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1799     */
1800    public StringType getNameElement() { 
1801      if (this.name == null)
1802        if (Configuration.errorOnAutoCreate())
1803          throw new Error("Attempt to auto-create PackagedProductDefinition.name");
1804        else if (Configuration.doAutoCreate())
1805          this.name = new StringType(); // bb
1806      return this.name;
1807    }
1808
1809    public boolean hasNameElement() { 
1810      return this.name != null && !this.name.isEmpty();
1811    }
1812
1813    public boolean hasName() { 
1814      return this.name != null && !this.name.isEmpty();
1815    }
1816
1817    /**
1818     * @param value {@link #name} (A name for this package. Typically what it would be listed as in a drug formulary or catalogue, inventory etc.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1819     */
1820    public PackagedProductDefinition setNameElement(StringType value) { 
1821      this.name = value;
1822      return this;
1823    }
1824
1825    /**
1826     * @return A name for this package. Typically what it would be listed as in a drug formulary or catalogue, inventory etc.
1827     */
1828    public String getName() { 
1829      return this.name == null ? null : this.name.getValue();
1830    }
1831
1832    /**
1833     * @param value A name for this package. Typically what it would be listed as in a drug formulary or catalogue, inventory etc.
1834     */
1835    public PackagedProductDefinition setName(String value) { 
1836      if (Utilities.noString(value))
1837        this.name = null;
1838      else {
1839        if (this.name == null)
1840          this.name = new StringType();
1841        this.name.setValue(value);
1842      }
1843      return this;
1844    }
1845
1846    /**
1847     * @return {@link #type} (A high level category e.g. medicinal product, raw material, shipping/transport container, etc.)
1848     */
1849    public CodeableConcept getType() { 
1850      if (this.type == null)
1851        if (Configuration.errorOnAutoCreate())
1852          throw new Error("Attempt to auto-create PackagedProductDefinition.type");
1853        else if (Configuration.doAutoCreate())
1854          this.type = new CodeableConcept(); // cc
1855      return this.type;
1856    }
1857
1858    public boolean hasType() { 
1859      return this.type != null && !this.type.isEmpty();
1860    }
1861
1862    /**
1863     * @param value {@link #type} (A high level category e.g. medicinal product, raw material, shipping/transport container, etc.)
1864     */
1865    public PackagedProductDefinition setType(CodeableConcept value) { 
1866      this.type = value;
1867      return this;
1868    }
1869
1870    /**
1871     * @return {@link #packageFor} (The product this package model relates to, not the contents of the package (for which see package.containedItem).)
1872     */
1873    public List<Reference> getPackageFor() { 
1874      if (this.packageFor == null)
1875        this.packageFor = new ArrayList<Reference>();
1876      return this.packageFor;
1877    }
1878
1879    /**
1880     * @return Returns a reference to <code>this</code> for easy method chaining
1881     */
1882    public PackagedProductDefinition setPackageFor(List<Reference> thePackageFor) { 
1883      this.packageFor = thePackageFor;
1884      return this;
1885    }
1886
1887    public boolean hasPackageFor() { 
1888      if (this.packageFor == null)
1889        return false;
1890      for (Reference item : this.packageFor)
1891        if (!item.isEmpty())
1892          return true;
1893      return false;
1894    }
1895
1896    public Reference addPackageFor() { //3
1897      Reference t = new Reference();
1898      if (this.packageFor == null)
1899        this.packageFor = new ArrayList<Reference>();
1900      this.packageFor.add(t);
1901      return t;
1902    }
1903
1904    public PackagedProductDefinition addPackageFor(Reference t) { //3
1905      if (t == null)
1906        return this;
1907      if (this.packageFor == null)
1908        this.packageFor = new ArrayList<Reference>();
1909      this.packageFor.add(t);
1910      return this;
1911    }
1912
1913    /**
1914     * @return The first repetition of repeating field {@link #packageFor}, creating it if it does not already exist {3}
1915     */
1916    public Reference getPackageForFirstRep() { 
1917      if (getPackageFor().isEmpty()) {
1918        addPackageFor();
1919      }
1920      return getPackageFor().get(0);
1921    }
1922
1923    /**
1924     * @return {@link #status} (The status within the lifecycle of this item. A high level status, this is not intended to duplicate details carried elsewhere such as legal status, or authorization or marketing status.)
1925     */
1926    public CodeableConcept getStatus() { 
1927      if (this.status == null)
1928        if (Configuration.errorOnAutoCreate())
1929          throw new Error("Attempt to auto-create PackagedProductDefinition.status");
1930        else if (Configuration.doAutoCreate())
1931          this.status = new CodeableConcept(); // cc
1932      return this.status;
1933    }
1934
1935    public boolean hasStatus() { 
1936      return this.status != null && !this.status.isEmpty();
1937    }
1938
1939    /**
1940     * @param value {@link #status} (The status within the lifecycle of this item. A high level status, this is not intended to duplicate details carried elsewhere such as legal status, or authorization or marketing status.)
1941     */
1942    public PackagedProductDefinition setStatus(CodeableConcept value) { 
1943      this.status = value;
1944      return this;
1945    }
1946
1947    /**
1948     * @return {@link #statusDate} (The date at which the given status became applicable.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value
1949     */
1950    public DateTimeType getStatusDateElement() { 
1951      if (this.statusDate == null)
1952        if (Configuration.errorOnAutoCreate())
1953          throw new Error("Attempt to auto-create PackagedProductDefinition.statusDate");
1954        else if (Configuration.doAutoCreate())
1955          this.statusDate = new DateTimeType(); // bb
1956      return this.statusDate;
1957    }
1958
1959    public boolean hasStatusDateElement() { 
1960      return this.statusDate != null && !this.statusDate.isEmpty();
1961    }
1962
1963    public boolean hasStatusDate() { 
1964      return this.statusDate != null && !this.statusDate.isEmpty();
1965    }
1966
1967    /**
1968     * @param value {@link #statusDate} (The date at which the given status became applicable.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value
1969     */
1970    public PackagedProductDefinition setStatusDateElement(DateTimeType value) { 
1971      this.statusDate = value;
1972      return this;
1973    }
1974
1975    /**
1976     * @return The date at which the given status became applicable.
1977     */
1978    public Date getStatusDate() { 
1979      return this.statusDate == null ? null : this.statusDate.getValue();
1980    }
1981
1982    /**
1983     * @param value The date at which the given status became applicable.
1984     */
1985    public PackagedProductDefinition setStatusDate(Date value) { 
1986      if (value == null)
1987        this.statusDate = null;
1988      else {
1989        if (this.statusDate == null)
1990          this.statusDate = new DateTimeType();
1991        this.statusDate.setValue(value);
1992      }
1993      return this;
1994    }
1995
1996    /**
1997     * @return {@link #containedItemQuantity} (A total of the complete count of contained items of a particular type/form, independent of sub-packaging or organization. This can be considered as the pack size. This attribute differs from containedItem.amount in that it can give a single aggregated count of all tablet types in a pack, even when these are different manufactured items. For example a pill pack of 21 tablets plus 7 sugar tablets, can be denoted here as '28 tablets'. This attribute is repeatable so that the different item types in one pack type can be counted (e.g. a count of vials and count of syringes). Each repeat must have different units, so that it is clear what the different sets of counted items are, and it is not intended to allow different counts of similar items (e.g. not '2 tubes and 3 tubes'). Repeats are not to be used to represent different pack sizes (e.g. 20 pack vs. 50 pack) - which would be different instances of this resource.)
1998     */
1999    public List<Quantity> getContainedItemQuantity() { 
2000      if (this.containedItemQuantity == null)
2001        this.containedItemQuantity = new ArrayList<Quantity>();
2002      return this.containedItemQuantity;
2003    }
2004
2005    /**
2006     * @return Returns a reference to <code>this</code> for easy method chaining
2007     */
2008    public PackagedProductDefinition setContainedItemQuantity(List<Quantity> theContainedItemQuantity) { 
2009      this.containedItemQuantity = theContainedItemQuantity;
2010      return this;
2011    }
2012
2013    public boolean hasContainedItemQuantity() { 
2014      if (this.containedItemQuantity == null)
2015        return false;
2016      for (Quantity item : this.containedItemQuantity)
2017        if (!item.isEmpty())
2018          return true;
2019      return false;
2020    }
2021
2022    public Quantity addContainedItemQuantity() { //3
2023      Quantity t = new Quantity();
2024      if (this.containedItemQuantity == null)
2025        this.containedItemQuantity = new ArrayList<Quantity>();
2026      this.containedItemQuantity.add(t);
2027      return t;
2028    }
2029
2030    public PackagedProductDefinition addContainedItemQuantity(Quantity t) { //3
2031      if (t == null)
2032        return this;
2033      if (this.containedItemQuantity == null)
2034        this.containedItemQuantity = new ArrayList<Quantity>();
2035      this.containedItemQuantity.add(t);
2036      return this;
2037    }
2038
2039    /**
2040     * @return The first repetition of repeating field {@link #containedItemQuantity}, creating it if it does not already exist {3}
2041     */
2042    public Quantity getContainedItemQuantityFirstRep() { 
2043      if (getContainedItemQuantity().isEmpty()) {
2044        addContainedItemQuantity();
2045      }
2046      return getContainedItemQuantity().get(0);
2047    }
2048
2049    /**
2050     * @return {@link #description} (Textual description. Note that this is not the name of the package or product.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2051     */
2052    public MarkdownType getDescriptionElement() { 
2053      if (this.description == null)
2054        if (Configuration.errorOnAutoCreate())
2055          throw new Error("Attempt to auto-create PackagedProductDefinition.description");
2056        else if (Configuration.doAutoCreate())
2057          this.description = new MarkdownType(); // bb
2058      return this.description;
2059    }
2060
2061    public boolean hasDescriptionElement() { 
2062      return this.description != null && !this.description.isEmpty();
2063    }
2064
2065    public boolean hasDescription() { 
2066      return this.description != null && !this.description.isEmpty();
2067    }
2068
2069    /**
2070     * @param value {@link #description} (Textual description. Note that this is not the name of the package or product.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2071     */
2072    public PackagedProductDefinition setDescriptionElement(MarkdownType value) { 
2073      this.description = value;
2074      return this;
2075    }
2076
2077    /**
2078     * @return Textual description. Note that this is not the name of the package or product.
2079     */
2080    public String getDescription() { 
2081      return this.description == null ? null : this.description.getValue();
2082    }
2083
2084    /**
2085     * @param value Textual description. Note that this is not the name of the package or product.
2086     */
2087    public PackagedProductDefinition setDescription(String value) { 
2088      if (value == null)
2089        this.description = null;
2090      else {
2091        if (this.description == null)
2092          this.description = new MarkdownType();
2093        this.description.setValue(value);
2094      }
2095      return this;
2096    }
2097
2098    /**
2099     * @return {@link #legalStatusOfSupply} (The legal status of supply of the packaged item as classified by the regulator.)
2100     */
2101    public List<PackagedProductDefinitionLegalStatusOfSupplyComponent> getLegalStatusOfSupply() { 
2102      if (this.legalStatusOfSupply == null)
2103        this.legalStatusOfSupply = new ArrayList<PackagedProductDefinitionLegalStatusOfSupplyComponent>();
2104      return this.legalStatusOfSupply;
2105    }
2106
2107    /**
2108     * @return Returns a reference to <code>this</code> for easy method chaining
2109     */
2110    public PackagedProductDefinition setLegalStatusOfSupply(List<PackagedProductDefinitionLegalStatusOfSupplyComponent> theLegalStatusOfSupply) { 
2111      this.legalStatusOfSupply = theLegalStatusOfSupply;
2112      return this;
2113    }
2114
2115    public boolean hasLegalStatusOfSupply() { 
2116      if (this.legalStatusOfSupply == null)
2117        return false;
2118      for (PackagedProductDefinitionLegalStatusOfSupplyComponent item : this.legalStatusOfSupply)
2119        if (!item.isEmpty())
2120          return true;
2121      return false;
2122    }
2123
2124    public PackagedProductDefinitionLegalStatusOfSupplyComponent addLegalStatusOfSupply() { //3
2125      PackagedProductDefinitionLegalStatusOfSupplyComponent t = new PackagedProductDefinitionLegalStatusOfSupplyComponent();
2126      if (this.legalStatusOfSupply == null)
2127        this.legalStatusOfSupply = new ArrayList<PackagedProductDefinitionLegalStatusOfSupplyComponent>();
2128      this.legalStatusOfSupply.add(t);
2129      return t;
2130    }
2131
2132    public PackagedProductDefinition addLegalStatusOfSupply(PackagedProductDefinitionLegalStatusOfSupplyComponent t) { //3
2133      if (t == null)
2134        return this;
2135      if (this.legalStatusOfSupply == null)
2136        this.legalStatusOfSupply = new ArrayList<PackagedProductDefinitionLegalStatusOfSupplyComponent>();
2137      this.legalStatusOfSupply.add(t);
2138      return this;
2139    }
2140
2141    /**
2142     * @return The first repetition of repeating field {@link #legalStatusOfSupply}, creating it if it does not already exist {3}
2143     */
2144    public PackagedProductDefinitionLegalStatusOfSupplyComponent getLegalStatusOfSupplyFirstRep() { 
2145      if (getLegalStatusOfSupply().isEmpty()) {
2146        addLegalStatusOfSupply();
2147      }
2148      return getLegalStatusOfSupply().get(0);
2149    }
2150
2151    /**
2152     * @return {@link #marketingStatus} (Allows specifying that an item is on the market for sale, or that it is not available, and the dates and locations associated.)
2153     */
2154    public List<MarketingStatus> getMarketingStatus() { 
2155      if (this.marketingStatus == null)
2156        this.marketingStatus = new ArrayList<MarketingStatus>();
2157      return this.marketingStatus;
2158    }
2159
2160    /**
2161     * @return Returns a reference to <code>this</code> for easy method chaining
2162     */
2163    public PackagedProductDefinition setMarketingStatus(List<MarketingStatus> theMarketingStatus) { 
2164      this.marketingStatus = theMarketingStatus;
2165      return this;
2166    }
2167
2168    public boolean hasMarketingStatus() { 
2169      if (this.marketingStatus == null)
2170        return false;
2171      for (MarketingStatus item : this.marketingStatus)
2172        if (!item.isEmpty())
2173          return true;
2174      return false;
2175    }
2176
2177    public MarketingStatus addMarketingStatus() { //3
2178      MarketingStatus t = new MarketingStatus();
2179      if (this.marketingStatus == null)
2180        this.marketingStatus = new ArrayList<MarketingStatus>();
2181      this.marketingStatus.add(t);
2182      return t;
2183    }
2184
2185    public PackagedProductDefinition addMarketingStatus(MarketingStatus t) { //3
2186      if (t == null)
2187        return this;
2188      if (this.marketingStatus == null)
2189        this.marketingStatus = new ArrayList<MarketingStatus>();
2190      this.marketingStatus.add(t);
2191      return this;
2192    }
2193
2194    /**
2195     * @return The first repetition of repeating field {@link #marketingStatus}, creating it if it does not already exist {3}
2196     */
2197    public MarketingStatus getMarketingStatusFirstRep() { 
2198      if (getMarketingStatus().isEmpty()) {
2199        addMarketingStatus();
2200      }
2201      return getMarketingStatus().get(0);
2202    }
2203
2204    /**
2205     * @return {@link #characteristic} (Allows the key features to be recorded, such as "hospital pack", "nurse prescribable", "calendar pack".)
2206     */
2207    public List<CodeableConcept> getCharacteristic() { 
2208      if (this.characteristic == null)
2209        this.characteristic = new ArrayList<CodeableConcept>();
2210      return this.characteristic;
2211    }
2212
2213    /**
2214     * @return Returns a reference to <code>this</code> for easy method chaining
2215     */
2216    public PackagedProductDefinition setCharacteristic(List<CodeableConcept> theCharacteristic) { 
2217      this.characteristic = theCharacteristic;
2218      return this;
2219    }
2220
2221    public boolean hasCharacteristic() { 
2222      if (this.characteristic == null)
2223        return false;
2224      for (CodeableConcept item : this.characteristic)
2225        if (!item.isEmpty())
2226          return true;
2227      return false;
2228    }
2229
2230    public CodeableConcept addCharacteristic() { //3
2231      CodeableConcept t = new CodeableConcept();
2232      if (this.characteristic == null)
2233        this.characteristic = new ArrayList<CodeableConcept>();
2234      this.characteristic.add(t);
2235      return t;
2236    }
2237
2238    public PackagedProductDefinition addCharacteristic(CodeableConcept t) { //3
2239      if (t == null)
2240        return this;
2241      if (this.characteristic == null)
2242        this.characteristic = new ArrayList<CodeableConcept>();
2243      this.characteristic.add(t);
2244      return this;
2245    }
2246
2247    /**
2248     * @return The first repetition of repeating field {@link #characteristic}, creating it if it does not already exist {3}
2249     */
2250    public CodeableConcept getCharacteristicFirstRep() { 
2251      if (getCharacteristic().isEmpty()) {
2252        addCharacteristic();
2253      }
2254      return getCharacteristic().get(0);
2255    }
2256
2257    /**
2258     * @return {@link #copackagedIndicator} (Identifies if the package contains different items, such as when a drug product is supplied with another item e.g. a diluent or adjuvant.). This is the underlying object with id, value and extensions. The accessor "getCopackagedIndicator" gives direct access to the value
2259     */
2260    public BooleanType getCopackagedIndicatorElement() { 
2261      if (this.copackagedIndicator == null)
2262        if (Configuration.errorOnAutoCreate())
2263          throw new Error("Attempt to auto-create PackagedProductDefinition.copackagedIndicator");
2264        else if (Configuration.doAutoCreate())
2265          this.copackagedIndicator = new BooleanType(); // bb
2266      return this.copackagedIndicator;
2267    }
2268
2269    public boolean hasCopackagedIndicatorElement() { 
2270      return this.copackagedIndicator != null && !this.copackagedIndicator.isEmpty();
2271    }
2272
2273    public boolean hasCopackagedIndicator() { 
2274      return this.copackagedIndicator != null && !this.copackagedIndicator.isEmpty();
2275    }
2276
2277    /**
2278     * @param value {@link #copackagedIndicator} (Identifies if the package contains different items, such as when a drug product is supplied with another item e.g. a diluent or adjuvant.). This is the underlying object with id, value and extensions. The accessor "getCopackagedIndicator" gives direct access to the value
2279     */
2280    public PackagedProductDefinition setCopackagedIndicatorElement(BooleanType value) { 
2281      this.copackagedIndicator = value;
2282      return this;
2283    }
2284
2285    /**
2286     * @return Identifies if the package contains different items, such as when a drug product is supplied with another item e.g. a diluent or adjuvant.
2287     */
2288    public boolean getCopackagedIndicator() { 
2289      return this.copackagedIndicator == null || this.copackagedIndicator.isEmpty() ? false : this.copackagedIndicator.getValue();
2290    }
2291
2292    /**
2293     * @param value Identifies if the package contains different items, such as when a drug product is supplied with another item e.g. a diluent or adjuvant.
2294     */
2295    public PackagedProductDefinition setCopackagedIndicator(boolean value) { 
2296        if (this.copackagedIndicator == null)
2297          this.copackagedIndicator = new BooleanType();
2298        this.copackagedIndicator.setValue(value);
2299      return this;
2300    }
2301
2302    /**
2303     * @return {@link #manufacturer} (Manufacturer of this package type. When there are multiple it means these are all possible manufacturers.)
2304     */
2305    public List<Reference> getManufacturer() { 
2306      if (this.manufacturer == null)
2307        this.manufacturer = new ArrayList<Reference>();
2308      return this.manufacturer;
2309    }
2310
2311    /**
2312     * @return Returns a reference to <code>this</code> for easy method chaining
2313     */
2314    public PackagedProductDefinition setManufacturer(List<Reference> theManufacturer) { 
2315      this.manufacturer = theManufacturer;
2316      return this;
2317    }
2318
2319    public boolean hasManufacturer() { 
2320      if (this.manufacturer == null)
2321        return false;
2322      for (Reference item : this.manufacturer)
2323        if (!item.isEmpty())
2324          return true;
2325      return false;
2326    }
2327
2328    public Reference addManufacturer() { //3
2329      Reference t = new Reference();
2330      if (this.manufacturer == null)
2331        this.manufacturer = new ArrayList<Reference>();
2332      this.manufacturer.add(t);
2333      return t;
2334    }
2335
2336    public PackagedProductDefinition addManufacturer(Reference t) { //3
2337      if (t == null)
2338        return this;
2339      if (this.manufacturer == null)
2340        this.manufacturer = new ArrayList<Reference>();
2341      this.manufacturer.add(t);
2342      return this;
2343    }
2344
2345    /**
2346     * @return The first repetition of repeating field {@link #manufacturer}, creating it if it does not already exist {3}
2347     */
2348    public Reference getManufacturerFirstRep() { 
2349      if (getManufacturer().isEmpty()) {
2350        addManufacturer();
2351      }
2352      return getManufacturer().get(0);
2353    }
2354
2355    /**
2356     * @return {@link #attachedDocument} (Additional information or supporting documentation about the packaged product.)
2357     */
2358    public List<Reference> getAttachedDocument() { 
2359      if (this.attachedDocument == null)
2360        this.attachedDocument = new ArrayList<Reference>();
2361      return this.attachedDocument;
2362    }
2363
2364    /**
2365     * @return Returns a reference to <code>this</code> for easy method chaining
2366     */
2367    public PackagedProductDefinition setAttachedDocument(List<Reference> theAttachedDocument) { 
2368      this.attachedDocument = theAttachedDocument;
2369      return this;
2370    }
2371
2372    public boolean hasAttachedDocument() { 
2373      if (this.attachedDocument == null)
2374        return false;
2375      for (Reference item : this.attachedDocument)
2376        if (!item.isEmpty())
2377          return true;
2378      return false;
2379    }
2380
2381    public Reference addAttachedDocument() { //3
2382      Reference t = new Reference();
2383      if (this.attachedDocument == null)
2384        this.attachedDocument = new ArrayList<Reference>();
2385      this.attachedDocument.add(t);
2386      return t;
2387    }
2388
2389    public PackagedProductDefinition addAttachedDocument(Reference t) { //3
2390      if (t == null)
2391        return this;
2392      if (this.attachedDocument == null)
2393        this.attachedDocument = new ArrayList<Reference>();
2394      this.attachedDocument.add(t);
2395      return this;
2396    }
2397
2398    /**
2399     * @return The first repetition of repeating field {@link #attachedDocument}, creating it if it does not already exist {3}
2400     */
2401    public Reference getAttachedDocumentFirstRep() { 
2402      if (getAttachedDocument().isEmpty()) {
2403        addAttachedDocument();
2404      }
2405      return getAttachedDocument().get(0);
2406    }
2407
2408    /**
2409     * @return {@link #packaging} (A packaging item, as a container for medically related items, possibly with other packaging items within, or a packaging component, such as bottle cap (which is not a device or a medication manufactured item).)
2410     */
2411    public PackagedProductDefinitionPackagingComponent getPackaging() { 
2412      if (this.packaging == null)
2413        if (Configuration.errorOnAutoCreate())
2414          throw new Error("Attempt to auto-create PackagedProductDefinition.packaging");
2415        else if (Configuration.doAutoCreate())
2416          this.packaging = new PackagedProductDefinitionPackagingComponent(); // cc
2417      return this.packaging;
2418    }
2419
2420    public boolean hasPackaging() { 
2421      return this.packaging != null && !this.packaging.isEmpty();
2422    }
2423
2424    /**
2425     * @param value {@link #packaging} (A packaging item, as a container for medically related items, possibly with other packaging items within, or a packaging component, such as bottle cap (which is not a device or a medication manufactured item).)
2426     */
2427    public PackagedProductDefinition setPackaging(PackagedProductDefinitionPackagingComponent value) { 
2428      this.packaging = value;
2429      return this;
2430    }
2431
2432      protected void listChildren(List<Property> children) {
2433        super.listChildren(children);
2434        children.add(new Property("identifier", "Identifier", "A unique identifier for this package as whole - not the the content of the package. Unique instance identifiers assigned to a package by manufacturers, regulators, drug catalogue custodians or other organizations.", 0, java.lang.Integer.MAX_VALUE, identifier));
2435        children.add(new Property("name", "string", "A name for this package. Typically what it would be listed as in a drug formulary or catalogue, inventory etc.", 0, 1, name));
2436        children.add(new Property("type", "CodeableConcept", "A high level category e.g. medicinal product, raw material, shipping/transport container, etc.", 0, 1, type));
2437        children.add(new Property("packageFor", "Reference(MedicinalProductDefinition)", "The product this package model relates to, not the contents of the package (for which see package.containedItem).", 0, java.lang.Integer.MAX_VALUE, packageFor));
2438        children.add(new Property("status", "CodeableConcept", "The status within the lifecycle of this item. A high level status, this is not intended to duplicate details carried elsewhere such as legal status, or authorization or marketing status.", 0, 1, status));
2439        children.add(new Property("statusDate", "dateTime", "The date at which the given status became applicable.", 0, 1, statusDate));
2440        children.add(new Property("containedItemQuantity", "Quantity", "A total of the complete count of contained items of a particular type/form, independent of sub-packaging or organization. This can be considered as the pack size. This attribute differs from containedItem.amount in that it can give a single aggregated count of all tablet types in a pack, even when these are different manufactured items. For example a pill pack of 21 tablets plus 7 sugar tablets, can be denoted here as '28 tablets'. This attribute is repeatable so that the different item types in one pack type can be counted (e.g. a count of vials and count of syringes). Each repeat must have different units, so that it is clear what the different sets of counted items are, and it is not intended to allow different counts of similar items (e.g. not '2 tubes and 3 tubes'). Repeats are not to be used to represent different pack sizes (e.g. 20 pack vs. 50 pack) - which would be different instances of this resource.", 0, java.lang.Integer.MAX_VALUE, containedItemQuantity));
2441        children.add(new Property("description", "markdown", "Textual description. Note that this is not the name of the package or product.", 0, 1, description));
2442        children.add(new Property("legalStatusOfSupply", "", "The legal status of supply of the packaged item as classified by the regulator.", 0, java.lang.Integer.MAX_VALUE, legalStatusOfSupply));
2443        children.add(new Property("marketingStatus", "MarketingStatus", "Allows specifying that an item is on the market for sale, or that it is not available, and the dates and locations associated.", 0, java.lang.Integer.MAX_VALUE, marketingStatus));
2444        children.add(new Property("characteristic", "CodeableConcept", "Allows the key features to be recorded, such as \"hospital pack\", \"nurse prescribable\", \"calendar pack\".", 0, java.lang.Integer.MAX_VALUE, characteristic));
2445        children.add(new Property("copackagedIndicator", "boolean", "Identifies if the package contains different items, such as when a drug product is supplied with another item e.g. a diluent or adjuvant.", 0, 1, copackagedIndicator));
2446        children.add(new Property("manufacturer", "Reference(Organization)", "Manufacturer of this package type. When there are multiple it means these are all possible manufacturers.", 0, java.lang.Integer.MAX_VALUE, manufacturer));
2447        children.add(new Property("attachedDocument", "Reference(DocumentReference)", "Additional information or supporting documentation about the packaged product.", 0, java.lang.Integer.MAX_VALUE, attachedDocument));
2448        children.add(new Property("packaging", "", "A packaging item, as a container for medically related items, possibly with other packaging items within, or a packaging component, such as bottle cap (which is not a device or a medication manufactured item).", 0, 1, packaging));
2449      }
2450
2451      @Override
2452      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2453        switch (_hash) {
2454        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A unique identifier for this package as whole - not the the content of the package. Unique instance identifiers assigned to a package by manufacturers, regulators, drug catalogue custodians or other organizations.", 0, java.lang.Integer.MAX_VALUE, identifier);
2455        case 3373707: /*name*/  return new Property("name", "string", "A name for this package. Typically what it would be listed as in a drug formulary or catalogue, inventory etc.", 0, 1, name);
2456        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "A high level category e.g. medicinal product, raw material, shipping/transport container, etc.", 0, 1, type);
2457        case 29307555: /*packageFor*/  return new Property("packageFor", "Reference(MedicinalProductDefinition)", "The product this package model relates to, not the contents of the package (for which see package.containedItem).", 0, java.lang.Integer.MAX_VALUE, packageFor);
2458        case -892481550: /*status*/  return new Property("status", "CodeableConcept", "The status within the lifecycle of this item. A high level status, this is not intended to duplicate details carried elsewhere such as legal status, or authorization or marketing status.", 0, 1, status);
2459        case 247524032: /*statusDate*/  return new Property("statusDate", "dateTime", "The date at which the given status became applicable.", 0, 1, statusDate);
2460        case -1686893359: /*containedItemQuantity*/  return new Property("containedItemQuantity", "Quantity", "A total of the complete count of contained items of a particular type/form, independent of sub-packaging or organization. This can be considered as the pack size. This attribute differs from containedItem.amount in that it can give a single aggregated count of all tablet types in a pack, even when these are different manufactured items. For example a pill pack of 21 tablets plus 7 sugar tablets, can be denoted here as '28 tablets'. This attribute is repeatable so that the different item types in one pack type can be counted (e.g. a count of vials and count of syringes). Each repeat must have different units, so that it is clear what the different sets of counted items are, and it is not intended to allow different counts of similar items (e.g. not '2 tubes and 3 tubes'). Repeats are not to be used to represent different pack sizes (e.g. 20 pack vs. 50 pack) - which would be different instances of this resource.", 0, java.lang.Integer.MAX_VALUE, containedItemQuantity);
2461        case -1724546052: /*description*/  return new Property("description", "markdown", "Textual description. Note that this is not the name of the package or product.", 0, 1, description);
2462        case -844874031: /*legalStatusOfSupply*/  return new Property("legalStatusOfSupply", "", "The legal status of supply of the packaged item as classified by the regulator.", 0, java.lang.Integer.MAX_VALUE, legalStatusOfSupply);
2463        case 70767032: /*marketingStatus*/  return new Property("marketingStatus", "MarketingStatus", "Allows specifying that an item is on the market for sale, or that it is not available, and the dates and locations associated.", 0, java.lang.Integer.MAX_VALUE, marketingStatus);
2464        case 366313883: /*characteristic*/  return new Property("characteristic", "CodeableConcept", "Allows the key features to be recorded, such as \"hospital pack\", \"nurse prescribable\", \"calendar pack\".", 0, java.lang.Integer.MAX_VALUE, characteristic);
2465        case -1638663195: /*copackagedIndicator*/  return new Property("copackagedIndicator", "boolean", "Identifies if the package contains different items, such as when a drug product is supplied with another item e.g. a diluent or adjuvant.", 0, 1, copackagedIndicator);
2466        case -1969347631: /*manufacturer*/  return new Property("manufacturer", "Reference(Organization)", "Manufacturer of this package type. When there are multiple it means these are all possible manufacturers.", 0, java.lang.Integer.MAX_VALUE, manufacturer);
2467        case -513945889: /*attachedDocument*/  return new Property("attachedDocument", "Reference(DocumentReference)", "Additional information or supporting documentation about the packaged product.", 0, java.lang.Integer.MAX_VALUE, attachedDocument);
2468        case 1802065795: /*packaging*/  return new Property("packaging", "", "A packaging item, as a container for medically related items, possibly with other packaging items within, or a packaging component, such as bottle cap (which is not a device or a medication manufactured item).", 0, 1, packaging);
2469        default: return super.getNamedProperty(_hash, _name, _checkValid);
2470        }
2471
2472      }
2473
2474      @Override
2475      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2476        switch (hash) {
2477        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2478        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
2479        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
2480        case 29307555: /*packageFor*/ return this.packageFor == null ? new Base[0] : this.packageFor.toArray(new Base[this.packageFor.size()]); // Reference
2481        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // CodeableConcept
2482        case 247524032: /*statusDate*/ return this.statusDate == null ? new Base[0] : new Base[] {this.statusDate}; // DateTimeType
2483        case -1686893359: /*containedItemQuantity*/ return this.containedItemQuantity == null ? new Base[0] : this.containedItemQuantity.toArray(new Base[this.containedItemQuantity.size()]); // Quantity
2484        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
2485        case -844874031: /*legalStatusOfSupply*/ return this.legalStatusOfSupply == null ? new Base[0] : this.legalStatusOfSupply.toArray(new Base[this.legalStatusOfSupply.size()]); // PackagedProductDefinitionLegalStatusOfSupplyComponent
2486        case 70767032: /*marketingStatus*/ return this.marketingStatus == null ? new Base[0] : this.marketingStatus.toArray(new Base[this.marketingStatus.size()]); // MarketingStatus
2487        case 366313883: /*characteristic*/ return this.characteristic == null ? new Base[0] : this.characteristic.toArray(new Base[this.characteristic.size()]); // CodeableConcept
2488        case -1638663195: /*copackagedIndicator*/ return this.copackagedIndicator == null ? new Base[0] : new Base[] {this.copackagedIndicator}; // BooleanType
2489        case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : this.manufacturer.toArray(new Base[this.manufacturer.size()]); // Reference
2490        case -513945889: /*attachedDocument*/ return this.attachedDocument == null ? new Base[0] : this.attachedDocument.toArray(new Base[this.attachedDocument.size()]); // Reference
2491        case 1802065795: /*packaging*/ return this.packaging == null ? new Base[0] : new Base[] {this.packaging}; // PackagedProductDefinitionPackagingComponent
2492        default: return super.getProperty(hash, name, checkValid);
2493        }
2494
2495      }
2496
2497      @Override
2498      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2499        switch (hash) {
2500        case -1618432855: // identifier
2501          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2502          return value;
2503        case 3373707: // name
2504          this.name = TypeConvertor.castToString(value); // StringType
2505          return value;
2506        case 3575610: // type
2507          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2508          return value;
2509        case 29307555: // packageFor
2510          this.getPackageFor().add(TypeConvertor.castToReference(value)); // Reference
2511          return value;
2512        case -892481550: // status
2513          this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2514          return value;
2515        case 247524032: // statusDate
2516          this.statusDate = TypeConvertor.castToDateTime(value); // DateTimeType
2517          return value;
2518        case -1686893359: // containedItemQuantity
2519          this.getContainedItemQuantity().add(TypeConvertor.castToQuantity(value)); // Quantity
2520          return value;
2521        case -1724546052: // description
2522          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
2523          return value;
2524        case -844874031: // legalStatusOfSupply
2525          this.getLegalStatusOfSupply().add((PackagedProductDefinitionLegalStatusOfSupplyComponent) value); // PackagedProductDefinitionLegalStatusOfSupplyComponent
2526          return value;
2527        case 70767032: // marketingStatus
2528          this.getMarketingStatus().add(TypeConvertor.castToMarketingStatus(value)); // MarketingStatus
2529          return value;
2530        case 366313883: // characteristic
2531          this.getCharacteristic().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2532          return value;
2533        case -1638663195: // copackagedIndicator
2534          this.copackagedIndicator = TypeConvertor.castToBoolean(value); // BooleanType
2535          return value;
2536        case -1969347631: // manufacturer
2537          this.getManufacturer().add(TypeConvertor.castToReference(value)); // Reference
2538          return value;
2539        case -513945889: // attachedDocument
2540          this.getAttachedDocument().add(TypeConvertor.castToReference(value)); // Reference
2541          return value;
2542        case 1802065795: // packaging
2543          this.packaging = (PackagedProductDefinitionPackagingComponent) value; // PackagedProductDefinitionPackagingComponent
2544          return value;
2545        default: return super.setProperty(hash, name, value);
2546        }
2547
2548      }
2549
2550      @Override
2551      public Base setProperty(String name, Base value) throws FHIRException {
2552        if (name.equals("identifier")) {
2553          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2554        } else if (name.equals("name")) {
2555          this.name = TypeConvertor.castToString(value); // StringType
2556        } else if (name.equals("type")) {
2557          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2558        } else if (name.equals("packageFor")) {
2559          this.getPackageFor().add(TypeConvertor.castToReference(value));
2560        } else if (name.equals("status")) {
2561          this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2562        } else if (name.equals("statusDate")) {
2563          this.statusDate = TypeConvertor.castToDateTime(value); // DateTimeType
2564        } else if (name.equals("containedItemQuantity")) {
2565          this.getContainedItemQuantity().add(TypeConvertor.castToQuantity(value));
2566        } else if (name.equals("description")) {
2567          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
2568        } else if (name.equals("legalStatusOfSupply")) {
2569          this.getLegalStatusOfSupply().add((PackagedProductDefinitionLegalStatusOfSupplyComponent) value);
2570        } else if (name.equals("marketingStatus")) {
2571          this.getMarketingStatus().add(TypeConvertor.castToMarketingStatus(value));
2572        } else if (name.equals("characteristic")) {
2573          this.getCharacteristic().add(TypeConvertor.castToCodeableConcept(value));
2574        } else if (name.equals("copackagedIndicator")) {
2575          this.copackagedIndicator = TypeConvertor.castToBoolean(value); // BooleanType
2576        } else if (name.equals("manufacturer")) {
2577          this.getManufacturer().add(TypeConvertor.castToReference(value));
2578        } else if (name.equals("attachedDocument")) {
2579          this.getAttachedDocument().add(TypeConvertor.castToReference(value));
2580        } else if (name.equals("packaging")) {
2581          this.packaging = (PackagedProductDefinitionPackagingComponent) value; // PackagedProductDefinitionPackagingComponent
2582        } else
2583          return super.setProperty(name, value);
2584        return value;
2585      }
2586
2587      @Override
2588      public Base makeProperty(int hash, String name) throws FHIRException {
2589        switch (hash) {
2590        case -1618432855:  return addIdentifier(); 
2591        case 3373707:  return getNameElement();
2592        case 3575610:  return getType();
2593        case 29307555:  return addPackageFor(); 
2594        case -892481550:  return getStatus();
2595        case 247524032:  return getStatusDateElement();
2596        case -1686893359:  return addContainedItemQuantity(); 
2597        case -1724546052:  return getDescriptionElement();
2598        case -844874031:  return addLegalStatusOfSupply(); 
2599        case 70767032:  return addMarketingStatus(); 
2600        case 366313883:  return addCharacteristic(); 
2601        case -1638663195:  return getCopackagedIndicatorElement();
2602        case -1969347631:  return addManufacturer(); 
2603        case -513945889:  return addAttachedDocument(); 
2604        case 1802065795:  return getPackaging();
2605        default: return super.makeProperty(hash, name);
2606        }
2607
2608      }
2609
2610      @Override
2611      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2612        switch (hash) {
2613        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2614        case 3373707: /*name*/ return new String[] {"string"};
2615        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2616        case 29307555: /*packageFor*/ return new String[] {"Reference"};
2617        case -892481550: /*status*/ return new String[] {"CodeableConcept"};
2618        case 247524032: /*statusDate*/ return new String[] {"dateTime"};
2619        case -1686893359: /*containedItemQuantity*/ return new String[] {"Quantity"};
2620        case -1724546052: /*description*/ return new String[] {"markdown"};
2621        case -844874031: /*legalStatusOfSupply*/ return new String[] {};
2622        case 70767032: /*marketingStatus*/ return new String[] {"MarketingStatus"};
2623        case 366313883: /*characteristic*/ return new String[] {"CodeableConcept"};
2624        case -1638663195: /*copackagedIndicator*/ return new String[] {"boolean"};
2625        case -1969347631: /*manufacturer*/ return new String[] {"Reference"};
2626        case -513945889: /*attachedDocument*/ return new String[] {"Reference"};
2627        case 1802065795: /*packaging*/ return new String[] {};
2628        default: return super.getTypesForProperty(hash, name);
2629        }
2630
2631      }
2632
2633      @Override
2634      public Base addChild(String name) throws FHIRException {
2635        if (name.equals("identifier")) {
2636          return addIdentifier();
2637        }
2638        else if (name.equals("name")) {
2639          throw new FHIRException("Cannot call addChild on a primitive type PackagedProductDefinition.name");
2640        }
2641        else if (name.equals("type")) {
2642          this.type = new CodeableConcept();
2643          return this.type;
2644        }
2645        else if (name.equals("packageFor")) {
2646          return addPackageFor();
2647        }
2648        else if (name.equals("status")) {
2649          this.status = new CodeableConcept();
2650          return this.status;
2651        }
2652        else if (name.equals("statusDate")) {
2653          throw new FHIRException("Cannot call addChild on a primitive type PackagedProductDefinition.statusDate");
2654        }
2655        else if (name.equals("containedItemQuantity")) {
2656          return addContainedItemQuantity();
2657        }
2658        else if (name.equals("description")) {
2659          throw new FHIRException("Cannot call addChild on a primitive type PackagedProductDefinition.description");
2660        }
2661        else if (name.equals("legalStatusOfSupply")) {
2662          return addLegalStatusOfSupply();
2663        }
2664        else if (name.equals("marketingStatus")) {
2665          return addMarketingStatus();
2666        }
2667        else if (name.equals("characteristic")) {
2668          return addCharacteristic();
2669        }
2670        else if (name.equals("copackagedIndicator")) {
2671          throw new FHIRException("Cannot call addChild on a primitive type PackagedProductDefinition.copackagedIndicator");
2672        }
2673        else if (name.equals("manufacturer")) {
2674          return addManufacturer();
2675        }
2676        else if (name.equals("attachedDocument")) {
2677          return addAttachedDocument();
2678        }
2679        else if (name.equals("packaging")) {
2680          this.packaging = new PackagedProductDefinitionPackagingComponent();
2681          return this.packaging;
2682        }
2683        else
2684          return super.addChild(name);
2685      }
2686
2687  public String fhirType() {
2688    return "PackagedProductDefinition";
2689
2690  }
2691
2692      public PackagedProductDefinition copy() {
2693        PackagedProductDefinition dst = new PackagedProductDefinition();
2694        copyValues(dst);
2695        return dst;
2696      }
2697
2698      public void copyValues(PackagedProductDefinition dst) {
2699        super.copyValues(dst);
2700        if (identifier != null) {
2701          dst.identifier = new ArrayList<Identifier>();
2702          for (Identifier i : identifier)
2703            dst.identifier.add(i.copy());
2704        };
2705        dst.name = name == null ? null : name.copy();
2706        dst.type = type == null ? null : type.copy();
2707        if (packageFor != null) {
2708          dst.packageFor = new ArrayList<Reference>();
2709          for (Reference i : packageFor)
2710            dst.packageFor.add(i.copy());
2711        };
2712        dst.status = status == null ? null : status.copy();
2713        dst.statusDate = statusDate == null ? null : statusDate.copy();
2714        if (containedItemQuantity != null) {
2715          dst.containedItemQuantity = new ArrayList<Quantity>();
2716          for (Quantity i : containedItemQuantity)
2717            dst.containedItemQuantity.add(i.copy());
2718        };
2719        dst.description = description == null ? null : description.copy();
2720        if (legalStatusOfSupply != null) {
2721          dst.legalStatusOfSupply = new ArrayList<PackagedProductDefinitionLegalStatusOfSupplyComponent>();
2722          for (PackagedProductDefinitionLegalStatusOfSupplyComponent i : legalStatusOfSupply)
2723            dst.legalStatusOfSupply.add(i.copy());
2724        };
2725        if (marketingStatus != null) {
2726          dst.marketingStatus = new ArrayList<MarketingStatus>();
2727          for (MarketingStatus i : marketingStatus)
2728            dst.marketingStatus.add(i.copy());
2729        };
2730        if (characteristic != null) {
2731          dst.characteristic = new ArrayList<CodeableConcept>();
2732          for (CodeableConcept i : characteristic)
2733            dst.characteristic.add(i.copy());
2734        };
2735        dst.copackagedIndicator = copackagedIndicator == null ? null : copackagedIndicator.copy();
2736        if (manufacturer != null) {
2737          dst.manufacturer = new ArrayList<Reference>();
2738          for (Reference i : manufacturer)
2739            dst.manufacturer.add(i.copy());
2740        };
2741        if (attachedDocument != null) {
2742          dst.attachedDocument = new ArrayList<Reference>();
2743          for (Reference i : attachedDocument)
2744            dst.attachedDocument.add(i.copy());
2745        };
2746        dst.packaging = packaging == null ? null : packaging.copy();
2747      }
2748
2749      protected PackagedProductDefinition typedCopy() {
2750        return copy();
2751      }
2752
2753      @Override
2754      public boolean equalsDeep(Base other_) {
2755        if (!super.equalsDeep(other_))
2756          return false;
2757        if (!(other_ instanceof PackagedProductDefinition))
2758          return false;
2759        PackagedProductDefinition o = (PackagedProductDefinition) other_;
2760        return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(type, o.type, true)
2761           && compareDeep(packageFor, o.packageFor, true) && compareDeep(status, o.status, true) && compareDeep(statusDate, o.statusDate, true)
2762           && compareDeep(containedItemQuantity, o.containedItemQuantity, true) && compareDeep(description, o.description, true)
2763           && compareDeep(legalStatusOfSupply, o.legalStatusOfSupply, true) && compareDeep(marketingStatus, o.marketingStatus, true)
2764           && compareDeep(characteristic, o.characteristic, true) && compareDeep(copackagedIndicator, o.copackagedIndicator, true)
2765           && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(attachedDocument, o.attachedDocument, true)
2766           && compareDeep(packaging, o.packaging, true);
2767      }
2768
2769      @Override
2770      public boolean equalsShallow(Base other_) {
2771        if (!super.equalsShallow(other_))
2772          return false;
2773        if (!(other_ instanceof PackagedProductDefinition))
2774          return false;
2775        PackagedProductDefinition o = (PackagedProductDefinition) other_;
2776        return compareValues(name, o.name, true) && compareValues(statusDate, o.statusDate, true) && compareValues(description, o.description, true)
2777           && compareValues(copackagedIndicator, o.copackagedIndicator, true);
2778      }
2779
2780      public boolean isEmpty() {
2781        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, name, type, packageFor
2782          , status, statusDate, containedItemQuantity, description, legalStatusOfSupply, marketingStatus
2783          , characteristic, copackagedIndicator, manufacturer, attachedDocument, packaging);
2784      }
2785
2786  @Override
2787  public ResourceType getResourceType() {
2788    return ResourceType.PackagedProductDefinition;
2789   }
2790
2791 /**
2792   * Search parameter: <b>biological</b>
2793   * <p>
2794   * Description: <b>A biologically derived product within this packaged product</b><br>
2795   * Type: <b>reference</b><br>
2796   * Path: <b>PackagedProductDefinition.packaging.containedItem.item.reference</b><br>
2797   * </p>
2798   */
2799  @SearchParamDefinition(name="biological", path="PackagedProductDefinition.packaging.containedItem.item.reference", description="A biologically derived product within this packaged product", type="reference" )
2800  public static final String SP_BIOLOGICAL = "biological";
2801 /**
2802   * <b>Fluent Client</b> search parameter constant for <b>biological</b>
2803   * <p>
2804   * Description: <b>A biologically derived product within this packaged product</b><br>
2805   * Type: <b>reference</b><br>
2806   * Path: <b>PackagedProductDefinition.packaging.containedItem.item.reference</b><br>
2807   * </p>
2808   */
2809  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BIOLOGICAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BIOLOGICAL);
2810
2811/**
2812   * Constant for fluent queries to be used to add include statements. Specifies
2813   * the path value of "<b>PackagedProductDefinition:biological</b>".
2814   */
2815  public static final ca.uhn.fhir.model.api.Include INCLUDE_BIOLOGICAL = new ca.uhn.fhir.model.api.Include("PackagedProductDefinition:biological").toLocked();
2816
2817 /**
2818   * Search parameter: <b>contained-item</b>
2819   * <p>
2820   * Description: <b>Any of the contained items within this packaged product</b><br>
2821   * Type: <b>reference</b><br>
2822   * Path: <b>PackagedProductDefinition.packaging.containedItem.item.reference</b><br>
2823   * </p>
2824   */
2825  @SearchParamDefinition(name="contained-item", path="PackagedProductDefinition.packaging.containedItem.item.reference", description="Any of the contained items within this packaged product", type="reference" )
2826  public static final String SP_CONTAINED_ITEM = "contained-item";
2827 /**
2828   * <b>Fluent Client</b> search parameter constant for <b>contained-item</b>
2829   * <p>
2830   * Description: <b>Any of the contained items within this packaged product</b><br>
2831   * Type: <b>reference</b><br>
2832   * Path: <b>PackagedProductDefinition.packaging.containedItem.item.reference</b><br>
2833   * </p>
2834   */
2835  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONTAINED_ITEM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONTAINED_ITEM);
2836
2837/**
2838   * Constant for fluent queries to be used to add include statements. Specifies
2839   * the path value of "<b>PackagedProductDefinition:contained-item</b>".
2840   */
2841  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONTAINED_ITEM = new ca.uhn.fhir.model.api.Include("PackagedProductDefinition:contained-item").toLocked();
2842
2843 /**
2844   * Search parameter: <b>device</b>
2845   * <p>
2846   * Description: <b>A device within this packaged product</b><br>
2847   * Type: <b>reference</b><br>
2848   * Path: <b>PackagedProductDefinition.packaging.containedItem.item.reference</b><br>
2849   * </p>
2850   */
2851  @SearchParamDefinition(name="device", path="PackagedProductDefinition.packaging.containedItem.item.reference", description="A device within this packaged product", type="reference" )
2852  public static final String SP_DEVICE = "device";
2853 /**
2854   * <b>Fluent Client</b> search parameter constant for <b>device</b>
2855   * <p>
2856   * Description: <b>A device within this packaged product</b><br>
2857   * Type: <b>reference</b><br>
2858   * Path: <b>PackagedProductDefinition.packaging.containedItem.item.reference</b><br>
2859   * </p>
2860   */
2861  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEVICE);
2862
2863/**
2864   * Constant for fluent queries to be used to add include statements. Specifies
2865   * the path value of "<b>PackagedProductDefinition:device</b>".
2866   */
2867  public static final ca.uhn.fhir.model.api.Include INCLUDE_DEVICE = new ca.uhn.fhir.model.api.Include("PackagedProductDefinition:device").toLocked();
2868
2869 /**
2870   * Search parameter: <b>identifier</b>
2871   * <p>
2872   * Description: <b>Unique identifier</b><br>
2873   * Type: <b>token</b><br>
2874   * Path: <b>PackagedProductDefinition.identifier</b><br>
2875   * </p>
2876   */
2877  @SearchParamDefinition(name="identifier", path="PackagedProductDefinition.identifier", description="Unique identifier", type="token" )
2878  public static final String SP_IDENTIFIER = "identifier";
2879 /**
2880   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2881   * <p>
2882   * Description: <b>Unique identifier</b><br>
2883   * Type: <b>token</b><br>
2884   * Path: <b>PackagedProductDefinition.identifier</b><br>
2885   * </p>
2886   */
2887  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2888
2889 /**
2890   * Search parameter: <b>manufactured-item</b>
2891   * <p>
2892   * Description: <b>A manufactured item of medication within this packaged product</b><br>
2893   * Type: <b>reference</b><br>
2894   * Path: <b>PackagedProductDefinition.packaging.containedItem.item.reference</b><br>
2895   * </p>
2896   */
2897  @SearchParamDefinition(name="manufactured-item", path="PackagedProductDefinition.packaging.containedItem.item.reference", description="A manufactured item of medication within this packaged product", type="reference" )
2898  public static final String SP_MANUFACTURED_ITEM = "manufactured-item";
2899 /**
2900   * <b>Fluent Client</b> search parameter constant for <b>manufactured-item</b>
2901   * <p>
2902   * Description: <b>A manufactured item of medication within this packaged product</b><br>
2903   * Type: <b>reference</b><br>
2904   * Path: <b>PackagedProductDefinition.packaging.containedItem.item.reference</b><br>
2905   * </p>
2906   */
2907  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MANUFACTURED_ITEM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MANUFACTURED_ITEM);
2908
2909/**
2910   * Constant for fluent queries to be used to add include statements. Specifies
2911   * the path value of "<b>PackagedProductDefinition:manufactured-item</b>".
2912   */
2913  public static final ca.uhn.fhir.model.api.Include INCLUDE_MANUFACTURED_ITEM = new ca.uhn.fhir.model.api.Include("PackagedProductDefinition:manufactured-item").toLocked();
2914
2915 /**
2916   * Search parameter: <b>medication</b>
2917   * <p>
2918   * Description: <b>A manufactured item of medication within this packaged product</b><br>
2919   * Type: <b>reference</b><br>
2920   * Path: <b>PackagedProductDefinition.packaging.containedItem.item.reference</b><br>
2921   * </p>
2922   */
2923  @SearchParamDefinition(name="medication", path="PackagedProductDefinition.packaging.containedItem.item.reference", description="A manufactured item of medication within this packaged product", type="reference" )
2924  public static final String SP_MEDICATION = "medication";
2925 /**
2926   * <b>Fluent Client</b> search parameter constant for <b>medication</b>
2927   * <p>
2928   * Description: <b>A manufactured item of medication within this packaged product</b><br>
2929   * Type: <b>reference</b><br>
2930   * Path: <b>PackagedProductDefinition.packaging.containedItem.item.reference</b><br>
2931   * </p>
2932   */
2933  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEDICATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEDICATION);
2934
2935/**
2936   * Constant for fluent queries to be used to add include statements. Specifies
2937   * the path value of "<b>PackagedProductDefinition:medication</b>".
2938   */
2939  public static final ca.uhn.fhir.model.api.Include INCLUDE_MEDICATION = new ca.uhn.fhir.model.api.Include("PackagedProductDefinition:medication").toLocked();
2940
2941 /**
2942   * Search parameter: <b>name</b>
2943   * <p>
2944   * Description: <b>A name for this package. Typically what it would be listed as in a drug formulary or catalogue, inventory etc</b><br>
2945   * Type: <b>token</b><br>
2946   * Path: <b>PackagedProductDefinition.name</b><br>
2947   * </p>
2948   */
2949  @SearchParamDefinition(name="name", path="PackagedProductDefinition.name", description="A name for this package. Typically what it would be listed as in a drug formulary or catalogue, inventory etc", type="token" )
2950  public static final String SP_NAME = "name";
2951 /**
2952   * <b>Fluent Client</b> search parameter constant for <b>name</b>
2953   * <p>
2954   * Description: <b>A name for this package. Typically what it would be listed as in a drug formulary or catalogue, inventory etc</b><br>
2955   * Type: <b>token</b><br>
2956   * Path: <b>PackagedProductDefinition.name</b><br>
2957   * </p>
2958   */
2959  public static final ca.uhn.fhir.rest.gclient.TokenClientParam NAME = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_NAME);
2960
2961 /**
2962   * Search parameter: <b>nutrition</b>
2963   * <p>
2964   * Description: <b>A nutrition product within this packaged product</b><br>
2965   * Type: <b>reference</b><br>
2966   * Path: <b>PackagedProductDefinition.packaging.containedItem.item.reference</b><br>
2967   * </p>
2968   */
2969  @SearchParamDefinition(name="nutrition", path="PackagedProductDefinition.packaging.containedItem.item.reference", description="A nutrition product within this packaged product", type="reference" )
2970  public static final String SP_NUTRITION = "nutrition";
2971 /**
2972   * <b>Fluent Client</b> search parameter constant for <b>nutrition</b>
2973   * <p>
2974   * Description: <b>A nutrition product within this packaged product</b><br>
2975   * Type: <b>reference</b><br>
2976   * Path: <b>PackagedProductDefinition.packaging.containedItem.item.reference</b><br>
2977   * </p>
2978   */
2979  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam NUTRITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_NUTRITION);
2980
2981/**
2982   * Constant for fluent queries to be used to add include statements. Specifies
2983   * the path value of "<b>PackagedProductDefinition:nutrition</b>".
2984   */
2985  public static final ca.uhn.fhir.model.api.Include INCLUDE_NUTRITION = new ca.uhn.fhir.model.api.Include("PackagedProductDefinition:nutrition").toLocked();
2986
2987 /**
2988   * Search parameter: <b>package-for</b>
2989   * <p>
2990   * Description: <b>The product that this is a pack for</b><br>
2991   * Type: <b>reference</b><br>
2992   * Path: <b>PackagedProductDefinition.packageFor</b><br>
2993   * </p>
2994   */
2995  @SearchParamDefinition(name="package-for", path="PackagedProductDefinition.packageFor", description="The product that this is a pack for", type="reference", target={MedicinalProductDefinition.class } )
2996  public static final String SP_PACKAGE_FOR = "package-for";
2997 /**
2998   * <b>Fluent Client</b> search parameter constant for <b>package-for</b>
2999   * <p>
3000   * Description: <b>The product that this is a pack for</b><br>
3001   * Type: <b>reference</b><br>
3002   * Path: <b>PackagedProductDefinition.packageFor</b><br>
3003   * </p>
3004   */
3005  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PACKAGE_FOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PACKAGE_FOR);
3006
3007/**
3008   * Constant for fluent queries to be used to add include statements. Specifies
3009   * the path value of "<b>PackagedProductDefinition:package-for</b>".
3010   */
3011  public static final ca.uhn.fhir.model.api.Include INCLUDE_PACKAGE_FOR = new ca.uhn.fhir.model.api.Include("PackagedProductDefinition:package-for").toLocked();
3012
3013 /**
3014   * Search parameter: <b>package</b>
3015   * <p>
3016   * Description: <b>A complete packaged product within this packaged product</b><br>
3017   * Type: <b>reference</b><br>
3018   * Path: <b>PackagedProductDefinition.packaging.containedItem.item.reference</b><br>
3019   * </p>
3020   */
3021  @SearchParamDefinition(name="package", path="PackagedProductDefinition.packaging.containedItem.item.reference", description="A complete packaged product within this packaged product", type="reference" )
3022  public static final String SP_PACKAGE = "package";
3023 /**
3024   * <b>Fluent Client</b> search parameter constant for <b>package</b>
3025   * <p>
3026   * Description: <b>A complete packaged product within this packaged product</b><br>
3027   * Type: <b>reference</b><br>
3028   * Path: <b>PackagedProductDefinition.packaging.containedItem.item.reference</b><br>
3029   * </p>
3030   */
3031  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PACKAGE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PACKAGE);
3032
3033/**
3034   * Constant for fluent queries to be used to add include statements. Specifies
3035   * the path value of "<b>PackagedProductDefinition:package</b>".
3036   */
3037  public static final ca.uhn.fhir.model.api.Include INCLUDE_PACKAGE = new ca.uhn.fhir.model.api.Include("PackagedProductDefinition:package").toLocked();
3038
3039 /**
3040   * Search parameter: <b>status</b>
3041   * <p>
3042   * Description: <b>The status within the lifecycle of this item. A high level status, this is not intended to duplicate details carried elsewhere such as legal status, or authorization or marketing status</b><br>
3043   * Type: <b>token</b><br>
3044   * Path: <b>PackagedProductDefinition.status</b><br>
3045   * </p>
3046   */
3047  @SearchParamDefinition(name="status", path="PackagedProductDefinition.status", description="The status within the lifecycle of this item. A high level status, this is not intended to duplicate details carried elsewhere such as legal status, or authorization or marketing status", type="token" )
3048  public static final String SP_STATUS = "status";
3049 /**
3050   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3051   * <p>
3052   * Description: <b>The status within the lifecycle of this item. A high level status, this is not intended to duplicate details carried elsewhere such as legal status, or authorization or marketing status</b><br>
3053   * Type: <b>token</b><br>
3054   * Path: <b>PackagedProductDefinition.status</b><br>
3055   * </p>
3056   */
3057  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3058
3059
3060}
3061