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 Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0
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 * Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use, drug catalogs, to support prescribing, adverse events management etc.).
052 */
053@ResourceDef(name="MedicinalProductDefinition", profile="http://hl7.org/fhir/StructureDefinition/MedicinalProductDefinition")
054public class MedicinalProductDefinition extends DomainResource {
055
056    @Block()
057    public static class MedicinalProductDefinitionContactComponent extends BackboneElement implements IBaseBackboneElement {
058        /**
059         * Allows the contact to be classified, for example QPPV, Pharmacovigilance Enquiry Information.
060         */
061        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
062        @Description(shortDefinition="Allows the contact to be classified, for example QPPV, Pharmacovigilance Enquiry Information", formalDefinition="Allows the contact to be classified, for example QPPV, Pharmacovigilance Enquiry Information." )
063        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medicinal-product-contact-type")
064        protected CodeableConcept type;
065
066        /**
067         * A product specific contact, person (in a role), or an organization.
068         */
069        @Child(name = "contact", type = {Organization.class, PractitionerRole.class}, order=2, min=1, max=1, modifier=false, summary=true)
070        @Description(shortDefinition="A product specific contact, person (in a role), or an organization", formalDefinition="A product specific contact, person (in a role), or an organization." )
071        protected Reference contact;
072
073        private static final long serialVersionUID = -587616244L;
074
075    /**
076     * Constructor
077     */
078      public MedicinalProductDefinitionContactComponent() {
079        super();
080      }
081
082    /**
083     * Constructor
084     */
085      public MedicinalProductDefinitionContactComponent(Reference contact) {
086        super();
087        this.setContact(contact);
088      }
089
090        /**
091         * @return {@link #type} (Allows the contact to be classified, for example QPPV, Pharmacovigilance Enquiry Information.)
092         */
093        public CodeableConcept getType() { 
094          if (this.type == null)
095            if (Configuration.errorOnAutoCreate())
096              throw new Error("Attempt to auto-create MedicinalProductDefinitionContactComponent.type");
097            else if (Configuration.doAutoCreate())
098              this.type = new CodeableConcept(); // cc
099          return this.type;
100        }
101
102        public boolean hasType() { 
103          return this.type != null && !this.type.isEmpty();
104        }
105
106        /**
107         * @param value {@link #type} (Allows the contact to be classified, for example QPPV, Pharmacovigilance Enquiry Information.)
108         */
109        public MedicinalProductDefinitionContactComponent setType(CodeableConcept value) { 
110          this.type = value;
111          return this;
112        }
113
114        /**
115         * @return {@link #contact} (A product specific contact, person (in a role), or an organization.)
116         */
117        public Reference getContact() { 
118          if (this.contact == null)
119            if (Configuration.errorOnAutoCreate())
120              throw new Error("Attempt to auto-create MedicinalProductDefinitionContactComponent.contact");
121            else if (Configuration.doAutoCreate())
122              this.contact = new Reference(); // cc
123          return this.contact;
124        }
125
126        public boolean hasContact() { 
127          return this.contact != null && !this.contact.isEmpty();
128        }
129
130        /**
131         * @param value {@link #contact} (A product specific contact, person (in a role), or an organization.)
132         */
133        public MedicinalProductDefinitionContactComponent setContact(Reference value) { 
134          this.contact = value;
135          return this;
136        }
137
138        protected void listChildren(List<Property> children) {
139          super.listChildren(children);
140          children.add(new Property("type", "CodeableConcept", "Allows the contact to be classified, for example QPPV, Pharmacovigilance Enquiry Information.", 0, 1, type));
141          children.add(new Property("contact", "Reference(Organization|PractitionerRole)", "A product specific contact, person (in a role), or an organization.", 0, 1, contact));
142        }
143
144        @Override
145        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
146          switch (_hash) {
147          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Allows the contact to be classified, for example QPPV, Pharmacovigilance Enquiry Information.", 0, 1, type);
148          case 951526432: /*contact*/  return new Property("contact", "Reference(Organization|PractitionerRole)", "A product specific contact, person (in a role), or an organization.", 0, 1, contact);
149          default: return super.getNamedProperty(_hash, _name, _checkValid);
150          }
151
152        }
153
154      @Override
155      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
156        switch (hash) {
157        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
158        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : new Base[] {this.contact}; // Reference
159        default: return super.getProperty(hash, name, checkValid);
160        }
161
162      }
163
164      @Override
165      public Base setProperty(int hash, String name, Base value) throws FHIRException {
166        switch (hash) {
167        case 3575610: // type
168          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
169          return value;
170        case 951526432: // contact
171          this.contact = TypeConvertor.castToReference(value); // Reference
172          return value;
173        default: return super.setProperty(hash, name, value);
174        }
175
176      }
177
178      @Override
179      public Base setProperty(String name, Base value) throws FHIRException {
180        if (name.equals("type")) {
181          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
182        } else if (name.equals("contact")) {
183          this.contact = TypeConvertor.castToReference(value); // Reference
184        } else
185          return super.setProperty(name, value);
186        return value;
187      }
188
189      @Override
190      public Base makeProperty(int hash, String name) throws FHIRException {
191        switch (hash) {
192        case 3575610:  return getType();
193        case 951526432:  return getContact();
194        default: return super.makeProperty(hash, name);
195        }
196
197      }
198
199      @Override
200      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
201        switch (hash) {
202        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
203        case 951526432: /*contact*/ return new String[] {"Reference"};
204        default: return super.getTypesForProperty(hash, name);
205        }
206
207      }
208
209      @Override
210      public Base addChild(String name) throws FHIRException {
211        if (name.equals("type")) {
212          this.type = new CodeableConcept();
213          return this.type;
214        }
215        else if (name.equals("contact")) {
216          this.contact = new Reference();
217          return this.contact;
218        }
219        else
220          return super.addChild(name);
221      }
222
223      public MedicinalProductDefinitionContactComponent copy() {
224        MedicinalProductDefinitionContactComponent dst = new MedicinalProductDefinitionContactComponent();
225        copyValues(dst);
226        return dst;
227      }
228
229      public void copyValues(MedicinalProductDefinitionContactComponent dst) {
230        super.copyValues(dst);
231        dst.type = type == null ? null : type.copy();
232        dst.contact = contact == null ? null : contact.copy();
233      }
234
235      @Override
236      public boolean equalsDeep(Base other_) {
237        if (!super.equalsDeep(other_))
238          return false;
239        if (!(other_ instanceof MedicinalProductDefinitionContactComponent))
240          return false;
241        MedicinalProductDefinitionContactComponent o = (MedicinalProductDefinitionContactComponent) other_;
242        return compareDeep(type, o.type, true) && compareDeep(contact, o.contact, true);
243      }
244
245      @Override
246      public boolean equalsShallow(Base other_) {
247        if (!super.equalsShallow(other_))
248          return false;
249        if (!(other_ instanceof MedicinalProductDefinitionContactComponent))
250          return false;
251        MedicinalProductDefinitionContactComponent o = (MedicinalProductDefinitionContactComponent) other_;
252        return true;
253      }
254
255      public boolean isEmpty() {
256        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, contact);
257      }
258
259  public String fhirType() {
260    return "MedicinalProductDefinition.contact";
261
262  }
263
264  }
265
266    @Block()
267    public static class MedicinalProductDefinitionNameComponent extends BackboneElement implements IBaseBackboneElement {
268        /**
269         * The full product name.
270         */
271        @Child(name = "productName", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
272        @Description(shortDefinition="The full product name", formalDefinition="The full product name." )
273        protected StringType productName;
274
275        /**
276         * Type of product name, such as rINN, BAN, Proprietary, Non-Proprietary.
277         */
278        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
279        @Description(shortDefinition="Type of product name, such as rINN, BAN, Proprietary, Non-Proprietary", formalDefinition="Type of product name, such as rINN, BAN, Proprietary, Non-Proprietary." )
280        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medicinal-product-name-type")
281        protected CodeableConcept type;
282
283        /**
284         * Coding words or phrases of the name.
285         */
286        @Child(name = "part", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
287        @Description(shortDefinition="Coding words or phrases of the name", formalDefinition="Coding words or phrases of the name." )
288        protected List<MedicinalProductDefinitionNamePartComponent> part;
289
290        /**
291         * Country and jurisdiction where the name applies, and associated language.
292         */
293        @Child(name = "usage", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
294        @Description(shortDefinition="Country and jurisdiction where the name applies", formalDefinition="Country and jurisdiction where the name applies, and associated language." )
295        protected List<MedicinalProductDefinitionNameUsageComponent> usage;
296
297        private static final long serialVersionUID = 890277480L;
298
299    /**
300     * Constructor
301     */
302      public MedicinalProductDefinitionNameComponent() {
303        super();
304      }
305
306    /**
307     * Constructor
308     */
309      public MedicinalProductDefinitionNameComponent(String productName) {
310        super();
311        this.setProductName(productName);
312      }
313
314        /**
315         * @return {@link #productName} (The full product name.). This is the underlying object with id, value and extensions. The accessor "getProductName" gives direct access to the value
316         */
317        public StringType getProductNameElement() { 
318          if (this.productName == null)
319            if (Configuration.errorOnAutoCreate())
320              throw new Error("Attempt to auto-create MedicinalProductDefinitionNameComponent.productName");
321            else if (Configuration.doAutoCreate())
322              this.productName = new StringType(); // bb
323          return this.productName;
324        }
325
326        public boolean hasProductNameElement() { 
327          return this.productName != null && !this.productName.isEmpty();
328        }
329
330        public boolean hasProductName() { 
331          return this.productName != null && !this.productName.isEmpty();
332        }
333
334        /**
335         * @param value {@link #productName} (The full product name.). This is the underlying object with id, value and extensions. The accessor "getProductName" gives direct access to the value
336         */
337        public MedicinalProductDefinitionNameComponent setProductNameElement(StringType value) { 
338          this.productName = value;
339          return this;
340        }
341
342        /**
343         * @return The full product name.
344         */
345        public String getProductName() { 
346          return this.productName == null ? null : this.productName.getValue();
347        }
348
349        /**
350         * @param value The full product name.
351         */
352        public MedicinalProductDefinitionNameComponent setProductName(String value) { 
353            if (this.productName == null)
354              this.productName = new StringType();
355            this.productName.setValue(value);
356          return this;
357        }
358
359        /**
360         * @return {@link #type} (Type of product name, such as rINN, BAN, Proprietary, Non-Proprietary.)
361         */
362        public CodeableConcept getType() { 
363          if (this.type == null)
364            if (Configuration.errorOnAutoCreate())
365              throw new Error("Attempt to auto-create MedicinalProductDefinitionNameComponent.type");
366            else if (Configuration.doAutoCreate())
367              this.type = new CodeableConcept(); // cc
368          return this.type;
369        }
370
371        public boolean hasType() { 
372          return this.type != null && !this.type.isEmpty();
373        }
374
375        /**
376         * @param value {@link #type} (Type of product name, such as rINN, BAN, Proprietary, Non-Proprietary.)
377         */
378        public MedicinalProductDefinitionNameComponent setType(CodeableConcept value) { 
379          this.type = value;
380          return this;
381        }
382
383        /**
384         * @return {@link #part} (Coding words or phrases of the name.)
385         */
386        public List<MedicinalProductDefinitionNamePartComponent> getPart() { 
387          if (this.part == null)
388            this.part = new ArrayList<MedicinalProductDefinitionNamePartComponent>();
389          return this.part;
390        }
391
392        /**
393         * @return Returns a reference to <code>this</code> for easy method chaining
394         */
395        public MedicinalProductDefinitionNameComponent setPart(List<MedicinalProductDefinitionNamePartComponent> thePart) { 
396          this.part = thePart;
397          return this;
398        }
399
400        public boolean hasPart() { 
401          if (this.part == null)
402            return false;
403          for (MedicinalProductDefinitionNamePartComponent item : this.part)
404            if (!item.isEmpty())
405              return true;
406          return false;
407        }
408
409        public MedicinalProductDefinitionNamePartComponent addPart() { //3
410          MedicinalProductDefinitionNamePartComponent t = new MedicinalProductDefinitionNamePartComponent();
411          if (this.part == null)
412            this.part = new ArrayList<MedicinalProductDefinitionNamePartComponent>();
413          this.part.add(t);
414          return t;
415        }
416
417        public MedicinalProductDefinitionNameComponent addPart(MedicinalProductDefinitionNamePartComponent t) { //3
418          if (t == null)
419            return this;
420          if (this.part == null)
421            this.part = new ArrayList<MedicinalProductDefinitionNamePartComponent>();
422          this.part.add(t);
423          return this;
424        }
425
426        /**
427         * @return The first repetition of repeating field {@link #part}, creating it if it does not already exist {3}
428         */
429        public MedicinalProductDefinitionNamePartComponent getPartFirstRep() { 
430          if (getPart().isEmpty()) {
431            addPart();
432          }
433          return getPart().get(0);
434        }
435
436        /**
437         * @return {@link #usage} (Country and jurisdiction where the name applies, and associated language.)
438         */
439        public List<MedicinalProductDefinitionNameUsageComponent> getUsage() { 
440          if (this.usage == null)
441            this.usage = new ArrayList<MedicinalProductDefinitionNameUsageComponent>();
442          return this.usage;
443        }
444
445        /**
446         * @return Returns a reference to <code>this</code> for easy method chaining
447         */
448        public MedicinalProductDefinitionNameComponent setUsage(List<MedicinalProductDefinitionNameUsageComponent> theUsage) { 
449          this.usage = theUsage;
450          return this;
451        }
452
453        public boolean hasUsage() { 
454          if (this.usage == null)
455            return false;
456          for (MedicinalProductDefinitionNameUsageComponent item : this.usage)
457            if (!item.isEmpty())
458              return true;
459          return false;
460        }
461
462        public MedicinalProductDefinitionNameUsageComponent addUsage() { //3
463          MedicinalProductDefinitionNameUsageComponent t = new MedicinalProductDefinitionNameUsageComponent();
464          if (this.usage == null)
465            this.usage = new ArrayList<MedicinalProductDefinitionNameUsageComponent>();
466          this.usage.add(t);
467          return t;
468        }
469
470        public MedicinalProductDefinitionNameComponent addUsage(MedicinalProductDefinitionNameUsageComponent t) { //3
471          if (t == null)
472            return this;
473          if (this.usage == null)
474            this.usage = new ArrayList<MedicinalProductDefinitionNameUsageComponent>();
475          this.usage.add(t);
476          return this;
477        }
478
479        /**
480         * @return The first repetition of repeating field {@link #usage}, creating it if it does not already exist {3}
481         */
482        public MedicinalProductDefinitionNameUsageComponent getUsageFirstRep() { 
483          if (getUsage().isEmpty()) {
484            addUsage();
485          }
486          return getUsage().get(0);
487        }
488
489        protected void listChildren(List<Property> children) {
490          super.listChildren(children);
491          children.add(new Property("productName", "string", "The full product name.", 0, 1, productName));
492          children.add(new Property("type", "CodeableConcept", "Type of product name, such as rINN, BAN, Proprietary, Non-Proprietary.", 0, 1, type));
493          children.add(new Property("part", "", "Coding words or phrases of the name.", 0, java.lang.Integer.MAX_VALUE, part));
494          children.add(new Property("usage", "", "Country and jurisdiction where the name applies, and associated language.", 0, java.lang.Integer.MAX_VALUE, usage));
495        }
496
497        @Override
498        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
499          switch (_hash) {
500          case -1491817446: /*productName*/  return new Property("productName", "string", "The full product name.", 0, 1, productName);
501          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Type of product name, such as rINN, BAN, Proprietary, Non-Proprietary.", 0, 1, type);
502          case 3433459: /*part*/  return new Property("part", "", "Coding words or phrases of the name.", 0, java.lang.Integer.MAX_VALUE, part);
503          case 111574433: /*usage*/  return new Property("usage", "", "Country and jurisdiction where the name applies, and associated language.", 0, java.lang.Integer.MAX_VALUE, usage);
504          default: return super.getNamedProperty(_hash, _name, _checkValid);
505          }
506
507        }
508
509      @Override
510      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
511        switch (hash) {
512        case -1491817446: /*productName*/ return this.productName == null ? new Base[0] : new Base[] {this.productName}; // StringType
513        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
514        case 3433459: /*part*/ return this.part == null ? new Base[0] : this.part.toArray(new Base[this.part.size()]); // MedicinalProductDefinitionNamePartComponent
515        case 111574433: /*usage*/ return this.usage == null ? new Base[0] : this.usage.toArray(new Base[this.usage.size()]); // MedicinalProductDefinitionNameUsageComponent
516        default: return super.getProperty(hash, name, checkValid);
517        }
518
519      }
520
521      @Override
522      public Base setProperty(int hash, String name, Base value) throws FHIRException {
523        switch (hash) {
524        case -1491817446: // productName
525          this.productName = TypeConvertor.castToString(value); // StringType
526          return value;
527        case 3575610: // type
528          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
529          return value;
530        case 3433459: // part
531          this.getPart().add((MedicinalProductDefinitionNamePartComponent) value); // MedicinalProductDefinitionNamePartComponent
532          return value;
533        case 111574433: // usage
534          this.getUsage().add((MedicinalProductDefinitionNameUsageComponent) value); // MedicinalProductDefinitionNameUsageComponent
535          return value;
536        default: return super.setProperty(hash, name, value);
537        }
538
539      }
540
541      @Override
542      public Base setProperty(String name, Base value) throws FHIRException {
543        if (name.equals("productName")) {
544          this.productName = TypeConvertor.castToString(value); // StringType
545        } else if (name.equals("type")) {
546          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
547        } else if (name.equals("part")) {
548          this.getPart().add((MedicinalProductDefinitionNamePartComponent) value);
549        } else if (name.equals("usage")) {
550          this.getUsage().add((MedicinalProductDefinitionNameUsageComponent) value);
551        } else
552          return super.setProperty(name, value);
553        return value;
554      }
555
556      @Override
557      public Base makeProperty(int hash, String name) throws FHIRException {
558        switch (hash) {
559        case -1491817446:  return getProductNameElement();
560        case 3575610:  return getType();
561        case 3433459:  return addPart(); 
562        case 111574433:  return addUsage(); 
563        default: return super.makeProperty(hash, name);
564        }
565
566      }
567
568      @Override
569      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
570        switch (hash) {
571        case -1491817446: /*productName*/ return new String[] {"string"};
572        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
573        case 3433459: /*part*/ return new String[] {};
574        case 111574433: /*usage*/ return new String[] {};
575        default: return super.getTypesForProperty(hash, name);
576        }
577
578      }
579
580      @Override
581      public Base addChild(String name) throws FHIRException {
582        if (name.equals("productName")) {
583          throw new FHIRException("Cannot call addChild on a singleton property MedicinalProductDefinition.name.productName");
584        }
585        else if (name.equals("type")) {
586          this.type = new CodeableConcept();
587          return this.type;
588        }
589        else if (name.equals("part")) {
590          return addPart();
591        }
592        else if (name.equals("usage")) {
593          return addUsage();
594        }
595        else
596          return super.addChild(name);
597      }
598
599      public MedicinalProductDefinitionNameComponent copy() {
600        MedicinalProductDefinitionNameComponent dst = new MedicinalProductDefinitionNameComponent();
601        copyValues(dst);
602        return dst;
603      }
604
605      public void copyValues(MedicinalProductDefinitionNameComponent dst) {
606        super.copyValues(dst);
607        dst.productName = productName == null ? null : productName.copy();
608        dst.type = type == null ? null : type.copy();
609        if (part != null) {
610          dst.part = new ArrayList<MedicinalProductDefinitionNamePartComponent>();
611          for (MedicinalProductDefinitionNamePartComponent i : part)
612            dst.part.add(i.copy());
613        };
614        if (usage != null) {
615          dst.usage = new ArrayList<MedicinalProductDefinitionNameUsageComponent>();
616          for (MedicinalProductDefinitionNameUsageComponent i : usage)
617            dst.usage.add(i.copy());
618        };
619      }
620
621      @Override
622      public boolean equalsDeep(Base other_) {
623        if (!super.equalsDeep(other_))
624          return false;
625        if (!(other_ instanceof MedicinalProductDefinitionNameComponent))
626          return false;
627        MedicinalProductDefinitionNameComponent o = (MedicinalProductDefinitionNameComponent) other_;
628        return compareDeep(productName, o.productName, true) && compareDeep(type, o.type, true) && compareDeep(part, o.part, true)
629           && compareDeep(usage, o.usage, true);
630      }
631
632      @Override
633      public boolean equalsShallow(Base other_) {
634        if (!super.equalsShallow(other_))
635          return false;
636        if (!(other_ instanceof MedicinalProductDefinitionNameComponent))
637          return false;
638        MedicinalProductDefinitionNameComponent o = (MedicinalProductDefinitionNameComponent) other_;
639        return compareValues(productName, o.productName, true);
640      }
641
642      public boolean isEmpty() {
643        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(productName, type, part
644          , usage);
645      }
646
647  public String fhirType() {
648    return "MedicinalProductDefinition.name";
649
650  }
651
652  }
653
654    @Block()
655    public static class MedicinalProductDefinitionNamePartComponent extends BackboneElement implements IBaseBackboneElement {
656        /**
657         * A fragment of a product name.
658         */
659        @Child(name = "part", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
660        @Description(shortDefinition="A fragment of a product name", formalDefinition="A fragment of a product name." )
661        protected StringType part;
662
663        /**
664         * Identifying type for this part of the name (e.g. strength part).
665         */
666        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=true)
667        @Description(shortDefinition="Identifying type for this part of the name (e.g. strength part)", formalDefinition="Identifying type for this part of the name (e.g. strength part)." )
668        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medicinal-product-name-part-type")
669        protected CodeableConcept type;
670
671        private static final long serialVersionUID = -1359126549L;
672
673    /**
674     * Constructor
675     */
676      public MedicinalProductDefinitionNamePartComponent() {
677        super();
678      }
679
680    /**
681     * Constructor
682     */
683      public MedicinalProductDefinitionNamePartComponent(String part, CodeableConcept type) {
684        super();
685        this.setPart(part);
686        this.setType(type);
687      }
688
689        /**
690         * @return {@link #part} (A fragment of a product name.). This is the underlying object with id, value and extensions. The accessor "getPart" gives direct access to the value
691         */
692        public StringType getPartElement() { 
693          if (this.part == null)
694            if (Configuration.errorOnAutoCreate())
695              throw new Error("Attempt to auto-create MedicinalProductDefinitionNamePartComponent.part");
696            else if (Configuration.doAutoCreate())
697              this.part = new StringType(); // bb
698          return this.part;
699        }
700
701        public boolean hasPartElement() { 
702          return this.part != null && !this.part.isEmpty();
703        }
704
705        public boolean hasPart() { 
706          return this.part != null && !this.part.isEmpty();
707        }
708
709        /**
710         * @param value {@link #part} (A fragment of a product name.). This is the underlying object with id, value and extensions. The accessor "getPart" gives direct access to the value
711         */
712        public MedicinalProductDefinitionNamePartComponent setPartElement(StringType value) { 
713          this.part = value;
714          return this;
715        }
716
717        /**
718         * @return A fragment of a product name.
719         */
720        public String getPart() { 
721          return this.part == null ? null : this.part.getValue();
722        }
723
724        /**
725         * @param value A fragment of a product name.
726         */
727        public MedicinalProductDefinitionNamePartComponent setPart(String value) { 
728            if (this.part == null)
729              this.part = new StringType();
730            this.part.setValue(value);
731          return this;
732        }
733
734        /**
735         * @return {@link #type} (Identifying type for this part of the name (e.g. strength part).)
736         */
737        public CodeableConcept getType() { 
738          if (this.type == null)
739            if (Configuration.errorOnAutoCreate())
740              throw new Error("Attempt to auto-create MedicinalProductDefinitionNamePartComponent.type");
741            else if (Configuration.doAutoCreate())
742              this.type = new CodeableConcept(); // cc
743          return this.type;
744        }
745
746        public boolean hasType() { 
747          return this.type != null && !this.type.isEmpty();
748        }
749
750        /**
751         * @param value {@link #type} (Identifying type for this part of the name (e.g. strength part).)
752         */
753        public MedicinalProductDefinitionNamePartComponent setType(CodeableConcept value) { 
754          this.type = value;
755          return this;
756        }
757
758        protected void listChildren(List<Property> children) {
759          super.listChildren(children);
760          children.add(new Property("part", "string", "A fragment of a product name.", 0, 1, part));
761          children.add(new Property("type", "CodeableConcept", "Identifying type for this part of the name (e.g. strength part).", 0, 1, type));
762        }
763
764        @Override
765        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
766          switch (_hash) {
767          case 3433459: /*part*/  return new Property("part", "string", "A fragment of a product name.", 0, 1, part);
768          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Identifying type for this part of the name (e.g. strength part).", 0, 1, type);
769          default: return super.getNamedProperty(_hash, _name, _checkValid);
770          }
771
772        }
773
774      @Override
775      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
776        switch (hash) {
777        case 3433459: /*part*/ return this.part == null ? new Base[0] : new Base[] {this.part}; // StringType
778        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
779        default: return super.getProperty(hash, name, checkValid);
780        }
781
782      }
783
784      @Override
785      public Base setProperty(int hash, String name, Base value) throws FHIRException {
786        switch (hash) {
787        case 3433459: // part
788          this.part = TypeConvertor.castToString(value); // StringType
789          return value;
790        case 3575610: // type
791          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
792          return value;
793        default: return super.setProperty(hash, name, value);
794        }
795
796      }
797
798      @Override
799      public Base setProperty(String name, Base value) throws FHIRException {
800        if (name.equals("part")) {
801          this.part = TypeConvertor.castToString(value); // StringType
802        } else if (name.equals("type")) {
803          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
804        } else
805          return super.setProperty(name, value);
806        return value;
807      }
808
809      @Override
810      public Base makeProperty(int hash, String name) throws FHIRException {
811        switch (hash) {
812        case 3433459:  return getPartElement();
813        case 3575610:  return getType();
814        default: return super.makeProperty(hash, name);
815        }
816
817      }
818
819      @Override
820      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
821        switch (hash) {
822        case 3433459: /*part*/ return new String[] {"string"};
823        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
824        default: return super.getTypesForProperty(hash, name);
825        }
826
827      }
828
829      @Override
830      public Base addChild(String name) throws FHIRException {
831        if (name.equals("part")) {
832          throw new FHIRException("Cannot call addChild on a singleton property MedicinalProductDefinition.name.part.part");
833        }
834        else if (name.equals("type")) {
835          this.type = new CodeableConcept();
836          return this.type;
837        }
838        else
839          return super.addChild(name);
840      }
841
842      public MedicinalProductDefinitionNamePartComponent copy() {
843        MedicinalProductDefinitionNamePartComponent dst = new MedicinalProductDefinitionNamePartComponent();
844        copyValues(dst);
845        return dst;
846      }
847
848      public void copyValues(MedicinalProductDefinitionNamePartComponent dst) {
849        super.copyValues(dst);
850        dst.part = part == null ? null : part.copy();
851        dst.type = type == null ? null : type.copy();
852      }
853
854      @Override
855      public boolean equalsDeep(Base other_) {
856        if (!super.equalsDeep(other_))
857          return false;
858        if (!(other_ instanceof MedicinalProductDefinitionNamePartComponent))
859          return false;
860        MedicinalProductDefinitionNamePartComponent o = (MedicinalProductDefinitionNamePartComponent) other_;
861        return compareDeep(part, o.part, true) && compareDeep(type, o.type, true);
862      }
863
864      @Override
865      public boolean equalsShallow(Base other_) {
866        if (!super.equalsShallow(other_))
867          return false;
868        if (!(other_ instanceof MedicinalProductDefinitionNamePartComponent))
869          return false;
870        MedicinalProductDefinitionNamePartComponent o = (MedicinalProductDefinitionNamePartComponent) other_;
871        return compareValues(part, o.part, true);
872      }
873
874      public boolean isEmpty() {
875        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(part, type);
876      }
877
878  public String fhirType() {
879    return "MedicinalProductDefinition.name.part";
880
881  }
882
883  }
884
885    @Block()
886    public static class MedicinalProductDefinitionNameUsageComponent extends BackboneElement implements IBaseBackboneElement {
887        /**
888         * Country code for where this name applies.
889         */
890        @Child(name = "country", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
891        @Description(shortDefinition="Country code for where this name applies", formalDefinition="Country code for where this name applies." )
892        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/country")
893        protected CodeableConcept country;
894
895        /**
896         * Jurisdiction code for where this name applies. A jurisdiction may be a sub- or supra-national entity (e.g. a state or a geographic region).
897         */
898        @Child(name = "jurisdiction", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
899        @Description(shortDefinition="Jurisdiction code for where this name applies", formalDefinition="Jurisdiction code for where this name applies. A jurisdiction may be a sub- or supra-national entity (e.g. a state or a geographic region)." )
900        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/jurisdiction")
901        protected CodeableConcept jurisdiction;
902
903        /**
904         * Language code for this name.
905         */
906        @Child(name = "language", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=true)
907        @Description(shortDefinition="Language code for this name", formalDefinition="Language code for this name." )
908        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/all-languages")
909        protected CodeableConcept language;
910
911        private static final long serialVersionUID = 1627157564L;
912
913    /**
914     * Constructor
915     */
916      public MedicinalProductDefinitionNameUsageComponent() {
917        super();
918      }
919
920    /**
921     * Constructor
922     */
923      public MedicinalProductDefinitionNameUsageComponent(CodeableConcept country, CodeableConcept language) {
924        super();
925        this.setCountry(country);
926        this.setLanguage(language);
927      }
928
929        /**
930         * @return {@link #country} (Country code for where this name applies.)
931         */
932        public CodeableConcept getCountry() { 
933          if (this.country == null)
934            if (Configuration.errorOnAutoCreate())
935              throw new Error("Attempt to auto-create MedicinalProductDefinitionNameUsageComponent.country");
936            else if (Configuration.doAutoCreate())
937              this.country = new CodeableConcept(); // cc
938          return this.country;
939        }
940
941        public boolean hasCountry() { 
942          return this.country != null && !this.country.isEmpty();
943        }
944
945        /**
946         * @param value {@link #country} (Country code for where this name applies.)
947         */
948        public MedicinalProductDefinitionNameUsageComponent setCountry(CodeableConcept value) { 
949          this.country = value;
950          return this;
951        }
952
953        /**
954         * @return {@link #jurisdiction} (Jurisdiction code for where this name applies. A jurisdiction may be a sub- or supra-national entity (e.g. a state or a geographic region).)
955         */
956        public CodeableConcept getJurisdiction() { 
957          if (this.jurisdiction == null)
958            if (Configuration.errorOnAutoCreate())
959              throw new Error("Attempt to auto-create MedicinalProductDefinitionNameUsageComponent.jurisdiction");
960            else if (Configuration.doAutoCreate())
961              this.jurisdiction = new CodeableConcept(); // cc
962          return this.jurisdiction;
963        }
964
965        public boolean hasJurisdiction() { 
966          return this.jurisdiction != null && !this.jurisdiction.isEmpty();
967        }
968
969        /**
970         * @param value {@link #jurisdiction} (Jurisdiction code for where this name applies. A jurisdiction may be a sub- or supra-national entity (e.g. a state or a geographic region).)
971         */
972        public MedicinalProductDefinitionNameUsageComponent setJurisdiction(CodeableConcept value) { 
973          this.jurisdiction = value;
974          return this;
975        }
976
977        /**
978         * @return {@link #language} (Language code for this name.)
979         */
980        public CodeableConcept getLanguage() { 
981          if (this.language == null)
982            if (Configuration.errorOnAutoCreate())
983              throw new Error("Attempt to auto-create MedicinalProductDefinitionNameUsageComponent.language");
984            else if (Configuration.doAutoCreate())
985              this.language = new CodeableConcept(); // cc
986          return this.language;
987        }
988
989        public boolean hasLanguage() { 
990          return this.language != null && !this.language.isEmpty();
991        }
992
993        /**
994         * @param value {@link #language} (Language code for this name.)
995         */
996        public MedicinalProductDefinitionNameUsageComponent setLanguage(CodeableConcept value) { 
997          this.language = value;
998          return this;
999        }
1000
1001        protected void listChildren(List<Property> children) {
1002          super.listChildren(children);
1003          children.add(new Property("country", "CodeableConcept", "Country code for where this name applies.", 0, 1, country));
1004          children.add(new Property("jurisdiction", "CodeableConcept", "Jurisdiction code for where this name applies. A jurisdiction may be a sub- or supra-national entity (e.g. a state or a geographic region).", 0, 1, jurisdiction));
1005          children.add(new Property("language", "CodeableConcept", "Language code for this name.", 0, 1, language));
1006        }
1007
1008        @Override
1009        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1010          switch (_hash) {
1011          case 957831062: /*country*/  return new Property("country", "CodeableConcept", "Country code for where this name applies.", 0, 1, country);
1012          case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "Jurisdiction code for where this name applies. A jurisdiction may be a sub- or supra-national entity (e.g. a state or a geographic region).", 0, 1, jurisdiction);
1013          case -1613589672: /*language*/  return new Property("language", "CodeableConcept", "Language code for this name.", 0, 1, language);
1014          default: return super.getNamedProperty(_hash, _name, _checkValid);
1015          }
1016
1017        }
1018
1019      @Override
1020      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1021        switch (hash) {
1022        case 957831062: /*country*/ return this.country == null ? new Base[0] : new Base[] {this.country}; // CodeableConcept
1023        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : new Base[] {this.jurisdiction}; // CodeableConcept
1024        case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeableConcept
1025        default: return super.getProperty(hash, name, checkValid);
1026        }
1027
1028      }
1029
1030      @Override
1031      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1032        switch (hash) {
1033        case 957831062: // country
1034          this.country = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1035          return value;
1036        case -507075711: // jurisdiction
1037          this.jurisdiction = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1038          return value;
1039        case -1613589672: // language
1040          this.language = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1041          return value;
1042        default: return super.setProperty(hash, name, value);
1043        }
1044
1045      }
1046
1047      @Override
1048      public Base setProperty(String name, Base value) throws FHIRException {
1049        if (name.equals("country")) {
1050          this.country = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1051        } else if (name.equals("jurisdiction")) {
1052          this.jurisdiction = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1053        } else if (name.equals("language")) {
1054          this.language = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1055        } else
1056          return super.setProperty(name, value);
1057        return value;
1058      }
1059
1060      @Override
1061      public Base makeProperty(int hash, String name) throws FHIRException {
1062        switch (hash) {
1063        case 957831062:  return getCountry();
1064        case -507075711:  return getJurisdiction();
1065        case -1613589672:  return getLanguage();
1066        default: return super.makeProperty(hash, name);
1067        }
1068
1069      }
1070
1071      @Override
1072      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1073        switch (hash) {
1074        case 957831062: /*country*/ return new String[] {"CodeableConcept"};
1075        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
1076        case -1613589672: /*language*/ return new String[] {"CodeableConcept"};
1077        default: return super.getTypesForProperty(hash, name);
1078        }
1079
1080      }
1081
1082      @Override
1083      public Base addChild(String name) throws FHIRException {
1084        if (name.equals("country")) {
1085          this.country = new CodeableConcept();
1086          return this.country;
1087        }
1088        else if (name.equals("jurisdiction")) {
1089          this.jurisdiction = new CodeableConcept();
1090          return this.jurisdiction;
1091        }
1092        else if (name.equals("language")) {
1093          this.language = new CodeableConcept();
1094          return this.language;
1095        }
1096        else
1097          return super.addChild(name);
1098      }
1099
1100      public MedicinalProductDefinitionNameUsageComponent copy() {
1101        MedicinalProductDefinitionNameUsageComponent dst = new MedicinalProductDefinitionNameUsageComponent();
1102        copyValues(dst);
1103        return dst;
1104      }
1105
1106      public void copyValues(MedicinalProductDefinitionNameUsageComponent dst) {
1107        super.copyValues(dst);
1108        dst.country = country == null ? null : country.copy();
1109        dst.jurisdiction = jurisdiction == null ? null : jurisdiction.copy();
1110        dst.language = language == null ? null : language.copy();
1111      }
1112
1113      @Override
1114      public boolean equalsDeep(Base other_) {
1115        if (!super.equalsDeep(other_))
1116          return false;
1117        if (!(other_ instanceof MedicinalProductDefinitionNameUsageComponent))
1118          return false;
1119        MedicinalProductDefinitionNameUsageComponent o = (MedicinalProductDefinitionNameUsageComponent) other_;
1120        return compareDeep(country, o.country, true) && compareDeep(jurisdiction, o.jurisdiction, true)
1121           && compareDeep(language, o.language, true);
1122      }
1123
1124      @Override
1125      public boolean equalsShallow(Base other_) {
1126        if (!super.equalsShallow(other_))
1127          return false;
1128        if (!(other_ instanceof MedicinalProductDefinitionNameUsageComponent))
1129          return false;
1130        MedicinalProductDefinitionNameUsageComponent o = (MedicinalProductDefinitionNameUsageComponent) other_;
1131        return true;
1132      }
1133
1134      public boolean isEmpty() {
1135        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(country, jurisdiction, language
1136          );
1137      }
1138
1139  public String fhirType() {
1140    return "MedicinalProductDefinition.name.usage";
1141
1142  }
1143
1144  }
1145
1146    @Block()
1147    public static class MedicinalProductDefinitionCrossReferenceComponent extends BackboneElement implements IBaseBackboneElement {
1148        /**
1149         * Reference to another product, e.g. for linking authorised to investigational product.
1150         */
1151        @Child(name = "product", type = {CodeableReference.class}, order=1, min=1, max=1, modifier=false, summary=true)
1152        @Description(shortDefinition="Reference to another product, e.g. for linking authorised to investigational product", formalDefinition="Reference to another product, e.g. for linking authorised to investigational product." )
1153        protected CodeableReference product;
1154
1155        /**
1156         * The type of relationship, for instance branded to generic, virtual to actual product, product to development product (investigational), parallel import version.
1157         */
1158        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
1159        @Description(shortDefinition="The type of relationship, for instance branded to generic or virtual to actual product", formalDefinition="The type of relationship, for instance branded to generic, virtual to actual product, product to development product (investigational), parallel import version." )
1160        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medicinal-product-cross-reference-type")
1161        protected CodeableConcept type;
1162
1163        private static final long serialVersionUID = -1746125578L;
1164
1165    /**
1166     * Constructor
1167     */
1168      public MedicinalProductDefinitionCrossReferenceComponent() {
1169        super();
1170      }
1171
1172    /**
1173     * Constructor
1174     */
1175      public MedicinalProductDefinitionCrossReferenceComponent(CodeableReference product) {
1176        super();
1177        this.setProduct(product);
1178      }
1179
1180        /**
1181         * @return {@link #product} (Reference to another product, e.g. for linking authorised to investigational product.)
1182         */
1183        public CodeableReference getProduct() { 
1184          if (this.product == null)
1185            if (Configuration.errorOnAutoCreate())
1186              throw new Error("Attempt to auto-create MedicinalProductDefinitionCrossReferenceComponent.product");
1187            else if (Configuration.doAutoCreate())
1188              this.product = new CodeableReference(); // cc
1189          return this.product;
1190        }
1191
1192        public boolean hasProduct() { 
1193          return this.product != null && !this.product.isEmpty();
1194        }
1195
1196        /**
1197         * @param value {@link #product} (Reference to another product, e.g. for linking authorised to investigational product.)
1198         */
1199        public MedicinalProductDefinitionCrossReferenceComponent setProduct(CodeableReference value) { 
1200          this.product = value;
1201          return this;
1202        }
1203
1204        /**
1205         * @return {@link #type} (The type of relationship, for instance branded to generic, virtual to actual product, product to development product (investigational), parallel import version.)
1206         */
1207        public CodeableConcept getType() { 
1208          if (this.type == null)
1209            if (Configuration.errorOnAutoCreate())
1210              throw new Error("Attempt to auto-create MedicinalProductDefinitionCrossReferenceComponent.type");
1211            else if (Configuration.doAutoCreate())
1212              this.type = new CodeableConcept(); // cc
1213          return this.type;
1214        }
1215
1216        public boolean hasType() { 
1217          return this.type != null && !this.type.isEmpty();
1218        }
1219
1220        /**
1221         * @param value {@link #type} (The type of relationship, for instance branded to generic, virtual to actual product, product to development product (investigational), parallel import version.)
1222         */
1223        public MedicinalProductDefinitionCrossReferenceComponent setType(CodeableConcept value) { 
1224          this.type = value;
1225          return this;
1226        }
1227
1228        protected void listChildren(List<Property> children) {
1229          super.listChildren(children);
1230          children.add(new Property("product", "CodeableReference(MedicinalProductDefinition)", "Reference to another product, e.g. for linking authorised to investigational product.", 0, 1, product));
1231          children.add(new Property("type", "CodeableConcept", "The type of relationship, for instance branded to generic, virtual to actual product, product to development product (investigational), parallel import version.", 0, 1, type));
1232        }
1233
1234        @Override
1235        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1236          switch (_hash) {
1237          case -309474065: /*product*/  return new Property("product", "CodeableReference(MedicinalProductDefinition)", "Reference to another product, e.g. for linking authorised to investigational product.", 0, 1, product);
1238          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The type of relationship, for instance branded to generic, virtual to actual product, product to development product (investigational), parallel import version.", 0, 1, type);
1239          default: return super.getNamedProperty(_hash, _name, _checkValid);
1240          }
1241
1242        }
1243
1244      @Override
1245      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1246        switch (hash) {
1247        case -309474065: /*product*/ return this.product == null ? new Base[0] : new Base[] {this.product}; // CodeableReference
1248        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1249        default: return super.getProperty(hash, name, checkValid);
1250        }
1251
1252      }
1253
1254      @Override
1255      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1256        switch (hash) {
1257        case -309474065: // product
1258          this.product = TypeConvertor.castToCodeableReference(value); // CodeableReference
1259          return value;
1260        case 3575610: // type
1261          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1262          return value;
1263        default: return super.setProperty(hash, name, value);
1264        }
1265
1266      }
1267
1268      @Override
1269      public Base setProperty(String name, Base value) throws FHIRException {
1270        if (name.equals("product")) {
1271          this.product = TypeConvertor.castToCodeableReference(value); // CodeableReference
1272        } else if (name.equals("type")) {
1273          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1274        } else
1275          return super.setProperty(name, value);
1276        return value;
1277      }
1278
1279      @Override
1280      public Base makeProperty(int hash, String name) throws FHIRException {
1281        switch (hash) {
1282        case -309474065:  return getProduct();
1283        case 3575610:  return getType();
1284        default: return super.makeProperty(hash, name);
1285        }
1286
1287      }
1288
1289      @Override
1290      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1291        switch (hash) {
1292        case -309474065: /*product*/ return new String[] {"CodeableReference"};
1293        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1294        default: return super.getTypesForProperty(hash, name);
1295        }
1296
1297      }
1298
1299      @Override
1300      public Base addChild(String name) throws FHIRException {
1301        if (name.equals("product")) {
1302          this.product = new CodeableReference();
1303          return this.product;
1304        }
1305        else if (name.equals("type")) {
1306          this.type = new CodeableConcept();
1307          return this.type;
1308        }
1309        else
1310          return super.addChild(name);
1311      }
1312
1313      public MedicinalProductDefinitionCrossReferenceComponent copy() {
1314        MedicinalProductDefinitionCrossReferenceComponent dst = new MedicinalProductDefinitionCrossReferenceComponent();
1315        copyValues(dst);
1316        return dst;
1317      }
1318
1319      public void copyValues(MedicinalProductDefinitionCrossReferenceComponent dst) {
1320        super.copyValues(dst);
1321        dst.product = product == null ? null : product.copy();
1322        dst.type = type == null ? null : type.copy();
1323      }
1324
1325      @Override
1326      public boolean equalsDeep(Base other_) {
1327        if (!super.equalsDeep(other_))
1328          return false;
1329        if (!(other_ instanceof MedicinalProductDefinitionCrossReferenceComponent))
1330          return false;
1331        MedicinalProductDefinitionCrossReferenceComponent o = (MedicinalProductDefinitionCrossReferenceComponent) other_;
1332        return compareDeep(product, o.product, true) && compareDeep(type, o.type, true);
1333      }
1334
1335      @Override
1336      public boolean equalsShallow(Base other_) {
1337        if (!super.equalsShallow(other_))
1338          return false;
1339        if (!(other_ instanceof MedicinalProductDefinitionCrossReferenceComponent))
1340          return false;
1341        MedicinalProductDefinitionCrossReferenceComponent o = (MedicinalProductDefinitionCrossReferenceComponent) other_;
1342        return true;
1343      }
1344
1345      public boolean isEmpty() {
1346        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(product, type);
1347      }
1348
1349  public String fhirType() {
1350    return "MedicinalProductDefinition.crossReference";
1351
1352  }
1353
1354  }
1355
1356    @Block()
1357    public static class MedicinalProductDefinitionOperationComponent extends BackboneElement implements IBaseBackboneElement {
1358        /**
1359         * The type of manufacturing operation e.g. manufacturing itself, re-packaging. For the authorization of this, a RegulatedAuthorization would point to the same plan or activity referenced here.
1360         */
1361        @Child(name = "type", type = {CodeableReference.class}, order=1, min=0, max=1, modifier=false, summary=true)
1362        @Description(shortDefinition="The type of manufacturing operation e.g. manufacturing itself, re-packaging", formalDefinition="The type of manufacturing operation e.g. manufacturing itself, re-packaging. For the authorization of this, a RegulatedAuthorization would point to the same plan or activity referenced here." )
1363        protected CodeableReference type;
1364
1365        /**
1366         * Date range of applicability.
1367         */
1368        @Child(name = "effectiveDate", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=true)
1369        @Description(shortDefinition="Date range of applicability", formalDefinition="Date range of applicability." )
1370        protected Period effectiveDate;
1371
1372        /**
1373         * The organization or establishment responsible for (or associated with) the particular process or step, examples include the manufacturer, importer, agent.
1374         */
1375        @Child(name = "organization", type = {Organization.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1376        @Description(shortDefinition="The organization responsible for the particular process, e.g. the manufacturer or importer", formalDefinition="The organization or establishment responsible for (or associated with) the particular process or step, examples include the manufacturer, importer, agent." )
1377        protected List<Reference> organization;
1378
1379        /**
1380         * Specifies whether this particular business or manufacturing process is considered proprietary or confidential.
1381         */
1382        @Child(name = "confidentialityIndicator", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true)
1383        @Description(shortDefinition="Specifies whether this process is considered proprietary or confidential", formalDefinition="Specifies whether this particular business or manufacturing process is considered proprietary or confidential." )
1384        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medicinal-product-confidentiality")
1385        protected CodeableConcept confidentialityIndicator;
1386
1387        private static final long serialVersionUID = 1036054906L;
1388
1389    /**
1390     * Constructor
1391     */
1392      public MedicinalProductDefinitionOperationComponent() {
1393        super();
1394      }
1395
1396        /**
1397         * @return {@link #type} (The type of manufacturing operation e.g. manufacturing itself, re-packaging. For the authorization of this, a RegulatedAuthorization would point to the same plan or activity referenced here.)
1398         */
1399        public CodeableReference getType() { 
1400          if (this.type == null)
1401            if (Configuration.errorOnAutoCreate())
1402              throw new Error("Attempt to auto-create MedicinalProductDefinitionOperationComponent.type");
1403            else if (Configuration.doAutoCreate())
1404              this.type = new CodeableReference(); // cc
1405          return this.type;
1406        }
1407
1408        public boolean hasType() { 
1409          return this.type != null && !this.type.isEmpty();
1410        }
1411
1412        /**
1413         * @param value {@link #type} (The type of manufacturing operation e.g. manufacturing itself, re-packaging. For the authorization of this, a RegulatedAuthorization would point to the same plan or activity referenced here.)
1414         */
1415        public MedicinalProductDefinitionOperationComponent setType(CodeableReference value) { 
1416          this.type = value;
1417          return this;
1418        }
1419
1420        /**
1421         * @return {@link #effectiveDate} (Date range of applicability.)
1422         */
1423        public Period getEffectiveDate() { 
1424          if (this.effectiveDate == null)
1425            if (Configuration.errorOnAutoCreate())
1426              throw new Error("Attempt to auto-create MedicinalProductDefinitionOperationComponent.effectiveDate");
1427            else if (Configuration.doAutoCreate())
1428              this.effectiveDate = new Period(); // cc
1429          return this.effectiveDate;
1430        }
1431
1432        public boolean hasEffectiveDate() { 
1433          return this.effectiveDate != null && !this.effectiveDate.isEmpty();
1434        }
1435
1436        /**
1437         * @param value {@link #effectiveDate} (Date range of applicability.)
1438         */
1439        public MedicinalProductDefinitionOperationComponent setEffectiveDate(Period value) { 
1440          this.effectiveDate = value;
1441          return this;
1442        }
1443
1444        /**
1445         * @return {@link #organization} (The organization or establishment responsible for (or associated with) the particular process or step, examples include the manufacturer, importer, agent.)
1446         */
1447        public List<Reference> getOrganization() { 
1448          if (this.organization == null)
1449            this.organization = new ArrayList<Reference>();
1450          return this.organization;
1451        }
1452
1453        /**
1454         * @return Returns a reference to <code>this</code> for easy method chaining
1455         */
1456        public MedicinalProductDefinitionOperationComponent setOrganization(List<Reference> theOrganization) { 
1457          this.organization = theOrganization;
1458          return this;
1459        }
1460
1461        public boolean hasOrganization() { 
1462          if (this.organization == null)
1463            return false;
1464          for (Reference item : this.organization)
1465            if (!item.isEmpty())
1466              return true;
1467          return false;
1468        }
1469
1470        public Reference addOrganization() { //3
1471          Reference t = new Reference();
1472          if (this.organization == null)
1473            this.organization = new ArrayList<Reference>();
1474          this.organization.add(t);
1475          return t;
1476        }
1477
1478        public MedicinalProductDefinitionOperationComponent addOrganization(Reference t) { //3
1479          if (t == null)
1480            return this;
1481          if (this.organization == null)
1482            this.organization = new ArrayList<Reference>();
1483          this.organization.add(t);
1484          return this;
1485        }
1486
1487        /**
1488         * @return The first repetition of repeating field {@link #organization}, creating it if it does not already exist {3}
1489         */
1490        public Reference getOrganizationFirstRep() { 
1491          if (getOrganization().isEmpty()) {
1492            addOrganization();
1493          }
1494          return getOrganization().get(0);
1495        }
1496
1497        /**
1498         * @return {@link #confidentialityIndicator} (Specifies whether this particular business or manufacturing process is considered proprietary or confidential.)
1499         */
1500        public CodeableConcept getConfidentialityIndicator() { 
1501          if (this.confidentialityIndicator == null)
1502            if (Configuration.errorOnAutoCreate())
1503              throw new Error("Attempt to auto-create MedicinalProductDefinitionOperationComponent.confidentialityIndicator");
1504            else if (Configuration.doAutoCreate())
1505              this.confidentialityIndicator = new CodeableConcept(); // cc
1506          return this.confidentialityIndicator;
1507        }
1508
1509        public boolean hasConfidentialityIndicator() { 
1510          return this.confidentialityIndicator != null && !this.confidentialityIndicator.isEmpty();
1511        }
1512
1513        /**
1514         * @param value {@link #confidentialityIndicator} (Specifies whether this particular business or manufacturing process is considered proprietary or confidential.)
1515         */
1516        public MedicinalProductDefinitionOperationComponent setConfidentialityIndicator(CodeableConcept value) { 
1517          this.confidentialityIndicator = value;
1518          return this;
1519        }
1520
1521        protected void listChildren(List<Property> children) {
1522          super.listChildren(children);
1523          children.add(new Property("type", "CodeableReference(ActivityDefinition|PlanDefinition)", "The type of manufacturing operation e.g. manufacturing itself, re-packaging. For the authorization of this, a RegulatedAuthorization would point to the same plan or activity referenced here.", 0, 1, type));
1524          children.add(new Property("effectiveDate", "Period", "Date range of applicability.", 0, 1, effectiveDate));
1525          children.add(new Property("organization", "Reference(Organization)", "The organization or establishment responsible for (or associated with) the particular process or step, examples include the manufacturer, importer, agent.", 0, java.lang.Integer.MAX_VALUE, organization));
1526          children.add(new Property("confidentialityIndicator", "CodeableConcept", "Specifies whether this particular business or manufacturing process is considered proprietary or confidential.", 0, 1, confidentialityIndicator));
1527        }
1528
1529        @Override
1530        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1531          switch (_hash) {
1532          case 3575610: /*type*/  return new Property("type", "CodeableReference(ActivityDefinition|PlanDefinition)", "The type of manufacturing operation e.g. manufacturing itself, re-packaging. For the authorization of this, a RegulatedAuthorization would point to the same plan or activity referenced here.", 0, 1, type);
1533          case -930389515: /*effectiveDate*/  return new Property("effectiveDate", "Period", "Date range of applicability.", 0, 1, effectiveDate);
1534          case 1178922291: /*organization*/  return new Property("organization", "Reference(Organization)", "The organization or establishment responsible for (or associated with) the particular process or step, examples include the manufacturer, importer, agent.", 0, java.lang.Integer.MAX_VALUE, organization);
1535          case -1449404791: /*confidentialityIndicator*/  return new Property("confidentialityIndicator", "CodeableConcept", "Specifies whether this particular business or manufacturing process is considered proprietary or confidential.", 0, 1, confidentialityIndicator);
1536          default: return super.getNamedProperty(_hash, _name, _checkValid);
1537          }
1538
1539        }
1540
1541      @Override
1542      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1543        switch (hash) {
1544        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableReference
1545        case -930389515: /*effectiveDate*/ return this.effectiveDate == null ? new Base[0] : new Base[] {this.effectiveDate}; // Period
1546        case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : this.organization.toArray(new Base[this.organization.size()]); // Reference
1547        case -1449404791: /*confidentialityIndicator*/ return this.confidentialityIndicator == null ? new Base[0] : new Base[] {this.confidentialityIndicator}; // CodeableConcept
1548        default: return super.getProperty(hash, name, checkValid);
1549        }
1550
1551      }
1552
1553      @Override
1554      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1555        switch (hash) {
1556        case 3575610: // type
1557          this.type = TypeConvertor.castToCodeableReference(value); // CodeableReference
1558          return value;
1559        case -930389515: // effectiveDate
1560          this.effectiveDate = TypeConvertor.castToPeriod(value); // Period
1561          return value;
1562        case 1178922291: // organization
1563          this.getOrganization().add(TypeConvertor.castToReference(value)); // Reference
1564          return value;
1565        case -1449404791: // confidentialityIndicator
1566          this.confidentialityIndicator = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1567          return value;
1568        default: return super.setProperty(hash, name, value);
1569        }
1570
1571      }
1572
1573      @Override
1574      public Base setProperty(String name, Base value) throws FHIRException {
1575        if (name.equals("type")) {
1576          this.type = TypeConvertor.castToCodeableReference(value); // CodeableReference
1577        } else if (name.equals("effectiveDate")) {
1578          this.effectiveDate = TypeConvertor.castToPeriod(value); // Period
1579        } else if (name.equals("organization")) {
1580          this.getOrganization().add(TypeConvertor.castToReference(value));
1581        } else if (name.equals("confidentialityIndicator")) {
1582          this.confidentialityIndicator = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1583        } else
1584          return super.setProperty(name, value);
1585        return value;
1586      }
1587
1588      @Override
1589      public Base makeProperty(int hash, String name) throws FHIRException {
1590        switch (hash) {
1591        case 3575610:  return getType();
1592        case -930389515:  return getEffectiveDate();
1593        case 1178922291:  return addOrganization(); 
1594        case -1449404791:  return getConfidentialityIndicator();
1595        default: return super.makeProperty(hash, name);
1596        }
1597
1598      }
1599
1600      @Override
1601      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1602        switch (hash) {
1603        case 3575610: /*type*/ return new String[] {"CodeableReference"};
1604        case -930389515: /*effectiveDate*/ return new String[] {"Period"};
1605        case 1178922291: /*organization*/ return new String[] {"Reference"};
1606        case -1449404791: /*confidentialityIndicator*/ return new String[] {"CodeableConcept"};
1607        default: return super.getTypesForProperty(hash, name);
1608        }
1609
1610      }
1611
1612      @Override
1613      public Base addChild(String name) throws FHIRException {
1614        if (name.equals("type")) {
1615          this.type = new CodeableReference();
1616          return this.type;
1617        }
1618        else if (name.equals("effectiveDate")) {
1619          this.effectiveDate = new Period();
1620          return this.effectiveDate;
1621        }
1622        else if (name.equals("organization")) {
1623          return addOrganization();
1624        }
1625        else if (name.equals("confidentialityIndicator")) {
1626          this.confidentialityIndicator = new CodeableConcept();
1627          return this.confidentialityIndicator;
1628        }
1629        else
1630          return super.addChild(name);
1631      }
1632
1633      public MedicinalProductDefinitionOperationComponent copy() {
1634        MedicinalProductDefinitionOperationComponent dst = new MedicinalProductDefinitionOperationComponent();
1635        copyValues(dst);
1636        return dst;
1637      }
1638
1639      public void copyValues(MedicinalProductDefinitionOperationComponent dst) {
1640        super.copyValues(dst);
1641        dst.type = type == null ? null : type.copy();
1642        dst.effectiveDate = effectiveDate == null ? null : effectiveDate.copy();
1643        if (organization != null) {
1644          dst.organization = new ArrayList<Reference>();
1645          for (Reference i : organization)
1646            dst.organization.add(i.copy());
1647        };
1648        dst.confidentialityIndicator = confidentialityIndicator == null ? null : confidentialityIndicator.copy();
1649      }
1650
1651      @Override
1652      public boolean equalsDeep(Base other_) {
1653        if (!super.equalsDeep(other_))
1654          return false;
1655        if (!(other_ instanceof MedicinalProductDefinitionOperationComponent))
1656          return false;
1657        MedicinalProductDefinitionOperationComponent o = (MedicinalProductDefinitionOperationComponent) other_;
1658        return compareDeep(type, o.type, true) && compareDeep(effectiveDate, o.effectiveDate, true) && compareDeep(organization, o.organization, true)
1659           && compareDeep(confidentialityIndicator, o.confidentialityIndicator, true);
1660      }
1661
1662      @Override
1663      public boolean equalsShallow(Base other_) {
1664        if (!super.equalsShallow(other_))
1665          return false;
1666        if (!(other_ instanceof MedicinalProductDefinitionOperationComponent))
1667          return false;
1668        MedicinalProductDefinitionOperationComponent o = (MedicinalProductDefinitionOperationComponent) other_;
1669        return true;
1670      }
1671
1672      public boolean isEmpty() {
1673        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, effectiveDate, organization
1674          , confidentialityIndicator);
1675      }
1676
1677  public String fhirType() {
1678    return "MedicinalProductDefinition.operation";
1679
1680  }
1681
1682  }
1683
1684    @Block()
1685    public static class MedicinalProductDefinitionCharacteristicComponent extends BackboneElement implements IBaseBackboneElement {
1686        /**
1687         * A code expressing the type of characteristic.
1688         */
1689        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
1690        @Description(shortDefinition="A code expressing the type of characteristic", formalDefinition="A code expressing the type of characteristic." )
1691        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/product-characteristic-codes")
1692        protected CodeableConcept type;
1693
1694        /**
1695         * A value for the characteristic.text.
1696         */
1697        @Child(name = "value", type = {CodeableConcept.class, MarkdownType.class, Quantity.class, IntegerType.class, DateType.class, BooleanType.class, Attachment.class}, order=2, min=0, max=1, modifier=false, summary=true)
1698        @Description(shortDefinition="A value for the characteristic", formalDefinition="A value for the characteristic.text." )
1699        protected DataType value;
1700
1701        private static final long serialVersionUID = -1659186716L;
1702
1703    /**
1704     * Constructor
1705     */
1706      public MedicinalProductDefinitionCharacteristicComponent() {
1707        super();
1708      }
1709
1710    /**
1711     * Constructor
1712     */
1713      public MedicinalProductDefinitionCharacteristicComponent(CodeableConcept type) {
1714        super();
1715        this.setType(type);
1716      }
1717
1718        /**
1719         * @return {@link #type} (A code expressing the type of characteristic.)
1720         */
1721        public CodeableConcept getType() { 
1722          if (this.type == null)
1723            if (Configuration.errorOnAutoCreate())
1724              throw new Error("Attempt to auto-create MedicinalProductDefinitionCharacteristicComponent.type");
1725            else if (Configuration.doAutoCreate())
1726              this.type = new CodeableConcept(); // cc
1727          return this.type;
1728        }
1729
1730        public boolean hasType() { 
1731          return this.type != null && !this.type.isEmpty();
1732        }
1733
1734        /**
1735         * @param value {@link #type} (A code expressing the type of characteristic.)
1736         */
1737        public MedicinalProductDefinitionCharacteristicComponent setType(CodeableConcept value) { 
1738          this.type = value;
1739          return this;
1740        }
1741
1742        /**
1743         * @return {@link #value} (A value for the characteristic.text.)
1744         */
1745        public DataType getValue() { 
1746          return this.value;
1747        }
1748
1749        /**
1750         * @return {@link #value} (A value for the characteristic.text.)
1751         */
1752        public CodeableConcept getValueCodeableConcept() throws FHIRException { 
1753          if (this.value == null)
1754            this.value = new CodeableConcept();
1755          if (!(this.value instanceof CodeableConcept))
1756            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered");
1757          return (CodeableConcept) this.value;
1758        }
1759
1760        public boolean hasValueCodeableConcept() { 
1761          return this != null && this.value instanceof CodeableConcept;
1762        }
1763
1764        /**
1765         * @return {@link #value} (A value for the characteristic.text.)
1766         */
1767        public MarkdownType getValueMarkdownType() throws FHIRException { 
1768          if (this.value == null)
1769            this.value = new MarkdownType();
1770          if (!(this.value instanceof MarkdownType))
1771            throw new FHIRException("Type mismatch: the type MarkdownType was expected, but "+this.value.getClass().getName()+" was encountered");
1772          return (MarkdownType) this.value;
1773        }
1774
1775        public boolean hasValueMarkdownType() { 
1776          return this != null && this.value instanceof MarkdownType;
1777        }
1778
1779        /**
1780         * @return {@link #value} (A value for the characteristic.text.)
1781         */
1782        public Quantity getValueQuantity() throws FHIRException { 
1783          if (this.value == null)
1784            this.value = new Quantity();
1785          if (!(this.value instanceof Quantity))
1786            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
1787          return (Quantity) this.value;
1788        }
1789
1790        public boolean hasValueQuantity() { 
1791          return this != null && this.value instanceof Quantity;
1792        }
1793
1794        /**
1795         * @return {@link #value} (A value for the characteristic.text.)
1796         */
1797        public IntegerType getValueIntegerType() throws FHIRException { 
1798          if (this.value == null)
1799            this.value = new IntegerType();
1800          if (!(this.value instanceof IntegerType))
1801            throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered");
1802          return (IntegerType) this.value;
1803        }
1804
1805        public boolean hasValueIntegerType() { 
1806          return this != null && this.value instanceof IntegerType;
1807        }
1808
1809        /**
1810         * @return {@link #value} (A value for the characteristic.text.)
1811         */
1812        public DateType getValueDateType() throws FHIRException { 
1813          if (this.value == null)
1814            this.value = new DateType();
1815          if (!(this.value instanceof DateType))
1816            throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered");
1817          return (DateType) this.value;
1818        }
1819
1820        public boolean hasValueDateType() { 
1821          return this != null && this.value instanceof DateType;
1822        }
1823
1824        /**
1825         * @return {@link #value} (A value for the characteristic.text.)
1826         */
1827        public BooleanType getValueBooleanType() throws FHIRException { 
1828          if (this.value == null)
1829            this.value = new BooleanType();
1830          if (!(this.value instanceof BooleanType))
1831            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
1832          return (BooleanType) this.value;
1833        }
1834
1835        public boolean hasValueBooleanType() { 
1836          return this != null && this.value instanceof BooleanType;
1837        }
1838
1839        /**
1840         * @return {@link #value} (A value for the characteristic.text.)
1841         */
1842        public Attachment getValueAttachment() throws FHIRException { 
1843          if (this.value == null)
1844            this.value = new Attachment();
1845          if (!(this.value instanceof Attachment))
1846            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered");
1847          return (Attachment) this.value;
1848        }
1849
1850        public boolean hasValueAttachment() { 
1851          return this != null && this.value instanceof Attachment;
1852        }
1853
1854        public boolean hasValue() { 
1855          return this.value != null && !this.value.isEmpty();
1856        }
1857
1858        /**
1859         * @param value {@link #value} (A value for the characteristic.text.)
1860         */
1861        public MedicinalProductDefinitionCharacteristicComponent setValue(DataType value) { 
1862          if (value != null && !(value instanceof CodeableConcept || value instanceof MarkdownType || value instanceof Quantity || value instanceof IntegerType || value instanceof DateType || value instanceof BooleanType || value instanceof Attachment))
1863            throw new FHIRException("Not the right type for MedicinalProductDefinition.characteristic.value[x]: "+value.fhirType());
1864          this.value = value;
1865          return this;
1866        }
1867
1868        protected void listChildren(List<Property> children) {
1869          super.listChildren(children);
1870          children.add(new Property("type", "CodeableConcept", "A code expressing the type of characteristic.", 0, 1, type));
1871          children.add(new Property("value[x]", "CodeableConcept|markdown|Quantity|integer|date|boolean|Attachment", "A value for the characteristic.text.", 0, 1, value));
1872        }
1873
1874        @Override
1875        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1876          switch (_hash) {
1877          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "A code expressing the type of characteristic.", 0, 1, type);
1878          case -1410166417: /*value[x]*/  return new Property("value[x]", "CodeableConcept|markdown|Quantity|integer|date|boolean|Attachment", "A value for the characteristic.text.", 0, 1, value);
1879          case 111972721: /*value*/  return new Property("value[x]", "CodeableConcept|markdown|Quantity|integer|date|boolean|Attachment", "A value for the characteristic.text.", 0, 1, value);
1880          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "CodeableConcept", "A value for the characteristic.text.", 0, 1, value);
1881          case -497880704: /*valueMarkdown*/  return new Property("value[x]", "markdown", "A value for the characteristic.text.", 0, 1, value);
1882          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "Quantity", "A value for the characteristic.text.", 0, 1, value);
1883          case -1668204915: /*valueInteger*/  return new Property("value[x]", "integer", "A value for the characteristic.text.", 0, 1, value);
1884          case -766192449: /*valueDate*/  return new Property("value[x]", "date", "A value for the characteristic.text.", 0, 1, value);
1885          case 733421943: /*valueBoolean*/  return new Property("value[x]", "boolean", "A value for the characteristic.text.", 0, 1, value);
1886          case -475566732: /*valueAttachment*/  return new Property("value[x]", "Attachment", "A value for the characteristic.text.", 0, 1, value);
1887          default: return super.getNamedProperty(_hash, _name, _checkValid);
1888          }
1889
1890        }
1891
1892      @Override
1893      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1894        switch (hash) {
1895        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1896        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType
1897        default: return super.getProperty(hash, name, checkValid);
1898        }
1899
1900      }
1901
1902      @Override
1903      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1904        switch (hash) {
1905        case 3575610: // type
1906          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1907          return value;
1908        case 111972721: // value
1909          this.value = TypeConvertor.castToType(value); // DataType
1910          return value;
1911        default: return super.setProperty(hash, name, value);
1912        }
1913
1914      }
1915
1916      @Override
1917      public Base setProperty(String name, Base value) throws FHIRException {
1918        if (name.equals("type")) {
1919          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1920        } else if (name.equals("value[x]")) {
1921          this.value = TypeConvertor.castToType(value); // DataType
1922        } else
1923          return super.setProperty(name, value);
1924        return value;
1925      }
1926
1927      @Override
1928      public Base makeProperty(int hash, String name) throws FHIRException {
1929        switch (hash) {
1930        case 3575610:  return getType();
1931        case -1410166417:  return getValue();
1932        case 111972721:  return getValue();
1933        default: return super.makeProperty(hash, name);
1934        }
1935
1936      }
1937
1938      @Override
1939      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1940        switch (hash) {
1941        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1942        case 111972721: /*value*/ return new String[] {"CodeableConcept", "markdown", "Quantity", "integer", "date", "boolean", "Attachment"};
1943        default: return super.getTypesForProperty(hash, name);
1944        }
1945
1946      }
1947
1948      @Override
1949      public Base addChild(String name) throws FHIRException {
1950        if (name.equals("type")) {
1951          this.type = new CodeableConcept();
1952          return this.type;
1953        }
1954        else if (name.equals("valueCodeableConcept")) {
1955          this.value = new CodeableConcept();
1956          return this.value;
1957        }
1958        else if (name.equals("valueMarkdown")) {
1959          this.value = new MarkdownType();
1960          return this.value;
1961        }
1962        else if (name.equals("valueQuantity")) {
1963          this.value = new Quantity();
1964          return this.value;
1965        }
1966        else if (name.equals("valueInteger")) {
1967          this.value = new IntegerType();
1968          return this.value;
1969        }
1970        else if (name.equals("valueDate")) {
1971          this.value = new DateType();
1972          return this.value;
1973        }
1974        else if (name.equals("valueBoolean")) {
1975          this.value = new BooleanType();
1976          return this.value;
1977        }
1978        else if (name.equals("valueAttachment")) {
1979          this.value = new Attachment();
1980          return this.value;
1981        }
1982        else
1983          return super.addChild(name);
1984      }
1985
1986      public MedicinalProductDefinitionCharacteristicComponent copy() {
1987        MedicinalProductDefinitionCharacteristicComponent dst = new MedicinalProductDefinitionCharacteristicComponent();
1988        copyValues(dst);
1989        return dst;
1990      }
1991
1992      public void copyValues(MedicinalProductDefinitionCharacteristicComponent dst) {
1993        super.copyValues(dst);
1994        dst.type = type == null ? null : type.copy();
1995        dst.value = value == null ? null : value.copy();
1996      }
1997
1998      @Override
1999      public boolean equalsDeep(Base other_) {
2000        if (!super.equalsDeep(other_))
2001          return false;
2002        if (!(other_ instanceof MedicinalProductDefinitionCharacteristicComponent))
2003          return false;
2004        MedicinalProductDefinitionCharacteristicComponent o = (MedicinalProductDefinitionCharacteristicComponent) other_;
2005        return compareDeep(type, o.type, true) && compareDeep(value, o.value, true);
2006      }
2007
2008      @Override
2009      public boolean equalsShallow(Base other_) {
2010        if (!super.equalsShallow(other_))
2011          return false;
2012        if (!(other_ instanceof MedicinalProductDefinitionCharacteristicComponent))
2013          return false;
2014        MedicinalProductDefinitionCharacteristicComponent o = (MedicinalProductDefinitionCharacteristicComponent) other_;
2015        return true;
2016      }
2017
2018      public boolean isEmpty() {
2019        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, value);
2020      }
2021
2022  public String fhirType() {
2023    return "MedicinalProductDefinition.characteristic";
2024
2025  }
2026
2027  }
2028
2029    /**
2030     * Business identifier for this product. Could be an MPID. When in development or being regulated, products are typically referenced by official identifiers, assigned by a manufacturer or regulator, and unique to a product (which, when compared to a product instance being prescribed, is actually a product type). See also MedicinalProductDefinition.code.
2031     */
2032    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2033    @Description(shortDefinition="Business identifier for this product. Could be an MPID", formalDefinition="Business identifier for this product. Could be an MPID. When in development or being regulated, products are typically referenced by official identifiers, assigned by a manufacturer or regulator, and unique to a product (which, when compared to a product instance being prescribed, is actually a product type). See also MedicinalProductDefinition.code." )
2034    protected List<Identifier> identifier;
2035
2036    /**
2037     * Regulatory type, e.g. Investigational or Authorized.
2038     */
2039    @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
2040    @Description(shortDefinition="Regulatory type, e.g. Investigational or Authorized", formalDefinition="Regulatory type, e.g. Investigational or Authorized." )
2041    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medicinal-product-type")
2042    protected CodeableConcept type;
2043
2044    /**
2045     * If this medicine applies to human or veterinary uses.
2046     */
2047    @Child(name = "domain", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
2048    @Description(shortDefinition="If this medicine applies to human or veterinary uses", formalDefinition="If this medicine applies to human or veterinary uses." )
2049    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medicinal-product-domain")
2050    protected CodeableConcept domain;
2051
2052    /**
2053     * A business identifier relating to a specific version of the product, this is commonly used to support revisions to an existing product.
2054     */
2055    @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
2056    @Description(shortDefinition="A business identifier relating to a specific version of the product", formalDefinition="A business identifier relating to a specific version of the product, this is commonly used to support revisions to an existing product." )
2057    protected StringType version;
2058
2059    /**
2060     * The status within the lifecycle of this product record. A high-level status, this is not intended to duplicate details carried elsewhere such as legal status, or authorization status.
2061     */
2062    @Child(name = "status", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=true, summary=true)
2063    @Description(shortDefinition="The status within the lifecycle of this product record", formalDefinition="The status within the lifecycle of this product record. A high-level status, this is not intended to duplicate details carried elsewhere such as legal status, or authorization status." )
2064    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status")
2065    protected CodeableConcept status;
2066
2067    /**
2068     * The date at which the given status became applicable.
2069     */
2070    @Child(name = "statusDate", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=true)
2071    @Description(shortDefinition="The date at which the given status became applicable", formalDefinition="The date at which the given status became applicable." )
2072    protected DateTimeType statusDate;
2073
2074    /**
2075     * General description of this product.
2076     */
2077    @Child(name = "description", type = {MarkdownType.class}, order=6, min=0, max=1, modifier=false, summary=true)
2078    @Description(shortDefinition="General description of this product", formalDefinition="General description of this product." )
2079    protected MarkdownType description;
2080
2081    /**
2082     * The dose form for a single part product, or combined form of a multiple part product. This is one concept that describes all the components. It does not represent the form with components physically mixed, if that might be necessary, for which see (AdministrableProductDefinition.administrableDoseForm).
2083     */
2084    @Child(name = "combinedPharmaceuticalDoseForm", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true)
2085    @Description(shortDefinition="The dose form for a single part product, or combined form of a multiple part product", formalDefinition="The dose form for a single part product, or combined form of a multiple part product. This is one concept that describes all the components. It does not represent the form with components physically mixed, if that might be necessary, for which see (AdministrableProductDefinition.administrableDoseForm)." )
2086    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/combined-dose-form")
2087    protected CodeableConcept combinedPharmaceuticalDoseForm;
2088
2089    /**
2090     * The path by which the product is taken into or makes contact with the body. In some regions this is referred to as the licenced or approved route. See also AdministrableProductDefinition resource. MedicinalProductDefinition.route is the same concept as AdministrableProductDefinition.routeOfAdministration.code, and they cannot be used together.
2091     */
2092    @Child(name = "route", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2093    @Description(shortDefinition="The path by which the product is taken into or makes contact with the body", formalDefinition="The path by which the product is taken into or makes contact with the body. In some regions this is referred to as the licenced or approved route. See also AdministrableProductDefinition resource. MedicinalProductDefinition.route is the same concept as AdministrableProductDefinition.routeOfAdministration.code, and they cannot be used together." )
2094    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/route-codes")
2095    protected List<CodeableConcept> route;
2096
2097    /**
2098     * Description of indication(s) for this product, used when structured indications are not required. In cases where structured indications are required, they are captured using the ClinicalUseDefinition resource. An indication is a medical situation for which using the product is appropriate.
2099     */
2100    @Child(name = "indication", type = {MarkdownType.class}, order=9, min=0, max=1, modifier=false, summary=true)
2101    @Description(shortDefinition="Description of indication(s) for this product, used when structured indications are not required", formalDefinition="Description of indication(s) for this product, used when structured indications are not required. In cases where structured indications are required, they are captured using the ClinicalUseDefinition resource. An indication is a medical situation for which using the product is appropriate." )
2102    protected MarkdownType indication;
2103
2104    /**
2105     * The legal status of supply of the medicinal product as classified by the regulator.
2106     */
2107    @Child(name = "legalStatusOfSupply", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=true)
2108    @Description(shortDefinition="The legal status of supply of the medicinal product as classified by the regulator", formalDefinition="The legal status of supply of the medicinal product as classified by the regulator." )
2109    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/legal-status-of-supply")
2110    protected CodeableConcept legalStatusOfSupply;
2111
2112    /**
2113     * Whether the Medicinal Product is subject to additional monitoring for regulatory reasons, such as heightened reporting requirements.
2114     */
2115    @Child(name = "additionalMonitoringIndicator", type = {CodeableConcept.class}, order=11, min=0, max=1, modifier=false, summary=true)
2116    @Description(shortDefinition="Whether the Medicinal Product is subject to additional monitoring for regulatory reasons", formalDefinition="Whether the Medicinal Product is subject to additional monitoring for regulatory reasons, such as heightened reporting requirements." )
2117    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medicinal-product-additional-monitoring")
2118    protected CodeableConcept additionalMonitoringIndicator;
2119
2120    /**
2121     * Whether the Medicinal Product is subject to special measures for regulatory reasons, such as a requirement to conduct post-authorization studies.
2122     */
2123    @Child(name = "specialMeasures", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2124    @Description(shortDefinition="Whether the Medicinal Product is subject to special measures for regulatory reasons", formalDefinition="Whether the Medicinal Product is subject to special measures for regulatory reasons, such as a requirement to conduct post-authorization studies." )
2125    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medicinal-product-special-measures")
2126    protected List<CodeableConcept> specialMeasures;
2127
2128    /**
2129     * If authorised for use in children, or infants, neonates etc.
2130     */
2131    @Child(name = "pediatricUseIndicator", type = {CodeableConcept.class}, order=13, min=0, max=1, modifier=false, summary=true)
2132    @Description(shortDefinition="If authorised for use in children", formalDefinition="If authorised for use in children, or infants, neonates etc." )
2133    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medicinal-product-pediatric-use")
2134    protected CodeableConcept pediatricUseIndicator;
2135
2136    /**
2137     * Allows the product to be classified by various systems, commonly WHO ATC.
2138     */
2139    @Child(name = "classification", type = {CodeableConcept.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2140    @Description(shortDefinition="Allows the product to be classified by various systems", formalDefinition="Allows the product to be classified by various systems, commonly WHO ATC." )
2141    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medicinal-product-classification")
2142    protected List<CodeableConcept> classification;
2143
2144    /**
2145     * Marketing status of the medicinal product, in contrast to marketing authorization. This refers to the product being actually 'on the market' as opposed to being allowed to be on the market (which is an authorization).
2146     */
2147    @Child(name = "marketingStatus", type = {MarketingStatus.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2148    @Description(shortDefinition="Marketing status of the medicinal product, in contrast to marketing authorization", formalDefinition="Marketing status of the medicinal product, in contrast to marketing authorization. This refers to the product being actually 'on the market' as opposed to being allowed to be on the market (which is an authorization)." )
2149    protected List<MarketingStatus> marketingStatus;
2150
2151    /**
2152     * Package type for the product. See also the PackagedProductDefinition resource.
2153     */
2154    @Child(name = "packagedMedicinalProduct", type = {CodeableConcept.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2155    @Description(shortDefinition="Package type for the product", formalDefinition="Package type for the product. See also the PackagedProductDefinition resource." )
2156    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medicinal-product-package-type")
2157    protected List<CodeableConcept> packagedMedicinalProduct;
2158
2159    /**
2160     * Types of medicinal manufactured items and/or devices that this product consists of, such as tablets, capsule, or syringes. Used as a direct link when the item's packaging is not being recorded (see also PackagedProductDefinition.package.containedItem.item).
2161     */
2162    @Child(name = "comprisedOf", type = {ManufacturedItemDefinition.class, DeviceDefinition.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2163    @Description(shortDefinition="Types of medicinal manufactured items and/or devices that this product consists of, such as tablets, capsule, or syringes", formalDefinition="Types of medicinal manufactured items and/or devices that this product consists of, such as tablets, capsule, or syringes. Used as a direct link when the item's packaging is not being recorded (see also PackagedProductDefinition.package.containedItem.item)." )
2164    protected List<Reference> comprisedOf;
2165
2166    /**
2167     * The ingredients of this medicinal product - when not detailed in other resources. This is only needed if the ingredients are not specified by incoming references from the Ingredient resource, or indirectly via incoming AdministrableProductDefinition, PackagedProductDefinition or ManufacturedItemDefinition references. In cases where those levels of detail are not used, the ingredients may be specified directly here as codes.
2168     */
2169    @Child(name = "ingredient", type = {CodeableConcept.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2170    @Description(shortDefinition="The ingredients of this medicinal product - when not detailed in other resources", formalDefinition="The ingredients of this medicinal product - when not detailed in other resources. This is only needed if the ingredients are not specified by incoming references from the Ingredient resource, or indirectly via incoming AdministrableProductDefinition, PackagedProductDefinition or ManufacturedItemDefinition references. In cases where those levels of detail are not used, the ingredients may be specified directly here as codes." )
2171    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-codes")
2172    protected List<CodeableConcept> ingredient;
2173
2174    /**
2175     * Any component of the drug product which is not the chemical entity defined as the drug substance, or an excipient in the drug product. This includes process-related impurities and contaminants, product-related impurities including degradation products.
2176     */
2177    @Child(name = "impurity", type = {CodeableReference.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2178    @Description(shortDefinition="Any component of the drug product which is not the chemical entity defined as the drug substance, or an excipient in the drug product", formalDefinition="Any component of the drug product which is not the chemical entity defined as the drug substance, or an excipient in the drug product. This includes process-related impurities and contaminants, product-related impurities including degradation products." )
2179    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-codes")
2180    protected List<CodeableReference> impurity;
2181
2182    /**
2183     * Additional information or supporting documentation about the medicinal product.
2184     */
2185    @Child(name = "attachedDocument", type = {DocumentReference.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2186    @Description(shortDefinition="Additional documentation about the medicinal product", formalDefinition="Additional information or supporting documentation about the medicinal product." )
2187    protected List<Reference> attachedDocument;
2188
2189    /**
2190     * A master file for the medicinal product (e.g. Pharmacovigilance System Master File). Drug master files (DMFs) are documents submitted to regulatory agencies to provide confidential detailed information about facilities, processes or articles used in the manufacturing, processing, packaging and storing of drug products.
2191     */
2192    @Child(name = "masterFile", type = {DocumentReference.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2193    @Description(shortDefinition="A master file for the medicinal product (e.g. Pharmacovigilance System Master File)", formalDefinition="A master file for the medicinal product (e.g. Pharmacovigilance System Master File). Drug master files (DMFs) are documents submitted to regulatory agencies to provide confidential detailed information about facilities, processes or articles used in the manufacturing, processing, packaging and storing of drug products." )
2194    protected List<Reference> masterFile;
2195
2196    /**
2197     * A product specific contact, person (in a role), or an organization.
2198     */
2199    @Child(name = "contact", type = {}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2200    @Description(shortDefinition="A product specific contact, person (in a role), or an organization", formalDefinition="A product specific contact, person (in a role), or an organization." )
2201    protected List<MedicinalProductDefinitionContactComponent> contact;
2202
2203    /**
2204     * Clinical trials or studies that this product is involved in.
2205     */
2206    @Child(name = "clinicalTrial", type = {ResearchStudy.class}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2207    @Description(shortDefinition="Clinical trials or studies that this product is involved in", formalDefinition="Clinical trials or studies that this product is involved in." )
2208    protected List<Reference> clinicalTrial;
2209
2210    /**
2211     * A code that this product is known by, usually within some formal terminology, perhaps assigned by a third party (i.e. not the manufacturer or regulator). Products (types of medications) tend to be known by identifiers during development and within regulatory process. However when they are prescribed they tend to be identified by codes. The same product may be have multiple codes, applied to it by multiple organizations.
2212     */
2213    @Child(name = "code", type = {Coding.class}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2214    @Description(shortDefinition="A code that this product is known by, within some formal terminology", formalDefinition="A code that this product is known by, usually within some formal terminology, perhaps assigned by a third party (i.e. not the manufacturer or regulator). Products (types of medications) tend to be known by identifiers during development and within regulatory process. However when they are prescribed they tend to be identified by codes. The same product may be have multiple codes, applied to it by multiple organizations." )
2215    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medication-codes")
2216    protected List<Coding> code;
2217
2218    /**
2219     * The product's name, including full name and possibly coded parts.
2220     */
2221    @Child(name = "name", type = {}, order=25, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2222    @Description(shortDefinition="The product's name, including full name and possibly coded parts", formalDefinition="The product's name, including full name and possibly coded parts." )
2223    protected List<MedicinalProductDefinitionNameComponent> name;
2224
2225    /**
2226     * Reference to another product, e.g. for linking authorised to investigational product, or a virtual product.
2227     */
2228    @Child(name = "crossReference", type = {}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2229    @Description(shortDefinition="Reference to another product, e.g. for linking authorised to investigational product", formalDefinition="Reference to another product, e.g. for linking authorised to investigational product, or a virtual product." )
2230    protected List<MedicinalProductDefinitionCrossReferenceComponent> crossReference;
2231
2232    /**
2233     * A manufacturing or administrative process or step associated with (or performed on) the medicinal product.
2234     */
2235    @Child(name = "operation", type = {}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2236    @Description(shortDefinition="A manufacturing or administrative process for the medicinal product", formalDefinition="A manufacturing or administrative process or step associated with (or performed on) the medicinal product." )
2237    protected List<MedicinalProductDefinitionOperationComponent> operation;
2238
2239    /**
2240     * Allows the key product features to be recorded, such as "sugar free", "modified release", "parallel import".
2241     */
2242    @Child(name = "characteristic", type = {}, order=28, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2243    @Description(shortDefinition="Key product features such as \"sugar free\", \"modified release\"", formalDefinition="Allows the key product features to be recorded, such as \"sugar free\", \"modified release\", \"parallel import\"." )
2244    protected List<MedicinalProductDefinitionCharacteristicComponent> characteristic;
2245
2246    private static final long serialVersionUID = 1105265034L;
2247
2248  /**
2249   * Constructor
2250   */
2251    public MedicinalProductDefinition() {
2252      super();
2253    }
2254
2255  /**
2256   * Constructor
2257   */
2258    public MedicinalProductDefinition(MedicinalProductDefinitionNameComponent name) {
2259      super();
2260      this.addName(name);
2261    }
2262
2263    /**
2264     * @return {@link #identifier} (Business identifier for this product. Could be an MPID. When in development or being regulated, products are typically referenced by official identifiers, assigned by a manufacturer or regulator, and unique to a product (which, when compared to a product instance being prescribed, is actually a product type). See also MedicinalProductDefinition.code.)
2265     */
2266    public List<Identifier> getIdentifier() { 
2267      if (this.identifier == null)
2268        this.identifier = new ArrayList<Identifier>();
2269      return this.identifier;
2270    }
2271
2272    /**
2273     * @return Returns a reference to <code>this</code> for easy method chaining
2274     */
2275    public MedicinalProductDefinition setIdentifier(List<Identifier> theIdentifier) { 
2276      this.identifier = theIdentifier;
2277      return this;
2278    }
2279
2280    public boolean hasIdentifier() { 
2281      if (this.identifier == null)
2282        return false;
2283      for (Identifier item : this.identifier)
2284        if (!item.isEmpty())
2285          return true;
2286      return false;
2287    }
2288
2289    public Identifier addIdentifier() { //3
2290      Identifier t = new Identifier();
2291      if (this.identifier == null)
2292        this.identifier = new ArrayList<Identifier>();
2293      this.identifier.add(t);
2294      return t;
2295    }
2296
2297    public MedicinalProductDefinition addIdentifier(Identifier t) { //3
2298      if (t == null)
2299        return this;
2300      if (this.identifier == null)
2301        this.identifier = new ArrayList<Identifier>();
2302      this.identifier.add(t);
2303      return this;
2304    }
2305
2306    /**
2307     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
2308     */
2309    public Identifier getIdentifierFirstRep() { 
2310      if (getIdentifier().isEmpty()) {
2311        addIdentifier();
2312      }
2313      return getIdentifier().get(0);
2314    }
2315
2316    /**
2317     * @return {@link #type} (Regulatory type, e.g. Investigational or Authorized.)
2318     */
2319    public CodeableConcept getType() { 
2320      if (this.type == null)
2321        if (Configuration.errorOnAutoCreate())
2322          throw new Error("Attempt to auto-create MedicinalProductDefinition.type");
2323        else if (Configuration.doAutoCreate())
2324          this.type = new CodeableConcept(); // cc
2325      return this.type;
2326    }
2327
2328    public boolean hasType() { 
2329      return this.type != null && !this.type.isEmpty();
2330    }
2331
2332    /**
2333     * @param value {@link #type} (Regulatory type, e.g. Investigational or Authorized.)
2334     */
2335    public MedicinalProductDefinition setType(CodeableConcept value) { 
2336      this.type = value;
2337      return this;
2338    }
2339
2340    /**
2341     * @return {@link #domain} (If this medicine applies to human or veterinary uses.)
2342     */
2343    public CodeableConcept getDomain() { 
2344      if (this.domain == null)
2345        if (Configuration.errorOnAutoCreate())
2346          throw new Error("Attempt to auto-create MedicinalProductDefinition.domain");
2347        else if (Configuration.doAutoCreate())
2348          this.domain = new CodeableConcept(); // cc
2349      return this.domain;
2350    }
2351
2352    public boolean hasDomain() { 
2353      return this.domain != null && !this.domain.isEmpty();
2354    }
2355
2356    /**
2357     * @param value {@link #domain} (If this medicine applies to human or veterinary uses.)
2358     */
2359    public MedicinalProductDefinition setDomain(CodeableConcept value) { 
2360      this.domain = value;
2361      return this;
2362    }
2363
2364    /**
2365     * @return {@link #version} (A business identifier relating to a specific version of the product, this is commonly used to support revisions to an existing product.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
2366     */
2367    public StringType getVersionElement() { 
2368      if (this.version == null)
2369        if (Configuration.errorOnAutoCreate())
2370          throw new Error("Attempt to auto-create MedicinalProductDefinition.version");
2371        else if (Configuration.doAutoCreate())
2372          this.version = new StringType(); // bb
2373      return this.version;
2374    }
2375
2376    public boolean hasVersionElement() { 
2377      return this.version != null && !this.version.isEmpty();
2378    }
2379
2380    public boolean hasVersion() { 
2381      return this.version != null && !this.version.isEmpty();
2382    }
2383
2384    /**
2385     * @param value {@link #version} (A business identifier relating to a specific version of the product, this is commonly used to support revisions to an existing product.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
2386     */
2387    public MedicinalProductDefinition setVersionElement(StringType value) { 
2388      this.version = value;
2389      return this;
2390    }
2391
2392    /**
2393     * @return A business identifier relating to a specific version of the product, this is commonly used to support revisions to an existing product.
2394     */
2395    public String getVersion() { 
2396      return this.version == null ? null : this.version.getValue();
2397    }
2398
2399    /**
2400     * @param value A business identifier relating to a specific version of the product, this is commonly used to support revisions to an existing product.
2401     */
2402    public MedicinalProductDefinition setVersion(String value) { 
2403      if (Utilities.noString(value))
2404        this.version = null;
2405      else {
2406        if (this.version == null)
2407          this.version = new StringType();
2408        this.version.setValue(value);
2409      }
2410      return this;
2411    }
2412
2413    /**
2414     * @return {@link #status} (The status within the lifecycle of this product record. A high-level status, this is not intended to duplicate details carried elsewhere such as legal status, or authorization status.)
2415     */
2416    public CodeableConcept getStatus() { 
2417      if (this.status == null)
2418        if (Configuration.errorOnAutoCreate())
2419          throw new Error("Attempt to auto-create MedicinalProductDefinition.status");
2420        else if (Configuration.doAutoCreate())
2421          this.status = new CodeableConcept(); // cc
2422      return this.status;
2423    }
2424
2425    public boolean hasStatus() { 
2426      return this.status != null && !this.status.isEmpty();
2427    }
2428
2429    /**
2430     * @param value {@link #status} (The status within the lifecycle of this product record. A high-level status, this is not intended to duplicate details carried elsewhere such as legal status, or authorization status.)
2431     */
2432    public MedicinalProductDefinition setStatus(CodeableConcept value) { 
2433      this.status = value;
2434      return this;
2435    }
2436
2437    /**
2438     * @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
2439     */
2440    public DateTimeType getStatusDateElement() { 
2441      if (this.statusDate == null)
2442        if (Configuration.errorOnAutoCreate())
2443          throw new Error("Attempt to auto-create MedicinalProductDefinition.statusDate");
2444        else if (Configuration.doAutoCreate())
2445          this.statusDate = new DateTimeType(); // bb
2446      return this.statusDate;
2447    }
2448
2449    public boolean hasStatusDateElement() { 
2450      return this.statusDate != null && !this.statusDate.isEmpty();
2451    }
2452
2453    public boolean hasStatusDate() { 
2454      return this.statusDate != null && !this.statusDate.isEmpty();
2455    }
2456
2457    /**
2458     * @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
2459     */
2460    public MedicinalProductDefinition setStatusDateElement(DateTimeType value) { 
2461      this.statusDate = value;
2462      return this;
2463    }
2464
2465    /**
2466     * @return The date at which the given status became applicable.
2467     */
2468    public Date getStatusDate() { 
2469      return this.statusDate == null ? null : this.statusDate.getValue();
2470    }
2471
2472    /**
2473     * @param value The date at which the given status became applicable.
2474     */
2475    public MedicinalProductDefinition setStatusDate(Date value) { 
2476      if (value == null)
2477        this.statusDate = null;
2478      else {
2479        if (this.statusDate == null)
2480          this.statusDate = new DateTimeType();
2481        this.statusDate.setValue(value);
2482      }
2483      return this;
2484    }
2485
2486    /**
2487     * @return {@link #description} (General description of this product.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2488     */
2489    public MarkdownType getDescriptionElement() { 
2490      if (this.description == null)
2491        if (Configuration.errorOnAutoCreate())
2492          throw new Error("Attempt to auto-create MedicinalProductDefinition.description");
2493        else if (Configuration.doAutoCreate())
2494          this.description = new MarkdownType(); // bb
2495      return this.description;
2496    }
2497
2498    public boolean hasDescriptionElement() { 
2499      return this.description != null && !this.description.isEmpty();
2500    }
2501
2502    public boolean hasDescription() { 
2503      return this.description != null && !this.description.isEmpty();
2504    }
2505
2506    /**
2507     * @param value {@link #description} (General description of this product.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2508     */
2509    public MedicinalProductDefinition setDescriptionElement(MarkdownType value) { 
2510      this.description = value;
2511      return this;
2512    }
2513
2514    /**
2515     * @return General description of this product.
2516     */
2517    public String getDescription() { 
2518      return this.description == null ? null : this.description.getValue();
2519    }
2520
2521    /**
2522     * @param value General description of this product.
2523     */
2524    public MedicinalProductDefinition setDescription(String value) { 
2525      if (Utilities.noString(value))
2526        this.description = null;
2527      else {
2528        if (this.description == null)
2529          this.description = new MarkdownType();
2530        this.description.setValue(value);
2531      }
2532      return this;
2533    }
2534
2535    /**
2536     * @return {@link #combinedPharmaceuticalDoseForm} (The dose form for a single part product, or combined form of a multiple part product. This is one concept that describes all the components. It does not represent the form with components physically mixed, if that might be necessary, for which see (AdministrableProductDefinition.administrableDoseForm).)
2537     */
2538    public CodeableConcept getCombinedPharmaceuticalDoseForm() { 
2539      if (this.combinedPharmaceuticalDoseForm == null)
2540        if (Configuration.errorOnAutoCreate())
2541          throw new Error("Attempt to auto-create MedicinalProductDefinition.combinedPharmaceuticalDoseForm");
2542        else if (Configuration.doAutoCreate())
2543          this.combinedPharmaceuticalDoseForm = new CodeableConcept(); // cc
2544      return this.combinedPharmaceuticalDoseForm;
2545    }
2546
2547    public boolean hasCombinedPharmaceuticalDoseForm() { 
2548      return this.combinedPharmaceuticalDoseForm != null && !this.combinedPharmaceuticalDoseForm.isEmpty();
2549    }
2550
2551    /**
2552     * @param value {@link #combinedPharmaceuticalDoseForm} (The dose form for a single part product, or combined form of a multiple part product. This is one concept that describes all the components. It does not represent the form with components physically mixed, if that might be necessary, for which see (AdministrableProductDefinition.administrableDoseForm).)
2553     */
2554    public MedicinalProductDefinition setCombinedPharmaceuticalDoseForm(CodeableConcept value) { 
2555      this.combinedPharmaceuticalDoseForm = value;
2556      return this;
2557    }
2558
2559    /**
2560     * @return {@link #route} (The path by which the product is taken into or makes contact with the body. In some regions this is referred to as the licenced or approved route. See also AdministrableProductDefinition resource. MedicinalProductDefinition.route is the same concept as AdministrableProductDefinition.routeOfAdministration.code, and they cannot be used together.)
2561     */
2562    public List<CodeableConcept> getRoute() { 
2563      if (this.route == null)
2564        this.route = new ArrayList<CodeableConcept>();
2565      return this.route;
2566    }
2567
2568    /**
2569     * @return Returns a reference to <code>this</code> for easy method chaining
2570     */
2571    public MedicinalProductDefinition setRoute(List<CodeableConcept> theRoute) { 
2572      this.route = theRoute;
2573      return this;
2574    }
2575
2576    public boolean hasRoute() { 
2577      if (this.route == null)
2578        return false;
2579      for (CodeableConcept item : this.route)
2580        if (!item.isEmpty())
2581          return true;
2582      return false;
2583    }
2584
2585    public CodeableConcept addRoute() { //3
2586      CodeableConcept t = new CodeableConcept();
2587      if (this.route == null)
2588        this.route = new ArrayList<CodeableConcept>();
2589      this.route.add(t);
2590      return t;
2591    }
2592
2593    public MedicinalProductDefinition addRoute(CodeableConcept t) { //3
2594      if (t == null)
2595        return this;
2596      if (this.route == null)
2597        this.route = new ArrayList<CodeableConcept>();
2598      this.route.add(t);
2599      return this;
2600    }
2601
2602    /**
2603     * @return The first repetition of repeating field {@link #route}, creating it if it does not already exist {3}
2604     */
2605    public CodeableConcept getRouteFirstRep() { 
2606      if (getRoute().isEmpty()) {
2607        addRoute();
2608      }
2609      return getRoute().get(0);
2610    }
2611
2612    /**
2613     * @return {@link #indication} (Description of indication(s) for this product, used when structured indications are not required. In cases where structured indications are required, they are captured using the ClinicalUseDefinition resource. An indication is a medical situation for which using the product is appropriate.). This is the underlying object with id, value and extensions. The accessor "getIndication" gives direct access to the value
2614     */
2615    public MarkdownType getIndicationElement() { 
2616      if (this.indication == null)
2617        if (Configuration.errorOnAutoCreate())
2618          throw new Error("Attempt to auto-create MedicinalProductDefinition.indication");
2619        else if (Configuration.doAutoCreate())
2620          this.indication = new MarkdownType(); // bb
2621      return this.indication;
2622    }
2623
2624    public boolean hasIndicationElement() { 
2625      return this.indication != null && !this.indication.isEmpty();
2626    }
2627
2628    public boolean hasIndication() { 
2629      return this.indication != null && !this.indication.isEmpty();
2630    }
2631
2632    /**
2633     * @param value {@link #indication} (Description of indication(s) for this product, used when structured indications are not required. In cases where structured indications are required, they are captured using the ClinicalUseDefinition resource. An indication is a medical situation for which using the product is appropriate.). This is the underlying object with id, value and extensions. The accessor "getIndication" gives direct access to the value
2634     */
2635    public MedicinalProductDefinition setIndicationElement(MarkdownType value) { 
2636      this.indication = value;
2637      return this;
2638    }
2639
2640    /**
2641     * @return Description of indication(s) for this product, used when structured indications are not required. In cases where structured indications are required, they are captured using the ClinicalUseDefinition resource. An indication is a medical situation for which using the product is appropriate.
2642     */
2643    public String getIndication() { 
2644      return this.indication == null ? null : this.indication.getValue();
2645    }
2646
2647    /**
2648     * @param value Description of indication(s) for this product, used when structured indications are not required. In cases where structured indications are required, they are captured using the ClinicalUseDefinition resource. An indication is a medical situation for which using the product is appropriate.
2649     */
2650    public MedicinalProductDefinition setIndication(String value) { 
2651      if (Utilities.noString(value))
2652        this.indication = null;
2653      else {
2654        if (this.indication == null)
2655          this.indication = new MarkdownType();
2656        this.indication.setValue(value);
2657      }
2658      return this;
2659    }
2660
2661    /**
2662     * @return {@link #legalStatusOfSupply} (The legal status of supply of the medicinal product as classified by the regulator.)
2663     */
2664    public CodeableConcept getLegalStatusOfSupply() { 
2665      if (this.legalStatusOfSupply == null)
2666        if (Configuration.errorOnAutoCreate())
2667          throw new Error("Attempt to auto-create MedicinalProductDefinition.legalStatusOfSupply");
2668        else if (Configuration.doAutoCreate())
2669          this.legalStatusOfSupply = new CodeableConcept(); // cc
2670      return this.legalStatusOfSupply;
2671    }
2672
2673    public boolean hasLegalStatusOfSupply() { 
2674      return this.legalStatusOfSupply != null && !this.legalStatusOfSupply.isEmpty();
2675    }
2676
2677    /**
2678     * @param value {@link #legalStatusOfSupply} (The legal status of supply of the medicinal product as classified by the regulator.)
2679     */
2680    public MedicinalProductDefinition setLegalStatusOfSupply(CodeableConcept value) { 
2681      this.legalStatusOfSupply = value;
2682      return this;
2683    }
2684
2685    /**
2686     * @return {@link #additionalMonitoringIndicator} (Whether the Medicinal Product is subject to additional monitoring for regulatory reasons, such as heightened reporting requirements.)
2687     */
2688    public CodeableConcept getAdditionalMonitoringIndicator() { 
2689      if (this.additionalMonitoringIndicator == null)
2690        if (Configuration.errorOnAutoCreate())
2691          throw new Error("Attempt to auto-create MedicinalProductDefinition.additionalMonitoringIndicator");
2692        else if (Configuration.doAutoCreate())
2693          this.additionalMonitoringIndicator = new CodeableConcept(); // cc
2694      return this.additionalMonitoringIndicator;
2695    }
2696
2697    public boolean hasAdditionalMonitoringIndicator() { 
2698      return this.additionalMonitoringIndicator != null && !this.additionalMonitoringIndicator.isEmpty();
2699    }
2700
2701    /**
2702     * @param value {@link #additionalMonitoringIndicator} (Whether the Medicinal Product is subject to additional monitoring for regulatory reasons, such as heightened reporting requirements.)
2703     */
2704    public MedicinalProductDefinition setAdditionalMonitoringIndicator(CodeableConcept value) { 
2705      this.additionalMonitoringIndicator = value;
2706      return this;
2707    }
2708
2709    /**
2710     * @return {@link #specialMeasures} (Whether the Medicinal Product is subject to special measures for regulatory reasons, such as a requirement to conduct post-authorization studies.)
2711     */
2712    public List<CodeableConcept> getSpecialMeasures() { 
2713      if (this.specialMeasures == null)
2714        this.specialMeasures = new ArrayList<CodeableConcept>();
2715      return this.specialMeasures;
2716    }
2717
2718    /**
2719     * @return Returns a reference to <code>this</code> for easy method chaining
2720     */
2721    public MedicinalProductDefinition setSpecialMeasures(List<CodeableConcept> theSpecialMeasures) { 
2722      this.specialMeasures = theSpecialMeasures;
2723      return this;
2724    }
2725
2726    public boolean hasSpecialMeasures() { 
2727      if (this.specialMeasures == null)
2728        return false;
2729      for (CodeableConcept item : this.specialMeasures)
2730        if (!item.isEmpty())
2731          return true;
2732      return false;
2733    }
2734
2735    public CodeableConcept addSpecialMeasures() { //3
2736      CodeableConcept t = new CodeableConcept();
2737      if (this.specialMeasures == null)
2738        this.specialMeasures = new ArrayList<CodeableConcept>();
2739      this.specialMeasures.add(t);
2740      return t;
2741    }
2742
2743    public MedicinalProductDefinition addSpecialMeasures(CodeableConcept t) { //3
2744      if (t == null)
2745        return this;
2746      if (this.specialMeasures == null)
2747        this.specialMeasures = new ArrayList<CodeableConcept>();
2748      this.specialMeasures.add(t);
2749      return this;
2750    }
2751
2752    /**
2753     * @return The first repetition of repeating field {@link #specialMeasures}, creating it if it does not already exist {3}
2754     */
2755    public CodeableConcept getSpecialMeasuresFirstRep() { 
2756      if (getSpecialMeasures().isEmpty()) {
2757        addSpecialMeasures();
2758      }
2759      return getSpecialMeasures().get(0);
2760    }
2761
2762    /**
2763     * @return {@link #pediatricUseIndicator} (If authorised for use in children, or infants, neonates etc.)
2764     */
2765    public CodeableConcept getPediatricUseIndicator() { 
2766      if (this.pediatricUseIndicator == null)
2767        if (Configuration.errorOnAutoCreate())
2768          throw new Error("Attempt to auto-create MedicinalProductDefinition.pediatricUseIndicator");
2769        else if (Configuration.doAutoCreate())
2770          this.pediatricUseIndicator = new CodeableConcept(); // cc
2771      return this.pediatricUseIndicator;
2772    }
2773
2774    public boolean hasPediatricUseIndicator() { 
2775      return this.pediatricUseIndicator != null && !this.pediatricUseIndicator.isEmpty();
2776    }
2777
2778    /**
2779     * @param value {@link #pediatricUseIndicator} (If authorised for use in children, or infants, neonates etc.)
2780     */
2781    public MedicinalProductDefinition setPediatricUseIndicator(CodeableConcept value) { 
2782      this.pediatricUseIndicator = value;
2783      return this;
2784    }
2785
2786    /**
2787     * @return {@link #classification} (Allows the product to be classified by various systems, commonly WHO ATC.)
2788     */
2789    public List<CodeableConcept> getClassification() { 
2790      if (this.classification == null)
2791        this.classification = new ArrayList<CodeableConcept>();
2792      return this.classification;
2793    }
2794
2795    /**
2796     * @return Returns a reference to <code>this</code> for easy method chaining
2797     */
2798    public MedicinalProductDefinition setClassification(List<CodeableConcept> theClassification) { 
2799      this.classification = theClassification;
2800      return this;
2801    }
2802
2803    public boolean hasClassification() { 
2804      if (this.classification == null)
2805        return false;
2806      for (CodeableConcept item : this.classification)
2807        if (!item.isEmpty())
2808          return true;
2809      return false;
2810    }
2811
2812    public CodeableConcept addClassification() { //3
2813      CodeableConcept t = new CodeableConcept();
2814      if (this.classification == null)
2815        this.classification = new ArrayList<CodeableConcept>();
2816      this.classification.add(t);
2817      return t;
2818    }
2819
2820    public MedicinalProductDefinition addClassification(CodeableConcept t) { //3
2821      if (t == null)
2822        return this;
2823      if (this.classification == null)
2824        this.classification = new ArrayList<CodeableConcept>();
2825      this.classification.add(t);
2826      return this;
2827    }
2828
2829    /**
2830     * @return The first repetition of repeating field {@link #classification}, creating it if it does not already exist {3}
2831     */
2832    public CodeableConcept getClassificationFirstRep() { 
2833      if (getClassification().isEmpty()) {
2834        addClassification();
2835      }
2836      return getClassification().get(0);
2837    }
2838
2839    /**
2840     * @return {@link #marketingStatus} (Marketing status of the medicinal product, in contrast to marketing authorization. This refers to the product being actually 'on the market' as opposed to being allowed to be on the market (which is an authorization).)
2841     */
2842    public List<MarketingStatus> getMarketingStatus() { 
2843      if (this.marketingStatus == null)
2844        this.marketingStatus = new ArrayList<MarketingStatus>();
2845      return this.marketingStatus;
2846    }
2847
2848    /**
2849     * @return Returns a reference to <code>this</code> for easy method chaining
2850     */
2851    public MedicinalProductDefinition setMarketingStatus(List<MarketingStatus> theMarketingStatus) { 
2852      this.marketingStatus = theMarketingStatus;
2853      return this;
2854    }
2855
2856    public boolean hasMarketingStatus() { 
2857      if (this.marketingStatus == null)
2858        return false;
2859      for (MarketingStatus item : this.marketingStatus)
2860        if (!item.isEmpty())
2861          return true;
2862      return false;
2863    }
2864
2865    public MarketingStatus addMarketingStatus() { //3
2866      MarketingStatus t = new MarketingStatus();
2867      if (this.marketingStatus == null)
2868        this.marketingStatus = new ArrayList<MarketingStatus>();
2869      this.marketingStatus.add(t);
2870      return t;
2871    }
2872
2873    public MedicinalProductDefinition addMarketingStatus(MarketingStatus t) { //3
2874      if (t == null)
2875        return this;
2876      if (this.marketingStatus == null)
2877        this.marketingStatus = new ArrayList<MarketingStatus>();
2878      this.marketingStatus.add(t);
2879      return this;
2880    }
2881
2882    /**
2883     * @return The first repetition of repeating field {@link #marketingStatus}, creating it if it does not already exist {3}
2884     */
2885    public MarketingStatus getMarketingStatusFirstRep() { 
2886      if (getMarketingStatus().isEmpty()) {
2887        addMarketingStatus();
2888      }
2889      return getMarketingStatus().get(0);
2890    }
2891
2892    /**
2893     * @return {@link #packagedMedicinalProduct} (Package type for the product. See also the PackagedProductDefinition resource.)
2894     */
2895    public List<CodeableConcept> getPackagedMedicinalProduct() { 
2896      if (this.packagedMedicinalProduct == null)
2897        this.packagedMedicinalProduct = new ArrayList<CodeableConcept>();
2898      return this.packagedMedicinalProduct;
2899    }
2900
2901    /**
2902     * @return Returns a reference to <code>this</code> for easy method chaining
2903     */
2904    public MedicinalProductDefinition setPackagedMedicinalProduct(List<CodeableConcept> thePackagedMedicinalProduct) { 
2905      this.packagedMedicinalProduct = thePackagedMedicinalProduct;
2906      return this;
2907    }
2908
2909    public boolean hasPackagedMedicinalProduct() { 
2910      if (this.packagedMedicinalProduct == null)
2911        return false;
2912      for (CodeableConcept item : this.packagedMedicinalProduct)
2913        if (!item.isEmpty())
2914          return true;
2915      return false;
2916    }
2917
2918    public CodeableConcept addPackagedMedicinalProduct() { //3
2919      CodeableConcept t = new CodeableConcept();
2920      if (this.packagedMedicinalProduct == null)
2921        this.packagedMedicinalProduct = new ArrayList<CodeableConcept>();
2922      this.packagedMedicinalProduct.add(t);
2923      return t;
2924    }
2925
2926    public MedicinalProductDefinition addPackagedMedicinalProduct(CodeableConcept t) { //3
2927      if (t == null)
2928        return this;
2929      if (this.packagedMedicinalProduct == null)
2930        this.packagedMedicinalProduct = new ArrayList<CodeableConcept>();
2931      this.packagedMedicinalProduct.add(t);
2932      return this;
2933    }
2934
2935    /**
2936     * @return The first repetition of repeating field {@link #packagedMedicinalProduct}, creating it if it does not already exist {3}
2937     */
2938    public CodeableConcept getPackagedMedicinalProductFirstRep() { 
2939      if (getPackagedMedicinalProduct().isEmpty()) {
2940        addPackagedMedicinalProduct();
2941      }
2942      return getPackagedMedicinalProduct().get(0);
2943    }
2944
2945    /**
2946     * @return {@link #comprisedOf} (Types of medicinal manufactured items and/or devices that this product consists of, such as tablets, capsule, or syringes. Used as a direct link when the item's packaging is not being recorded (see also PackagedProductDefinition.package.containedItem.item).)
2947     */
2948    public List<Reference> getComprisedOf() { 
2949      if (this.comprisedOf == null)
2950        this.comprisedOf = new ArrayList<Reference>();
2951      return this.comprisedOf;
2952    }
2953
2954    /**
2955     * @return Returns a reference to <code>this</code> for easy method chaining
2956     */
2957    public MedicinalProductDefinition setComprisedOf(List<Reference> theComprisedOf) { 
2958      this.comprisedOf = theComprisedOf;
2959      return this;
2960    }
2961
2962    public boolean hasComprisedOf() { 
2963      if (this.comprisedOf == null)
2964        return false;
2965      for (Reference item : this.comprisedOf)
2966        if (!item.isEmpty())
2967          return true;
2968      return false;
2969    }
2970
2971    public Reference addComprisedOf() { //3
2972      Reference t = new Reference();
2973      if (this.comprisedOf == null)
2974        this.comprisedOf = new ArrayList<Reference>();
2975      this.comprisedOf.add(t);
2976      return t;
2977    }
2978
2979    public MedicinalProductDefinition addComprisedOf(Reference t) { //3
2980      if (t == null)
2981        return this;
2982      if (this.comprisedOf == null)
2983        this.comprisedOf = new ArrayList<Reference>();
2984      this.comprisedOf.add(t);
2985      return this;
2986    }
2987
2988    /**
2989     * @return The first repetition of repeating field {@link #comprisedOf}, creating it if it does not already exist {3}
2990     */
2991    public Reference getComprisedOfFirstRep() { 
2992      if (getComprisedOf().isEmpty()) {
2993        addComprisedOf();
2994      }
2995      return getComprisedOf().get(0);
2996    }
2997
2998    /**
2999     * @return {@link #ingredient} (The ingredients of this medicinal product - when not detailed in other resources. This is only needed if the ingredients are not specified by incoming references from the Ingredient resource, or indirectly via incoming AdministrableProductDefinition, PackagedProductDefinition or ManufacturedItemDefinition references. In cases where those levels of detail are not used, the ingredients may be specified directly here as codes.)
3000     */
3001    public List<CodeableConcept> getIngredient() { 
3002      if (this.ingredient == null)
3003        this.ingredient = new ArrayList<CodeableConcept>();
3004      return this.ingredient;
3005    }
3006
3007    /**
3008     * @return Returns a reference to <code>this</code> for easy method chaining
3009     */
3010    public MedicinalProductDefinition setIngredient(List<CodeableConcept> theIngredient) { 
3011      this.ingredient = theIngredient;
3012      return this;
3013    }
3014
3015    public boolean hasIngredient() { 
3016      if (this.ingredient == null)
3017        return false;
3018      for (CodeableConcept item : this.ingredient)
3019        if (!item.isEmpty())
3020          return true;
3021      return false;
3022    }
3023
3024    public CodeableConcept addIngredient() { //3
3025      CodeableConcept t = new CodeableConcept();
3026      if (this.ingredient == null)
3027        this.ingredient = new ArrayList<CodeableConcept>();
3028      this.ingredient.add(t);
3029      return t;
3030    }
3031
3032    public MedicinalProductDefinition addIngredient(CodeableConcept t) { //3
3033      if (t == null)
3034        return this;
3035      if (this.ingredient == null)
3036        this.ingredient = new ArrayList<CodeableConcept>();
3037      this.ingredient.add(t);
3038      return this;
3039    }
3040
3041    /**
3042     * @return The first repetition of repeating field {@link #ingredient}, creating it if it does not already exist {3}
3043     */
3044    public CodeableConcept getIngredientFirstRep() { 
3045      if (getIngredient().isEmpty()) {
3046        addIngredient();
3047      }
3048      return getIngredient().get(0);
3049    }
3050
3051    /**
3052     * @return {@link #impurity} (Any component of the drug product which is not the chemical entity defined as the drug substance, or an excipient in the drug product. This includes process-related impurities and contaminants, product-related impurities including degradation products.)
3053     */
3054    public List<CodeableReference> getImpurity() { 
3055      if (this.impurity == null)
3056        this.impurity = new ArrayList<CodeableReference>();
3057      return this.impurity;
3058    }
3059
3060    /**
3061     * @return Returns a reference to <code>this</code> for easy method chaining
3062     */
3063    public MedicinalProductDefinition setImpurity(List<CodeableReference> theImpurity) { 
3064      this.impurity = theImpurity;
3065      return this;
3066    }
3067
3068    public boolean hasImpurity() { 
3069      if (this.impurity == null)
3070        return false;
3071      for (CodeableReference item : this.impurity)
3072        if (!item.isEmpty())
3073          return true;
3074      return false;
3075    }
3076
3077    public CodeableReference addImpurity() { //3
3078      CodeableReference t = new CodeableReference();
3079      if (this.impurity == null)
3080        this.impurity = new ArrayList<CodeableReference>();
3081      this.impurity.add(t);
3082      return t;
3083    }
3084
3085    public MedicinalProductDefinition addImpurity(CodeableReference t) { //3
3086      if (t == null)
3087        return this;
3088      if (this.impurity == null)
3089        this.impurity = new ArrayList<CodeableReference>();
3090      this.impurity.add(t);
3091      return this;
3092    }
3093
3094    /**
3095     * @return The first repetition of repeating field {@link #impurity}, creating it if it does not already exist {3}
3096     */
3097    public CodeableReference getImpurityFirstRep() { 
3098      if (getImpurity().isEmpty()) {
3099        addImpurity();
3100      }
3101      return getImpurity().get(0);
3102    }
3103
3104    /**
3105     * @return {@link #attachedDocument} (Additional information or supporting documentation about the medicinal product.)
3106     */
3107    public List<Reference> getAttachedDocument() { 
3108      if (this.attachedDocument == null)
3109        this.attachedDocument = new ArrayList<Reference>();
3110      return this.attachedDocument;
3111    }
3112
3113    /**
3114     * @return Returns a reference to <code>this</code> for easy method chaining
3115     */
3116    public MedicinalProductDefinition setAttachedDocument(List<Reference> theAttachedDocument) { 
3117      this.attachedDocument = theAttachedDocument;
3118      return this;
3119    }
3120
3121    public boolean hasAttachedDocument() { 
3122      if (this.attachedDocument == null)
3123        return false;
3124      for (Reference item : this.attachedDocument)
3125        if (!item.isEmpty())
3126          return true;
3127      return false;
3128    }
3129
3130    public Reference addAttachedDocument() { //3
3131      Reference t = new Reference();
3132      if (this.attachedDocument == null)
3133        this.attachedDocument = new ArrayList<Reference>();
3134      this.attachedDocument.add(t);
3135      return t;
3136    }
3137
3138    public MedicinalProductDefinition addAttachedDocument(Reference t) { //3
3139      if (t == null)
3140        return this;
3141      if (this.attachedDocument == null)
3142        this.attachedDocument = new ArrayList<Reference>();
3143      this.attachedDocument.add(t);
3144      return this;
3145    }
3146
3147    /**
3148     * @return The first repetition of repeating field {@link #attachedDocument}, creating it if it does not already exist {3}
3149     */
3150    public Reference getAttachedDocumentFirstRep() { 
3151      if (getAttachedDocument().isEmpty()) {
3152        addAttachedDocument();
3153      }
3154      return getAttachedDocument().get(0);
3155    }
3156
3157    /**
3158     * @return {@link #masterFile} (A master file for the medicinal product (e.g. Pharmacovigilance System Master File). Drug master files (DMFs) are documents submitted to regulatory agencies to provide confidential detailed information about facilities, processes or articles used in the manufacturing, processing, packaging and storing of drug products.)
3159     */
3160    public List<Reference> getMasterFile() { 
3161      if (this.masterFile == null)
3162        this.masterFile = new ArrayList<Reference>();
3163      return this.masterFile;
3164    }
3165
3166    /**
3167     * @return Returns a reference to <code>this</code> for easy method chaining
3168     */
3169    public MedicinalProductDefinition setMasterFile(List<Reference> theMasterFile) { 
3170      this.masterFile = theMasterFile;
3171      return this;
3172    }
3173
3174    public boolean hasMasterFile() { 
3175      if (this.masterFile == null)
3176        return false;
3177      for (Reference item : this.masterFile)
3178        if (!item.isEmpty())
3179          return true;
3180      return false;
3181    }
3182
3183    public Reference addMasterFile() { //3
3184      Reference t = new Reference();
3185      if (this.masterFile == null)
3186        this.masterFile = new ArrayList<Reference>();
3187      this.masterFile.add(t);
3188      return t;
3189    }
3190
3191    public MedicinalProductDefinition addMasterFile(Reference t) { //3
3192      if (t == null)
3193        return this;
3194      if (this.masterFile == null)
3195        this.masterFile = new ArrayList<Reference>();
3196      this.masterFile.add(t);
3197      return this;
3198    }
3199
3200    /**
3201     * @return The first repetition of repeating field {@link #masterFile}, creating it if it does not already exist {3}
3202     */
3203    public Reference getMasterFileFirstRep() { 
3204      if (getMasterFile().isEmpty()) {
3205        addMasterFile();
3206      }
3207      return getMasterFile().get(0);
3208    }
3209
3210    /**
3211     * @return {@link #contact} (A product specific contact, person (in a role), or an organization.)
3212     */
3213    public List<MedicinalProductDefinitionContactComponent> getContact() { 
3214      if (this.contact == null)
3215        this.contact = new ArrayList<MedicinalProductDefinitionContactComponent>();
3216      return this.contact;
3217    }
3218
3219    /**
3220     * @return Returns a reference to <code>this</code> for easy method chaining
3221     */
3222    public MedicinalProductDefinition setContact(List<MedicinalProductDefinitionContactComponent> theContact) { 
3223      this.contact = theContact;
3224      return this;
3225    }
3226
3227    public boolean hasContact() { 
3228      if (this.contact == null)
3229        return false;
3230      for (MedicinalProductDefinitionContactComponent item : this.contact)
3231        if (!item.isEmpty())
3232          return true;
3233      return false;
3234    }
3235
3236    public MedicinalProductDefinitionContactComponent addContact() { //3
3237      MedicinalProductDefinitionContactComponent t = new MedicinalProductDefinitionContactComponent();
3238      if (this.contact == null)
3239        this.contact = new ArrayList<MedicinalProductDefinitionContactComponent>();
3240      this.contact.add(t);
3241      return t;
3242    }
3243
3244    public MedicinalProductDefinition addContact(MedicinalProductDefinitionContactComponent t) { //3
3245      if (t == null)
3246        return this;
3247      if (this.contact == null)
3248        this.contact = new ArrayList<MedicinalProductDefinitionContactComponent>();
3249      this.contact.add(t);
3250      return this;
3251    }
3252
3253    /**
3254     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist {3}
3255     */
3256    public MedicinalProductDefinitionContactComponent getContactFirstRep() { 
3257      if (getContact().isEmpty()) {
3258        addContact();
3259      }
3260      return getContact().get(0);
3261    }
3262
3263    /**
3264     * @return {@link #clinicalTrial} (Clinical trials or studies that this product is involved in.)
3265     */
3266    public List<Reference> getClinicalTrial() { 
3267      if (this.clinicalTrial == null)
3268        this.clinicalTrial = new ArrayList<Reference>();
3269      return this.clinicalTrial;
3270    }
3271
3272    /**
3273     * @return Returns a reference to <code>this</code> for easy method chaining
3274     */
3275    public MedicinalProductDefinition setClinicalTrial(List<Reference> theClinicalTrial) { 
3276      this.clinicalTrial = theClinicalTrial;
3277      return this;
3278    }
3279
3280    public boolean hasClinicalTrial() { 
3281      if (this.clinicalTrial == null)
3282        return false;
3283      for (Reference item : this.clinicalTrial)
3284        if (!item.isEmpty())
3285          return true;
3286      return false;
3287    }
3288
3289    public Reference addClinicalTrial() { //3
3290      Reference t = new Reference();
3291      if (this.clinicalTrial == null)
3292        this.clinicalTrial = new ArrayList<Reference>();
3293      this.clinicalTrial.add(t);
3294      return t;
3295    }
3296
3297    public MedicinalProductDefinition addClinicalTrial(Reference t) { //3
3298      if (t == null)
3299        return this;
3300      if (this.clinicalTrial == null)
3301        this.clinicalTrial = new ArrayList<Reference>();
3302      this.clinicalTrial.add(t);
3303      return this;
3304    }
3305
3306    /**
3307     * @return The first repetition of repeating field {@link #clinicalTrial}, creating it if it does not already exist {3}
3308     */
3309    public Reference getClinicalTrialFirstRep() { 
3310      if (getClinicalTrial().isEmpty()) {
3311        addClinicalTrial();
3312      }
3313      return getClinicalTrial().get(0);
3314    }
3315
3316    /**
3317     * @return {@link #code} (A code that this product is known by, usually within some formal terminology, perhaps assigned by a third party (i.e. not the manufacturer or regulator). Products (types of medications) tend to be known by identifiers during development and within regulatory process. However when they are prescribed they tend to be identified by codes. The same product may be have multiple codes, applied to it by multiple organizations.)
3318     */
3319    public List<Coding> getCode() { 
3320      if (this.code == null)
3321        this.code = new ArrayList<Coding>();
3322      return this.code;
3323    }
3324
3325    /**
3326     * @return Returns a reference to <code>this</code> for easy method chaining
3327     */
3328    public MedicinalProductDefinition setCode(List<Coding> theCode) { 
3329      this.code = theCode;
3330      return this;
3331    }
3332
3333    public boolean hasCode() { 
3334      if (this.code == null)
3335        return false;
3336      for (Coding item : this.code)
3337        if (!item.isEmpty())
3338          return true;
3339      return false;
3340    }
3341
3342    public Coding addCode() { //3
3343      Coding t = new Coding();
3344      if (this.code == null)
3345        this.code = new ArrayList<Coding>();
3346      this.code.add(t);
3347      return t;
3348    }
3349
3350    public MedicinalProductDefinition addCode(Coding t) { //3
3351      if (t == null)
3352        return this;
3353      if (this.code == null)
3354        this.code = new ArrayList<Coding>();
3355      this.code.add(t);
3356      return this;
3357    }
3358
3359    /**
3360     * @return The first repetition of repeating field {@link #code}, creating it if it does not already exist {3}
3361     */
3362    public Coding getCodeFirstRep() { 
3363      if (getCode().isEmpty()) {
3364        addCode();
3365      }
3366      return getCode().get(0);
3367    }
3368
3369    /**
3370     * @return {@link #name} (The product's name, including full name and possibly coded parts.)
3371     */
3372    public List<MedicinalProductDefinitionNameComponent> getName() { 
3373      if (this.name == null)
3374        this.name = new ArrayList<MedicinalProductDefinitionNameComponent>();
3375      return this.name;
3376    }
3377
3378    /**
3379     * @return Returns a reference to <code>this</code> for easy method chaining
3380     */
3381    public MedicinalProductDefinition setName(List<MedicinalProductDefinitionNameComponent> theName) { 
3382      this.name = theName;
3383      return this;
3384    }
3385
3386    public boolean hasName() { 
3387      if (this.name == null)
3388        return false;
3389      for (MedicinalProductDefinitionNameComponent item : this.name)
3390        if (!item.isEmpty())
3391          return true;
3392      return false;
3393    }
3394
3395    public MedicinalProductDefinitionNameComponent addName() { //3
3396      MedicinalProductDefinitionNameComponent t = new MedicinalProductDefinitionNameComponent();
3397      if (this.name == null)
3398        this.name = new ArrayList<MedicinalProductDefinitionNameComponent>();
3399      this.name.add(t);
3400      return t;
3401    }
3402
3403    public MedicinalProductDefinition addName(MedicinalProductDefinitionNameComponent t) { //3
3404      if (t == null)
3405        return this;
3406      if (this.name == null)
3407        this.name = new ArrayList<MedicinalProductDefinitionNameComponent>();
3408      this.name.add(t);
3409      return this;
3410    }
3411
3412    /**
3413     * @return The first repetition of repeating field {@link #name}, creating it if it does not already exist {3}
3414     */
3415    public MedicinalProductDefinitionNameComponent getNameFirstRep() { 
3416      if (getName().isEmpty()) {
3417        addName();
3418      }
3419      return getName().get(0);
3420    }
3421
3422    /**
3423     * @return {@link #crossReference} (Reference to another product, e.g. for linking authorised to investigational product, or a virtual product.)
3424     */
3425    public List<MedicinalProductDefinitionCrossReferenceComponent> getCrossReference() { 
3426      if (this.crossReference == null)
3427        this.crossReference = new ArrayList<MedicinalProductDefinitionCrossReferenceComponent>();
3428      return this.crossReference;
3429    }
3430
3431    /**
3432     * @return Returns a reference to <code>this</code> for easy method chaining
3433     */
3434    public MedicinalProductDefinition setCrossReference(List<MedicinalProductDefinitionCrossReferenceComponent> theCrossReference) { 
3435      this.crossReference = theCrossReference;
3436      return this;
3437    }
3438
3439    public boolean hasCrossReference() { 
3440      if (this.crossReference == null)
3441        return false;
3442      for (MedicinalProductDefinitionCrossReferenceComponent item : this.crossReference)
3443        if (!item.isEmpty())
3444          return true;
3445      return false;
3446    }
3447
3448    public MedicinalProductDefinitionCrossReferenceComponent addCrossReference() { //3
3449      MedicinalProductDefinitionCrossReferenceComponent t = new MedicinalProductDefinitionCrossReferenceComponent();
3450      if (this.crossReference == null)
3451        this.crossReference = new ArrayList<MedicinalProductDefinitionCrossReferenceComponent>();
3452      this.crossReference.add(t);
3453      return t;
3454    }
3455
3456    public MedicinalProductDefinition addCrossReference(MedicinalProductDefinitionCrossReferenceComponent t) { //3
3457      if (t == null)
3458        return this;
3459      if (this.crossReference == null)
3460        this.crossReference = new ArrayList<MedicinalProductDefinitionCrossReferenceComponent>();
3461      this.crossReference.add(t);
3462      return this;
3463    }
3464
3465    /**
3466     * @return The first repetition of repeating field {@link #crossReference}, creating it if it does not already exist {3}
3467     */
3468    public MedicinalProductDefinitionCrossReferenceComponent getCrossReferenceFirstRep() { 
3469      if (getCrossReference().isEmpty()) {
3470        addCrossReference();
3471      }
3472      return getCrossReference().get(0);
3473    }
3474
3475    /**
3476     * @return {@link #operation} (A manufacturing or administrative process or step associated with (or performed on) the medicinal product.)
3477     */
3478    public List<MedicinalProductDefinitionOperationComponent> getOperation() { 
3479      if (this.operation == null)
3480        this.operation = new ArrayList<MedicinalProductDefinitionOperationComponent>();
3481      return this.operation;
3482    }
3483
3484    /**
3485     * @return Returns a reference to <code>this</code> for easy method chaining
3486     */
3487    public MedicinalProductDefinition setOperation(List<MedicinalProductDefinitionOperationComponent> theOperation) { 
3488      this.operation = theOperation;
3489      return this;
3490    }
3491
3492    public boolean hasOperation() { 
3493      if (this.operation == null)
3494        return false;
3495      for (MedicinalProductDefinitionOperationComponent item : this.operation)
3496        if (!item.isEmpty())
3497          return true;
3498      return false;
3499    }
3500
3501    public MedicinalProductDefinitionOperationComponent addOperation() { //3
3502      MedicinalProductDefinitionOperationComponent t = new MedicinalProductDefinitionOperationComponent();
3503      if (this.operation == null)
3504        this.operation = new ArrayList<MedicinalProductDefinitionOperationComponent>();
3505      this.operation.add(t);
3506      return t;
3507    }
3508
3509    public MedicinalProductDefinition addOperation(MedicinalProductDefinitionOperationComponent t) { //3
3510      if (t == null)
3511        return this;
3512      if (this.operation == null)
3513        this.operation = new ArrayList<MedicinalProductDefinitionOperationComponent>();
3514      this.operation.add(t);
3515      return this;
3516    }
3517
3518    /**
3519     * @return The first repetition of repeating field {@link #operation}, creating it if it does not already exist {3}
3520     */
3521    public MedicinalProductDefinitionOperationComponent getOperationFirstRep() { 
3522      if (getOperation().isEmpty()) {
3523        addOperation();
3524      }
3525      return getOperation().get(0);
3526    }
3527
3528    /**
3529     * @return {@link #characteristic} (Allows the key product features to be recorded, such as "sugar free", "modified release", "parallel import".)
3530     */
3531    public List<MedicinalProductDefinitionCharacteristicComponent> getCharacteristic() { 
3532      if (this.characteristic == null)
3533        this.characteristic = new ArrayList<MedicinalProductDefinitionCharacteristicComponent>();
3534      return this.characteristic;
3535    }
3536
3537    /**
3538     * @return Returns a reference to <code>this</code> for easy method chaining
3539     */
3540    public MedicinalProductDefinition setCharacteristic(List<MedicinalProductDefinitionCharacteristicComponent> theCharacteristic) { 
3541      this.characteristic = theCharacteristic;
3542      return this;
3543    }
3544
3545    public boolean hasCharacteristic() { 
3546      if (this.characteristic == null)
3547        return false;
3548      for (MedicinalProductDefinitionCharacteristicComponent item : this.characteristic)
3549        if (!item.isEmpty())
3550          return true;
3551      return false;
3552    }
3553
3554    public MedicinalProductDefinitionCharacteristicComponent addCharacteristic() { //3
3555      MedicinalProductDefinitionCharacteristicComponent t = new MedicinalProductDefinitionCharacteristicComponent();
3556      if (this.characteristic == null)
3557        this.characteristic = new ArrayList<MedicinalProductDefinitionCharacteristicComponent>();
3558      this.characteristic.add(t);
3559      return t;
3560    }
3561
3562    public MedicinalProductDefinition addCharacteristic(MedicinalProductDefinitionCharacteristicComponent t) { //3
3563      if (t == null)
3564        return this;
3565      if (this.characteristic == null)
3566        this.characteristic = new ArrayList<MedicinalProductDefinitionCharacteristicComponent>();
3567      this.characteristic.add(t);
3568      return this;
3569    }
3570
3571    /**
3572     * @return The first repetition of repeating field {@link #characteristic}, creating it if it does not already exist {3}
3573     */
3574    public MedicinalProductDefinitionCharacteristicComponent getCharacteristicFirstRep() { 
3575      if (getCharacteristic().isEmpty()) {
3576        addCharacteristic();
3577      }
3578      return getCharacteristic().get(0);
3579    }
3580
3581      protected void listChildren(List<Property> children) {
3582        super.listChildren(children);
3583        children.add(new Property("identifier", "Identifier", "Business identifier for this product. Could be an MPID. When in development or being regulated, products are typically referenced by official identifiers, assigned by a manufacturer or regulator, and unique to a product (which, when compared to a product instance being prescribed, is actually a product type). See also MedicinalProductDefinition.code.", 0, java.lang.Integer.MAX_VALUE, identifier));
3584        children.add(new Property("type", "CodeableConcept", "Regulatory type, e.g. Investigational or Authorized.", 0, 1, type));
3585        children.add(new Property("domain", "CodeableConcept", "If this medicine applies to human or veterinary uses.", 0, 1, domain));
3586        children.add(new Property("version", "string", "A business identifier relating to a specific version of the product, this is commonly used to support revisions to an existing product.", 0, 1, version));
3587        children.add(new Property("status", "CodeableConcept", "The status within the lifecycle of this product record. A high-level status, this is not intended to duplicate details carried elsewhere such as legal status, or authorization status.", 0, 1, status));
3588        children.add(new Property("statusDate", "dateTime", "The date at which the given status became applicable.", 0, 1, statusDate));
3589        children.add(new Property("description", "markdown", "General description of this product.", 0, 1, description));
3590        children.add(new Property("combinedPharmaceuticalDoseForm", "CodeableConcept", "The dose form for a single part product, or combined form of a multiple part product. This is one concept that describes all the components. It does not represent the form with components physically mixed, if that might be necessary, for which see (AdministrableProductDefinition.administrableDoseForm).", 0, 1, combinedPharmaceuticalDoseForm));
3591        children.add(new Property("route", "CodeableConcept", "The path by which the product is taken into or makes contact with the body. In some regions this is referred to as the licenced or approved route. See also AdministrableProductDefinition resource. MedicinalProductDefinition.route is the same concept as AdministrableProductDefinition.routeOfAdministration.code, and they cannot be used together.", 0, java.lang.Integer.MAX_VALUE, route));
3592        children.add(new Property("indication", "markdown", "Description of indication(s) for this product, used when structured indications are not required. In cases where structured indications are required, they are captured using the ClinicalUseDefinition resource. An indication is a medical situation for which using the product is appropriate.", 0, 1, indication));
3593        children.add(new Property("legalStatusOfSupply", "CodeableConcept", "The legal status of supply of the medicinal product as classified by the regulator.", 0, 1, legalStatusOfSupply));
3594        children.add(new Property("additionalMonitoringIndicator", "CodeableConcept", "Whether the Medicinal Product is subject to additional monitoring for regulatory reasons, such as heightened reporting requirements.", 0, 1, additionalMonitoringIndicator));
3595        children.add(new Property("specialMeasures", "CodeableConcept", "Whether the Medicinal Product is subject to special measures for regulatory reasons, such as a requirement to conduct post-authorization studies.", 0, java.lang.Integer.MAX_VALUE, specialMeasures));
3596        children.add(new Property("pediatricUseIndicator", "CodeableConcept", "If authorised for use in children, or infants, neonates etc.", 0, 1, pediatricUseIndicator));
3597        children.add(new Property("classification", "CodeableConcept", "Allows the product to be classified by various systems, commonly WHO ATC.", 0, java.lang.Integer.MAX_VALUE, classification));
3598        children.add(new Property("marketingStatus", "MarketingStatus", "Marketing status of the medicinal product, in contrast to marketing authorization. This refers to the product being actually 'on the market' as opposed to being allowed to be on the market (which is an authorization).", 0, java.lang.Integer.MAX_VALUE, marketingStatus));
3599        children.add(new Property("packagedMedicinalProduct", "CodeableConcept", "Package type for the product. See also the PackagedProductDefinition resource.", 0, java.lang.Integer.MAX_VALUE, packagedMedicinalProduct));
3600        children.add(new Property("comprisedOf", "Reference(ManufacturedItemDefinition|DeviceDefinition)", "Types of medicinal manufactured items and/or devices that this product consists of, such as tablets, capsule, or syringes. Used as a direct link when the item's packaging is not being recorded (see also PackagedProductDefinition.package.containedItem.item).", 0, java.lang.Integer.MAX_VALUE, comprisedOf));
3601        children.add(new Property("ingredient", "CodeableConcept", "The ingredients of this medicinal product - when not detailed in other resources. This is only needed if the ingredients are not specified by incoming references from the Ingredient resource, or indirectly via incoming AdministrableProductDefinition, PackagedProductDefinition or ManufacturedItemDefinition references. In cases where those levels of detail are not used, the ingredients may be specified directly here as codes.", 0, java.lang.Integer.MAX_VALUE, ingredient));
3602        children.add(new Property("impurity", "CodeableReference(SubstanceDefinition)", "Any component of the drug product which is not the chemical entity defined as the drug substance, or an excipient in the drug product. This includes process-related impurities and contaminants, product-related impurities including degradation products.", 0, java.lang.Integer.MAX_VALUE, impurity));
3603        children.add(new Property("attachedDocument", "Reference(DocumentReference)", "Additional information or supporting documentation about the medicinal product.", 0, java.lang.Integer.MAX_VALUE, attachedDocument));
3604        children.add(new Property("masterFile", "Reference(DocumentReference)", "A master file for the medicinal product (e.g. Pharmacovigilance System Master File). Drug master files (DMFs) are documents submitted to regulatory agencies to provide confidential detailed information about facilities, processes or articles used in the manufacturing, processing, packaging and storing of drug products.", 0, java.lang.Integer.MAX_VALUE, masterFile));
3605        children.add(new Property("contact", "", "A product specific contact, person (in a role), or an organization.", 0, java.lang.Integer.MAX_VALUE, contact));
3606        children.add(new Property("clinicalTrial", "Reference(ResearchStudy)", "Clinical trials or studies that this product is involved in.", 0, java.lang.Integer.MAX_VALUE, clinicalTrial));
3607        children.add(new Property("code", "Coding", "A code that this product is known by, usually within some formal terminology, perhaps assigned by a third party (i.e. not the manufacturer or regulator). Products (types of medications) tend to be known by identifiers during development and within regulatory process. However when they are prescribed they tend to be identified by codes. The same product may be have multiple codes, applied to it by multiple organizations.", 0, java.lang.Integer.MAX_VALUE, code));
3608        children.add(new Property("name", "", "The product's name, including full name and possibly coded parts.", 0, java.lang.Integer.MAX_VALUE, name));
3609        children.add(new Property("crossReference", "", "Reference to another product, e.g. for linking authorised to investigational product, or a virtual product.", 0, java.lang.Integer.MAX_VALUE, crossReference));
3610        children.add(new Property("operation", "", "A manufacturing or administrative process or step associated with (or performed on) the medicinal product.", 0, java.lang.Integer.MAX_VALUE, operation));
3611        children.add(new Property("characteristic", "", "Allows the key product features to be recorded, such as \"sugar free\", \"modified release\", \"parallel import\".", 0, java.lang.Integer.MAX_VALUE, characteristic));
3612      }
3613
3614      @Override
3615      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3616        switch (_hash) {
3617        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Business identifier for this product. Could be an MPID. When in development or being regulated, products are typically referenced by official identifiers, assigned by a manufacturer or regulator, and unique to a product (which, when compared to a product instance being prescribed, is actually a product type). See also MedicinalProductDefinition.code.", 0, java.lang.Integer.MAX_VALUE, identifier);
3618        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Regulatory type, e.g. Investigational or Authorized.", 0, 1, type);
3619        case -1326197564: /*domain*/  return new Property("domain", "CodeableConcept", "If this medicine applies to human or veterinary uses.", 0, 1, domain);
3620        case 351608024: /*version*/  return new Property("version", "string", "A business identifier relating to a specific version of the product, this is commonly used to support revisions to an existing product.", 0, 1, version);
3621        case -892481550: /*status*/  return new Property("status", "CodeableConcept", "The status within the lifecycle of this product record. A high-level status, this is not intended to duplicate details carried elsewhere such as legal status, or authorization status.", 0, 1, status);
3622        case 247524032: /*statusDate*/  return new Property("statusDate", "dateTime", "The date at which the given status became applicable.", 0, 1, statusDate);
3623        case -1724546052: /*description*/  return new Property("description", "markdown", "General description of this product.", 0, 1, description);
3624        case -1992898487: /*combinedPharmaceuticalDoseForm*/  return new Property("combinedPharmaceuticalDoseForm", "CodeableConcept", "The dose form for a single part product, or combined form of a multiple part product. This is one concept that describes all the components. It does not represent the form with components physically mixed, if that might be necessary, for which see (AdministrableProductDefinition.administrableDoseForm).", 0, 1, combinedPharmaceuticalDoseForm);
3625        case 108704329: /*route*/  return new Property("route", "CodeableConcept", "The path by which the product is taken into or makes contact with the body. In some regions this is referred to as the licenced or approved route. See also AdministrableProductDefinition resource. MedicinalProductDefinition.route is the same concept as AdministrableProductDefinition.routeOfAdministration.code, and they cannot be used together.", 0, java.lang.Integer.MAX_VALUE, route);
3626        case -597168804: /*indication*/  return new Property("indication", "markdown", "Description of indication(s) for this product, used when structured indications are not required. In cases where structured indications are required, they are captured using the ClinicalUseDefinition resource. An indication is a medical situation for which using the product is appropriate.", 0, 1, indication);
3627        case -844874031: /*legalStatusOfSupply*/  return new Property("legalStatusOfSupply", "CodeableConcept", "The legal status of supply of the medicinal product as classified by the regulator.", 0, 1, legalStatusOfSupply);
3628        case 1935999744: /*additionalMonitoringIndicator*/  return new Property("additionalMonitoringIndicator", "CodeableConcept", "Whether the Medicinal Product is subject to additional monitoring for regulatory reasons, such as heightened reporting requirements.", 0, 1, additionalMonitoringIndicator);
3629        case 975102638: /*specialMeasures*/  return new Property("specialMeasures", "CodeableConcept", "Whether the Medicinal Product is subject to special measures for regulatory reasons, such as a requirement to conduct post-authorization studies.", 0, java.lang.Integer.MAX_VALUE, specialMeasures);
3630        case -1515533081: /*pediatricUseIndicator*/  return new Property("pediatricUseIndicator", "CodeableConcept", "If authorised for use in children, or infants, neonates etc.", 0, 1, pediatricUseIndicator);
3631        case 382350310: /*classification*/  return new Property("classification", "CodeableConcept", "Allows the product to be classified by various systems, commonly WHO ATC.", 0, java.lang.Integer.MAX_VALUE, classification);
3632        case 70767032: /*marketingStatus*/  return new Property("marketingStatus", "MarketingStatus", "Marketing status of the medicinal product, in contrast to marketing authorization. This refers to the product being actually 'on the market' as opposed to being allowed to be on the market (which is an authorization).", 0, java.lang.Integer.MAX_VALUE, marketingStatus);
3633        case -361025513: /*packagedMedicinalProduct*/  return new Property("packagedMedicinalProduct", "CodeableConcept", "Package type for the product. See also the PackagedProductDefinition resource.", 0, java.lang.Integer.MAX_VALUE, packagedMedicinalProduct);
3634        case 1546078211: /*comprisedOf*/  return new Property("comprisedOf", "Reference(ManufacturedItemDefinition|DeviceDefinition)", "Types of medicinal manufactured items and/or devices that this product consists of, such as tablets, capsule, or syringes. Used as a direct link when the item's packaging is not being recorded (see also PackagedProductDefinition.package.containedItem.item).", 0, java.lang.Integer.MAX_VALUE, comprisedOf);
3635        case -206409263: /*ingredient*/  return new Property("ingredient", "CodeableConcept", "The ingredients of this medicinal product - when not detailed in other resources. This is only needed if the ingredients are not specified by incoming references from the Ingredient resource, or indirectly via incoming AdministrableProductDefinition, PackagedProductDefinition or ManufacturedItemDefinition references. In cases where those levels of detail are not used, the ingredients may be specified directly here as codes.", 0, java.lang.Integer.MAX_VALUE, ingredient);
3636        case -416837467: /*impurity*/  return new Property("impurity", "CodeableReference(SubstanceDefinition)", "Any component of the drug product which is not the chemical entity defined as the drug substance, or an excipient in the drug product. This includes process-related impurities and contaminants, product-related impurities including degradation products.", 0, java.lang.Integer.MAX_VALUE, impurity);
3637        case -513945889: /*attachedDocument*/  return new Property("attachedDocument", "Reference(DocumentReference)", "Additional information or supporting documentation about the medicinal product.", 0, java.lang.Integer.MAX_VALUE, attachedDocument);
3638        case -2039573762: /*masterFile*/  return new Property("masterFile", "Reference(DocumentReference)", "A master file for the medicinal product (e.g. Pharmacovigilance System Master File). Drug master files (DMFs) are documents submitted to regulatory agencies to provide confidential detailed information about facilities, processes or articles used in the manufacturing, processing, packaging and storing of drug products.", 0, java.lang.Integer.MAX_VALUE, masterFile);
3639        case 951526432: /*contact*/  return new Property("contact", "", "A product specific contact, person (in a role), or an organization.", 0, java.lang.Integer.MAX_VALUE, contact);
3640        case 1232866243: /*clinicalTrial*/  return new Property("clinicalTrial", "Reference(ResearchStudy)", "Clinical trials or studies that this product is involved in.", 0, java.lang.Integer.MAX_VALUE, clinicalTrial);
3641        case 3059181: /*code*/  return new Property("code", "Coding", "A code that this product is known by, usually within some formal terminology, perhaps assigned by a third party (i.e. not the manufacturer or regulator). Products (types of medications) tend to be known by identifiers during development and within regulatory process. However when they are prescribed they tend to be identified by codes. The same product may be have multiple codes, applied to it by multiple organizations.", 0, java.lang.Integer.MAX_VALUE, code);
3642        case 3373707: /*name*/  return new Property("name", "", "The product's name, including full name and possibly coded parts.", 0, java.lang.Integer.MAX_VALUE, name);
3643        case -986968341: /*crossReference*/  return new Property("crossReference", "", "Reference to another product, e.g. for linking authorised to investigational product, or a virtual product.", 0, java.lang.Integer.MAX_VALUE, crossReference);
3644        case 1662702951: /*operation*/  return new Property("operation", "", "A manufacturing or administrative process or step associated with (or performed on) the medicinal product.", 0, java.lang.Integer.MAX_VALUE, operation);
3645        case 366313883: /*characteristic*/  return new Property("characteristic", "", "Allows the key product features to be recorded, such as \"sugar free\", \"modified release\", \"parallel import\".", 0, java.lang.Integer.MAX_VALUE, characteristic);
3646        default: return super.getNamedProperty(_hash, _name, _checkValid);
3647        }
3648
3649      }
3650
3651      @Override
3652      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3653        switch (hash) {
3654        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3655        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
3656        case -1326197564: /*domain*/ return this.domain == null ? new Base[0] : new Base[] {this.domain}; // CodeableConcept
3657        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
3658        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // CodeableConcept
3659        case 247524032: /*statusDate*/ return this.statusDate == null ? new Base[0] : new Base[] {this.statusDate}; // DateTimeType
3660        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
3661        case -1992898487: /*combinedPharmaceuticalDoseForm*/ return this.combinedPharmaceuticalDoseForm == null ? new Base[0] : new Base[] {this.combinedPharmaceuticalDoseForm}; // CodeableConcept
3662        case 108704329: /*route*/ return this.route == null ? new Base[0] : this.route.toArray(new Base[this.route.size()]); // CodeableConcept
3663        case -597168804: /*indication*/ return this.indication == null ? new Base[0] : new Base[] {this.indication}; // MarkdownType
3664        case -844874031: /*legalStatusOfSupply*/ return this.legalStatusOfSupply == null ? new Base[0] : new Base[] {this.legalStatusOfSupply}; // CodeableConcept
3665        case 1935999744: /*additionalMonitoringIndicator*/ return this.additionalMonitoringIndicator == null ? new Base[0] : new Base[] {this.additionalMonitoringIndicator}; // CodeableConcept
3666        case 975102638: /*specialMeasures*/ return this.specialMeasures == null ? new Base[0] : this.specialMeasures.toArray(new Base[this.specialMeasures.size()]); // CodeableConcept
3667        case -1515533081: /*pediatricUseIndicator*/ return this.pediatricUseIndicator == null ? new Base[0] : new Base[] {this.pediatricUseIndicator}; // CodeableConcept
3668        case 382350310: /*classification*/ return this.classification == null ? new Base[0] : this.classification.toArray(new Base[this.classification.size()]); // CodeableConcept
3669        case 70767032: /*marketingStatus*/ return this.marketingStatus == null ? new Base[0] : this.marketingStatus.toArray(new Base[this.marketingStatus.size()]); // MarketingStatus
3670        case -361025513: /*packagedMedicinalProduct*/ return this.packagedMedicinalProduct == null ? new Base[0] : this.packagedMedicinalProduct.toArray(new Base[this.packagedMedicinalProduct.size()]); // CodeableConcept
3671        case 1546078211: /*comprisedOf*/ return this.comprisedOf == null ? new Base[0] : this.comprisedOf.toArray(new Base[this.comprisedOf.size()]); // Reference
3672        case -206409263: /*ingredient*/ return this.ingredient == null ? new Base[0] : this.ingredient.toArray(new Base[this.ingredient.size()]); // CodeableConcept
3673        case -416837467: /*impurity*/ return this.impurity == null ? new Base[0] : this.impurity.toArray(new Base[this.impurity.size()]); // CodeableReference
3674        case -513945889: /*attachedDocument*/ return this.attachedDocument == null ? new Base[0] : this.attachedDocument.toArray(new Base[this.attachedDocument.size()]); // Reference
3675        case -2039573762: /*masterFile*/ return this.masterFile == null ? new Base[0] : this.masterFile.toArray(new Base[this.masterFile.size()]); // Reference
3676        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // MedicinalProductDefinitionContactComponent
3677        case 1232866243: /*clinicalTrial*/ return this.clinicalTrial == null ? new Base[0] : this.clinicalTrial.toArray(new Base[this.clinicalTrial.size()]); // Reference
3678        case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // Coding
3679        case 3373707: /*name*/ return this.name == null ? new Base[0] : this.name.toArray(new Base[this.name.size()]); // MedicinalProductDefinitionNameComponent
3680        case -986968341: /*crossReference*/ return this.crossReference == null ? new Base[0] : this.crossReference.toArray(new Base[this.crossReference.size()]); // MedicinalProductDefinitionCrossReferenceComponent
3681        case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : this.operation.toArray(new Base[this.operation.size()]); // MedicinalProductDefinitionOperationComponent
3682        case 366313883: /*characteristic*/ return this.characteristic == null ? new Base[0] : this.characteristic.toArray(new Base[this.characteristic.size()]); // MedicinalProductDefinitionCharacteristicComponent
3683        default: return super.getProperty(hash, name, checkValid);
3684        }
3685
3686      }
3687
3688      @Override
3689      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3690        switch (hash) {
3691        case -1618432855: // identifier
3692          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
3693          return value;
3694        case 3575610: // type
3695          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3696          return value;
3697        case -1326197564: // domain
3698          this.domain = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3699          return value;
3700        case 351608024: // version
3701          this.version = TypeConvertor.castToString(value); // StringType
3702          return value;
3703        case -892481550: // status
3704          this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3705          return value;
3706        case 247524032: // statusDate
3707          this.statusDate = TypeConvertor.castToDateTime(value); // DateTimeType
3708          return value;
3709        case -1724546052: // description
3710          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
3711          return value;
3712        case -1992898487: // combinedPharmaceuticalDoseForm
3713          this.combinedPharmaceuticalDoseForm = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3714          return value;
3715        case 108704329: // route
3716          this.getRoute().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3717          return value;
3718        case -597168804: // indication
3719          this.indication = TypeConvertor.castToMarkdown(value); // MarkdownType
3720          return value;
3721        case -844874031: // legalStatusOfSupply
3722          this.legalStatusOfSupply = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3723          return value;
3724        case 1935999744: // additionalMonitoringIndicator
3725          this.additionalMonitoringIndicator = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3726          return value;
3727        case 975102638: // specialMeasures
3728          this.getSpecialMeasures().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3729          return value;
3730        case -1515533081: // pediatricUseIndicator
3731          this.pediatricUseIndicator = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3732          return value;
3733        case 382350310: // classification
3734          this.getClassification().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3735          return value;
3736        case 70767032: // marketingStatus
3737          this.getMarketingStatus().add(TypeConvertor.castToMarketingStatus(value)); // MarketingStatus
3738          return value;
3739        case -361025513: // packagedMedicinalProduct
3740          this.getPackagedMedicinalProduct().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3741          return value;
3742        case 1546078211: // comprisedOf
3743          this.getComprisedOf().add(TypeConvertor.castToReference(value)); // Reference
3744          return value;
3745        case -206409263: // ingredient
3746          this.getIngredient().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3747          return value;
3748        case -416837467: // impurity
3749          this.getImpurity().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
3750          return value;
3751        case -513945889: // attachedDocument
3752          this.getAttachedDocument().add(TypeConvertor.castToReference(value)); // Reference
3753          return value;
3754        case -2039573762: // masterFile
3755          this.getMasterFile().add(TypeConvertor.castToReference(value)); // Reference
3756          return value;
3757        case 951526432: // contact
3758          this.getContact().add((MedicinalProductDefinitionContactComponent) value); // MedicinalProductDefinitionContactComponent
3759          return value;
3760        case 1232866243: // clinicalTrial
3761          this.getClinicalTrial().add(TypeConvertor.castToReference(value)); // Reference
3762          return value;
3763        case 3059181: // code
3764          this.getCode().add(TypeConvertor.castToCoding(value)); // Coding
3765          return value;
3766        case 3373707: // name
3767          this.getName().add((MedicinalProductDefinitionNameComponent) value); // MedicinalProductDefinitionNameComponent
3768          return value;
3769        case -986968341: // crossReference
3770          this.getCrossReference().add((MedicinalProductDefinitionCrossReferenceComponent) value); // MedicinalProductDefinitionCrossReferenceComponent
3771          return value;
3772        case 1662702951: // operation
3773          this.getOperation().add((MedicinalProductDefinitionOperationComponent) value); // MedicinalProductDefinitionOperationComponent
3774          return value;
3775        case 366313883: // characteristic
3776          this.getCharacteristic().add((MedicinalProductDefinitionCharacteristicComponent) value); // MedicinalProductDefinitionCharacteristicComponent
3777          return value;
3778        default: return super.setProperty(hash, name, value);
3779        }
3780
3781      }
3782
3783      @Override
3784      public Base setProperty(String name, Base value) throws FHIRException {
3785        if (name.equals("identifier")) {
3786          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
3787        } else if (name.equals("type")) {
3788          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3789        } else if (name.equals("domain")) {
3790          this.domain = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3791        } else if (name.equals("version")) {
3792          this.version = TypeConvertor.castToString(value); // StringType
3793        } else if (name.equals("status")) {
3794          this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3795        } else if (name.equals("statusDate")) {
3796          this.statusDate = TypeConvertor.castToDateTime(value); // DateTimeType
3797        } else if (name.equals("description")) {
3798          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
3799        } else if (name.equals("combinedPharmaceuticalDoseForm")) {
3800          this.combinedPharmaceuticalDoseForm = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3801        } else if (name.equals("route")) {
3802          this.getRoute().add(TypeConvertor.castToCodeableConcept(value));
3803        } else if (name.equals("indication")) {
3804          this.indication = TypeConvertor.castToMarkdown(value); // MarkdownType
3805        } else if (name.equals("legalStatusOfSupply")) {
3806          this.legalStatusOfSupply = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3807        } else if (name.equals("additionalMonitoringIndicator")) {
3808          this.additionalMonitoringIndicator = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3809        } else if (name.equals("specialMeasures")) {
3810          this.getSpecialMeasures().add(TypeConvertor.castToCodeableConcept(value));
3811        } else if (name.equals("pediatricUseIndicator")) {
3812          this.pediatricUseIndicator = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3813        } else if (name.equals("classification")) {
3814          this.getClassification().add(TypeConvertor.castToCodeableConcept(value));
3815        } else if (name.equals("marketingStatus")) {
3816          this.getMarketingStatus().add(TypeConvertor.castToMarketingStatus(value));
3817        } else if (name.equals("packagedMedicinalProduct")) {
3818          this.getPackagedMedicinalProduct().add(TypeConvertor.castToCodeableConcept(value));
3819        } else if (name.equals("comprisedOf")) {
3820          this.getComprisedOf().add(TypeConvertor.castToReference(value));
3821        } else if (name.equals("ingredient")) {
3822          this.getIngredient().add(TypeConvertor.castToCodeableConcept(value));
3823        } else if (name.equals("impurity")) {
3824          this.getImpurity().add(TypeConvertor.castToCodeableReference(value));
3825        } else if (name.equals("attachedDocument")) {
3826          this.getAttachedDocument().add(TypeConvertor.castToReference(value));
3827        } else if (name.equals("masterFile")) {
3828          this.getMasterFile().add(TypeConvertor.castToReference(value));
3829        } else if (name.equals("contact")) {
3830          this.getContact().add((MedicinalProductDefinitionContactComponent) value);
3831        } else if (name.equals("clinicalTrial")) {
3832          this.getClinicalTrial().add(TypeConvertor.castToReference(value));
3833        } else if (name.equals("code")) {
3834          this.getCode().add(TypeConvertor.castToCoding(value));
3835        } else if (name.equals("name")) {
3836          this.getName().add((MedicinalProductDefinitionNameComponent) value);
3837        } else if (name.equals("crossReference")) {
3838          this.getCrossReference().add((MedicinalProductDefinitionCrossReferenceComponent) value);
3839        } else if (name.equals("operation")) {
3840          this.getOperation().add((MedicinalProductDefinitionOperationComponent) value);
3841        } else if (name.equals("characteristic")) {
3842          this.getCharacteristic().add((MedicinalProductDefinitionCharacteristicComponent) value);
3843        } else
3844          return super.setProperty(name, value);
3845        return value;
3846      }
3847
3848      @Override
3849      public Base makeProperty(int hash, String name) throws FHIRException {
3850        switch (hash) {
3851        case -1618432855:  return addIdentifier(); 
3852        case 3575610:  return getType();
3853        case -1326197564:  return getDomain();
3854        case 351608024:  return getVersionElement();
3855        case -892481550:  return getStatus();
3856        case 247524032:  return getStatusDateElement();
3857        case -1724546052:  return getDescriptionElement();
3858        case -1992898487:  return getCombinedPharmaceuticalDoseForm();
3859        case 108704329:  return addRoute(); 
3860        case -597168804:  return getIndicationElement();
3861        case -844874031:  return getLegalStatusOfSupply();
3862        case 1935999744:  return getAdditionalMonitoringIndicator();
3863        case 975102638:  return addSpecialMeasures(); 
3864        case -1515533081:  return getPediatricUseIndicator();
3865        case 382350310:  return addClassification(); 
3866        case 70767032:  return addMarketingStatus(); 
3867        case -361025513:  return addPackagedMedicinalProduct(); 
3868        case 1546078211:  return addComprisedOf(); 
3869        case -206409263:  return addIngredient(); 
3870        case -416837467:  return addImpurity(); 
3871        case -513945889:  return addAttachedDocument(); 
3872        case -2039573762:  return addMasterFile(); 
3873        case 951526432:  return addContact(); 
3874        case 1232866243:  return addClinicalTrial(); 
3875        case 3059181:  return addCode(); 
3876        case 3373707:  return addName(); 
3877        case -986968341:  return addCrossReference(); 
3878        case 1662702951:  return addOperation(); 
3879        case 366313883:  return addCharacteristic(); 
3880        default: return super.makeProperty(hash, name);
3881        }
3882
3883      }
3884
3885      @Override
3886      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3887        switch (hash) {
3888        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3889        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3890        case -1326197564: /*domain*/ return new String[] {"CodeableConcept"};
3891        case 351608024: /*version*/ return new String[] {"string"};
3892        case -892481550: /*status*/ return new String[] {"CodeableConcept"};
3893        case 247524032: /*statusDate*/ return new String[] {"dateTime"};
3894        case -1724546052: /*description*/ return new String[] {"markdown"};
3895        case -1992898487: /*combinedPharmaceuticalDoseForm*/ return new String[] {"CodeableConcept"};
3896        case 108704329: /*route*/ return new String[] {"CodeableConcept"};
3897        case -597168804: /*indication*/ return new String[] {"markdown"};
3898        case -844874031: /*legalStatusOfSupply*/ return new String[] {"CodeableConcept"};
3899        case 1935999744: /*additionalMonitoringIndicator*/ return new String[] {"CodeableConcept"};
3900        case 975102638: /*specialMeasures*/ return new String[] {"CodeableConcept"};
3901        case -1515533081: /*pediatricUseIndicator*/ return new String[] {"CodeableConcept"};
3902        case 382350310: /*classification*/ return new String[] {"CodeableConcept"};
3903        case 70767032: /*marketingStatus*/ return new String[] {"MarketingStatus"};
3904        case -361025513: /*packagedMedicinalProduct*/ return new String[] {"CodeableConcept"};
3905        case 1546078211: /*comprisedOf*/ return new String[] {"Reference"};
3906        case -206409263: /*ingredient*/ return new String[] {"CodeableConcept"};
3907        case -416837467: /*impurity*/ return new String[] {"CodeableReference"};
3908        case -513945889: /*attachedDocument*/ return new String[] {"Reference"};
3909        case -2039573762: /*masterFile*/ return new String[] {"Reference"};
3910        case 951526432: /*contact*/ return new String[] {};
3911        case 1232866243: /*clinicalTrial*/ return new String[] {"Reference"};
3912        case 3059181: /*code*/ return new String[] {"Coding"};
3913        case 3373707: /*name*/ return new String[] {};
3914        case -986968341: /*crossReference*/ return new String[] {};
3915        case 1662702951: /*operation*/ return new String[] {};
3916        case 366313883: /*characteristic*/ return new String[] {};
3917        default: return super.getTypesForProperty(hash, name);
3918        }
3919
3920      }
3921
3922      @Override
3923      public Base addChild(String name) throws FHIRException {
3924        if (name.equals("identifier")) {
3925          return addIdentifier();
3926        }
3927        else if (name.equals("type")) {
3928          this.type = new CodeableConcept();
3929          return this.type;
3930        }
3931        else if (name.equals("domain")) {
3932          this.domain = new CodeableConcept();
3933          return this.domain;
3934        }
3935        else if (name.equals("version")) {
3936          throw new FHIRException("Cannot call addChild on a singleton property MedicinalProductDefinition.version");
3937        }
3938        else if (name.equals("status")) {
3939          this.status = new CodeableConcept();
3940          return this.status;
3941        }
3942        else if (name.equals("statusDate")) {
3943          throw new FHIRException("Cannot call addChild on a singleton property MedicinalProductDefinition.statusDate");
3944        }
3945        else if (name.equals("description")) {
3946          throw new FHIRException("Cannot call addChild on a singleton property MedicinalProductDefinition.description");
3947        }
3948        else if (name.equals("combinedPharmaceuticalDoseForm")) {
3949          this.combinedPharmaceuticalDoseForm = new CodeableConcept();
3950          return this.combinedPharmaceuticalDoseForm;
3951        }
3952        else if (name.equals("route")) {
3953          return addRoute();
3954        }
3955        else if (name.equals("indication")) {
3956          throw new FHIRException("Cannot call addChild on a singleton property MedicinalProductDefinition.indication");
3957        }
3958        else if (name.equals("legalStatusOfSupply")) {
3959          this.legalStatusOfSupply = new CodeableConcept();
3960          return this.legalStatusOfSupply;
3961        }
3962        else if (name.equals("additionalMonitoringIndicator")) {
3963          this.additionalMonitoringIndicator = new CodeableConcept();
3964          return this.additionalMonitoringIndicator;
3965        }
3966        else if (name.equals("specialMeasures")) {
3967          return addSpecialMeasures();
3968        }
3969        else if (name.equals("pediatricUseIndicator")) {
3970          this.pediatricUseIndicator = new CodeableConcept();
3971          return this.pediatricUseIndicator;
3972        }
3973        else if (name.equals("classification")) {
3974          return addClassification();
3975        }
3976        else if (name.equals("marketingStatus")) {
3977          return addMarketingStatus();
3978        }
3979        else if (name.equals("packagedMedicinalProduct")) {
3980          return addPackagedMedicinalProduct();
3981        }
3982        else if (name.equals("comprisedOf")) {
3983          return addComprisedOf();
3984        }
3985        else if (name.equals("ingredient")) {
3986          return addIngredient();
3987        }
3988        else if (name.equals("impurity")) {
3989          return addImpurity();
3990        }
3991        else if (name.equals("attachedDocument")) {
3992          return addAttachedDocument();
3993        }
3994        else if (name.equals("masterFile")) {
3995          return addMasterFile();
3996        }
3997        else if (name.equals("contact")) {
3998          return addContact();
3999        }
4000        else if (name.equals("clinicalTrial")) {
4001          return addClinicalTrial();
4002        }
4003        else if (name.equals("code")) {
4004          return addCode();
4005        }
4006        else if (name.equals("name")) {
4007          return addName();
4008        }
4009        else if (name.equals("crossReference")) {
4010          return addCrossReference();
4011        }
4012        else if (name.equals("operation")) {
4013          return addOperation();
4014        }
4015        else if (name.equals("characteristic")) {
4016          return addCharacteristic();
4017        }
4018        else
4019          return super.addChild(name);
4020      }
4021
4022  public String fhirType() {
4023    return "MedicinalProductDefinition";
4024
4025  }
4026
4027      public MedicinalProductDefinition copy() {
4028        MedicinalProductDefinition dst = new MedicinalProductDefinition();
4029        copyValues(dst);
4030        return dst;
4031      }
4032
4033      public void copyValues(MedicinalProductDefinition dst) {
4034        super.copyValues(dst);
4035        if (identifier != null) {
4036          dst.identifier = new ArrayList<Identifier>();
4037          for (Identifier i : identifier)
4038            dst.identifier.add(i.copy());
4039        };
4040        dst.type = type == null ? null : type.copy();
4041        dst.domain = domain == null ? null : domain.copy();
4042        dst.version = version == null ? null : version.copy();
4043        dst.status = status == null ? null : status.copy();
4044        dst.statusDate = statusDate == null ? null : statusDate.copy();
4045        dst.description = description == null ? null : description.copy();
4046        dst.combinedPharmaceuticalDoseForm = combinedPharmaceuticalDoseForm == null ? null : combinedPharmaceuticalDoseForm.copy();
4047        if (route != null) {
4048          dst.route = new ArrayList<CodeableConcept>();
4049          for (CodeableConcept i : route)
4050            dst.route.add(i.copy());
4051        };
4052        dst.indication = indication == null ? null : indication.copy();
4053        dst.legalStatusOfSupply = legalStatusOfSupply == null ? null : legalStatusOfSupply.copy();
4054        dst.additionalMonitoringIndicator = additionalMonitoringIndicator == null ? null : additionalMonitoringIndicator.copy();
4055        if (specialMeasures != null) {
4056          dst.specialMeasures = new ArrayList<CodeableConcept>();
4057          for (CodeableConcept i : specialMeasures)
4058            dst.specialMeasures.add(i.copy());
4059        };
4060        dst.pediatricUseIndicator = pediatricUseIndicator == null ? null : pediatricUseIndicator.copy();
4061        if (classification != null) {
4062          dst.classification = new ArrayList<CodeableConcept>();
4063          for (CodeableConcept i : classification)
4064            dst.classification.add(i.copy());
4065        };
4066        if (marketingStatus != null) {
4067          dst.marketingStatus = new ArrayList<MarketingStatus>();
4068          for (MarketingStatus i : marketingStatus)
4069            dst.marketingStatus.add(i.copy());
4070        };
4071        if (packagedMedicinalProduct != null) {
4072          dst.packagedMedicinalProduct = new ArrayList<CodeableConcept>();
4073          for (CodeableConcept i : packagedMedicinalProduct)
4074            dst.packagedMedicinalProduct.add(i.copy());
4075        };
4076        if (comprisedOf != null) {
4077          dst.comprisedOf = new ArrayList<Reference>();
4078          for (Reference i : comprisedOf)
4079            dst.comprisedOf.add(i.copy());
4080        };
4081        if (ingredient != null) {
4082          dst.ingredient = new ArrayList<CodeableConcept>();
4083          for (CodeableConcept i : ingredient)
4084            dst.ingredient.add(i.copy());
4085        };
4086        if (impurity != null) {
4087          dst.impurity = new ArrayList<CodeableReference>();
4088          for (CodeableReference i : impurity)
4089            dst.impurity.add(i.copy());
4090        };
4091        if (attachedDocument != null) {
4092          dst.attachedDocument = new ArrayList<Reference>();
4093          for (Reference i : attachedDocument)
4094            dst.attachedDocument.add(i.copy());
4095        };
4096        if (masterFile != null) {
4097          dst.masterFile = new ArrayList<Reference>();
4098          for (Reference i : masterFile)
4099            dst.masterFile.add(i.copy());
4100        };
4101        if (contact != null) {
4102          dst.contact = new ArrayList<MedicinalProductDefinitionContactComponent>();
4103          for (MedicinalProductDefinitionContactComponent i : contact)
4104            dst.contact.add(i.copy());
4105        };
4106        if (clinicalTrial != null) {
4107          dst.clinicalTrial = new ArrayList<Reference>();
4108          for (Reference i : clinicalTrial)
4109            dst.clinicalTrial.add(i.copy());
4110        };
4111        if (code != null) {
4112          dst.code = new ArrayList<Coding>();
4113          for (Coding i : code)
4114            dst.code.add(i.copy());
4115        };
4116        if (name != null) {
4117          dst.name = new ArrayList<MedicinalProductDefinitionNameComponent>();
4118          for (MedicinalProductDefinitionNameComponent i : name)
4119            dst.name.add(i.copy());
4120        };
4121        if (crossReference != null) {
4122          dst.crossReference = new ArrayList<MedicinalProductDefinitionCrossReferenceComponent>();
4123          for (MedicinalProductDefinitionCrossReferenceComponent i : crossReference)
4124            dst.crossReference.add(i.copy());
4125        };
4126        if (operation != null) {
4127          dst.operation = new ArrayList<MedicinalProductDefinitionOperationComponent>();
4128          for (MedicinalProductDefinitionOperationComponent i : operation)
4129            dst.operation.add(i.copy());
4130        };
4131        if (characteristic != null) {
4132          dst.characteristic = new ArrayList<MedicinalProductDefinitionCharacteristicComponent>();
4133          for (MedicinalProductDefinitionCharacteristicComponent i : characteristic)
4134            dst.characteristic.add(i.copy());
4135        };
4136      }
4137
4138      protected MedicinalProductDefinition typedCopy() {
4139        return copy();
4140      }
4141
4142      @Override
4143      public boolean equalsDeep(Base other_) {
4144        if (!super.equalsDeep(other_))
4145          return false;
4146        if (!(other_ instanceof MedicinalProductDefinition))
4147          return false;
4148        MedicinalProductDefinition o = (MedicinalProductDefinition) other_;
4149        return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(domain, o.domain, true)
4150           && compareDeep(version, o.version, true) && compareDeep(status, o.status, true) && compareDeep(statusDate, o.statusDate, true)
4151           && compareDeep(description, o.description, true) && compareDeep(combinedPharmaceuticalDoseForm, o.combinedPharmaceuticalDoseForm, true)
4152           && compareDeep(route, o.route, true) && compareDeep(indication, o.indication, true) && compareDeep(legalStatusOfSupply, o.legalStatusOfSupply, true)
4153           && compareDeep(additionalMonitoringIndicator, o.additionalMonitoringIndicator, true) && compareDeep(specialMeasures, o.specialMeasures, true)
4154           && compareDeep(pediatricUseIndicator, o.pediatricUseIndicator, true) && compareDeep(classification, o.classification, true)
4155           && compareDeep(marketingStatus, o.marketingStatus, true) && compareDeep(packagedMedicinalProduct, o.packagedMedicinalProduct, true)
4156           && compareDeep(comprisedOf, o.comprisedOf, true) && compareDeep(ingredient, o.ingredient, true)
4157           && compareDeep(impurity, o.impurity, true) && compareDeep(attachedDocument, o.attachedDocument, true)
4158           && compareDeep(masterFile, o.masterFile, true) && compareDeep(contact, o.contact, true) && compareDeep(clinicalTrial, o.clinicalTrial, true)
4159           && compareDeep(code, o.code, true) && compareDeep(name, o.name, true) && compareDeep(crossReference, o.crossReference, true)
4160           && compareDeep(operation, o.operation, true) && compareDeep(characteristic, o.characteristic, true)
4161          ;
4162      }
4163
4164      @Override
4165      public boolean equalsShallow(Base other_) {
4166        if (!super.equalsShallow(other_))
4167          return false;
4168        if (!(other_ instanceof MedicinalProductDefinition))
4169          return false;
4170        MedicinalProductDefinition o = (MedicinalProductDefinition) other_;
4171        return compareValues(version, o.version, true) && compareValues(statusDate, o.statusDate, true) && compareValues(description, o.description, true)
4172           && compareValues(indication, o.indication, true);
4173      }
4174
4175      public boolean isEmpty() {
4176        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, type, domain
4177          , version, status, statusDate, description, combinedPharmaceuticalDoseForm, route
4178          , indication, legalStatusOfSupply, additionalMonitoringIndicator, specialMeasures, pediatricUseIndicator
4179          , classification, marketingStatus, packagedMedicinalProduct, comprisedOf, ingredient
4180          , impurity, attachedDocument, masterFile, contact, clinicalTrial, code, name, crossReference
4181          , operation, characteristic);
4182      }
4183
4184  @Override
4185  public ResourceType getResourceType() {
4186    return ResourceType.MedicinalProductDefinition;
4187   }
4188
4189 /**
4190   * Search parameter: <b>characteristic-type</b>
4191   * <p>
4192   * Description: <b>A category for the characteristic</b><br>
4193   * Type: <b>token</b><br>
4194   * Path: <b>MedicinalProductDefinition.characteristic.type</b><br>
4195   * </p>
4196   */
4197  @SearchParamDefinition(name="characteristic-type", path="MedicinalProductDefinition.characteristic.type", description="A category for the characteristic", type="token" )
4198  public static final String SP_CHARACTERISTIC_TYPE = "characteristic-type";
4199 /**
4200   * <b>Fluent Client</b> search parameter constant for <b>characteristic-type</b>
4201   * <p>
4202   * Description: <b>A category for the characteristic</b><br>
4203   * Type: <b>token</b><br>
4204   * Path: <b>MedicinalProductDefinition.characteristic.type</b><br>
4205   * </p>
4206   */
4207  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CHARACTERISTIC_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CHARACTERISTIC_TYPE);
4208
4209 /**
4210   * Search parameter: <b>characteristic</b>
4211   * <p>
4212   * Description: <b>Allows the key product features to be recorded, such as "sugar free", "modified release", "parallel import"</b><br>
4213   * Type: <b>token</b><br>
4214   * Path: <b>MedicinalProductDefinition.characteristic.value.ofType(Quantity) | MedicinalProductDefinition.characteristic.value.ofType(CodeableConcept)</b><br>
4215   * </p>
4216   */
4217  @SearchParamDefinition(name="characteristic", path="MedicinalProductDefinition.characteristic.value.ofType(Quantity) | MedicinalProductDefinition.characteristic.value.ofType(CodeableConcept)", description="Allows the key product features to be recorded, such as \"sugar free\", \"modified release\", \"parallel import\"", type="token" )
4218  public static final String SP_CHARACTERISTIC = "characteristic";
4219 /**
4220   * <b>Fluent Client</b> search parameter constant for <b>characteristic</b>
4221   * <p>
4222   * Description: <b>Allows the key product features to be recorded, such as "sugar free", "modified release", "parallel import"</b><br>
4223   * Type: <b>token</b><br>
4224   * Path: <b>MedicinalProductDefinition.characteristic.value.ofType(Quantity) | MedicinalProductDefinition.characteristic.value.ofType(CodeableConcept)</b><br>
4225   * </p>
4226   */
4227  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CHARACTERISTIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CHARACTERISTIC);
4228
4229 /**
4230   * Search parameter: <b>contact</b>
4231   * <p>
4232   * Description: <b>A product specific contact, person (in a role), or an organization</b><br>
4233   * Type: <b>reference</b><br>
4234   * Path: <b>MedicinalProductDefinition.contact.contact</b><br>
4235   * </p>
4236   */
4237  @SearchParamDefinition(name="contact", path="MedicinalProductDefinition.contact.contact", description="A product specific contact, person (in a role), or an organization", type="reference", target={Organization.class, PractitionerRole.class } )
4238  public static final String SP_CONTACT = "contact";
4239 /**
4240   * <b>Fluent Client</b> search parameter constant for <b>contact</b>
4241   * <p>
4242   * Description: <b>A product specific contact, person (in a role), or an organization</b><br>
4243   * Type: <b>reference</b><br>
4244   * Path: <b>MedicinalProductDefinition.contact.contact</b><br>
4245   * </p>
4246   */
4247  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONTACT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONTACT);
4248
4249/**
4250   * Constant for fluent queries to be used to add include statements. Specifies
4251   * the path value of "<b>MedicinalProductDefinition:contact</b>".
4252   */
4253  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONTACT = new ca.uhn.fhir.model.api.Include("MedicinalProductDefinition:contact").toLocked();
4254
4255 /**
4256   * Search parameter: <b>domain</b>
4257   * <p>
4258   * Description: <b>If this medicine applies to human or veterinary uses</b><br>
4259   * Type: <b>token</b><br>
4260   * Path: <b>MedicinalProductDefinition.domain</b><br>
4261   * </p>
4262   */
4263  @SearchParamDefinition(name="domain", path="MedicinalProductDefinition.domain", description="If this medicine applies to human or veterinary uses", type="token" )
4264  public static final String SP_DOMAIN = "domain";
4265 /**
4266   * <b>Fluent Client</b> search parameter constant for <b>domain</b>
4267   * <p>
4268   * Description: <b>If this medicine applies to human or veterinary uses</b><br>
4269   * Type: <b>token</b><br>
4270   * Path: <b>MedicinalProductDefinition.domain</b><br>
4271   * </p>
4272   */
4273  public static final ca.uhn.fhir.rest.gclient.TokenClientParam DOMAIN = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DOMAIN);
4274
4275 /**
4276   * Search parameter: <b>identifier</b>
4277   * <p>
4278   * Description: <b>Business identifier for this product. Could be an MPID</b><br>
4279   * Type: <b>token</b><br>
4280   * Path: <b>MedicinalProductDefinition.identifier</b><br>
4281   * </p>
4282   */
4283  @SearchParamDefinition(name="identifier", path="MedicinalProductDefinition.identifier", description="Business identifier for this product. Could be an MPID", type="token" )
4284  public static final String SP_IDENTIFIER = "identifier";
4285 /**
4286   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
4287   * <p>
4288   * Description: <b>Business identifier for this product. Could be an MPID</b><br>
4289   * Type: <b>token</b><br>
4290   * Path: <b>MedicinalProductDefinition.identifier</b><br>
4291   * </p>
4292   */
4293  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
4294
4295 /**
4296   * Search parameter: <b>ingredient</b>
4297   * <p>
4298   * Description: <b>An ingredient of this product</b><br>
4299   * Type: <b>token</b><br>
4300   * Path: <b>MedicinalProductDefinition.ingredient</b><br>
4301   * </p>
4302   */
4303  @SearchParamDefinition(name="ingredient", path="MedicinalProductDefinition.ingredient", description="An ingredient of this product", type="token" )
4304  public static final String SP_INGREDIENT = "ingredient";
4305 /**
4306   * <b>Fluent Client</b> search parameter constant for <b>ingredient</b>
4307   * <p>
4308   * Description: <b>An ingredient of this product</b><br>
4309   * Type: <b>token</b><br>
4310   * Path: <b>MedicinalProductDefinition.ingredient</b><br>
4311   * </p>
4312   */
4313  public static final ca.uhn.fhir.rest.gclient.TokenClientParam INGREDIENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INGREDIENT);
4314
4315 /**
4316   * Search parameter: <b>master-file</b>
4317   * <p>
4318   * Description: <b>A master file for to the medicinal product (e.g. Pharmacovigilance System Master File)</b><br>
4319   * Type: <b>reference</b><br>
4320   * Path: <b>MedicinalProductDefinition.masterFile</b><br>
4321   * </p>
4322   */
4323  @SearchParamDefinition(name="master-file", path="MedicinalProductDefinition.masterFile", description="A master file for to the medicinal product (e.g. Pharmacovigilance System Master File)", type="reference", target={DocumentReference.class } )
4324  public static final String SP_MASTER_FILE = "master-file";
4325 /**
4326   * <b>Fluent Client</b> search parameter constant for <b>master-file</b>
4327   * <p>
4328   * Description: <b>A master file for to the medicinal product (e.g. Pharmacovigilance System Master File)</b><br>
4329   * Type: <b>reference</b><br>
4330   * Path: <b>MedicinalProductDefinition.masterFile</b><br>
4331   * </p>
4332   */
4333  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MASTER_FILE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MASTER_FILE);
4334
4335/**
4336   * Constant for fluent queries to be used to add include statements. Specifies
4337   * the path value of "<b>MedicinalProductDefinition:master-file</b>".
4338   */
4339  public static final ca.uhn.fhir.model.api.Include INCLUDE_MASTER_FILE = new ca.uhn.fhir.model.api.Include("MedicinalProductDefinition:master-file").toLocked();
4340
4341 /**
4342   * Search parameter: <b>name-language</b>
4343   * <p>
4344   * Description: <b>Language code for this name</b><br>
4345   * Type: <b>token</b><br>
4346   * Path: <b>MedicinalProductDefinition.name.usage.language</b><br>
4347   * </p>
4348   */
4349  @SearchParamDefinition(name="name-language", path="MedicinalProductDefinition.name.usage.language", description="Language code for this name", type="token" )
4350  public static final String SP_NAME_LANGUAGE = "name-language";
4351 /**
4352   * <b>Fluent Client</b> search parameter constant for <b>name-language</b>
4353   * <p>
4354   * Description: <b>Language code for this name</b><br>
4355   * Type: <b>token</b><br>
4356   * Path: <b>MedicinalProductDefinition.name.usage.language</b><br>
4357   * </p>
4358   */
4359  public static final ca.uhn.fhir.rest.gclient.TokenClientParam NAME_LANGUAGE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_NAME_LANGUAGE);
4360
4361 /**
4362   * Search parameter: <b>name</b>
4363   * <p>
4364   * Description: <b>The full product name</b><br>
4365   * Type: <b>string</b><br>
4366   * Path: <b>MedicinalProductDefinition.name.productName</b><br>
4367   * </p>
4368   */
4369  @SearchParamDefinition(name="name", path="MedicinalProductDefinition.name.productName", description="The full product name", type="string" )
4370  public static final String SP_NAME = "name";
4371 /**
4372   * <b>Fluent Client</b> search parameter constant for <b>name</b>
4373   * <p>
4374   * Description: <b>The full product name</b><br>
4375   * Type: <b>string</b><br>
4376   * Path: <b>MedicinalProductDefinition.name.productName</b><br>
4377   * </p>
4378   */
4379  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
4380
4381 /**
4382   * Search parameter: <b>product-classification</b>
4383   * <p>
4384   * Description: <b>Allows the product to be classified by various systems</b><br>
4385   * Type: <b>token</b><br>
4386   * Path: <b>MedicinalProductDefinition.classification</b><br>
4387   * </p>
4388   */
4389  @SearchParamDefinition(name="product-classification", path="MedicinalProductDefinition.classification", description="Allows the product to be classified by various systems", type="token" )
4390  public static final String SP_PRODUCT_CLASSIFICATION = "product-classification";
4391 /**
4392   * <b>Fluent Client</b> search parameter constant for <b>product-classification</b>
4393   * <p>
4394   * Description: <b>Allows the product to be classified by various systems</b><br>
4395   * Type: <b>token</b><br>
4396   * Path: <b>MedicinalProductDefinition.classification</b><br>
4397   * </p>
4398   */
4399  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PRODUCT_CLASSIFICATION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PRODUCT_CLASSIFICATION);
4400
4401 /**
4402   * Search parameter: <b>status</b>
4403   * <p>
4404   * Description: <b>The status within the lifecycle of this product record. A high-level status, this is not intended to duplicate details carried elsewhere such as legal status, or authorization status</b><br>
4405   * Type: <b>token</b><br>
4406   * Path: <b>MedicinalProductDefinition.status</b><br>
4407   * </p>
4408   */
4409  @SearchParamDefinition(name="status", path="MedicinalProductDefinition.status", description="The status within the lifecycle of this product record. A high-level status, this is not intended to duplicate details carried elsewhere such as legal status, or authorization status", type="token" )
4410  public static final String SP_STATUS = "status";
4411 /**
4412   * <b>Fluent Client</b> search parameter constant for <b>status</b>
4413   * <p>
4414   * Description: <b>The status within the lifecycle of this product record. A high-level status, this is not intended to duplicate details carried elsewhere such as legal status, or authorization status</b><br>
4415   * Type: <b>token</b><br>
4416   * Path: <b>MedicinalProductDefinition.status</b><br>
4417   * </p>
4418   */
4419  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
4420
4421 /**
4422   * Search parameter: <b>type</b>
4423   * <p>
4424   * Description: <b>Regulatory type, e.g. Investigational or Authorized</b><br>
4425   * Type: <b>token</b><br>
4426   * Path: <b>MedicinalProductDefinition.type</b><br>
4427   * </p>
4428   */
4429  @SearchParamDefinition(name="type", path="MedicinalProductDefinition.type", description="Regulatory type, e.g. Investigational or Authorized", type="token" )
4430  public static final String SP_TYPE = "type";
4431 /**
4432   * <b>Fluent Client</b> search parameter constant for <b>type</b>
4433   * <p>
4434   * Description: <b>Regulatory type, e.g. Investigational or Authorized</b><br>
4435   * Type: <b>token</b><br>
4436   * Path: <b>MedicinalProductDefinition.type</b><br>
4437   * </p>
4438   */
4439  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
4440
4441
4442}
4443